Documentation ¶
Index ¶
- Constants
- type AccountCoreData
- type AccountCoreDataMarshaling
- type AccountResource
- type Block
- type BlockMetadataTransaction
- type Change
- func (c *Change) AsDeleteModuleChange() *DeleteModuleChange
- func (c *Change) AsDeleteResourceChange() *DeleteResourceChange
- func (c *Change) AsDeleteTableItemChange() *DeleteTableItemChange
- func (c *Change) AsWriteModuleChange() *WriteModuleChange
- func (c *Change) AsWriteResourceChange() *WriteResourceChange
- func (c *Change) AsWriteTableItemChange() *WriteTableItemChange
- type CoinInfo
- type DeleteModuleChange
- type DeleteResourceChange
- type DeleteTableItem
- type DeleteTableItemChange
- type Event
- type Guid
- type LedgerInfo
- type MoveFunction
- type MoveModule
- type MoveModuleAbi
- type MoveScript
- type MoveStruct
- type MoveStructField
- type Payload
- type RestError
- type Script
- type Signature
- type Transaction
- type UserTransaction
- type WriteModuleChange
- type WriteResourceChange
- type WriteSet
- type WriteTableItemChange
Constants ¶
View Source
const ( TypeChangeDeleteModule = "delete_module" TypeChangeDeleteResource = "delete_resource" TypeChangeDeleteTableItem = "delete_table_item" TypeChangeWriteModule = "write_module" TypeChangeWriteResource = "write_resource" TypeChangeWriteTableItem = "write_table_item" )
View Source
const ( TypePendingTransaction = "pending_transaction" TypeGenesisTransaction = "genesis_transaction" TypeUserTransaction = "user_transaction" TypeBlockMetadataTransaction = "block_metadata_transaction" TypeStateCheckoutpointTransaction = "state_checkpoint_transaction" )
View Source
const ( EntryFunctionPayload = "entry_function_payload" ScriptPayload = "script_payload" ModuleBundlePayload = "module_bundle_payload" WriteSetPayload = "write_set_payload" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountCoreData ¶
type AccountCoreData struct { SequenceNumber uint64 `json:"sequence_number"` AuthenticationKey string `json:"authentication_key"` }
func (AccountCoreData) MarshalJSON ¶
func (a AccountCoreData) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*AccountCoreData) UnmarshalJSON ¶
func (a *AccountCoreData) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type AccountCoreDataMarshaling ¶
type AccountCoreDataMarshaling struct {
SequenceNumber jsonUint64
}
type AccountResource ¶
type Block ¶
type Block struct { BlockHeight uint64 `json:"block_height"` BlockHash string `json:"block_hash"` BlockTimestamp uint64 `json:"block_timestamp"` FirstVersion uint64 `json:"first_version"` LastVersion uint64 `json:"last_version"` Transactions []Transaction `json:"transactions"` }
func (Block) MarshalJSON ¶
MarshalJSON marshals as JSON.
func (*Block) UnmarshalJSON ¶
UnmarshalJSON unmarshals from JSON.
type BlockMetadataTransaction ¶
type BlockMetadataTransaction struct { Type string `json:"type"` Hash string `json:"hash"` Events []Event Version uint64 `json:"version"` StateRootHash string `json:"state_root_hash"` EventRootHash string `json:"event_root_hash"` GasUsed uint64 `json:"gas_used"` Success bool `json:"success"` VmStatus string `json:"vm_status"` AccumulatorRootHash string `json:"accumulator_root_hash"` Changes []Change `json:"changes"` Timestamp uint64 `json:"timestamp"` ID string `json:"id"` Round uint64 `json:"round"` PreviousBlockVotes []bool `json:"previous_block_votes"` Proposer string `json:"proposer"` // contains filtered or unexported fields }
type Change ¶
type Change struct { Type string `json:"type"` // delete_module|delete_resource|delete_table_item|write_module|write_resource|write_table_item StateKeyHash string `json:"state_key_hash"` // delete_module|delete_resource|delete_table_item|write_module Address string `json:"address"` // delete_module|delete_resource|write_module Resource string `json:"resource"` // delete_resource Module string `json:"module"` // delete_module Handle string `json:"handle"` //write_table_item Key string `json:"key"` // write_table_item Value string `json:"value"` //write_table_item Data interface{} `json:"data"` // delete_table_item(DeleteTableItem)|write_module(MoveModule)|write_resource(AccountResource) }
func (*Change) AsDeleteModuleChange ¶
func (c *Change) AsDeleteModuleChange() *DeleteModuleChange
func (*Change) AsDeleteResourceChange ¶
func (c *Change) AsDeleteResourceChange() *DeleteResourceChange
func (*Change) AsDeleteTableItemChange ¶
func (c *Change) AsDeleteTableItemChange() *DeleteTableItemChange
func (*Change) AsWriteModuleChange ¶
func (c *Change) AsWriteModuleChange() *WriteModuleChange
func (*Change) AsWriteResourceChange ¶
func (c *Change) AsWriteResourceChange() *WriteResourceChange
func (*Change) AsWriteTableItemChange ¶
func (c *Change) AsWriteTableItemChange() *WriteTableItemChange
type DeleteModuleChange ¶
type DeleteResourceChange ¶
type DeleteTableItem ¶
type DeleteTableItemChange ¶
type Event ¶
type Event struct { Guid *Guid `json:"guid,omitempty"` Key string `json:"key"` SequenceNumber uint64 `json:"sequence_number"` Type string `json:"type"` // eg. 0x1::aptos_coin::AptosCoin, match ^(bool|u8|u64|u128|address|signer|vector<.+>|0x[0-9a-zA-Z:_<, >]+)$ Data interface{} `json:"data"` Version uint64 `json:"version"` // only getEvents will return version }
func (Event) MarshalJSON ¶
MarshalJSON marshals as JSON.
func (*Event) UnmarshalJSON ¶
UnmarshalJSON unmarshals from JSON.
type LedgerInfo ¶
type LedgerInfo struct { ChainId int `json:"chain_id"` LedgerVersion uint64 `json:"ledger_version" gencodec:"required"` LedgerTimestamp uint64 `json:"ledger_timestamp" gencodec:"required"` BlockHeight uint64 `json:"block_height" gencodec:"required"` Epoch uint64 `json:"epoch"` NodeRole string `json:"node_role"` OldestBlockHeight uint64 `json:"oldest_block_height"` OldestLedgerVersion uint64 `json:"oldest_ledger_version"` }
LedgerInfo represents chain current ledger info
func (LedgerInfo) MarshalJSON ¶
func (l LedgerInfo) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*LedgerInfo) UnmarshalJSON ¶
func (l *LedgerInfo) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type MoveFunction ¶
type MoveModule ¶
type MoveModule struct { ByteCode string `json:"bytecode"` Abi *MoveModuleAbi `json:"abi"` }
type MoveModuleAbi ¶
type MoveModuleAbi struct { Address string `json:"address"` Name string `json:"name"` Friend []string `json:"friend"` ExposedFunctions []MoveFunction `json:"exposed_functions"` Structs []MoveStruct `json:"structs"` }
type MoveScript ¶
type MoveScript struct { Bytecode string `json:"bytecode"` Abi *MoveFunction `json:"abi"` }
type MoveStruct ¶
type MoveStruct struct { Name string IsNative bool Abilities []string `json:"abilities"` // copy|drop|store|key GenericTypeParams []interface{} `json:"generic_type_params"` Fields []MoveStructField `json:"fields"` }
type MoveStructField ¶
type Payload ¶
type Payload struct { Type string `json:"type"` // ScriptPayload|ScriptFunctionPayload|ModuleBundlePayload|WriteSetPayload TypeArguments []string `json:"type_arguments"` // ScriptPayload|ScriptFunctionPayload Arguments []interface{} `json:"arguments"` // ScriptPayload|ScriptFunctionPayload Modules []MoveModule `json:"modules"` // ModuleBundlePayload Code *MoveScript `json:"code"` // ScriptPayload Function string `json:"function"` // ScriptFunctionPayload WriteSet *WriteSet `json:"write_set"` // WriteSetPayload }
type RestError ¶
type RestError struct { Code int `json:"code"` Message string `json:"message"` AptosLedgerVersion uint64 `json:"aptos_ledger_version"` }
func (RestError) MarshalJSON ¶
MarshalJSON marshals as JSON.
func (*RestError) UnmarshalJSON ¶
UnmarshalJSON unmarshals from JSON.
type Script ¶
type Script struct { Code *MoveScript `json:"code"` TypeArguments []string `json:"type_arguments"` Arguments []interface{} `json:"arguments"` }
type Signature ¶
type Signature struct { Type string `json:"type"` // ed25519_signature|multi_ed25519_signature|multi_agent_signature PublicKey string `json:"public_key"` // ed25519_signature Signature string `json:"signature"` // ed25519_signature PublicKeys []string `json:"public_keys"` // multi_ed25519_signature Signatures []string `json:"signatures"` // multi_ed25519_signature Threshold int `json:"threshold"` // multi_ed25519_signature Bitmap string `json:"bitmap"` // multi_ed25519_signature Sender *Signature `json:"Sender"` // multi_agent_signature SecondarySignerAddresses []string `json:"secondary_signer_addresses"` // multi_agent_signature SecondarySigners []Signature `json:"secondary_signers"` // multi_agent_signature }
type Transaction ¶
type Transaction struct { Type string `json:"type"` Hash string `json:"hash"` // PendingTransaction|GenesisTransaction|UserTransaction|BlockMetadataTransaction|StateCheckoutpointTransaction Sender string `json:"sender"` // PendingTransaction|UserTransaction SequenceNumber uint64 `json:"sequence_number"` // PendingTransaction|UserTransaction MaxGasAmount uint64 `json:"max_gas_amount"` // PendingTransaction|UserTransaction GasUnitPrice uint64 `json:"gas_unit_price"` // PendingTransaction|UserTransaction GasCurrencyCode string `json:"gas_currency_code"` // PendingTransaction|UserTransaction ExpirationTimestampSecs uint64 `json:"expiration_timestamp_secs"` // PendingTransaction|UserTransaction Payload *Payload `json:"payload"` // PendingTransaction|GenesisTransaction|UserTransaction Signature *Signature `json:"signature"` // PendingTransaction|UserTransaction Events []Event `json:"events"` // GenesisTransaction|UserTransaction|BlockMetadataTransaction Version uint64 `json:"version"` // GenesisTransaction|UserTransaction|BlockMetadataTransaction|StateCheckoutpointTransaction StateRootHash string `json:"state_root_hash"` // GenesisTransaction|UserTransaction|BlockMetadataTransaction|StateCheckoutpointTransaction EventRootHash string `json:"event_root_hash"` // GenesisTransaction|UserTransaction|BlockMetadataTransaction|StateCheckoutpointTransaction GasUsed uint64 `json:"gas_used"` // GenesisTransaction|UserTransaction|BlockMetadataTransaction|StateCheckoutpointTransaction Success bool `json:"success"` // GenesisTransaction|UserTransaction|BlockMetadataTransaction|StateCheckoutpointTransaction VmStatus string `json:"vm_status"` // GenesisTransaction|UserTransaction|BlockMetadataTransaction|StateCheckoutpointTransaction AccumulatorRootHash string `json:"accumulator_root_hash"` // GenesisTransaction|UserTransaction|BlockMetadataTransaction|StateCheckoutpointTransaction Changes []Change `json:"changes"` // GenesisTransaction|UserTransaction|BlockMetadataTransaction|StateCheckoutpointTransaction Timestamp uint64 `json:"timestamp"` // UserTransaction|BlockMetadataTransaction|StateCheckoutpointTransaction ID string `json:"id"` //BlockMetadataTransaction Round uint64 `json:"round"` //BlockMetadataTransaction PreviousBlockVotes []bool `json:"previous_block_votes"` //BlockMetadataTransaction Proposer string `json:"proposer"` //BlockMetadataTransaction }
Transaction
func (*Transaction) AsBlockMetadataTransaction ¶
func (t *Transaction) AsBlockMetadataTransaction() *BlockMetadataTransaction
func (*Transaction) AsUserTransaction ¶
func (t *Transaction) AsUserTransaction() *UserTransaction
func (Transaction) MarshalJSON ¶
func (t Transaction) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*Transaction) UnmarshalJSON ¶
func (t *Transaction) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type UserTransaction ¶
type UserTransaction struct { Type string `json:"type"` Hash string `json:"hash"` Sender string `json:"sender"` SequenceNumber uint64 `json:"sequence_number"` MaxGasAmount uint64 `json:"max_gas_amount"` GasUnitPrice uint64 `json:"gas_unit_price"` GasCurrencyCode string `json:"gas_currency_code"` ExpirationTimestampSecs uint64 `json:"expiration_timestamp_secs"` Payload *Payload `json:"payload"` Signature *Signature `json:"signature"` Events []Event `json:"events"` Version uint64 `json:"version"` StateRootHash string `json:"state_root_hash"` EventRootHash string `json:"event_root_hash"` GasUsed uint64 `json:"gas_used"` Success bool `json:"success"` VmStatus string `json:"vm_status"` AccumulatorRootHash string `json:"accumulator_root_hash"` Changes []Change `json:"changes"` Timestamp uint64 `json:"timestamp"` // contains filtered or unexported fields }
type WriteModuleChange ¶
type WriteResourceChange ¶
type WriteResourceChange struct { Type string `json:"type"` StateKeyHash string `json:"state_key_hash"` Address string `json:"address"` Data interface{} `json:"data"` // contains filtered or unexported fields }
func (*WriteResourceChange) GetData ¶
func (wrc *WriteResourceChange) GetData() (ar AccountResource, success bool)
type WriteSet ¶
type WriteSet struct { Type string `json:"type"` // script_write_set|direct_write_set ExecuteAs string `json:"execute_as"` // script_write_set Script *Script `json:"script"` // script_write_set Changes []Change `json:"changes"` // direct_write_set Events []Event `json:"events"` // direct_write_set }
Click to show internal directories.
Click to hide internal directories.