The eth_getUncleCountByBlockNumber
method returns the number of uncles (ommer blocks) in a block specified by the block number or tag. Uncle blocks are valid blocks that weren't included in the main chain but are still referenced and partially rewarded in Ethereum.
This method returns a count of uncle blocks for a specific block identified by its number or a block tag.
Block number in hex format or tags: latest, earliest, pending, safe, finalized
Integer of the number of uncles in this block (hexadecimal)
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x0" // 0 uncles in this block
}
The blockNumber
parameter accepts several special tags:
latest
: The most recent blockearliest
: Genesis blockpending
: Currently pending blocksafe
: Latest safe blockfinalized
: Latest finalized block