proxy/eth_getTransactionByBlockNumberAndIndex - 获取指定区块序号交易的详情
使用proxy模块的eth_getTransactionByBlockNumberAndIndex方法获取指定编号区块 的交易详情。
API调用
GET|POST /api
查询|表单参数:
- module:proxy
- action:eth_getTransactionByBlockNumberAndIndex
- tag:区块编号
- index:交易序号
- apikey:etherscan API密钥
API返回结果
返回结果为一个JSON对象,主要字段如下:
- jsonrpc:RPC版本号,2.0
- id:RPC请求编号
- result:调用结果为交易详情,主要字段描述如下:
- blockHash:区块哈希
- blockNumber:区块编号
- from:交易发起账号
- gas:gas用量
- gasPrice:gas价格
- hash:交易哈希
- input:交易额外数据
- nonce:nonce值
- to:接受账号
- transactionIndex:交易序号
- value:交易金额
- v:
- r:
- s:
示例代码
以curl为例的调用代码如下,也可以点击这里查看浏览器中的运行结果:
~$ curl https://api.etherscan.io/api?module=proxy&action=eth_getTransactionByBlockNumberAndIndex&tag=0x10d4f&index=0x0&apikey=YourApiKeyToken
返回结果如下:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0x7eb7c23a5ac2f2d70aa1ba4e5c56d89de5ac993590e5f6e79c394e290d998ba8",
"blockNumber": "0x10d4f",
"from": "0x4458f86353b4740fe9e09071c23a7437640063c9",
"gas": "0x5208",
"gasPrice": "0xba43b7400",
"hash": "0xa442249820de6be754da81eafbd44a865773e4b23d7c0522d31fd03977823008",
"input": "0x",
"nonce": "0x1",
"to": "0xbf3403210f9802205f426759947a80a9fda71b1e",
"transactionIndex": "0x0",
"value": "0xaa9f075c200000",
"v": "0x1b",
"r": "0x2c2789c6704ba2606e200e1ba4fd17ba4f0e0f94abe32a12733708c3d3442616",
"s": "0x2946f47e3ece580b5b5ecb0f8c52604fa5f60aeb4103fc73adcbf6d620f9872b"
}
}