types

package
v0.0.0-...-c4e539a Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BcsSerializeBool

func BcsSerializeBool(t bool) ([]byte, error)

func BcsSerializeBytes

func BcsSerializeBytes(t []byte) ([]byte, error)

func BcsSerializeFixedBytes

func BcsSerializeFixedBytes(t []byte) ([]byte, error)

func BcsSerializeLen

func BcsSerializeLen(t uint64) ([]byte, error)

func BcsSerializeStr

func BcsSerializeStr(t string) ([]byte, error)

func BcsSerializeU128

func BcsSerializeU128(t serde.Uint128) ([]byte, error)

func BcsSerializeU8

func BcsSerializeU8(t uint8) ([]byte, error)

func BcsSerializeUint64

func BcsSerializeUint64(t uint64) ([]byte, error)

func BytesFromHex

func BytesFromHex(t string) []byte

func Sha256Hash

func Sha256Hash(bytes []byte) []byte

func ToBCS

func ToBCS(t BCSable) []byte

ToBCS serialize given `BCSable` into BCS bytes. It panics if bcs serialization failed.

func ToHex

func ToHex(t BCSable) string

ToHex serialize given `BCSable` into BCS bytes and then return hex-encoded string It panics if bcs serialization failed.

Types

type AccountAddress

type AccountAddress []byte

func (*AccountAddress) BcsSerialize

func (obj *AccountAddress) BcsSerialize() ([]byte, error)

func (*AccountAddress) Serialize

func (obj *AccountAddress) Serialize(serializer serde.Serializer) error

type AccountAuthenticator

type AccountAuthenticator interface {
	Serialize(serializer serde.Serializer) error
	BcsSerialize() ([]byte, error)
}

type AccountAuthenticator__Ed25519

type AccountAuthenticator__Ed25519 struct {
	PublicKey Ed25519PublicKey
	Signature Ed25519Signature
}

func (*AccountAuthenticator__Ed25519) BcsSerialize

func (obj *AccountAuthenticator__Ed25519) BcsSerialize() ([]byte, error)

func (*AccountAuthenticator__Ed25519) Serialize

func (obj *AccountAuthenticator__Ed25519) Serialize(serializer serde.Serializer) error

type BCSable

type BCSable interface {
	BcsSerialize() ([]byte, error)
}

BCSable interface for `ToBCS`

type ChainId

type ChainId uint8

func (*ChainId) BcsSerialize

func (obj *ChainId) BcsSerialize() ([]byte, error)

func (*ChainId) Serialize

func (obj *ChainId) Serialize(serializer serde.Serializer) error

type Ed25519PublicKey

type Ed25519PublicKey []byte

func (*Ed25519PublicKey) BcsSerialize

func (obj *Ed25519PublicKey) BcsSerialize() ([]byte, error)

func (*Ed25519PublicKey) Serialize

func (obj *Ed25519PublicKey) Serialize(serializer serde.Serializer) error

type Ed25519Signature

type Ed25519Signature []byte

func (*Ed25519Signature) BcsSerialize

func (obj *Ed25519Signature) BcsSerialize() ([]byte, error)

func (*Ed25519Signature) Serialize

func (obj *Ed25519Signature) Serialize(serializer serde.Serializer) error

type Identifier

type Identifier string

func (*Identifier) BcsSerialize

func (obj *Identifier) BcsSerialize() ([]byte, error)

func (*Identifier) Serialize

func (obj *Identifier) Serialize(serializer serde.Serializer) error

type ModuleId

type ModuleId struct {
	Address AccountAddress
	Name    Identifier
}

func (*ModuleId) BcsSerialize

func (obj *ModuleId) BcsSerialize() ([]byte, error)

func (*ModuleId) Serialize

func (obj *ModuleId) Serialize(serializer serde.Serializer) error

type RawTransaction

type RawTransaction struct {
	Sender                  AccountAddress
	SequenceNumber          uint64
	Payload                 TransactionPayload
	MaxGasAmount            uint64
	GasUnitPrice            uint64
	ExpirationTimestampSecs uint64
	ChainId                 ChainId
}

func (*RawTransaction) BcsSerialize

func (obj *RawTransaction) BcsSerialize() ([]byte, error)

func (*RawTransaction) GetSigningMessage

func (obj *RawTransaction) GetSigningMessage() ([]byte, error)

func (*RawTransaction) Serialize

