transactiondata

package
v0.0.0-...-742ae29 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrNotEnoughDataStr    = "not enough data"
	ErrInvalidEnumValueStr = "invalid enum value"
	ErrNotImplementedStr   = "not implemented"
)

Variables

View Source
var ErrInvalidEnumValue error
View Source
var ErrNotEnoughData error
View Source
var ErrNotImplemented error

Functions

func ParseULEB128

func ParseULEB128(data []byte, offset int) (int, int, error)

func SerializeULEB128

func SerializeULEB128(value int) []byte

func SerializeUint16

func SerializeUint16(value uint16) []byte

func SerializeUint64

func SerializeUint64(i uint64) []byte

Types

type AccountAddress

type AccountAddress [32]byte

func (*AccountAddress) Parse

func (c *AccountAddress) Parse(data []byte, offset int) (int, error)

func (*AccountAddress) ToBytes

func (c *AccountAddress) ToBytes() []byte

type AppId

type AppId int
const (
	AppIdSui       AppId = 0
	AppIdNarwhal   AppId = 1
	AppIdConsensus AppId = 2
)

func (*AppId) Parse

func (c *AppId) Parse(data []byte, offset int) (int, error)

type Argument

type Argument struct {
	ArgumentType         ArgumentType
	ArgumentInput        ArgumentInput
	ArgumentResult       ArgumentResult
	ArgumentNestedResult ArgumentNestedResult
}

func (*Argument) Parse

func (c *Argument) Parse(data []byte, offset int) (int, error)

func (*Argument) ToBytes

func (c *Argument) ToBytes() []byte

type ArgumentInput

type ArgumentInput uint16

type ArgumentNestedResult

type ArgumentNestedResult struct {
	Index1 uint16
	Index2 uint16
}

type ArgumentResult

type ArgumentResult uint16

type ArgumentType

type ArgumentType int
const (
	ArgumentTypeGasCoin      ArgumentType = 0
	ArgumentTypeInput        ArgumentType = 1
	ArgumentTypeResult       ArgumentType = 2
	ArgumentTypeNestedResult ArgumentType = 3
)

type AuthenticatorStateUpdate

type AuthenticatorStateUpdate struct {
}

func (*AuthenticatorStateUpdate) Parse

func (c *AuthenticatorStateUpdate) Parse(data []byte, offset int) (int, error)

func (*AuthenticatorStateUpdate) ToBytes

func (c *AuthenticatorStateUpdate) ToBytes() []byte

type CallArg

type CallArg struct {
	Type CallArgType

	Pure   []byte
	Object *ObjectArg
}

func (*CallArg) Parse

func (c *CallArg) Parse(data []byte, offset int) (int, error)

func (*CallArg) ToBytes

func (c *CallArg) ToBytes() []byte

type CallArgType

type CallArgType int
const (
	CallArgTypePure   CallArgType = 0
	CallArgTypeObject CallArgType = 1
)

type ChangeEpoch

type ChangeEpoch struct {
}

func (*ChangeEpoch) Parse

func (c *ChangeEpoch) Parse(data []byte, offset int) (int, error)

func (*ChangeEpoch) ToBytes

func (c *ChangeEpoch) ToBytes() []byte

type Command

type Command struct {
	Type CommandType

	MoveCall        *ProgrammableMoveCall
	TransferObjects *TransferObjects
	SplitCoins      *SplitCoins
	MergeCoins      *MergeCoins
	Publish         *Publish
	MakeMoveVec     *MakeMoveVec
	Upgrade         *Upgrade
}

func (*Command) Parse

func (c *Command) Parse(data []byte, offset int) (int, error)

func (*Command) String

func (c *Command) String() string

func (*Command) ToBytes

func (c *Command) ToBytes() []byte

type CommandType

type CommandType int
const (
	CommandTypeMoveCall        CommandType = 0
	CommandTypeTransferObjects CommandType = 1
	CommandTypeSplitCoins      CommandType = 2
	CommandTypeMergeCoins      CommandType = 3
	CommandTypePublish         CommandType = 4
	CommandTypeMakeMoveVec     CommandType = 5
	CommandTypeUpgrade         CommandType = 6
)

type ConsensusCommitPrologue

type ConsensusCommitPrologue struct {
}

func (*ConsensusCommitPrologue) Parse

func (c *ConsensusCommitPrologue) Parse(data []byte, offset int) (int, error)

func (*ConsensusCommitPrologue) ToBytes

func (c *ConsensusCommitPrologue) ToBytes() []byte

type ConsensusCommitPrologueV2

type ConsensusCommitPrologueV2 struct {
}

func (*ConsensusCommitPrologueV2) Parse

