Infura开发手册

eth_getUncleCountByBlockNumber

返回指定编号区块的叔伯数量。

API请求

POST https://<network>.infura.io/v3/YOUR-PROJECT-ID

请求头:

Content-Type: application/json

请求参数:

  • BLOCK PARAMETER:区块编号或字符串标签:"latest", "earliest" or "pending"

请求示例:

JSON-RPC over HTTPS POST:

curl https://mainnet.infura.io/v3/YOUR-PROJECT-ID \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_getUncleCountByBlockNumber","params": ["0x5bad55"],"id":1}'

JSON-RPC over websockets:

wscat -c wss://mainnet.infura.io/ws/v3/YOUR-PROJECT-ID
>{"jsonrpc":"2.0","method":"eth_getUncleCountByBlockNumber","params": ["0x5bad55"],"id":1}

API响应

返回指定哈希区块的叔伯数量。

响应结果示例:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x1"
}