proxy/eth_getTransactionReceipt - 获取指定交易的收据
使用proxy模块的eth_getTransactionReceipt方法发送裸交易。
API调用
GET|POST /api
查询|表单参数:
- module:proxy
- action:eth_getTransactionReceipt
- txhash:要查询收据的交易哈希
- apikey:etherscan API密钥
API返回结果
返回结果为一个JSON对象,主要字段如下:
- jsonrpc:RPC版本号,2.0
- id:RPC请求编号
- result:调用结果,为交易收据,主要包含如下字段:
- blockHash:区块哈希
- blockNumber:区块编号
- contractAddress:合约地址
- cululativeGasUsed:区块累计使用的gas
- from:发起账号
- gasUsed:交易使用的gas
- logs:交易产生的日志
- logsBloom:bloom过滤器
- root:根哈希
- to:交易接受账号
- transactionHash:交易哈希
- transactionIndex:交易序号
- error:错误信息
示例代码
以curl为例的调用代码如下,也可以点击这里查看浏览器中的运行结果:
~$ curl https://api.etherscan.io/api?module=proxy&action=eth_getTransactionReceipt&txhash=0x1e2910a262b1008d0616a0beb24c1a491d78771baa54a33e66065e03b1f46bc1&apikey=YourApiKeyToken
返回结果如下:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0xf64a12502afc36db3d29931a2148e5d6ddaa883a2a3c968ca2fb293fa9258c68",
"blockNumber": "0x70839",
"contractAddress": null,
"cumulativeGasUsed": "0x75d5",
"from": "0xc80fb22930b303b55df9b89901889126400add38",
"gasUsed": "0x75d5",
"logs": [
{
"address": "0x03fca6077d38dd99d0ce14ba32078bd2cda72d74",
"topics": [
"0x24bcf19562365f6510754002f8d7b818d275886315d29c7aa04785570b97a363"
],
"data": "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000a4861636b65726e65777300000000000000000000000000000000000000000000",
"blockNumber": "0x70839",
"transactionHash": "0x1e2910a262b1008d0616a0beb24c1a491d78771baa54a33e66065e03b1f46bc1",
"transactionIndex": "0x0",
"blockHash": "0xf64a12502afc36db3d29931a2148e5d6ddaa883a2a3c968ca2fb293fa9258c68",
"logIndex": "0x0",
"removed": false
}
],
"logsBloom": "0x00000000000000000000000000000400000000020000000000000000400000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"root": "0xc659845f1ac4e899ff1b0666dbac5deeda33a4a5d85da71f617f352824146e40",
"to": "0x03fca6077d38dd99d0ce14ba32078bd2cda72d74",
"transactionHash": "0x1e2910a262b1008d0616a0beb24c1a491d78771baa54a33e66065e03b1f46bc1",
"transactionIndex": "0x0"
}
}