eth_getUncleByBlockNumberAndIndex
Returns information about a uncle of a block by number and uncle index position.
Params
- a string array containing (required):QUANTITY|TAG(hex string|string, required)
- integer block number in hex string format, or the string"earliest"
,"latest"
or"pending"
, as in the default block parameter.QUANTITY(hex string, required)
- the uncle’s index position.
Object
- A block object, or null
when no block was found:number(hex string)
.QUANTITY
- the block number.null
when its pending block.hash(hex string)
.DATA
, 32 Bytes - hash of the block.null
when its pending block.parentHash(hex string)
.DATA
, 32 Bytes - hash of the parent block.nonce(hex string)
.DATA
, 8 Bytes - hash of the generated proof-of-work.null
when its pending block.sha3Uncles(hex string)
.DATA
, 32 Bytes - SHA3 of the uncles data in the block.logsBloom(hex string)
.DATA
, 256 Bytes - the bloom filter for the logs of the block.null
when its pending block.transactionsRoot(hex string)
.DATA
, 32 Bytes - the root of the transaction trie of the block.stateRoot(hex string)
.DATA
, 32 Bytes - the root of the final state trie of the block.receiptsRoot(hex string)
.DATA
, 32 Bytes - the root of the receipts trie of the block.miner(hex string)
.DATA
, 20 Bytes - the address of the beneficiary to whom the mining rewards were given.difficulty(hex string)
.QUANTITY
- integer of the difficulty for this block.totalDifficulty(hex string)
.QUANTITY
- integer of the total difficulty of the chain until this block.extraData(hex string)
.DATA
- the “extra data” field of this block.size(hex string)
.QUANTITY
- integer the size of this block in bytes.gasLimit(hex string)
.QUANTITY
- the maximum gas allowed in this block.gasUsed(hex string)
.QUANTITY
- the total used gas by all transactions in this block.timestamp(hex string)
.QUANTITY
- the unix timestamp for when the block was collated.transactions(array of object)
.Array
- array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.uncles(array of hex string)
.Array
- array of uncle hashes.
curl
TypeScript
curl https://api.blockvision.org/v1/<api key> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getUncleByBlockNumberAndIndex",
"params": [
"0x29c",
"0x0"
],
"id": 1
}'
import { BlockVisionProvider, BvNetwork } from 'blockvision.js'
// Optional parameters, but default to eth-mainnet and default api-key.
const bv = new BlockVisionProvider(BvNetwork.ETH_MAINNET)
// Access BlockVision Enhanced API requests
bv.getUncleByIndex('0x29c', '0x0').then(console.log)
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"difficulty": "0x57f117f5c",
"extraData": "0x476574682f76312e302e302f77696e646f77732f676f312e342e32",
"gasLimit": "0x1388",
"gasUsed": "0x0",
"hash": "0x932bdf904546a2287a2c9b2ede37925f698a7657484b172d4e5184f80bdd464d",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x5bf5e9cf9b456d6591073513de7fd69a9bef04bc",
"mixHash": "0x4500aa4ee2b3044a155252e35273770edeb2ab6f8cb19ca8e732771484462169",
"nonce": "0x24732773618192ac",
"number": "0x299",
"parentHash": "0xa779859b1ee558258b7008bbabff272280136c5dd3eb3ea3bfa8f6ae03bf91e5",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x21d",
"stateRoot": "0x2604fbf5183f5360da249b51f1b9f1e0f315d2ff3ffa1a4143ff221ad9ca1fec",
"timestamp": "0x55ba4827",
"totalDifficulty": "0xc46826a2c6a",
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncles": []
}
}
Last modified 1mo ago