eth_getUncleCountByBlockNumber - Arbitrum
Example code for the eth_getUncleCountByBlockNumber JSON RPC method. Сomplete guide on how to use eth_getUncleCountByBlockNumber JSON RPC in GetBlock Web3 documentation.
This method returns the number of uncles in a block specified by its block number.
Arbitrum does not produce uncle blocks, so this method always returns "0x0", but it remains available for full Ethereum RPC compatibility.
Parameters
block_number
string
yes
The block number in hex (for example "0x1a"), or predefined tags like "latest", "earliest", or "pending".
Request
curl --location 'https://go.getblock.us/<ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_getUncleCountByBlockNumber",
"params": [
"latest"
],
"id": "getblock.io"
}'import axios from 'axios'
let data = JSON.stringify({
"jsonrpc": "2.0",
"method": "eth_getUncleCountByBlockNumber",
"params": [
"latest"
],
"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
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": "0x0"
}Reponse Parameter Definition
result
The number of uncle blocks as a hexadecimal string.
String
Use case
Although Arbitrum never returns a nonzero value, this method helps developers to:
Maintain multi-chain compatibility with Ethereum RPC methods
Prevent breaking explorers or indexers that expect the method
Use the same codebase across EVM chains without conditionals
Ensure analytics tools can safely query block structure
Error handling
403
Forbidden
Missing or invalid ACCESS_TOKEN.
-32602
Invalid argument
Invalid block number
Integration with Web3
Last updated
Was this helpful?