批量查询交易明细#
通过交易哈希获取交易明细信息。
请求路径#
GET
https://web3.okx.com/api/v5/xlayer/transaction/transaction-multi请求参数#
| 参数名 | 类型 | 是否必须 | 描述 |
|---|---|---|---|
| chainShortName | String | 是 | 公链缩写符号,例如 XLAYER |
| txId | String | 是 | 交易哈希,多笔交易以,分隔 最多20个txId |
响应参数#
| 参数名 | 类型 | 描述 |
|---|---|---|
| txId | String | 交易哈希 |
| methodId | String | 方法 |
| blockHash | String | 区块哈希 |
| height | String | 交易发生的区块 |
| transactionTime | String | 交易时间;Unix时间戳的毫秒数格式,如 1597026383085 |
| from | String | 发送方地址 |
| to | String | 接收方地址 |
| isFromContract | Bol | From地址是否是合约地址 |
| isToContract | Bol | To地址是否是合约地址 |
| amount | String | 交易数量 |
| symbol | String | 交易数量对应的币种 |
| nonce | String | 发起者地址发起的第几笔交易 |
| gasLimit | String | gas限额 |
| gasUsed | String | gas消耗 |
| gasPrice | String | gas价格 |
| txFee | String | 手续费 |
| state | String | 交易状态: success 成功 fail 失败 pending 等待确认 |
| transactionType | String | 交易类型 0:原始交易类型 1:EIP2930 2:EIP1559 |
请求示例#
shell
curl --location --request GET 'https://web3.okx.com/api/v5/xlayer/transaction/transaction-multi?chainShortName=xlayer&txId=0x88c719ff4e6be26a81d642f5bbc6408e64dbd3dfdc9ef170a14d4fcf1c1db10c' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z'
响应示例#
json
{
"code": "0",
"msg": "",
"data": [
{
"txId": "0x88c719ff4e6be26a81d642f5bbc6408e64dbd3dfdc9ef170a14d4fcf1c1db10c",
"methodId": "",
"blockHash": "0x3ad8f2db660966e4f5b1bc54fb16e7d10ce43d23831f3ded93f27b5f8e1fa343",
"height": "31136282",
"transactionTime": "1755493834000",
"from": "0x55bd572ece54c253888f96bb1722fbc237c6936f",
"to": "0xd6e86442e5227bd135cf656be48117d43ce92e3b",
"isFromContract": false,
"isToContract": false,
"amount": "0.258308590014360608",
"symbol": "OKB",
"nonce": "6",
"txFee": "0.000021",
"gasPrice": "1000000000",
"gasLimit": "21000",
"gasUsed": "21000",
"state": "success",
"transactionType": "0"
}
]
}