func (c *ConsensusCommitPrologueV2) Parse(data []byte, offset int) (int, error)

func (*ConsensusCommitPrologueV2) ToBytes

func (c *ConsensusCommitPrologueV2) ToBytes() []byte

type ConsensusCommitPrologueV3

type ConsensusCommitPrologueV3 struct {
}

func (*ConsensusCommitPrologueV3) Parse

func (c *ConsensusCommitPrologueV3) Parse(data []byte, offset int) (int, error)

func (*ConsensusCommitPrologueV3) ToBytes

func (c *ConsensusCommitPrologueV3) ToBytes() []byte

type EndOfEpochTransactionKind

type EndOfEpochTransactionKind struct {
}

func (*EndOfEpochTransactionKind) Parse

func (c *EndOfEpochTransactionKind) Parse(data []byte, offset int) (int, error)

func (*EndOfEpochTransactionKind) ToBytes

func (c *EndOfEpochTransactionKind) ToBytes() []byte

type Envelope

type Envelope struct {
	TransactionDataWithIntent TransactionDataWithIntent
}

func (*Envelope) Parse

func (c *Envelope) Parse(bs []byte, offset int) (int, error)

type GasData

type GasData struct {
	Payment []ObjectRef
	Owner   SuiAddress
	Price   uint64
	Budget  uint64
}

func (*GasData) Parse

func (c *GasData) Parse(data []byte, offset int) (int, error)

func (*GasData) String

func (c *GasData) String() string

func (*GasData) ToBytes

func (c *GasData) ToBytes() []byte

type GenesisTransaction

type GenesisTransaction struct {
}

func (*GenesisTransaction) Parse

func (c *GenesisTransaction) Parse(data []byte, offset int) (int, error)

func (*GenesisTransaction) ToBytes

func (c *GenesisTransaction) ToBytes() []byte

type Intent

type Intent struct {
	Scope   IntentScope
	Version IntentVersion
	AppId   AppId
}

func (*Intent) Parse

func (c *Intent) Parse(data []byte, offset int) (int, error)

type IntentScope

type IntentScope int
const (
	IntentScopeTransactionData         IntentScope = 0
	IntentScopeTransactionEffects      IntentScope = 1
	IntentScopeCheckpointSummary       IntentScope = 2
	IntentScopePersonalMessage         IntentScope = 3
	IntentScopeSenderSignedTransaction IntentScope = 4
	IntentScopeProofOfPossession       IntentScope = 5
	IntentScopeHeaderDigest            IntentScope = 6
	IntentScopeBridgeEventUnused       IntentScope = 7
	IntentScopeConsensusBlock          IntentScope = 8
	IntentScopeDiscoveryPeers          IntentScope = 9
)

func (*IntentScope) Parse

func (c *IntentScope) Parse(data []byte, offset int) (int, error)

type IntentVersion

type IntentVersion int
const (
	IntentVersionV1 IntentVersion = 0
)

func (*IntentVersion) Parse

func (c *IntentVersion) Parse(data []byte, offset int) (int, error)

type MakeMoveVec

type MakeMoveVec struct {
}

func (*MakeMoveVec) Parse

func (c *MakeMoveVec) Parse(data []byte, offset int) (int, error)

func (*MakeMoveVec) ToBytes

func (c *MakeMoveVec) ToBytes() []byte

type MergeCoins

type MergeCoins struct {
	Argument  *Argument
	Arguments []*Argument
}

func (*MergeCoins) Parse

func (c *MergeCoins) Parse(data []byte, offset int) (int, error)

func (*MergeCoins) ToBytes

func (c *MergeCoins) ToBytes() []byte

type ObjectArg

type ObjectArg struct {
	Type ObjectArgType

	ImmOrOwnedObject *ObjectRef
	SharedObject     *SharedObject
	Receiving        *ObjectRef
}

func (*ObjectArg) Parse

func (c *ObjectArg) Parse(data []byte, offset int) (int, error)

func (*ObjectArg) ToBytes

func (c *ObjectArg) ToBytes() []byte

type ObjectArgType

type ObjectArgType int
const (
	ObjectArgTypeImmOrOwnedObject ObjectArgType = 0
	ObjectArgTypeSharedObject     ObjectArgType = 1
	ObjectArgTypeReceiving        ObjectArgType = 2
)

type ObjectDigest

type ObjectDigest struct {
	Digest []byte
}

func (*ObjectDigest) Parse

func (c *ObjectDigest) Parse(data []byte, offset int) (int, error)

func (*ObjectDigest) SetBase58

func (c *ObjectDigest) SetBase58(base58Data string)

func (*ObjectDigest) String

