api

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package api represents all types associated with the Endless REST API. It handles JSON packing and un-packing, through multiple inner types.

Quick links:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchSubmitTransactionFailure

type BatchSubmitTransactionFailure struct {
	// Error is the error that occurred when submitting the transaction
	Error Error
	//TransactionIndex is the index of submitted transactions that failed
	TransactionIndex uint32 `json:"transaction_index"`
}

BatchSubmitTransactionFailure is a failure of a transaction in a batch submission,

type BatchSubmitTransactionResponse

type BatchSubmitTransactionResponse struct {
	// TransactionFailures is the list of transactions that failed to submit, if it is empty, all were successful
	TransactionFailures []BatchSubmitTransactionFailure `json:"transaction_failures"`
}

BatchSubmitTransactionResponse is the response from submitting a batch of transactions to the blockchain

type Block

type Block struct {
	BlockHash      Hash                    // BlockHash of the block, a 32-byte hash in hexadecimal format
	BlockHeight    uint64                  // BlockHeight of the block, starts at 0
	BlockTimestamp uint64                  // BlockTimestamp is the Unix timestamp of the block, in microseconds, may not be set for block 0
	FirstVersion   uint64                  // FirstVersion of the block
	LastVersion    uint64                  // LastVersion of the block inclusive, may be the same value as FirstVersion
	Transactions   []*CommittedTransaction // Transactions in the block if requested, otherwise it is empty
}

Block describes a block properties and may have attached transactions

Example:

{
	"block_height": "1",
	"block_hash": "0x014e30aafd9f715ab6262322bf919abebd66d948f6822ffb8a2699a57722fb80",
	"block_timestamp": "1665609760857472",
	"first_version": "1",
	"last_version": "1",
	"transactions": null
}

func (*Block) UnmarshalJSON

func (o *Block) UnmarshalJSON(b []byte) error

UnmarshalJSON deserializes a JSON data blob into a Block

It will fail if not all fields are present, or a transaction is unparsable.

type BlockEndInfo

type BlockEndInfo struct {
	BlockGasLimitReached        bool   `json:"block_gas_limit_reached"`         // BlockGasLimitReached is true if the block gas limit was reached.
	BlockOutputLimitReached     bool   `json:"block_output_limit_reached"`      // BlockOutputLimitReached is true if the block output limit was reached.
	BlockEffectiveBlockGasUnits uint64 `json:"block_effective_block_gas_units"` // BlockEffectiveBlockGasUnits is the effective gas units used in the block.
	BlockApproxOutputSize       uint64 `json:"block_approx_output_size"`        // BlockApproxOutputSize is the approximate output size of the block.
}

BlockEndInfo is the information about the block gas

type BlockEpilogueTransaction

type BlockEpilogueTransaction struct {
	Version             uint64            // Version of the transaction, starts at 0 and increments per transaction.
	Hash                Hash              // Hash of the transaction, it is a SHA3-256 hash in hexadecimal format with a leading 0x.
	AccumulatorRootHash Hash              // AccumulatorRootHash of the transaction.
	StateChangeHash     Hash              // StateChangeHash of the transaction.
	EventRootHash       Hash              // EventRootHash of the transaction.
	GasUsed             uint64            // GasUsed by the transaction, will be in gas units.  It should be 0.
	Success             bool              // Success of the transaction.
	VmStatus            string            // VmStatus of the transaction, this will contain the error if any.
	Changes             []*WriteSetChange // Changes to the ledger from the transaction, should never be empty.
	Events              []*Event          // Events emitted by the transaction, may be empty.
	Timestamp           uint64            // Timestamp is the Unix timestamp in microseconds when the block of the transaction was committed.
	BlockEndInfo        *BlockEndInfo     // BlockEndInfo of the transaction, this will contain information about block gas.
	StateCheckpointHash Hash              // StateCheckpointHash of the transaction. Optional, and will be "" if not set.
}

BlockEpilogueTransaction is a transaction at the end of the block. It is not necessarily at the end of a block prior to being enabled as a feature.

func (*BlockEpilogueTransaction) TxnHash

func (o *BlockEpilogueTransaction) TxnHash() Hash

TxnHash gives us the hash of the transaction.

func (*BlockEpilogueTransaction) TxnSuccess

func (o *BlockEpilogueTransaction) TxnSuccess() *bool

TxnSuccess tells us if the transaction is a success. It will never be nil.

func (*BlockEpilogueTransaction) TxnVersion

func (o *BlockEpilogueTransaction) TxnVersion() *uint64

TxnVersion gives us the ledger version of the transaction. It will never be nil.

func (*BlockEpilogueTransaction) UnmarshalJSON

func (o *BlockEpilogueTransaction) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the BlockEpilogueTransaction from JSON handling conversion between types

type BlockMetadataTransaction

type BlockMetadataTransaction struct {
	Id                       string                // Id of the block, is the Hash of the block.
	Epoch                    uint64                // Epoch of the block, starts at 0 and increments per epoch.  Epoch is roughly 2 hours, and subject to change.
	Round                    uint64                // Round of the block, starts at 0 and increments per round in the epoch.
	PreviousBlockVotesBitvec []uint8               // PreviousBlockVotesBitvec of the block, this is a bit vector of the votes of the previous block.
	Proposer                 *types.AccountAddress // Proposer of the block, will never be nil.
	FailedProposerIndices    []uint32              // FailedProposerIndices of the block, this is the indices of the proposers that failed to propose a block.
	Version                  uint64                // Version of the transaction, starts at 0 and increments per transaction.
	Hash                     string                // Hash of the transaction, it is a SHA3-256 hash in hexadecimal format with a leading 0x.
	AccumulatorRootHash      Hash                  // AccumulatorRootHash of the transaction.
	StateChangeHash          Hash                  // StateChangeHash of the transaction.
	EventRootHash            Hash                  // EventRootHash of the transaction.
	GasUsed                  uint64                // GasUsed by the transaction, will be in gas units. Should always be 0.
	Success                  bool                  // Success of the transaction.
	VmStatus                 string                // VmStatus of the transaction, this will contain the error if any.
	Changes                  []*WriteSetChange     // Changes to the ledger from the transaction, should never be empty.
	Events                   []*Event              // Events emitted by the transaction, may be empty.
	Timestamp                uint64                // Timestamp is the Unix timestamp in microseconds when the block of the transaction was committed.
	StateCheckpointHash      Hash                  // StateCheckpointHash of the transaction. Optional, and will be "" if not set.
}

BlockMetadataTransaction is a transaction that is metadata about a block.