func (obj *RawTransaction) Serialize(serializer serde.Serializer) error

type Script

type Script struct {
	Code   []byte
	TyArgs []TypeTag
	Args   []TransactionArgument
}

func (*Script) BcsSerialize

func (obj *Script) BcsSerialize() ([]byte, error)

func (*Script) Serialize

func (obj *Script) Serialize(serializer serde.Serializer) error

type ScriptFunction

type ScriptFunction struct {
	Module   ModuleId
	Function Identifier
	TyArgs   []TypeTag
	Args     [][]byte
}

func (*ScriptFunction) BcsSerialize

func (obj *ScriptFunction) BcsSerialize() ([]byte, error)

func (*ScriptFunction) Serialize

func (obj *ScriptFunction) Serialize(serializer serde.Serializer) error

type SignedTransaction

type SignedTransaction struct {
	RawTxn        RawTransaction
	Authenticator TransactionAuthenticator
}

func (*SignedTransaction) BcsSerialize

func (obj *SignedTransaction) BcsSerialize() ([]byte, error)

func (*SignedTransaction) Serialize

func (obj *SignedTransaction) Serialize(serializer serde.Serializer) error

type StructTag

type StructTag struct {
	Address    AccountAddress
	Module     Identifier
	Name       Identifier
	TypeParams []TypeTag
}

func (*StructTag) BcsSerialize

func (obj *StructTag) BcsSerialize() ([]byte, error)

func (*StructTag) Serialize

func (obj *StructTag) Serialize(serializer serde.Serializer) error

type Transaction

type Transaction interface {
	Serialize(serializer serde.Serializer) error
	BcsSerialize() ([]byte, error)
}

type TransactionArgument

type TransactionArgument interface {
	Serialize(serializer serde.Serializer) error
	BcsSerialize() ([]byte, error)
}

type TransactionArgument__Address

type TransactionArgument__Address struct {
	Value AccountAddress
}

func (*TransactionArgument__Address) BcsSerialize

func (obj *TransactionArgument__Address) BcsSerialize() ([]byte, error)

func (*TransactionArgument__Address) Serialize

func (obj *TransactionArgument__Address) Serialize(serializer serde.Serializer) error

type TransactionArgument__Bool

type TransactionArgument__Bool bool

func (*TransactionArgument__Bool) BcsSerialize

func (obj *TransactionArgument__Bool) BcsSerialize() ([]byte, error)

func (*TransactionArgument__Bool) Serialize

func (obj *TransactionArgument__Bool) Serialize(serializer serde.Serializer) error

type TransactionArgument__U128

type TransactionArgument__U128 serde.Uint128

func (*TransactionArgument__U128) BcsSerialize

func (obj *TransactionArgument__U128) BcsSerialize() ([]byte, error)

func (*TransactionArgument__U128) Serialize

func (obj *TransactionArgument__U128) Serialize(serializer serde.Serializer) error

type TransactionArgument__U64

type TransactionArgument__U64 uint64

func (*TransactionArgument__U64) BcsSerialize

func (obj *TransactionArgument__U64) BcsSerialize() ([]byte, error)

func (*TransactionArgument__U64) Serialize

func (obj *TransactionArgument__U64) Serialize(serializer serde.Serializer) error

type TransactionArgument__U8

type TransactionArgument__U8 uint8

func (*TransactionArgument__U8) BcsSerialize

func (obj *TransactionArgument__U8) BcsSerialize() ([]byte, error)

func (*TransactionArgument__U8) Serialize

func (obj *TransactionArgument__U8) Serialize(serializer serde.Serializer) error

type TransactionArgument__U8Vector

type TransactionArgument__U8Vector []byte

func (*TransactionArgument__U8Vector) BcsSerialize

func (obj *TransactionArgument__U8Vector) BcsSerialize() ([]byte, error)

func (*TransactionArgument__U8Vector) Serialize

func (obj *TransactionArgument__U8Vector) Serialize(serializer serde.Serializer) error

type TransactionAuthenticator

type TransactionAuthenticator interface {
	Serialize(serializer serde.Serializer) error
	BcsSerialize() ([]byte, error)
}

type TransactionAuthenticator__Ed25519

type TransactionAuthenticator__Ed25519 struct {
	PublicKey Ed25519PublicKey
	Signature Ed25519Signature
}

func (*TransactionAuthenticator__Ed25519) BcsSerialize

