hmy_getBlocks

Description

hmy_getBlocks returns blocks in range [from; to]

API v1

Parameters

  1. String - starting block number in 0x format

  2. String - ending block number in 0x format

  3. blockArgs - optional args struct in json format (should be used just with { })

    1. fullTx - Bool: To show full tx or not

    2. withSigners- Bool: Include block signes in blocks or not

Returns

  • Array : returns blocks list in json format

    • number - Number: The block number. null when its pending block.

    • hash 32 Bytes - String: Hash of the block. null when its pending block.

    • parentHash 32 Bytes - String: Hash of the parent block.

    • nonce 8 Bytes - String: Hash of the generated proof-of-work.null when its pending block.

    • logsBloom 256 Bytes - String: The bloom filter for the logs of the block. null when its pending block.

    • transactionsRoot 32 Bytes - String: The root of the transaction trie of the block

    • stateRoot 32 Bytes - String: The root of the final state trie of the block.

    • miner - String: The address of the beneficiary to whom the mining rewards were given.

    • difficulty - Number: Integer of the difficulty for this block.

    • extraData - String: The “extra data” field of this block.

    • size - Number: Integer the size of this block in bytes.

    • gasLimit - Number: The maximum gas allowed in this block.

    • gasUsed - Number: The total used gas by all transactions in this block.

    • timestamp - Number: The unix timestamp for when the block was collated, 0x format.

    • stakingTransactions - Array: Array of staking transactions object; absent if inclStaking is false, are present by default.

    • transactions - Array: Array of transaction objects; absent if second parameter is false.

    • signers - Array: Array of validators one addresses who signed this block

    • uncles - Array: Array of uncle hashes.

Sample Curl Request

Sample Curl Response

API v2

Parameters

  1. Number - starting block number

  2. Number - ending block number

  3. blockArgs - optional args struct in json format (should be used just with { })

    1. fullTx - Bool: To show full tx or not

    2. withSigners- Bool: Include block signes in blocks or not

    3. inclStaking - Bool: To show staking txs or not

Returns

  • Array : returns blocks list in json format

    • number - Number: The block number. null when its pending block.

    • hash 32 Bytes - String: Hash of the block. null when its pending block.

    • parentHash 32 Bytes - String: Hash of the parent block.

    • nonce 8 Bytes - String: Hash of the generated proof-of-work. null when its pending block.

    • logsBloom 256 Bytes - String: The bloom filter for the logs of the block. null when its pending block.

    • transactionsRoot 32 Bytes - String: The root of the transaction trie of the block

    • stateRoot 32 Bytes - String: The root of the final state trie of the block.

    • miner - String: The address of the beneficiary to whom the mining rewards were given.

    • difficulty - String: Integer of the difficulty for this block.

    • extraData - String: The “extra data” field of this block.

    • size - Number: Integer the size of this block in bytes.

    • gasLimit - Number: The maximum gas allowed in this block.

    • gasUsed - Number: The total used gas by all transactions in this block.

    • timestamp - Number: The unix timestamp for when the block was collated.

    • stakingTransactions - Array: Array of staking transactions object; absent if inclStaking is false, are present by default

    • transactions - Array: Array of transaction objects; only hashes if fullTx is false, are hashes by default

    • signers - Array: Array of validators one addresses who signed this block

    • uncles - Array: Array of uncle hashes.

Sample Curl Request

Sample Curl Response

Last updated