func (*BlockMetadataTransaction) TxnHash

func (o *BlockMetadataTransaction) TxnHash() Hash

TxnHash gives us the hash of the transaction.

func (*BlockMetadataTransaction) TxnSuccess

func (o *BlockMetadataTransaction) TxnSuccess() *bool

TxnSuccess tells us if the transaction is a success. It will never be nil.

func (*BlockMetadataTransaction) TxnVersion

func (o *BlockMetadataTransaction) TxnVersion() *uint64

TxnVersion gives us the ledger version of the transaction. It will never be nil.

func (*BlockMetadataTransaction) UnmarshalJSON

func (o *BlockMetadataTransaction) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the BlockMetadataTransaction from JSON handling conversion between types

type CommittedTransaction

type CommittedTransaction struct {
	Type  TransactionVariant // Type of the transaction
	Inner TransactionImpl    // Inner is the actual transaction
}

CommittedTransaction is an enum type for all possible committed transactions on the blockchain This is the same as Transaction but with the Success and Version functions always confirmed.

func (*CommittedTransaction) BlockEpilogueTransaction

func (o *CommittedTransaction) BlockEpilogueTransaction() (*BlockEpilogueTransaction, error)

BlockEpilogueTransaction changes the transaction to a BlockEpilogueTransaction; however, it will fail if it's not one.

func (*CommittedTransaction) BlockMetadataTransaction

func (o *CommittedTransaction) BlockMetadataTransaction() (*BlockMetadataTransaction, error)

BlockMetadataTransaction changes the transaction to a BlockMetadataTransaction; however, it will fail if it's not one.

func (*CommittedTransaction) GenesisTransaction

func (o *CommittedTransaction) GenesisTransaction() (*GenesisTransaction, error)

GenesisTransaction changes the transaction to a GenesisTransaction; however, it will fail if it's not one.

func (*CommittedTransaction) Hash

func (o *CommittedTransaction) Hash() Hash

Hash of the transaction for lookup on-chain

func (*CommittedTransaction) StateCheckpointTransaction

func (o *CommittedTransaction) StateCheckpointTransaction() (*StateCheckpointTransaction, error)

StateCheckpointTransaction changes the transaction to a StateCheckpointTransaction; however, it will fail if it's not one.

func (*CommittedTransaction) Success

func (o *CommittedTransaction) Success() bool

Success of the transaction. Pending transactions, and genesis may not have a success field. If this is the case, it will be nil

func (*CommittedTransaction) UnknownTransaction

func (o *CommittedTransaction) UnknownTransaction() (*UnknownTransaction, error)

UnknownTransaction changes the transaction to a UnknownTransaction; however, it will fail if it's not one.

func (*CommittedTransaction) UnmarshalJSON

func (o *CommittedTransaction) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Transaction from JSON handling conversion between types

func (*CommittedTransaction) UserTransaction

func (o *CommittedTransaction) UserTransaction() (*UserTransaction, error)

UserTransaction changes the transaction to a UserTransaction; however, it will fail if it's not one.

func (*CommittedTransaction) ValidatorTransaction

func (o *CommittedTransaction) ValidatorTransaction() (*ValidatorTransaction, error)

ValidatorTransaction changes the transaction to a ValidatorTransaction; however, it will fail if it's not one.

func (*CommittedTransaction) Version

func (o *CommittedTransaction) Version() uint64

Version of the transaction on chain, will be nil if it is a PendingTransaction

type DecodedTableData

type DecodedTableData struct {
	Key       any    `json:"key"`        // Key is the key of the table item in a decoded format
	KeyType   string `json:"key_type"`   // KeyType is the type of the key as a string representation of a TypeTag
	Value     any    `json:"value"`      // Value is the value of the table item
	ValueType string `json:"value_type"` // ValueType is the type of the value as a string representation of a TypeTag
}

DecodedTableData is the decoded data for a table item

type DeletedTableData

type DeletedTableData struct {
	Key     any    `json:"key"`      // Key is the key of the table item in a decoded format
	KeyType string `json:"key_type"` // KeyType is the type of the key as a string representation of a TypeTag
}

DeletedTableData is the decoded data for a deleted table item

type DirectWriteSet

type DirectWriteSet struct {
	Changes []*WriteSetChange `json:"changes"` // Changes is the list of changes in the write set, can be empty
	Events  []*Event          `json:"events"`  // Events is the list of events in the write set, can be empty
}

DirectWriteSet is a raw set of changes and events. This is also used for the GenesisTransaction

type Ed25519Signature

type Ed25519Signature crypto.Ed25519Authenticator

Ed25519Signature represents an Ed25519 public key and signature pair, which actually is the crypto.AccountAuthenticator. It's poorly named Ed25519Signature in the API spec

func (*Ed25519Signature) UnmarshalJSON

func (o *Ed25519Signature) UnmarshalJSON(b []byte) error

UnmarshalJSON deserializes a JSON data blob into an Ed25519Signature

type Error

type Error struct {
	Message     string `json:"message"`       // Message is the error message
	ErrorCode   string `json:"error_code"`    // ErrorCode is the string name of the error
	VmErrorCode uint64 `json:"vm_error_code"` // VmErrorCode is the number of the failure, optional 0 if not set
}

Error is an error from the REST API

type Event

type Event struct {
	Type           string         // Type is the fully qualified name of the event e.g. 0x1::coin::WithdrawEvent
	Guid           *GUID          // GUID is the unique identifier of the event, only present in V1 events
	SequenceNumber uint64         // SequenceNumber is the sequence number of the event, only present in V1 events
	Data           map[string]any // Data is the event data, a map of field name to value, this should match it's on-chain struct representation
}

Event describes an on-chain event from Move. There are currently two types:

Handle events will have a GUID and SequenceNumber associated

{
  "type": "0x1::coin::WithdrawEvent",
  "guid": {
    "addr": "0x810026ca8291dd88b5b30a1d3ca2edd683d33d06c4a7f7c451d96f6d47bc5e8b",
    "creation_num": "3"
  },
  "sequence_number": "0",
  "data": {
    "amount": "1000"
  }
}

Module events will not have a GUID and SequenceNumber associated

{
  "type": "0x1::fungible_asset::Withdraw",
  "guid": {
    "addr": "0x0",
    "creation_num": "0"
  },
  "sequence_number": "0",
  "data": {
    "store": "0x1234123412341234123412341234123412341234123412341234123412341234",
    "amount": "1000"
  }
}

func (*Event) UnmarshalJSON

func (o *Event) UnmarshalJSON(b []byte) error

UnmarshalJSON deserializes a JSON data blob into an Event

