paiodecoder

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2025 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DEFAULT_NAME_PROGRAM = "decode-batch"
)
View Source
const TimeoutExecutionPaioDecoder = 1 * time.Minute

Variables

This section is empty.

Functions

func CreateTypedData

func CreateTypedData(
	app common.Address,
	nonce uint64,
	maxGasPrice *big.Int,
	dataBytes []byte,
	chainId *big.Int,
) apitypes.TypedData

func DownloadPaioDecoderExecutableAsNeeded

func DownloadPaioDecoderExecutableAsNeeded() (string, error)

func IsDecodeBatchInstalled

func IsDecodeBatchInstalled() (string, bool)

func NewPaioReleaseHandler

func NewPaioReleaseHandler() devnet.HandleRelease

func ParsePaioBatchToInputs

func ParsePaioBatchToInputs(jsonStr string, chainId *big.Int) ([]model.InputExtra, error)

Types

type DecoderPaio

type DecoderPaio interface {
	DecodePaioBatch(ctx context.Context, bytes []byte) (string, error)
}

type PaioBatch

type PaioBatch struct {
	SequencerPaymentAddress string            `json:"sequencer_payment_address"`
	Txs                     []PaioTransaction `json:"txs"`
}

type PaioConfig

type PaioConfig struct {
	AssetPaio   devnet.ReleaseAsset `json:"asset_paio"`
	LatestCheck string              `json:"latest_check"`
}

func LoadPaioConfig

func LoadPaioConfig(path string) (*PaioConfig, error)

func NewPaioConfig

func NewPaioConfig(ra devnet.ReleaseAsset) *PaioConfig

func (*PaioConfig) SavePaioConfig

func (a *PaioConfig) SavePaioConfig(path string) error

type PaioDecoder

type PaioDecoder struct {
	// contains filtered or unexported fields
}

func NewPaioDecoder

func NewPaioDecoder(location string) *PaioDecoder

func (*PaioDecoder) DecodePaioBatch

func (pd *PaioDecoder) DecodePaioBatch(stdCtx context.Context, rawBytes []byte) (string, error)

call the paio decoder binary

func (*PaioDecoder) DecodePaioBatchSkip

func (pd *PaioDecoder) DecodePaioBatchSkip(stdCtx context.Context, skip int, rawBytes []byte) (string, error)

type PaioMessage

type PaioMessage struct {
	App         string
	Nonce       string
	MaxGasPrice string
	Payload     []byte
}

func ParsePaioFrom712Message

func ParsePaioFrom712Message(typedData apitypes.TypedData) (PaioMessage, error)

type PaioReleaseHandler

type PaioReleaseHandler struct {
	Namespace      string
	Repository     string
	ConfigFilename string
	Client         *github.Client
}

func (PaioReleaseHandler) DownloadAsset

func (d PaioReleaseHandler) DownloadAsset(ctx context.Context, release *devnet.ReleaseAsset) (string, error)

DownloadAsset implements commons.HandleRelease.

func (PaioReleaseHandler) ExtractAsset

func (d PaioReleaseHandler) ExtractAsset(archive []byte, filename string, destDir string) error

ExtractAsset implements commons.HandleRelease.

func (PaioReleaseHandler) FormatNameRelease

func (d PaioReleaseHandler) FormatNameRelease(prefix string, goos string, goarch string, version string) string

FormatNameRelease implements commons.HandleRelease.

func (PaioReleaseHandler) GetLatestReleaseCompatible

func (p PaioReleaseHandler) GetLatestReleaseCompatible(ctx context.Context) (*devnet.ReleaseAsset, error)

GetLatestReleaseCompatible implements commons.HandleRelease.

func (PaioReleaseHandler) GetVersion

func (p PaioReleaseHandler) GetVersion(ctx context.Context) (string, error)

GetVersion implements devnet.HandleRelease.

func (PaioReleaseHandler) ListRelease

func (d PaioReleaseHandler) ListRelease(ctx context.Context) ([]devnet.ReleaseAsset, error)

ListRelease implements commons.HandleRelease.

func (PaioReleaseHandler) PlatformCompatible

func (d PaioReleaseHandler) PlatformCompatible() (string, error)

PlatformCompatible implements commons.HandleRelease.

func (PaioReleaseHandler) Prerequisites

func (d PaioReleaseHandler) Prerequisites(ctx context.Context) error

Prerequisites implements commons.HandleRelease.

func (PaioReleaseHandler) SaveConfigOnDefaultLocation

func (p PaioReleaseHandler) SaveConfigOnDefaultLocation(config *PaioConfig) error

func (PaioReleaseHandler) TryLoadConfig

func (a PaioReleaseHandler) TryLoadConfig() (*PaioConfig, error)

type PaioSignature

type PaioSignature struct {
	R string `json:"r"`
	S string `json:"s"`
	V string `json:"v"`
}

func (*PaioSignature) Hex

func (ps *PaioSignature) Hex() string

type PaioTransaction

type PaioTransaction struct {
	App         string        `json:"app"`
	Nonce       uint64        `json:"nonce"`
	MaxGasPrice uint64        `json:"max_gas_price"`
	Data        []byte        `json:"data"`
	Signature   PaioSignature `json:"signature"`
}

type ZzzzHuiDecoder

type ZzzzHuiDecoder struct {
}

func (ZzzzHuiDecoder) DecodePaioBatch

func (z ZzzzHuiDecoder) DecodePaioBatch(ctx context.Context, bytes []byte) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL