For the complete documentation index, see llms.txt. This page is also available as Markdown.

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://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_getUncleCountByBlockNumber",
    "params": ["latest"],
    "id": "getblock.io"
}'
const axios = require('axios');

const url = 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/';

const payload = {
    jsonrpc: '2.0',
    method: 'eth_getUncleCountByBlockNumber',
    params: ['latest'],
    id: 'getblock.io'
};

axios.post(url, payload, {
    headers: { 'Content-Type': 'application/json' }
})
.then(response => console.log(response.data))
.catch(error => console.error(error));

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?