type FeePayerSignature

type FeePayerSignature struct {
	FeePayerAddress          *types.AccountAddress   `json:"fee_payer_address"`
	FeePayerSigner           *Signature              `json:"fee_payer_signer"`
	SecondarySignerAddresses []*types.AccountAddress `json:"secondary_signer_addresses"`
	SecondarySigners         []*Signature            `json:"secondary_signers"`
	Sender                   *Signature              `json:"sender"`
}

FeePayerSignature is a sponsored transaction, the sender can be different from the fee payer of the transaction. It can also be multi-agent like MultiAgentSignature

type GUID

type GUID struct {
	CreationNumber uint64                // CreationNumber is the number of the GUID
	AccountAddress *types.AccountAddress // AccountAddress is the account address of the creator of the GUID
}

GUID describes a GUID associated with things like V1 events

Note that this can only be used to deserialize events in the `events` field, and not the `GUID` resource in `changes`.

func (*GUID) UnmarshalJSON

func (o *GUID) UnmarshalJSON(b []byte) error

UnmarshalJSON deserializes a JSON data blob into a [GUIDId]

type GenericTypeParam

type GenericTypeParam struct {
	Constraints []MoveAbility `json:"constraints"` // Constraints are the constraints required for the generic type e.g. copy.
}

GenericTypeParam is a set of requirements for a generic. These can be applied via different MoveAbility constraints required on the type.

Example:

{
	"constraints": [
		"copy"
	]
}

type GenesisTransaction

type GenesisTransaction struct {
	Version             uint64              // Version of the transaction, starts at 0 and increments per transaction.
	Hash                Hash                // Hash of the transaction, it is a SHA3-256 hash in hexadecimal format with a leading 0x.
	AccumulatorRootHash Hash                // AccumulatorRootHash of the transaction.
	StateChangeHash     Hash                // StateChangeHash of the transaction.
	EventRootHash       Hash                // EventRootHash of the transaction.
	GasUsed             uint64              // GasUsed by the transaction, will be in gas units.
	Success             bool                // Success of the transaction.
	VmStatus            string              // VmStatus of the transaction, this will contain the error if any.
	Changes             []*WriteSetChange   // Changes to the ledger from the transaction, should never be empty.
	Events              []*Event            // Events emitted by the transaction, may be empty.
	Payload             *TransactionPayload // Payload of the transaction, this is the actual transaction data.
	StateCheckpointHash Hash                // StateCheckpointHash of the transaction. Optional, and will be "" if not set.
}

GenesisTransaction is a transaction that is the first transaction on the blockchain.

func (*GenesisTransaction) TxnHash

func (o *GenesisTransaction) TxnHash() Hash

TxnHash gives us the hash of the transaction.

func (*GenesisTransaction) TxnSuccess

func (o *GenesisTransaction) TxnSuccess() *bool

TxnSuccess tells us if the transaction is a success. It will never be nil.

func (*GenesisTransaction) TxnVersion

func (o *GenesisTransaction) TxnVersion() *uint64

TxnVersion gives us the ledger version of the transaction. It will never be nil.

func (*GenesisTransaction) UnmarshalJSON

func (o *GenesisTransaction) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the GenesisTransaction from JSON handling conversion between types

type Hash

type Hash = string // TODO: do we make this a 32 byte array? or byte array?

Hash is a representation of a hash as Hex in JSON

This is always represented as a 32-byte hash in hexadecimal format

Example:

0xf4d07fdb8b5151971886a910e516d418a790dd5f6e068b0588066518a395a600

type HealthCheckResponse

type HealthCheckResponse struct {
	Message string `json:"message"` // Message is the human-readable message, usually "endless-node:ok"
}

HealthCheckResponse is the response to a health check request

Example:

{
	"message": "endless-node:ok"
}

type HexBytes

type HexBytes []byte

HexBytes is a type for handling Bytes encoded as hex in JSON

func (*HexBytes) UnmarshalJSON

func (u *HexBytes) UnmarshalJSON(b []byte) error

UnmarshalJSON deserializes a JSON data blob into a HexBytes

Example:

"0x123456" -> []byte{0x12, 0x34, 0x56}

type MoveAbility

type MoveAbility string

MoveAbility are the types of abilities applied to structs, the possible types are listed as MoveAbilityStore and others.

See more at the Move Ability Documentation.

const (
	MoveAbilityStore MoveAbility = "store" // MoveAbilityStore is the ability to store the type
	MoveAbilityDrop  MoveAbility = "drop"  // MoveAbilityDrop is the ability to drop the type
	MoveAbilityKey   MoveAbility = "key"   // MoveAbilityKey is the ability to use the type as a key in global storage
	MoveAbilityCopy  MoveAbility = "copy"  // MoveAbilityCopy is the ability to copy the type
)

type MoveBytecode

type MoveBytecode struct {
	Bytecode HexBytes    `json:"bytecode"`      // Bytecode is the hex encoded version of the compiled module
	Abi      *MoveModule `json:"abi,omitempty"` // Abi is the ABI for the module, and is optional
}

MoveBytecode describes a module, or script, and it's associated ABI as a MoveModule

Example 0x1::coin:

{
	"bytecode": "0xa11ceb0b123456...",
	"abi": {
		"address": "0x1",
		"name": "coin",
		"friends": [
			"0x1::endless_coin",
			"0x1::genesis",
			"0x1::transaction_fee"
		],
		"exposed_functions": [
			{
				"name": "balance",
				"visibility": "public",
				"is_entry": false,
				"is_view": true,
				"generic_type_params": [
					{
						"constraints": []
					}
				],
				"params": [
					"address"
				],
				"return": [
					"u64"
				]
			}
		],
		"structs": [
			{
				"name": "Coin",
				"is_native": false,
				"abilities": [
					"store"
				],
				"generic_type_params": [
					{
						"constraints": []
					}
				],
				"fields": [
					{
						"name": "value",
						"type": "u64"
					}
				]
			},
		],
	}
}

type MoveComponentId

type MoveComponentId = string

MoveComponentId is an id for a struct, function, or other type e.g. 0x1::endless_coin::eneLessCoin

type MoveFunction

type MoveFunction struct {
	Name              MoveComponentId     `json:"name"`                // Name is the name of the function e.g. balance
	Visibility        MoveVisibility      `json:"visibility"`          // Visibility is the visibility of the function e.g. public
	IsEntry           bool                `json:"is_entry"`            // IsEntry is true if the function is an entry function
	IsView            bool                `json:"is_view"`             // IsView is true if the function is a view function
	GenericTypeParams []*GenericTypeParam `json:"generic_type_params"` // GenericTypeParams are the generic type parameters for the function
	Params            []string            `json:"params"`              // Params are the parameters for the function in string format for the TypeTag
	Return            []string            `json:"return"`              // Return is the return type for the function in string format for the TypeTag
}