func (c *ObjectDigest) String() string

func (*ObjectDigest) ToBytes

func (c *ObjectDigest) ToBytes() []byte

type ObjectID

type ObjectID [32]byte

func (*ObjectID) Parse

func (c *ObjectID) Parse(data []byte, offset int) (int, error)

func (*ObjectID) SetHex

func (c *ObjectID) SetHex(hexData string)

func (*ObjectID) String

func (c *ObjectID) String() string

func (*ObjectID) ToBytes

func (c *ObjectID) ToBytes() []byte

type ObjectRef

type ObjectRef struct {
	ObjectID       ObjectID
	SequenceNumber SequenceNumber
	ObjectDigest   ObjectDigest
}

func (*ObjectRef) Parse

func (c *ObjectRef) Parse(data []byte, offset int) (int, error)

func (*ObjectRef) String

func (c *ObjectRef) String() string

func (*ObjectRef) ToBytes

func (c *ObjectRef) ToBytes() []byte

type ProgrammableMoveCall

type ProgrammableMoveCall struct {
	Package       ObjectID
	Module        string
	Function      string
	TypeArguments []TypeInput
	Arguments     []Argument
}

func (*ProgrammableMoveCall) Parse

func (c *ProgrammableMoveCall) Parse(data []byte, offset int) (int, error)

func (*ProgrammableMoveCall) ToBytes

func (c *ProgrammableMoveCall) ToBytes() []byte

type ProgrammableTransaction

type ProgrammableTransaction struct {
	Inputs   []*CallArg
	Commands []*Command
}

func (*ProgrammableTransaction) Parse

func (c *ProgrammableTransaction) Parse(data []byte, offset int) (int, error)

func (*ProgrammableTransaction) ToBytes

func (c *ProgrammableTransaction) ToBytes() []byte

type Publish

type Publish struct {
	Data      []PublishData
	ObjectIDs []ObjectID
}

func (*Publish) Parse

func (c *Publish) Parse(data []byte, offset int) (int, error)

func (*Publish) ToBytes

func (c *Publish) ToBytes() []byte

type PublishData

type PublishData struct {
	Data []byte
}

type RandomnessStateUpdate

type RandomnessStateUpdate struct {
}

func (*RandomnessStateUpdate) Parse

func (r *RandomnessStateUpdate) Parse(data []byte, offset int) (int, error)

func (*RandomnessStateUpdate) ToBytes

func (r *RandomnessStateUpdate) ToBytes() []byte

type SequenceNumber

type SequenceNumber uint64

func (SequenceNumber) String

func (c SequenceNumber) String() string

type SharedObject

type SharedObject struct {
	Id                   ObjectID
	InitialSharedVersion SequenceNumber
	Mutable              bool
}

func (*SharedObject) Parse

func (c *SharedObject) Parse(data []byte, offset int) (int, error)

func (*SharedObject) ToBytes

func (c *SharedObject) ToBytes() []byte

type SplitCoins

type SplitCoins struct {
	Argument  *Argument
	Arguments []*Argument
}

func (*SplitCoins) Parse

func (c *SplitCoins) Parse(data []byte, offset int) (int, error)

func (*SplitCoins) ToBytes

func (c *SplitCoins) ToBytes() []byte

type StructInput

type StructInput struct {
	Address    AccountAddress
	Module     string
	Name       string
	TypeParams []TypeInput
}

func (*StructInput) Parse

func (c *StructInput) Parse(data []byte, offset int) (int, error)

func (*StructInput) ToBytes

func (c *StructInput) ToBytes() []byte

type SuiAddress

type SuiAddress [32]byte

func (*SuiAddress) Parse

func (c *SuiAddress) Parse(data []byte, offset int) (int, error)

func (*SuiAddress) String

func (c *SuiAddress) String() string

func (*SuiAddress) ToBytes

func (c *SuiAddress) ToBytes() []byte

type TransactionData

type TransactionData struct {
	Version TransactionDataVersion
	V1      *TransactionDataV1
	V2      *TransactionDataV2
}

func NewTransactionData

func NewTransactionData() *TransactionData

func NewTransactionDataV1

func NewTransactionDataV1() *TransactionData

func NewTransactionDataV2

func NewTransactionDataV2() *TransactionData

func (*TransactionData) Parse

func (c *TransactionData) Parse(data []byte, offset int) (int, error)

func (*TransactionData) ToBytes

func (c *TransactionData) ToBytes() []byte

type TransactionDataV1

type TransactionDataV1 struct {
	Kind       *TransactionKind
	Sender     SuiAddress
	GasData    *GasData
	Expiration *TransactionExpiration
}

