Updated on 2023-12-06 GMT+08:00

eth_getUncleByBlockHashAndIndex

Introduction

This API returns information about an uncle of a block by hash and uncle index position. It consumes 16 CUs.

Parameter Description

Parameter

Type

Description

Block hash

String

The hash of a block.

Uncle index position

String

The uncle's index position in hexadecimal.

Return Value

Object: A block object with the following fields, or null when no block was found:
  • number: the block number of the requested block, encoded as hexadecimal. It is null if the block is pending.
  • hash: the hash of the block. It is null if the block is pending.
  • parentHash: the hash of the parent block.
  • nonce: the hash used to demonstrate proof-of-work. It is null if the block is pending.
  • sha3Uncles: SHA3 of the uncles data in the block.
  • logsBloom: the bloom filter for the logs of the block. It is null if the block is 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 miner receiving the reward.
  • difficulty: the difficulty for this block.
  • totalDifficulty: the total difficulty of the chain until this block.
  • extraData: the "extra data" field of this block.
  • size: the size of this block in bytes.
  • gasLimit: the maximum gas allowed in this block.
  • gasUsed: the total used gas by all transactions in this block.
  • timestamp: the Unix timestamp for when the block was collated.
  • transactions: an array of transaction objects, or 32-bytes transaction hashes, depending on the last given parameter.
  • uncles: an array of uncle hashes.

Request

curl https://your-http-endpoint/v1/<API-KEY> \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_getUncleByBlockHashAndIndex","params":[0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b", "0x0"],"id":1,"jsonrpc":"2.0"}'