MoveFunction describes a move function and its associated properties

Example 0x1::coin::balance:

{
	"name": "balance",
	"visibility": "public",
	"is_entry": false,
	"is_view": true,
	"generic_type_params": [
		{
			"constraints": []
		}
	],
	"params": [
		"address"
	],
	"return": [
		"u64"
	]
}

type MoveModule

type MoveModule struct {
	Address          *types.AccountAddress `json:"address"`           // Address is the address of the module e.g. 0x1
	Name             string                `json:"name"`              // Name is the name of the module e.g. coin
	Friends          []MoveComponentId     `json:"friends"`           // Friends are other modules that can access this module in the same package.
	ExposedFunctions []*MoveFunction       `json:"exposed_functions"` // ExposedFunctions are the functions that can be called from outside the module.
	Structs          []*MoveStruct         `json:"structs"`           // Structs are the structs defined in the module.
}

MoveModule describes the abilities and types associated with a specific module.

type MoveResource

type MoveResource struct {
	Type string         `json:"type"` // Type is the type of the resource e.g. 0x1::coin::CoinStore<0x1::endless_coin::eneLessCoin> or 0x1::account::Account
	Data map[string]any `json:"data"` // Data is the resource data matching the on-chain struct data
}

MoveResource is a resource in Move, it should match the on-chain struct data

type MoveScript

type MoveScript struct {
	Bytecode HexBytes      `json:"bytecode"`      // Bytecode is the hex encoded version of the compiled script.
	Abi      *MoveFunction `json:"abi,omitempty"` // Abi is the ABI for the module, and is optional.
}

MoveScript is the representation of a compiled script. The API may not fill in the ABI field.

Example:

{
	"bytecode": "0xa11ceb0b123456...",
	"abi": {
		"address": "0x1",
		"name": "coin",
		"friends": [
			"0x1::endless_coin",
			"0x1::genesis",
			"0x1::transaction_fee"
		],
		"exposed_functions": [
			{
				"name": "balance",
				"visibility": "public",
				"is_entry": false,
				"is_view": true,
				"generic_type_params": [
					{
						"constraints": []
					}
				],
				"params": [
					"address"
				],
				"return": [
					"u64"
				]
			}
		],
		"structs": [
			{
				"name": "Coin",
				"is_native": false,
				"abilities": [
					"store"
				],
				"generic_type_params": [
					{
						"constraints": []
					}
				],
				"fields": [
					{
						"name": "value",
						"type": "u64"
					}
				]
			}
		]
	}
}

type MoveStruct

type MoveStruct struct {
	Name              string              `json:"name"`                // Name is the name of the struct e.g. Coin
	IsNative          bool                `json:"is_native"`           // IsNative is true if the struct is native e.g. u64
	Abilities         []MoveAbility       `json:"abilities"`           // Abilities are the abilities applied to the struct e.g. copy or store
	GenericTypeParams []*GenericTypeParam `json:"generic_type_params"` // GenericTypeParams are the generic type parameters for the struct
	Fields            []*MoveStructField  `json:"fields"`              // Fields are the fields in the struct
}

MoveStruct describes the layout for a struct, and its constraints

Example 0x1::coin::Coin:

{
	"name": "Coin",
	"is_native": false,
	"abilities": [
		"store"
	],
	"generic_type_params": [
		{
			"constraints": []
		}
	],
	"fields": [
		{
			"name": "value",
			"type": "u64"
		}
	]
}

type MoveStructField

type MoveStructField struct {
	Name string `json:"name"` // Name of the field e.g. value
	Type string `json:"type"` // Type of the field in string format for the TypeTag e.g. u64
}

MoveStructField represents a single field in a struct, and it's associated type.

Example:

{
	"name": "value",
	"type": "u64"
}

type MoveVisibility

type MoveVisibility string

MoveVisibility is the visibility of a function or struct, the possible types are listed as MoveVisibilityPublic and others

See more at the Move Visibility Documentation.

const (
	MoveVisibilityPublic  MoveVisibility = "public"  // MoveVisibilityPublic is a function that is accessible anywhere
	MoveVisibilityPrivate MoveVisibility = "private" // MoveVisibilityPrivate is a function that is only accessible within the module
	MoveVisibilityFriend  MoveVisibility = "friend"  // MoveVisibilityFriend is a function that is only accessible to friends of the module
)

type MultiAgentSignature

type MultiAgentSignature struct {
	SecondarySignerAddresses []*types.AccountAddress `json:"secondary_signer_addresses"`
	SecondarySigners         []*Signature            `json:"secondary_signers"`
	Sender                   *Signature              `json:"sender"`
}

MultiAgentSignature is a transaction with multiple unique signers, acting on behalf of multiple accounts

type MultiEd25519Signature

type MultiEd25519Signature struct {
	// TODO: add the MultiEd25519 crypto type directly, and remove this extra redirection
	// Note that public keys and signatures should be the same length, unless the transaction failed
	PublicKeys []*crypto.Ed25519PublicKey
	Signatures []*crypto.Ed25519Signature
	Threshold  uint8
	Bitmap     []byte
}

MultiEd25519Signature is off-chain multi-sig with only Ed25519 keys

func (*MultiEd25519Signature) UnmarshalJSON

func (o *MultiEd25519Signature) UnmarshalJSON(b []byte) error

UnmarshalJSON deserializes a JSON data blob into a MultiEd25519Signature

type PendingTransaction

type PendingTransaction struct {
	Hash                    Hash                  // Hash of the transaction, it is a SHA3-256 hash in hexadecimal format with a leading 0x.
	Sender                  *types.AccountAddress // Sender of the transaction, will never be nil.
	SequenceNumber          uint64                // SequenceNumber of the transaction, starts at 0 and increments per transaction submitted by the sender.
	MaxGasAmount            uint64                // MaxGasAmount of the transaction, this is the max amount of gas units that the user is willing to pay.
	GasUnitPrice            uint64                // GasUnitPrice of the transaction, this is the multiplier per unit of gas to tokens.
	ExpirationTimestampSecs uint64                // ExpirationTimestampSecs of the transaction, this is the Unix timestamp in seconds when the transaction expires.
	Payload                 *TransactionPayload   // Payload of the transaction, this is the actual transaction data.
	Signature               *Signature            // Signature is the AccountAuthenticator of the sender.

}

