5.4.6.6 获取交易回执接口
在智能合约执行一笔交易后,可以使用该接口根据交易的哈希值获取交易的回执信息。
1. 接口地址:https://节点网关地址/api/cita/v1/node/getTxReceiptByTxHash
2. 通讯方式: POST
3. 签名算法:详见5.4.6.1应用接入签名算法
4. 请求参数
序号 | 字段名 | 字段 | 类型 | 必填 | 备注 |
---|---|---|---|---|---|
1 | 信息头 | header | Map | 是 | |
2 | 信息体 | body | Map | 是 | |
3 | 签名值 | mac | String | 是 | |
header | |||||
1 | 用户唯一标识 | userCode | String | 是 | |
2 | 应用唯一标识 | appCode | String | 是 | |
body | |||||
1 | 交易哈希 | txHash | string | 是 |
示例
{
"header":{"appCode":"cl0006202003181926573677572",
"userCode":"USER0006202003181951281835816"},
"body":{"txHash":"0x755f3e7833778f674e1b025f513f05722ba7248be43a3c9168b880847814021a"},
"mac":"MEUCIQDTFe2Gerdf7YJrG1a1Yt99M0ZQ3T1lGpsXdNmFV7WuTgIgSkZ19abUhAJbMrJMBoD8N7f26xhpQRuR4vNAfY7EEbs="
}
5. 响应参数
序号 | 字段名 | 字段 | 类型 | 必填 | 备注 |
---|---|---|---|---|---|
1 | 信息头 | header | Map | 是 | |
2 | 信息体 | body | Map | 是 | |
3 | 签名值 | mac | String | 是 | |
header: | |||||
1 | 响应标识 | code | int | 是 | 0:校验成功 -1:校验失败 |
2 | 响应信息 | msg | String | 否 | code=0时可为null |
body: | |||||
1 | 交易哈希 | transactionHash | string | 否 | code不为0时为空 |
2 | 交易序号 | transactionIndex | Int64 | ||
3 | 块哈希 | blockHash | String | ||
4 | 块号 | blockNumber | long | ||
5 | 累计使用gas | cumulativeGasUsed | string | ||
6 | 块中该交易之前(包含该交易)的所有交易消耗的 quota 总量 | cumulativeQuotaUsed | long | ||
7 | 使用gas | gasUsed | string | ||
8 | 交易消耗的 quota 数量 | quotaUsed | long | ||
9 | 合约地址 | contractAddress | string | 如果是部署合约, 这个地址指的是新创建出来的合约地址. 否则为空 | |
10 | 状态树根 | root | string | ||
11 | 状态 | status | string | ||
12 | 交易发送者 | from | string | ||
13 | 交易接收者 | to | string | ||
14 | Logs过滤器 | logsBloom | string | ||
15 | 错误信息 | errorMessage | string | ||
16 | 交易序号 | transactionIndexRaw | string | 十六进制字符串 | |
17 | 块号 | blockNumberRaw | string | 十六进制字符串 | |
18 | 累计使用gas | cumulativeGasUsedRaw | string | 十六进制字符串 | |
19 | 块中该交易之前(包含该交易)的所有交易消耗的 quota 总量 | cumulativeQuotaUsedRaw | string | 十六进制字符串 | |
20 | 使用gas | gasUsedRaw | string | 十六进制字符串 | |
21 | 交易消耗的 quota 数量 | quotaUsedRaw | string | 十六进制字符串 | |
22 | 交易产生的日志集合 | logs | []log | ||
log | |||||
1 | 是否删除 | removed | bool | ||
2 | 日志序号 | logIndex | long | ||
3 | 交易序号 | transactionIndex | long | ||
4 | 交易hash | transactionHash | string | ||
5 | 块hash | blockHash | string | ||
6 | 块号 | blockNumber | long | ||
7 | 合约地址 | address | string | ||
8 | 根据索引数组筛选的日志内容 | data | string | ||
9 | 交易事件序号 | transactionLogIndex | string | ||
10 | 交易序号 | transactionIndexRaw | string | 十六进制字符串 | |
11 | 块号 | blockNumberRaw | string | 十六进制字符串 | |
12 | 日志序号 | logIndexRaw | string | 十六进制字符串 | |
13 | 用来构造过滤器的索引数组 | topics | []string |
示例
{
"code": 1,
"msg": "处理成功",
"data": {
"transactionHash": "0x2072171b5233761a7eb25ecdb3e08dbcb14b7b9919ef538679a5adef1a04729f",
"transactionIndex": 0,
"blockHash": "0xc178fc32ff61b624350c48e4c1c66099228340a7b808bfea7f17ed1d0172879c",
"blockNumber": 5443,
"cumulativeGasUsed": null,
"cumulativeQuotaUsed": 30639,
"gasUsed": null,
"quotaUsed": 30639,
"contractAddress": null,
"root": null,
"status": null,
"from": null,
"to": null,
"logs": [{
"removed": false,
"logIndex": 0,
"transactionIndex": 0,
"transactionHash": "0x2072171b5233761a7eb25ecdb3e08dbcb14b7b9919ef538679a5adef1a04729f",
"blockHash": "0xc178fc32ff61b624350c48e4c1c66099228340a7b808bfea7f17ed1d0172879c",
"blockNumber": 5443,
"address": "0x728a4d500f9e2dcc01a7fa755476cf40f7cb5d1f",
"data": "0x00000000000000000000000000000000000000000000000000000000000000c8",
"transactionLogIndex": "0x0",
"topics": ["0xc6d8c0af6d21f291e7c359603aa97e0ed500f04db6e983b9fce75a91c6b8da6b"],
"transactionIndexRaw": "0x0",
"blockNumberRaw": "0x1543",
"logIndexRaw": "0x0"
}, {
"removed": false,
"logIndex": 1,
"transactionIndex": 0,
"transactionHash": "0x2072171b5233761a7eb25ecdb3e08dbcb14b7b9919ef538679a5adef1a04729f",
"blockHash": "0xc178fc32ff61b624350c48e4c1c66099228340a7b808bfea7f17ed1d0172879c",
"blockNumber": 5443,
"address": "0x728a4d500f9e2dcc01a7fa755476cf40f7cb5d1f",
"data": "0x00000000000000000000000000000000000000000000000000000000000000c8",
"transactionLogIndex": "0x1",
"topics": ["0xfd28ec3ec2555238d8ad6f9faf3e4cd10e574ce7e7ef28b73caa53f9512f65b9", "0x000000000000000000000000fe98e21021d9f3132103c7fd0509f8b7a32c286a"],
"transactionIndexRaw": "0x0",
"blockNumberRaw": "0x1543",
"logIndexRaw": "0x1"
}, {
"removed": false,
"logIndex": 2,
"transactionIndex": 0,
"transactionHash": "0x2072171b5233761a7eb25ecdb3e08dbcb14b7b9919ef538679a5adef1a04729f",
"blockHash": "0xc178fc32ff61b624350c48e4c1c66099228340a7b808bfea7f17ed1d0172879c",
"blockNumber": 5443,
"address": "0x728a4d500f9e2dcc01a7fa755476cf40f7cb5d1f",
"data": "0x",
"transactionLogIndex": "0x2",
"topics": ["0x59310b8be6fa298878e04229a6e8ad4e5dd6eda80b787363abf67948d720e50a", "0x00000000000000000000000000000000000000000000000000000000000000c8", "0x00000000000000000000000000000000000000000000000000000000000000c9", "0x00000000000000000000000000000000000000000000000000000000000000ca"],
"transactionIndexRaw": "0x0",
"blockNumberRaw": "0x1543",
"logIndexRaw": "0x2"
}],
"logsBloom": "0x00000000000000000000000000000020000000000000800000000000802000000004800000000000c00000000000100000100000000008000000000010000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000080004040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080040008000000000000000000000000000000000000002000000000000000000000000000000000000000020000000000000000000000000080000000000002000000000000000000000000000000000000000000000000800000",
"errorMessage": null,
"transactionIndexRaw": "0x0",
"blockNumberRaw": "0x1543",
"cumulativeGasUsedRaw": null,
"cumulativeQuotaUsedRaw": "0x77af",
"gasUsedRaw": null,
"quotaUsedRaw": "0x77af"
}
}