githubEdit

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.

circle-exclamation

Parameters

Parameter
Type
Required
Description

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"
}'

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

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

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid ACCESS_TOKEN.

-32602

Invalid argument

  • Invalid block number

Integration with Web3

Last updated

Was this helpful?