Marketplace has launched, further enabling blockchain developers! Learn more


eth_getBlockByHash RPC method

The eth_getBlockByHash EVM method is only supported on the Avalanche C-Chain.


  1. Hash - Hash of the block.
  2. Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions.


  1. Object - A block object, or null when no block was found.

    number - The block number of the requested block encoded as a hexadecimal. null if pending.

    hash - The block hash of the requested block. null if pending.

    parentHash - Hash of the parent block.

    nonce - Hash of the generated proof-of-work. null if pending.

    sha3Uncles - SHA3 of the uncles data in the block.

    logsBloom - The bloom filter for the logs of the block. null if pending.

    transactionsRoot - The root of the transaction trie of the block.

    stateRoot - The root of the final state trie of the block.

    receiptsRoot - The root of the receipts trie of the block.

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

    difficulty - Integer of the difficulty for this block encoded as a hexadecimal.

    totalDifficulty - Integer of the total difficulty of the chain until this block encoded as a hexadecimal.

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

    size - The size of this block in bytes as an Integer value encoded as hexadecimal.

    gasLimit - The maximum gas allowed in this block encoded as a hexadecimal.

    gasUsed - The total used gas by all transactions in this block encoded as a hexadecimal.

    timestamp - The unix timestamp for when the block was collated.

    transactions - Array of transaction objects - please see eth_getTransactionByHash for exact shape.

    uncles - Array of uncle hashes.

Code Examples:

To use the eth_getBlockByHash EVM method on the Avalanche C-Chain, ensure that the end of your URL includes ext/bc/C/rpc.

const ethers = require("ethers");
(async () => {
  const provider = new ethers.providers.JsonRpcProvider("");
  const blockData = await provider.getBlock(
Ready to get started? Create a free account