Links

eth_getUncleCountByBlockNumber

Returns the number of uncles in a block from a block matching the given block number.

Parameters

Params - a string array containing (required):
  • QUANTITY|TAG(hex string|string, required) - integer block number in hex string format, or the string "latest", "earliest" or "pending", see the default block parameter.

Returns

QUANTITY(string) - integer of the number of uncles in this block.

Example

Request

curl
TypeScript
curl https://api.blockvision.org/v1/<api key> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getUncleCountByBlockNumber",
"params": [
"0xe8"
],
"id": 42
}'
import { BlockVisionProvider, BvNetwork } from 'blockvision.js'
// Optional parameters, but default to eth-mainnet and default api-key.
const bv = new BlockVisionProvider(BvNetwork.POL_MAINNET)
// Access BlockVision Enhanced API requests
bv.getUncleCount("0xe8").then(console.log)

Result

{
"jsonrpc": "2.0",
"id": 42,
"result": "0x0"
}