PendingTransaction is a transaction that is not yet committed to the blockchain.

func (*PendingTransaction) TxnHash

func (o *PendingTransaction) TxnHash() Hash

TxnHash gives us the hash of the transaction.

func (*PendingTransaction) TxnSuccess

func (o *PendingTransaction) TxnSuccess() *bool

TxnSuccess tells us if the transaction is a success. It will always be nil.

func (*PendingTransaction) TxnVersion

func (o *PendingTransaction) TxnVersion() *uint64

TxnVersion gives us the ledger version of the transaction. It will always be nil.

func (*PendingTransaction) UnmarshalJSON

func (o *PendingTransaction) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the PendingTransaction from JSON handling conversion between types

type ScriptWriteSet

type ScriptWriteSet struct {
	ExecuteAs *types.AccountAddress     `json:"execute_as"` // ExecuteAs is the address that the script was executed as
	Script    *TransactionPayloadScript `json:"script"`     // Script is the script that generated the write set
}

ScriptWriteSet is a set of changes and events that are generated by a script

This hasn't been used in practice yet, but it's here for completeness

type Signature

type Signature struct {
	Type  SignatureVariant // Type of the signature, if the signature isn't recognized, it will be [SignatureVariantUnknown]
	Inner SignatureImpl    // Inner is the actual signature
}

Signature is an enum of all possible signatures on Endless

Unknown types will have the Type set to SignatureVariantUnknown and the Inner set to UnknownSignature

func (*Signature) UnmarshalJSON

func (o *Signature) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Signature from JSON handling conversion between types

type SignatureImpl

type SignatureImpl interface{}

SignatureImpl is an interface for all signatures in their JSON formats

type SignatureVariant

type SignatureVariant string

SignatureVariant is the JSON representation of the signature types

const (
	SignatureVariantEd25519      SignatureVariant = "ed25519_signature"       // SignatureVariantEd25519 maps to Ed25519Signature
	SignatureVariantMultiEd25519 SignatureVariant = "multi_ed25519_signature" // SignatureVariantMultiEd25519 maps to MultiEd25519Signature
	SignatureVariantMultiAgent   SignatureVariant = "multi_agent_signature"   // SignatureVariantMultiAgent maps to MultiAgentSignature
	SignatureVariantFeePayer     SignatureVariant = "fee_payer_signature"     // SignatureVariantFeePayer maps to FeePayerSignature
	SignatureVariantSingleSender SignatureVariant = "single_sender"           // SignatureVariantSingleSender maps to SingleSenderSignature
	SignatureVariantUnknown      SignatureVariant = "unknown"                 // SignatureVariantUnknown maps to UnknownSignature for unknown types
)

type SingleSenderSignature

type SingleSenderSignature map[string]any

SingleSenderSignature is a map of the possible keys, the API needs an update to describe the type of key TODO: Implement single sender crypto properly, needs updates on the API side

type StateCheckpointTransaction

type StateCheckpointTransaction struct {
	Version             uint64            // Version of the transaction, starts at 0 and increments per transaction.
	Hash                Hash              // Hash of the transaction, it is a SHA3-256 hash in hexadecimal format with a leading 0x.
	AccumulatorRootHash Hash              // AccumulatorRootHash of the transaction.
	StateChangeHash     Hash              // StateChangeHash of the transaction.
	EventRootHash       Hash              // EventRootHash of the transaction.
	GasUsed             uint64            // GasUsed by the transaction, will be in gas units.  It should be 0.
	Success             bool              // Success of the transaction.
	VmStatus            string            // VmStatus of the transaction, this will contain the error if any.
	Changes             []*WriteSetChange // Changes to the ledger from the transaction, should never be empty.
	Timestamp           uint64            // Timestamp is the Unix timestamp in microseconds when the block of the transaction was committed.
	StateCheckpointHash Hash              // StateCheckpointHash of the transaction. Optional, and will be "" if not set.
}

StateCheckpointTransaction is a transaction that is a checkpoint of the state of the blockchain. It is not necessarily at the end of a block.

func (*StateCheckpointTransaction) TxnHash

func (o *StateCheckpointTransaction) TxnHash() Hash

TxnHash gives us the hash of the transaction.

func (*StateCheckpointTransaction) TxnSuccess

func (o *StateCheckpointTransaction) TxnSuccess() *bool

TxnSuccess tells us if the transaction is a success. It will never be nil.

func (*StateCheckpointTransaction) TxnVersion

func (o *StateCheckpointTransaction) TxnVersion() *uint64

TxnVersion gives us the ledger version of the transaction. It will never be nil.

func (*StateCheckpointTransaction) UnmarshalJSON

func (o *StateCheckpointTransaction) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the StateCheckpointTransaction from JSON handling conversion between types

type SubmitTransactionResponse

type SubmitTransactionResponse = PendingTransaction

SubmitTransactionResponse is the response from submitting a transaction to the blockchain, it is the same as a PendingTransaction

type Transaction

type Transaction struct {
	Type  TransactionVariant // Type of the transaction
	Inner TransactionImpl    // Inner is the actual transaction
}

Transaction is an enum type for all possible transactions on the blockchain

func (*Transaction) BlockEpilogueTransaction

func (o *Transaction) BlockEpilogueTransaction() (*BlockEpilogueTransaction, error)

BlockEpilogueTransaction changes the transaction to a BlockEpilogueTransaction; however, it will fail if it's not one.

func (*Transaction) BlockMetadataTransaction

func (o *Transaction) BlockMetadataTransaction() (*BlockMetadataTransaction, error)

BlockMetadataTransaction changes the transaction to a BlockMetadataTransaction; however, it will fail if it's not one.

func (*Transaction) GenesisTransaction

func (o *Transaction) GenesisTransaction() (*GenesisTransaction, error)

GenesisTransaction changes the transaction to a GenesisTransaction; however, it will fail if it's not one.

func (*Transaction) Hash

func (o *Transaction) Hash() Hash

Hash of the transaction for lookup on-chain

func (*Transaction) PendingTransaction

func (o *Transaction) PendingTransaction() (*PendingTransaction, error)

PendingTransaction changes the transaction to a PendingTransaction; however, it will fail if it's not one.

func (*Transaction) StateCheckpointTransaction

func (o *Transaction) StateCheckpointTransaction() (*StateCheckpointTransaction, error)

StateCheckpointTransaction changes the transaction to a StateCheckpointTransaction; however, it will fail if it's not one.

func (*Transaction) Success

func (o *Transaction) Success() *bool

