eth_getUncleByBlockNumberAndIndex - Arbitrum
Example code for the eth_getUncleByBlockNumberAndIndex JSON RPC method. Сomplete guide on how to use eth_getUncleByBlockNumberAndIndex JSON RPC in GetBlock Web3 documentation.
This method returns information about an uncle block using the parent block hash and the uncle index.
Arbitrum does not produce uncle blocks, so this method always returns null, but it exists for full EVM compatibility.
Parameters
block_hash
string
yes
The hash of the block whose uncle is being requested. Must be a 32 byte hex string prefixed with 0x.
uncle_index
string
yes
The index of the uncle in the block. Must be a hex number like "0x0".
Request
curl --location 'https://go.getblock.us/<ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_getUncleByBlockHashAndIndex",
"params": [
"0x4cc1439cb36e8e984ed8c3562b222db19fac331ab79d9e90dc351325289621ea",
"0x0"
],
"id": "getblock.io"
}'import axios from 'axios'
let data = JSON.stringify({
"jsonrpc": "2.0",
"method": "eth_getUncleByBlockHashAndIndex",
"params": [
"0x4cc1439cb36e8e984ed8c3562b222db19fac331ab79d9e90dc351325289621ea",
"0x0"
],
"id": "getblock.io"
};
let config = {
method: "post",
maxBodyLength: Infinity,
url: "https://go.getblock.us/<ACCESS_TOKEN>",
headers: {
"Content-Type": "application/json",
},
data: data,
};
axios
.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Response
Reponse Parameter Definition
number
Block number of the uncle
hash
Hash of the uncle block
parentHash
Parent block hash
miner
Miner address
difficulty
Difficulty of uncle block
gasLimit
Gas limit
gasUsed
Gas used
timestamp
Timestamp
uncles
Always empty
Use case
Even though Arbitrum does not have uncle blocks, the method helps developers by:
Maintaining compatibility with Ethereum RPC tooling
Supporting indexers that expect standard EVM methods
Allowing multi-chain dashboards to run a single RPC workflow
Preventing errors in systems that automatically query all uncle endpoints
Error handling
403
Forbidden
Missing or invalid ACCESS_TOKEN.
-32602
Invalid argument
Invalid block hash
Invalid index
Integration with Web3
The eth_getUncleByBlockHashAndIndex method helps developers to:
Build tools compatible with Ethereum and Arbitrum
Implement universal RPC logic across multiple chains
Handle uncle queries gracefully even when none exist
Prevent backend crashes due to missing RPC behavior
Last updated
Was this helpful?