func (*TransactionDataV1) Parse

func (c *TransactionDataV1) Parse(data []byte, offset int) (int, error)

func (*TransactionDataV1) ToBytes

func (c *TransactionDataV1) ToBytes() []byte

type TransactionDataV2

type TransactionDataV2 struct {
}

func (*TransactionDataV2) Parse

func (c *TransactionDataV2) Parse(data []byte, offset int) (int, error)

func (*TransactionDataV2) ToBytes

func (c *TransactionDataV2) ToBytes() []byte

type TransactionDataVersion

type TransactionDataVersion int
const (
	TransactionDataVersionV1 TransactionDataVersion = 0
	TransactionDataVersionV2 TransactionDataVersion = 1
)

type TransactionDataWithIntent

type TransactionDataWithIntent struct {
	Intent *Intent
	Data   *TransactionData
}

func (*TransactionDataWithIntent) Parse

func (c *TransactionDataWithIntent) Parse(data []byte, offset int) (int, error)

type TransactionExpiration

type TransactionExpiration struct {
	Kind    TransactionExpirationType
	EpochId uint64
}

func NewTransactionExpiration

func NewTransactionExpiration() *TransactionExpiration

func (*TransactionExpiration) Parse

func (c *TransactionExpiration) Parse(data []byte, offset int) (int, error)

func (*TransactionExpiration) ToBytes

func (c *TransactionExpiration) ToBytes() []byte

type TransactionExpirationType

type TransactionExpirationType int
const (
	TransactionExpirationKindNone  TransactionExpirationType = 0
	TransactionExpirationKindEpoch TransactionExpirationType = 1
)

type TransactionKind

type TransactionKind struct {
	Type TransactionKindType

	ProgrammableTransaction   *ProgrammableTransaction
	ChangeEpoch               *ChangeEpoch
	Genesis                   *GenesisTransaction
	ConsensusCommitPrologue   *ConsensusCommitPrologue
	AuthenticatorStateUpdate  *AuthenticatorStateUpdate
	EndOfEpochTransaction     []*EndOfEpochTransactionKind
	RandomnessStateUpdate     *RandomnessStateUpdate
	ConsensusCommitPrologueV2 *ConsensusCommitPrologueV2
	ConsensusCommitPrologueV3 *ConsensusCommitPrologueV3
}

func (*TransactionKind) Parse

func (c *TransactionKind) Parse(data []byte, offset int) (int, error)

func (*TransactionKind) ToBytes

func (c *TransactionKind) ToBytes() []byte

type TransactionKindType

type TransactionKindType int
const (
	ProgrammableTransactionType   TransactionKindType = 0
	ChangeEpochType               TransactionKindType = 1
	GenesisType                   TransactionKindType = 2
	ConsensusCommitPrologueType   TransactionKindType = 3
	AuthenticatorStateUpdateType  TransactionKindType = 4
	EndOfEpochTransactionType     TransactionKindType = 5
	RandomnessStateUpdateType     TransactionKindType = 6
	ConsensusCommitPrologueV2Type TransactionKindType = 7
	ConsensusCommitPrologueV3Type TransactionKindType = 8
)

type TransferObjects

type TransferObjects struct {
	Arguments []*Argument
	Argument  *Argument
}

func (*TransferObjects) Parse

func (c *TransferObjects) Parse(data []byte, offset int) (int, error)

func (*TransferObjects) ToBytes

func (c *TransferObjects) ToBytes() []byte

type TypeInput

type TypeInput struct {
	Type            TypeInputType
	VectorTypeInput *TypeInput
	StructInput     *StructInput
}

func (*TypeInput) Parse

func (c *TypeInput) Parse(data []byte, offset int) (int, error)

func (*TypeInput) ToBytes

func (c *TypeInput) ToBytes() []byte

type TypeInputType

type TypeInputType int
const (
	TypeInputBool    TypeInputType = 0
	TypeInputU8      TypeInputType = 1
	TypeInputU64     TypeInputType = 2
	TypeInputU128    TypeInputType = 3
	TypeInputAddress TypeInputType = 4
	TypeInputSigner  TypeInputType = 5
	TypeInputVector  TypeInputType = 6
	TypeInputStruct  TypeInputType = 7
	TypeInputU16     TypeInputType = 8
	TypeInputU32     TypeInputType = 9
	TypeInputU256    TypeInputType = 10
)

type Upgrade

type Upgrade struct {
}

func (*Upgrade) Parse

func (c *Upgrade) Parse(data []byte, offset int) (int, error)

func (*Upgrade) ToBytes

func (c *Upgrade) ToBytes() []byte

Jump to

Keyboard shortcuts

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