Success of the transaction. Pending transactions, and genesis may not have a success field. If this is the case, it will be nil

func (*Transaction) UnknownTransaction

func (o *Transaction) UnknownTransaction() (*UnknownTransaction, error)

UnknownTransaction changes the transaction to a UnknownTransaction; however, it will fail if it's not one.

func (*Transaction) UnmarshalJSON

func (o *Transaction) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Transaction from JSON handling conversion between types

func (*Transaction) UserTransaction

func (o *Transaction) UserTransaction() (*UserTransaction, error)

UserTransaction changes the transaction to a UserTransaction; however, it will fail if it's not one.

func (*Transaction) ValidatorTransaction

func (o *Transaction) ValidatorTransaction() (*ValidatorTransaction, error)

ValidatorTransaction changes the transaction to a ValidatorTransaction; however, it will fail if it's not one.

func (*Transaction) Version

func (o *Transaction) Version() *uint64

Version of the transaction on chain, will be nil if it is a PendingTransaction

type TransactionImpl

type TransactionImpl interface {
	// TxnSuccess tells us if the transaction is a success.  It will be nil if the transaction is not committed.
	TxnSuccess() *bool

	// TxnHash gives us the hash of the transaction.
	TxnHash() Hash

	// TxnVersion gives us the ledger version of the transaction. It will be nil if the transaction is not committed.
	TxnVersion() *uint64
}

TransactionImpl is an interface for all transactions

type TransactionPayload

type TransactionPayload struct {
	Type  TransactionPayloadVariant // Type of the payload, if the payload isn't recognized, it will be [TransactionPayloadVariantUnknown]
	Inner TransactionPayloadImpl    // Inner is the actual payload
}

TransactionPayload is an enum of all possible transaction payloads

Unknown types will have the Type set to TransactionPayloadVariantUnknown and the Inner set to TransactionPayloadUnknown

func (*TransactionPayload) UnmarshalJSON

func (o *TransactionPayload) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TransactionPayload from JSON handling conversion between types

type TransactionPayloadEntryFunction

type TransactionPayloadEntryFunction struct {
	Function      string   `json:"function"`       // Function is the name of the function called e.g. 0x1::coin::transfer
	TypeArguments []string `json:"type_arguments"` // TypeArguments are the type arguments for the function as a string representation of the TypeTag.
	Arguments     []any    `json:"arguments"`      // Arguments are the arguments for the function.  The order should match the order in the Move source.
}

TransactionPayloadEntryFunction describes an entry function call by a transaction.

type TransactionPayloadImpl

type TransactionPayloadImpl interface{}

TransactionPayloadImpl is all the interfaces required for all transaction payloads

Current implementations are:

type TransactionPayloadModuleBundle

type TransactionPayloadModuleBundle struct{}

TransactionPayloadModuleBundle is a deprecated type that does not exist on mainnet.

type TransactionPayloadMultisig

type TransactionPayloadMultisig struct {
	MultisigAddress    *types.AccountAddress `json:"multisig_address"`              // MultisigAddress is the address of the multi-sig account
	TransactionPayload *TransactionPayload   `json:"transaction_payload,omitempty"` // TransactionPayload is the payload of the transaction, optional
}

TransactionPayloadMultisig describes a multi-sig running an entry function

TODO: This isn't ever a top level transaction payload, it is always nested in a TransactionPayload so it may not apply here

type TransactionPayloadScript

type TransactionPayloadScript struct {
	Code          *MoveScript `json:"code"`           // Code is the Move bytecode for the script.
	TypeArguments []string    `json:"type_arguments"` // TypeArguments are the type arguments for the script as a string representation of the TypeTag.
	Arguments     []any       `json:"arguments"`      // Arguments are the arguments for the script.  The order should match the order in the Move source.
}

TransactionPayloadScript describes a script payload along with associated.

See more information about scripts at the MoveScript Documentation.

type TransactionPayloadUnknown

type TransactionPayloadUnknown struct {
	Type    string         `json:"type"`    // Type is the actual type field from the JSON.
	Payload map[string]any `json:"payload"` // Payload is the raw JSON payload.
}

TransactionPayloadUnknown is to handle new types gracefully.

This is a fallback type for unknown transaction payloads.

type TransactionPayloadVariant

type TransactionPayloadVariant string

TransactionPayloadVariant is the type of payload represented in JSON

const (
	TransactionPayloadVariantEntryFunction TransactionPayloadVariant = "entry_function_payload" // TransactionPayloadVariantEntryFunction maps to TransactionPayloadEntryFunction
	TransactionPayloadVariantScript        TransactionPayloadVariant = "script_payload"         // TransactionPayloadVariantScript maps to TransactionPayloadScript
	TransactionPayloadVariantMultisig      TransactionPayloadVariant = "multisig_payload"       // TransactionPayloadVariantMultisig maps to TransactionPayloadMultisig
	TransactionPayloadVariantWriteSet      TransactionPayloadVariant = "write_set_payload"      // TransactionPayloadVariantWriteSet maps to TransactionPayloadWriteSet
	TransactionPayloadVariantModuleBundle  TransactionPayloadVariant = "module_bundle_payload"  // TransactionPayloadVariantModuleBundle maps to TransactionPayloadModuleBundle and is deprecated
	TransactionPayloadVariantUnknown       TransactionPayloadVariant = "unknown"                // TransactionPayloadVariantUnknown maps to TransactionPayloadUnknown for unknown types
)

type TransactionPayloadWriteSet

type TransactionPayloadWriteSet struct {
	WriteSet *WriteSet `json:"write_set"` // WriteSet is the write set for the transaction
}

TransactionPayloadWriteSet describes a write set transaction, such as genesis.

These should only be done at Genesis or in the event of a recovery from a catastrophic failure.

type TransactionVariant

type TransactionVariant string

TransactionVariant is the type of transaction, all transactions submitted by this SDK are TransactionVariantUser

const (
	TransactionVariantPending         TransactionVariant = "pending_transaction"          // TransactionVariantPending maps to PendingTransaction
	TransactionVariantUser            TransactionVariant = "user_transaction"             // TransactionVariantUser maps to UserTransaction
	TransactionVariantGenesis         TransactionVariant = "genesis_transaction"          // TransactionVariantGenesis maps to GenesisTransaction
	TransactionVariantBlockMetadata   TransactionVariant = "block_metadata_transaction"   // TransactionVariantBlockMetadata maps to BlockMetadataTransaction
	TransactionVariantBlockEpilogue   TransactionVariant = "block_epilogue_transaction"   // TransactionVariantBlockEpilogue maps to BlockEpilogueTransaction
	TransactionVariantStateCheckpoint TransactionVariant = "state_checkpoint_transaction" // TransactionVariantStateCheckpoint maps to StateCheckpointTransaction
	TransactionVariantValidator       TransactionVariant = "validator_transaction"        // TransactionVariantValidator maps to ValidatorTransaction
	TransactionVariantUnknown         TransactionVariant = "unknown"                      // TransactionVariantUnknown maps to UnknownTransaction for unknown types
)

