proxy/eth_getUncleByBlockNumberAndIndex - 获取指定叔伯区块
使用proxy模块的eth_getUncleByBlockNumberAndIndex方法获取指定编号区块 的指定序号的叔伯区块。
API调用
GET|POST /api
查询|表单参数:
- module:proxy
- action:eth_getUncleByBlockNumberAndIndex
- tag:区块编号
- index:叔伯块索引序号
- apikey:etherscan API密钥
API返回结果
返回结果为一个JSON对象,主要字段如下:
- jsonrpc:RPC版本号,2.0
- id:RPC请求编号
- result:调用结果指定编号区块的详细数据,包含以下字段:
- difficulty:区块难度
- extraData:额外数据
- gasLimit:gas上限
- gasUsed:已用gas
- hash:区块哈希值
- logsBloom:bloom日志
- miner:出块账号
- mixHash:混合哈希值
- nonce:nonce值
- number:
- parentHash:父区块哈希
- receiptsRoot:收据树根哈希
- sha3Uncles:叔伯块sha3哈希
- size:区块字节数
- stateRoot:状态树根哈希
- timeStamp:时间戳
- totalDifficulty:到该区块为止的总难度
- transactionsRoot:交易树根哈希
- uncles:叔伯块清单数组
示例代码
以curl为例的调用代码如下,也可以点击这里查看浏览器中的运行结果:
~$ curl https://api.etherscan.io/api?module=proxy&action=eth_getUncleByBlockNumberAndIndex&tag=0x210A9B&index=0x0&apikey=YourApiKeyToken
返回结果如下:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"difficulty": "0x3db79ff5de86",
"extraData": "0x7777772e62772e636f6d",
"gasLimit": "0x47e7c4",
"gasUsed": "0x14820",
"hash": "0x5ad884f542215bbb0b7e2558b2309ce89132e559ee1b001e81b77e702b43d932",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0xbcdfc35b86bedf72f0cda046a3c16829a2ef41d1",
"mixHash": "0x8d3e8e65a0803e3c023bafcd373e1d272c4f463ba0116f3e9591a8dc1e5b5018",
"nonce": "0x151a6600143aad31",
"number": "0x210a99",
"parentHash": "0x30fe09876530e366a49b6a3aa64c26cf7cd4348aa32a6ad83564b0ea4b3830ed",
"receiptsRoot": "0xf43ffa3981d0c714e1f677082fc15e69f408263f542bb98a2ac47d8d92f540fe",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x212",
"stateRoot": "0xce52569ccaa08e9030fc0fa5750332f7d2bc111699e3adb6c6927b73b5c56f14",
"timestamp": "0x57c515ba",
"totalDifficulty": null,
"transactionsRoot": "0x057c513a2722663a43b29d66b49809876289e3c7497b84e3bee52bb7648fba50",
"uncles": []
}
}