Updated on 2024-11-14 GMT+08:00

eth_getUncleByBlockNumberAndIndex

Introduction

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

Parameter Description

Parameter

Type

Description

Block number or tag

String

A hexadecimal block number, or the string (earliest, latest, or pending).

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_getUncleByBlockNumberAndIndex","params":["latest","0x0"],"id":1,"jsonrpc":"2.0"}'