type U64

type U64 uint64

U64 is a type for handling JSON string representations of the uint64

func (*U64) ToUint64

func (u *U64) ToUint64() uint64

ToUint64 converts a U64 to an uint64

We can guarantee that it's safe to convert a U64 to an uint64 because we've already validated the input on JSON parsing.

func (*U64) UnmarshalJSON

func (u *U64) UnmarshalJSON(b []byte) error

UnmarshalJSON deserializes a JSON data blob into a U64

type UnknownSignature

type UnknownSignature struct {
	Type    string         // Type is the type of the unknown signature
	Payload map[string]any // Payload is the raw JSON payload
}

UnknownSignature is a signature type that is not recognized by the SDK

This is a fallback type for unknown signatures.

type UnknownTransaction

type UnknownTransaction struct {
	Type    string         // Type is the type of the unknown transaction
	Payload map[string]any // Payload is the raw JSON payload
}

UnknownTransaction is a transaction type that is not recognized by the SDK

func (*UnknownTransaction) TxnHash

func (u *UnknownTransaction) TxnHash() Hash

TxnHash gives us the hash of the transaction.

func (*UnknownTransaction) TxnSuccess

func (u *UnknownTransaction) TxnSuccess() *bool

TxnSuccess tells us if the transaction is a success. It will be nil if the transaction is not committed.

func (*UnknownTransaction) TxnVersion

func (u *UnknownTransaction) TxnVersion() *uint64

TxnVersion gives us the ledger version of the transaction. It will be nil if the transaction is not committed.

type UnknownWriteSet

type UnknownWriteSet struct {
	Type    string         `json:"type"`    // Type is the type of the unknown write set
	Payload map[string]any `json:"payload"` // Payload is the raw JSON data for the unknown write set
}

UnknownWriteSet is a placeholder for unknown write sets

type UserTransaction

type UserTransaction struct {
	Version                 uint64                // Version of the transaction, starts at 0 and increments per transaction.
	Hash                    Hash                  // Hash of the transaction, it is a SHA3-256 hash in hexadecimal format with a leading 0x.
	AccumulatorRootHash     Hash                  // AccumulatorRootHash of the transaction.
	StateChangeHash         Hash                  // StateChangeHash of the transaction.
	EventRootHash           Hash                  // EventRootHash of the transaction.
	GasUsed                 uint64                // GasUsed by the transaction, will be in gas units.
	Success                 bool                  // Success of the transaction.
	VmStatus                string                // VmStatus of the transaction, this will contain the error if any.
	Changes                 []*WriteSetChange     // Changes to the ledger from the transaction, should never be empty.
	Events                  []*Event              // Events emitted by the transaction, may be empty.
	Sender                  *types.AccountAddress // Sender of the transaction, will never be nil.
	SequenceNumber          uint64                // SequenceNumber of the transaction, starts at 0 and increments per transaction submitted by the sender.
	MaxGasAmount            uint64                // MaxGasAmount of the transaction, this is the max amount of gas units that the user is willing to pay.
	GasUnitPrice            uint64                // GasUnitPrice of the transaction, this is the multiplier per unit of gas to tokens.
	ExpirationTimestampSecs uint64                // ExpirationTimestampSecs of the transaction, this is the Unix timestamp in seconds when the transaction expires.
	Payload                 *TransactionPayload   // Payload of the transaction, this is the actual transaction data.
	Signature               *Signature            // Signature is the AccountAuthenticator of the sender.
	Timestamp               uint64                // Timestamp is the Unix timestamp in microseconds when the block of the transaction was committed.
	StateCheckpointHash     Hash                  // StateCheckpointHash of the transaction. Optional, and will be "" if not set.
}

UserTransaction is a user submitted transaction as an entry function, script, or more.

These transactions are the only transactions submitted by users to the blockchain.

func (*UserTransaction) TxnHash

func (o *UserTransaction) TxnHash() Hash

TxnHash gives us the hash of the transaction.

func (*UserTransaction) TxnSuccess

func (o *UserTransaction) TxnSuccess() *bool

TxnSuccess tells us if the transaction is a success. It will never be nil.

func (*UserTransaction) TxnVersion

func (o *UserTransaction) TxnVersion() *uint64

TxnVersion gives us the ledger version of the transaction. It will never be nil.

func (*UserTransaction) UnmarshalJSON

func (o *UserTransaction) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the UserTransaction from JSON handling conversion between types

type ValidatorTransaction

type ValidatorTransaction struct {
	Version             uint64            // Version of the transaction, starts at 0 and increments per transaction.
	Hash                Hash              // Hash of the transaction, it is a SHA3-256 hash in hexadecimal format with a leading 0x.
	AccumulatorRootHash Hash              // AccumulatorRootHash of the transaction.
	StateChangeHash     Hash              // StateChangeHash of the transaction.
	EventRootHash       Hash              // EventRootHash of the transaction.
	GasUsed             uint64            // GasUsed by the transaction, will be in gas units.  It should be 0.
	Success             bool              // Success of the transaction.
	VmStatus            string            // VmStatus of the transaction, this will contain the error if any.
	Changes             []*WriteSetChange // Changes to the ledger from the transaction, should never be empty.
	Events              []*Event          // Events emitted by the transaction, may be empty.
	Timestamp           uint64            // Timestamp is the Unix timestamp in microseconds when the block of the transaction was committed.
	StateCheckpointHash Hash              // StateCheckpointHash of the transaction. Optional, and will be "" if not set.
}

ValidatorTransaction is a transaction that is metadata about a block. It's additional information from BlockMetadataTransaction

func (*ValidatorTransaction) TxnHash

func (o *ValidatorTransaction) TxnHash() Hash

TxnHash gives us the hash of the transaction.

func (*ValidatorTransaction) TxnSuccess

func (o *ValidatorTransaction) TxnSuccess() *bool

TxnSuccess tells us if the transaction is a success. It will never be nil.

func (*ValidatorTransaction) TxnVersion

func (o *ValidatorTransaction) TxnVersion() *uint64

TxnVersion gives us the ledger version of the transaction. It will never be nil.

