Returns the number of uncles in a block matching the given block number.
Request Format
{
"jsonrpc": "2.0",
"method": "eth_getUncleCountByBlockNumber",
"params": [
"0xe8"
],
"id": 1
}
Response Format
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1"
}
Parameters
- Block (
BlockNumberOrTag
): The block number or a special tag (latest
,earliest
,pending
).
Return Value
- Uncle Count (
uint
ornotFound
): Returns the number of uncles in the specified block.
Example
Request
{
"jsonrpc": "2.0",
"method": "eth_getUncleCountByBlockNumber",
"params": [
"0xe8"
],
"id": 1
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1"
}
Notes
- Useful for retrieving the number of uncles included in a specific block.
- If the block is not found, the response will return
notFound
.