hmy_getBlockByNumber
GetBlockByNumber
Get block by its index in the blockchain.
API v1
Parameters
String- The block number.Boolean- Iftrue, the returned block will contain all transactions in the block.
Returns
number-Number: The block number.nullwhen its pending block.hash32 Bytes -String: Hash of the block.nullwhen its pending block.parentHash32 Bytes -String: Hash of the parent block.nonce8 Bytes -String: Hash of the generated proof-of-work.nullwhen its pending block.logsBloom256 Bytes -String: The bloom filter for the logs of the block.nullwhen its pending block.transactionsRoot32 Bytes -String: The root of the transaction trie of the blockstateRoot32 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; are present by defaulttransactions-Array: Array of transaction objects; absent if second parameter isfalse.uncles-Array: Array of uncle hashes.
Sample Curl Request
Sample Curl Response
API v2
Parameters
Number- The block number.blockArgs- optional args struct in json format (should be used just with { })fullTx-Bool: To show full tx or notwithSigners-Bool: Include block signes in blocks or notinclStaking-Bool: To show staking txs or not
Returns
number-Number: The block number.nullwhen its pending block.hash32 Bytes -String: Hash of the block.nullwhen its pending block.parentHash32 Bytes -String: Hash of the parent block.nonce8 Bytes -String: Hash of the generated proof-of-work.nullwhen its pending block.logsBloom256 Bytes -String: The bloom filter for the logs of the block.nullwhen its pending block.transactionsRoot32 Bytes -String: The root of the transaction trie of the blockstateRoot32 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 defaulttransactions-Array: Array of transaction objects; absent if second parameter isfalse.uncles-Array: Array of uncle hashes.
Sample Curl Request
Sample Curl Response
Last updated
Was this helpful?