# Ledger

# ledger_getBlocksByAccAddr

Return transaction list of the specified account

  • Parameters:

    • string: Addr Account address
    • int: Index Page index
    • int: 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 information

    • AccountAddress : string of addr Account address
    • TokenBalanceInfoMap : Map<string of TokenTypeId>token Balance map in various token IDs
    • TotalNumber : 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 block

  • Example:

# ledger_getLatestBlock

Return the latest account block

  • Parameters: Address Account address

  • Returns: AccountBlock Latest account block

  • Example:

# ledger_getBlockByHeight

Return an account block by address and height

  • Parameters:

    • string : address Account address
    • string : height The height of account block
  • Returns: AccountBlock Account block

  • Example:

# ledger_getBlockByHash

Return an account block by transaction hash

  • Parameters:

    • string : hash Transaction hash
  • Returns: AccountBlock Account block

  • Example:

# ledger_getBlocksByHash

Return a certain number of consecutive account blocks backward from the specified block by hash

  • Parameters:

    • string : address Account address
    • string : hash Start account block hash
    • int : Number of blocks to query
  • Returns: Array<AccountBlock> Account block list

  • Example:

# 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 address
    • string : hash Start account block hash
    • string : tokenId Token id
    • int : Number of blocks to query
  • Returns: Array<AccountBlock> Account block list

  • Example:

# ledger_getSnapshotChainHeight

Return current snapshot chain height

  • Parameters: none

  • Returns: string of uint64 The current height of snapshot chain

  • Example:

# ledger_getSnapshotBlockByHash

Return a snapshot block by hash

  • Parameters:

    • Hash Snapshot block hash
  • Returns:

    Object : Snapshot block

    • producer : string Snapshot block producer
    • hash : Hash Snapshot block hash
    • prevHash : Hash Previous snapshot block hash
    • height : uint64 Snapshot block height
    • publicKey : ed25519.PublicKey Producer's public key
    • signature : []byte Signature
    • timestamp : time Timestamp when the snapshot block was produced
    • seed: uint64 Random seed that was generated by this producer in last round
    • seedHash: Hash Hash of random seed generated in current round
    • snapshotContent : map[types.Address]HashHeight Snapshot content
  • Example:

# ledger_getSnapshotBlockByHeight

Return a snapshot block by height

  • Parameters:

    • uint64 Snapshot block height
  • Returns:

    Object : Snapshot block

    • producer : string Snapshot block producer
    • hash : Hash Snapshot block hash
    • prevHash : Hash Previous snapshot block hash
    • height : uint64 Snapshot block height
    • publicKey : ed25519.PublicKey Producer's public key
    • signature : []byte Signature
    • timestamp : time Timestamp when the snapshot block was produced
    • seed: uint64 Random seed that was generated by this producer in last round
    • seedHash: Hash Hash of random seed generated in current round
    • snapshotContent : 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 list

    Object : VmLog

    • Topics : []types.Hash Topic list
      • Data : []byte Log data
  • Example: