eth_getUncleCountByBlockNumber - BSC

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

The eth_getUncleCountByBlockNumber method returns the number of uncles in a block by block number. On BSC, this typically returns 0.

Parameters

Parameter
Type
Required
Description

blockNumber

string

Yes

Block number (hex) or "latest"

Request Example

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

Response Example

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

Response Parameters

Parameter
Type
Description

result

string

Uncle count (0x0 on BSC)

Use Cases

  • EVM compatibility checks

  • Cross-chain development

Error Handling

Error Code
Description

-32602

Invalid params

SDK Integration

Last updated

Was this helpful?