func (obj *TransactionAuthenticator__Ed25519) BcsSerialize() ([]byte, error)

func (*TransactionAuthenticator__Ed25519) Serialize

func (obj *TransactionAuthenticator__Ed25519) Serialize(serializer serde.Serializer) error

type TransactionPayload

type TransactionPayload interface {
	Serialize(serializer serde.Serializer) error
	BcsSerialize() ([]byte, error)
}

type TransactionPayloadEntryFunction

type TransactionPayloadEntryFunction struct {
	Value ScriptFunction
}

func (*TransactionPayloadEntryFunction) BcsSerialize

func (obj *TransactionPayloadEntryFunction) BcsSerialize() ([]byte, error)

func (*TransactionPayloadEntryFunction) Serialize

func (obj *TransactionPayloadEntryFunction) Serialize(serializer serde.Serializer) error

type TransactionPayloadScript

type TransactionPayloadScript struct {
	Value Script
}

func (*TransactionPayloadScript) BcsSerialize

func (obj *TransactionPayloadScript) BcsSerialize() ([]byte, error)

func (*TransactionPayloadScript) Serialize

func (obj *TransactionPayloadScript) Serialize(serializer serde.Serializer) error

type Transaction__UserTransaction

type Transaction__UserTransaction struct {
	Value SignedTransaction
}

func (*Transaction__UserTransaction) BcsSerialize

func (obj *Transaction__UserTransaction) BcsSerialize() ([]byte, error)

func (*Transaction__UserTransaction) Serialize

func (obj *Transaction__UserTransaction) Serialize(serializer serde.Serializer) error

type TypeTag

type TypeTag interface {
	Serialize(serializer serde.Serializer) error
	BcsSerialize() ([]byte, error)
}

type TypeTag__Address

type TypeTag__Address struct {
}

func (*TypeTag__Address) BcsSerialize

func (obj *TypeTag__Address) BcsSerialize() ([]byte, error)

func (*TypeTag__Address) Serialize

func (obj *TypeTag__Address) Serialize(serializer serde.Serializer) error

type TypeTag__Bool

type TypeTag__Bool struct {
}

func (*TypeTag__Bool) BcsSerialize

func (obj *TypeTag__Bool) BcsSerialize() ([]byte, error)

func (*TypeTag__Bool) Serialize

func (obj *TypeTag__Bool) Serialize(serializer serde.Serializer) error

type TypeTag__Signer

type TypeTag__Signer struct {
}

func (*TypeTag__Signer) BcsSerialize

func (obj *TypeTag__Signer) BcsSerialize() ([]byte, error)

func (*TypeTag__Signer) Serialize

func (obj *TypeTag__Signer) Serialize(serializer serde.Serializer) error

type TypeTag__Struct

type TypeTag__Struct struct {
	Value StructTag
}

func (*TypeTag__Struct) BcsSerialize

func (obj *TypeTag__Struct) BcsSerialize() ([]byte, error)

func (*TypeTag__Struct) Serialize

func (obj *TypeTag__Struct) Serialize(serializer serde.Serializer) error

type TypeTag__U128

type TypeTag__U128 struct {
}

func (*TypeTag__U128) BcsSerialize

func (obj *TypeTag__U128) BcsSerialize() ([]byte, error)

func (*TypeTag__U128) Serialize

func (obj *TypeTag__U128) Serialize(serializer serde.Serializer) error

type TypeTag__U64

type TypeTag__U64 struct {
}

func (*TypeTag__U64) BcsSerialize

func (obj *TypeTag__U64) BcsSerialize() ([]byte, error)

func (*TypeTag__U64) Serialize

func (obj *TypeTag__U64) Serialize(serializer serde.Serializer) error

type TypeTag__U8

type TypeTag__U8 struct {
}

func (*TypeTag__U8) BcsSerialize

func (obj *TypeTag__U8) BcsSerialize() ([]byte, error)

func (*TypeTag__U8) Serialize

func (obj *TypeTag__U8) Serialize(serializer serde.Serializer) error

type TypeTag__Vector

type TypeTag__Vector struct {
	Value TypeTag
}

func (*TypeTag__Vector) BcsSerialize

func (obj *TypeTag__Vector) BcsSerialize() ([]byte, error)

func (*TypeTag__Vector) Serialize

func (obj *TypeTag__Vector) Serialize(serializer serde.Serializer) error

Jump to

Keyboard shortcuts

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