githubEdit

eth_getUncleCountByBlockHash - Arbitrum

Example code for the eth_getUncleCountByBlockHash JSON RPC method. Сomplete guide on how to use eth_getUncleCountByBlockHash JSON RPC in GetBlock Web3 documentation.

This method returns the number of uncles in a block identified by its hash.

circle-exclamation

Parameters

Parameter
Type
Required
Description

block_hash

string

yes

The hash of the block whose uncle count is requested. Must be a 32-byte hex string starting with 0x.

Request

curl --location 'https://go.getblock.us/<ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
   "jsonrpc": "2.0",
       "method": "eth_getUncleCountByBlockHash",
    "params": [
        "0xf5524f0cf99ac6bc5905e95294ebed9007e2d978155f3457118eb7a26d97503a"
    ],
    "id": "getblock.io"
}'

Response

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": "0x0"
}

Reponse Parameter Definition

Field
Description
Data Type

result

The number of uncle blocks as a hexadecimal string.

String

circle-info

But again, on Arbitrum the value is always null.

Use case

Even though uncle blocks do not exist on Arbitrum, this method helps developers to:

  • Maintain compatibility with Ethereum tools and SDKs

  • Avoid breaking multi-chain indexers or dashboards

  • Normalise RPC responses when building explorers

  • Support Ethereum-style APIs for analytics and monitoring

Error handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid ACCESS_TOKEN.

-32602

Invalid argument

  • Invalid block hash

Integration with Web3

Last updated

Was this helpful?