# Ledger
# ledger_getBlocksByAccAddr
Return transaction list of the specified account
Parameters:
string
:Addr
Account addressint
:Index
Page indexint
:Count
Page size
Returns:
Array<AccountBlock>
Example:
# ledger_getAccountByAccAddr
Return account info by address, including account height and token balance information
Parameters:
- string: Account address
Returns:
Object
: Detailed account informationAccountAddress
:string of addr
Account addressTokenBalanceInfoMap
:Map<string of TokenTypeId>token
Balance map in various token IDsTotalNumber
:string of uint64
Total transaction number of the account, equivalent to chain's height
Example:
# ledger_getLatestSnapshotChainHash
Return the latest snapshot block hash
Parameters: null
Returns:
Hash
The hash of latest snapshot blockExample:
# ledger_getLatestBlock
Return the latest account block
Parameters:
Address
Account addressReturns:
AccountBlock
Latest account blockExample:
# ledger_getBlockByHeight
Return an account block by address and height
Parameters:
string
:address
Account addressstring
:height
The height of account block
Returns:
AccountBlock
Account blockExample:
# ledger_getBlockByHash
Return an account block by transaction hash
Parameters:
string
:hash
Transaction hash
Returns:
AccountBlock
Account blockExample:
# ledger_getBlocksByHash
Return a certain number of consecutive account blocks backward from the specified block by hash
Parameters:
string
:address
Account addressstring
:hash
Start account block hashint
: Number of blocks to query
Returns:
Array<AccountBlock>
Account block listExample:
# ledger_getBlocksByHashInToken
Return a certain number of consecutive account blocks backward from the specified block by hash. The transactions in the blocks were settled in the specified token.
Parameters:
string
:address
Account addressstring
:hash
Start account block hashstring
:tokenId
Token idint
: Number of blocks to query
Returns:
Array<AccountBlock>
Account block listExample:
# ledger_getSnapshotChainHeight
Return current snapshot chain height
Parameters:
none
Returns:
string of uint64
The current height of snapshot chainExample:
# ledger_getSnapshotBlockByHash
Return a snapshot block by hash
Parameters:
Hash
Snapshot block hash
Returns:
Object
: Snapshot blockproducer
:string
Snapshot block producerhash
:Hash
Snapshot block hashprevHash
:Hash
Previous snapshot block hashheight
:uint64
Snapshot block heightpublicKey
:ed25519.PublicKey
Producer's public keysignature
:[]byte
Signaturetimestamp
:time
Timestamp when the snapshot block was producedseed
:uint64
Random seed that was generated by this producer in last roundseedHash
:Hash
Hash of random seed generated in current roundsnapshotContent
:map[types.Address]HashHeight
Snapshot content
Example:
# ledger_getSnapshotBlockByHeight
Return a snapshot block by height
Parameters:
uint64
Snapshot block height
Returns:
Object
: Snapshot blockproducer
:string
Snapshot block producerhash
:Hash
Snapshot block hashprevHash
:Hash
Previous snapshot block hashheight
:uint64
Snapshot block heightpublicKey
:ed25519.PublicKey
Producer's public keysignature
:[]byte
Signaturetimestamp
:time
Timestamp when the snapshot block was producedseed
:uint64
Random seed that was generated by this producer in last roundseedHash
:Hash
Hash of random seed generated in current roundsnapshotContent
:map[types.Address]HashHeight
Snapshot content
Example:
# ledger_getVmLogList
Return contract execution logs by response transaction hash
Parameters:
string
:Hash
Contract response transaction hash
Returns:
VmLogList<array<VmLog>>
VM log listObject
:VmLog
- Topics :
[]types.Hash
Topic list- Data :
[]byte
Log data
- Data :
- Topics :
Example: