Skip to main content

eth_getUncleByBlockHashAndIndex

Returns information about a uncle of a block given the block hash and the uncle index position.

Parameters

  • block hash: [Required] A string representing the hash (32 bytes) of a block.
  • uncle index position: [Required] A hexadecimal equivalent of the integer indicating the uncle's index position.

Returns

A block object, or null when no block was found. The block object returned will consist of the following keys and their values:

  • number: The block number. Null when the returned block is the pending block.
  • hash: 32 bytes. Hash of the block. Null when its pending block.
  • parentHash: 32 bytes. Hash of the parent block.
  • nonce: 8 bytes. Hash of the generated proof-of-work. Null when the returned block is the pending block.
  • sha3Uncles: 32 bytes. The SHA3 of the uncles data in the block.
  • logsBloom: 256 bytes. The Bloom filter for the logs of the block. Null when the returned block is the pending block.
  • transactionsRoot: 32 bytes. The root of the transaction trie of the block.
  • stateRoot: 32 bytes. The root of the final state trie of the block.
  • receiptsRoot: 32 bytes. The root of the receipts trie of the block.
  • miner: 20 bytes. The address of the beneficiary to whom the mining rewards were given.
  • difficulty: The hexadecimal of the difficulty for this block.
  • totalDifficulty: The hexadecimal of the total difficulty of the chain until this block.
  • extraData: The "extra data" field of this block.
  • size: The hexadecimal of the size of this block in bytes.
  • gasLimit: Maximum gas allowed in this block.
  • gasUsed: Total used gas by all transactions in this block.
  • timestamp: The unix timestamp for when the block was collated.
  • uncles: (Array). An array of uncle hashes.

Example

Replace YOUR-API-KEY with the API key from your Infura Dashboard.

Request

curl https://mainnet.infura.io/v3/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getUncleByBlockHashAndIndex","params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35","0x0"],"id":1}'

Response

{
"id" : 1,
"jsonrpc" : "2.0",
"result" : {
"blockHash" : "0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",
"blockNumber" : "0x5bad55",
"contractAddress" : null,
"cumulativeGasUsed" : "0xb90b0",
"effectiveGasPrice" : "0xfa56ea00",
"from" : "0x398137383b3d25c92898c656696e41950e47316b",
"gasUsed" : "0x1383f",
"logs" : [
{
"address" : "0x06012c8cf97bead5deae237070f9587f8e7a266d",
"blockHash" : "0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",
"blockNumber" : "0x5bad55",
"data" : "0x000000000000000000000000398137383b3d25c92898c656696e41950e47316b00000000000000000000000000000000000000000000000000000000000cee6100000000000000000000000000000000000000000000000000000000000ac3e100000000000000000000000000000000000000000000000000000000005baf35",
"logIndex" : "0x6",
"removed" : false,
"topics" : [
"0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80"
],
"transactionHash" : "0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0",
"transactionIndex" : "0x11"
}
],
"logsBloom" : "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000200000000000000000000000000000",
"status" : "0x1",
"to" : "0x06012c8cf97bead5deae237070f9587f8e7a266d",
"transactionHash" : "0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0",
"transactionIndex" : "0x11",
"type" : "0x0"
}
}