eth_getUncleByBlockNumberAndIndex
Returns information about the 'Uncle' of a block by hash and the Uncle index position.

REQUEST

1
POST https://<network>.infura.io/v3/YOUR-PROJECT-ID
Copied!

HEADERS

1
Content-Type: application/json
Copied!

REQUEST PARAMS

  • BLOCK PARAMETER [required] - hexadecimal block number, or the string "latest", "earliest" or "pending".
  • UNCLE INDEX POSITION [required] - a hex of the integer indicating the uncle's index position.

EXAMPLE

1
## JSON-RPC over HTTPS POST
2
## Replace YOUR-PROJECT-ID with a Project ID from your Infura Dashboard
3
## You can also replace mainnet with a different supported network
4
curl https://mainnet.infura.io/v3/YOUR-PROJECT-ID \
5
-X POST \
6
-H "Content-Type: application/json" \
7
-d '{"jsonrpc":"2.0","method":"eth_getUncleByBlockNumberAndIndex","params": ["0x29c","0x0"],"id":1}'
8
9
## JSON-RPC over WSS
10
## Replace YOUR-PROJECT-ID with a Project ID from your Infura Dashboard
11
## You can also replace mainnet with a different supported network
12
wscat -c wss://mainnet.infura.io/ws/v3/YOUR-PROJECT-ID
13
>{"jsonrpc":"2.0","method":"eth_getUncleByBlockNumberAndIndex","params": ["0x29c","0x0"],"id":1}
Copied!

RESPONSE

RESULT FIELDS

  • BLOCK - A block object, or null when no block was found
    • number: the block number. null when its 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 its pending block.
    • sha3Uncles: 32 Bytes - SHA3 of the uncles data in the block.
    • logsBloom: 256 Bytes - the bloom filter for the logs of the block. null when its 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: hexadecimal of the difficulty for this block.
    • totalDifficulty: hexadecimal of the total difficulty of the chain until this block.
    • extraData: the "extra data" field of this block.
    • size: hexadecimal 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.
    • uncles: an Array of uncle hashes.
Note: An uncle doesn't contain individual transactions.

BODY

1
{
2
"jsonrpc": "2.0",
3
"id": 1,
4
"result": {
5
"difficulty": "0x57f117f5c",
6
"extraData": "0x476574682f76312e302e302f77696e646f77732f676f312e342e32",
7
"gasLimit": "0x1388",
8
"gasUsed": "0x0",
9
"hash": "0x932bdf904546a2287a2c9b2ede37925f698a7657484b172d4e5184f80bdd464d",
10
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
11
"miner": "0x5bf5e9cf9b456d6591073513de7fd69a9bef04bc",
12
"mixHash": "0x4500aa4ee2b3044a155252e35273770edeb2ab6f8cb19ca8e732771484462169",
13
"nonce": "0x24732773618192ac",
14
"number": "0x299",
15
"parentHash": "0xa779859b1ee558258b7008bbabff272280136c5dd3eb3ea3bfa8f6ae03bf91e5",
16
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
17
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
18
"size": "0x21d",
19
"stateRoot": "0x2604fbf5183f5360da249b51f1b9f1e0f315d2ff3ffa1a4143ff221ad9ca1fec",
20
"timestamp": "0x55ba4827",
21
"totalDifficulty": null,
22
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
23
"uncles": []
24
}
25
}
Copied!
Copy link