func (*ValidatorTransaction) UnmarshalJSON

func (o *ValidatorTransaction) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ValidatorTransaction from JSON handling conversion between types

type WriteSet

type WriteSet struct {
	Type  WriteSetVariant // Type of the write set, if the write set isn't recognized, it will be [WriteSetVariantUnknown]
	Inner WriteSetImpl    // Inner is the actual write set
}

WriteSet is an enum of all possible write sets

func (*WriteSet) UnmarshalJSON

func (o *WriteSet) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the WriteSet from JSON handling conversion between types

type WriteSetChange

type WriteSetChange struct {
	Type  WriteSetChangeVariant // Type of the write set change, if the write set change isn't recognized, it will be [WriteSetChangeVariantUnknown]
	Inner WriteSetChangeImpl    // Inner is the actual write set change
}

WriteSetChange is an enum of all possible write set changes

func (*WriteSetChange) UnmarshalJSON

func (o *WriteSetChange) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the WriteSetChange from JSON handling conversion between types

type WriteSetChangeDeleteModule

type WriteSetChangeDeleteModule struct {
	Address      *types.AccountAddress `json:"address"`        // Address is the address the module is deleted
	StateKeyHash Hash                  `json:"state_key_hash"` // StateKeyHash is the hash of the state key
	Module       string                `json:"module"`         // Module is the module bytecode
}

WriteSetChangeDeleteModule is a change that deletes a module from an account

Note: There is no way to delete a module today, but this is here for completeness

type WriteSetChangeDeleteResource

type WriteSetChangeDeleteResource struct {
	Address      *types.AccountAddress `json:"address"`        // Address is the address the resource is deleted
	StateKeyHash Hash                  `json:"state_key_hash"` // StateKeyHash is the hash of the state key
	Resource     string                `json:"resource"`       // Resource is the struct name of the resource deleted
}

WriteSetChangeDeleteResource is a change that deletes a resource from an account

type WriteSetChangeDeleteTableItem

type WriteSetChangeDeleteTableItem struct {
	StateKeyHash Hash              `json:"state_key_hash"` // StateKeyHash is the hash of the state key
	Handle       string            `json:"handle"`         // Handle is the handle of the table, this will be a 32-byte hex string with a leading 0x
	Key          string            `json:"key"`            // Key is the key of the table item in BCS encoded hex
	Data         *DeletedTableData `json:"data,omitempty"` // Data is the decoded table data, optional
}

WriteSetChangeDeleteTableItem is a change that deletes a table item

type WriteSetChangeImpl

type WriteSetChangeImpl interface {
}

WriteSetChangeImpl is an interface for all write set changes

type WriteSetChangeUnknown

type WriteSetChangeUnknown struct {
	Type    string         `json:"type"`    // Type is the type of the unknown write set change
	Payload map[string]any `json:"payload"` // Payload is the raw JSON data for the unknown write set change
}

WriteSetChangeUnknown is a placeholder for unknown write set changes

type WriteSetChangeVariant

type WriteSetChangeVariant string

WriteSetChangeVariant is the type of WriteSetChange

const (
	WriteSetChangeVariantWriteResource   WriteSetChangeVariant = "write_resource"    // WriteSetChangeVariantWriteResource maps to WriteSetChangeWriteResource
	WriteSetChangeVariantDeleteResource  WriteSetChangeVariant = "delete_resource"   // WriteSetChangeVariantDeleteResource maps to WriteSetChangeDeleteResource
	WriteSetChangeVariantWriteModule     WriteSetChangeVariant = "write_module"      // WriteSetChangeVariantWriteModule maps to WriteSetChangeWriteModule
	WriteSetChangeVariantDeleteModule    WriteSetChangeVariant = "delete_module"     // WriteSetChangeVariantDeleteModule maps to WriteSetChangeDeleteModule
	WriteSetChangeVariantWriteTableItem  WriteSetChangeVariant = "write_table_item"  // WriteSetChangeVariantWriteTableItem maps to WriteSetChangeWriteTableItem
	WriteSetChangeVariantDeleteTableItem WriteSetChangeVariant = "delete_table_item" // WriteSetChangeVariantDeleteTableItem maps to WriteSetChangeDeleteTableItem
	WriteSetChangeVariantUnknown         WriteSetChangeVariant = "unknown"           // WriteSetChangeVariantUnknown maps to WriteSetChangeUnknown for unknown types
)

type WriteSetChangeWriteModule

type WriteSetChangeWriteModule struct {
	Address      *types.AccountAddress `json:"address"`        // Address is the address the module is stored
	StateKeyHash Hash                  `json:"state_key_hash"` // StateKeyHash is the hash of the state key
	Data         *MoveBytecode         `json:"data"`           // Data is the module bytecode
}

WriteSetChangeWriteModule is a change that writes a module to an account

type WriteSetChangeWriteResource

type WriteSetChangeWriteResource struct {
	Address      *types.AccountAddress `json:"address"`        // Address is the address the resource is stored
	StateKeyHash Hash                  `json:"state_key_hash"` // StateKeyHash is the hash of the state key
	Data         *MoveResource         `json:"data"`           // Data is the resource data matching the on-chain struct data
}

WriteSetChangeWriteResource is a change that writes a resource to an account

type WriteSetChangeWriteTableItem

type WriteSetChangeWriteTableItem struct {
	StateKeyHash Hash              `json:"state_key_hash"` // StateKeyHash is the hash of the state key
	Handle       string            `json:"handle"`         // Handle is the handle of the table, this will be a 32-byte hex string with a leading 0x
	Key          string            `json:"key"`            // Key is the key of the table item in BCS encoded hex
	Value        string            `json:"value"`          // Value is the value of the table item in BCS encoded hex
	Data         *DecodedTableData `json:"data,omitempty"` // Data is the decoded table data, optional
}

WriteSetChangeWriteTableItem is a change that writes a table item

type WriteSetImpl

type WriteSetImpl interface {
}

WriteSetImpl is an interface for all write sets

type WriteSetVariant

type WriteSetVariant string

WriteSetVariant is the type of WriteSet

const (
	WriteSetVariantDirect  WriteSetVariant = "direct_write_set" // WriteSetVariantDirect maps to DirectWriteSet
	WriteSetVariantScript  WriteSetVariant = "script_write_set" // WriteSetVariantScript maps to ScriptWriteSet
	WriteSetVariantUnknown WriteSetVariant = "unknown"          // WriteSetVariantUnknown maps to UnknownWriteSet for unknown types
)

Jump to

Keyboard shortcuts

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