githubEdit

eth_getUncleByBlockNumberAndIndex - Polygon

Example code for the eth_getUncleByBlockNumberAndIndex json-rpc method. Сomplete guide on how to use eth_getUncleByBlockNumberAndIndex json-rpc in GetBlock.io Web3 documentation.

The eth_getUncleByBlockNumberAndIndex method returns information about an uncle of a block by number and uncle index position.

Parameters

Parameter
Type
Required
Description

blockNumber

string

Yes

Block number in hex, or "latest", "earliest", "pending"

uncleIndex

string

Yes

Uncle index position in hexadecimal

Request

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_getUncleByBlockNumberAndIndex",
    "params": ["0x3A2B5C7", "0x0"],
    "id": "getblock.io"
}'

Response

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

Response Parameters

Field
Type
Description

jsonrpc

string

JSON-RPC version (2.0)

id

string

Request identifier

result

varies

Uncle block object or null if not found

Use Case

The eth_getUncleByBlockNumberAndIndex method is useful for:

  • Ethereum compatibility

  • Chain analysis

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid ACCESS-TOKEN

-32600

Invalid Request

Malformed request body

-32602

Invalid params

Invalid method parameters

Web3 Integration

Last updated

Was this helpful?