查询指定交易哈希交易明细#
获取链上交易基础信息。
请求路径#
GET
https://web3.okx.com/api/v5/xlayer/transaction/transaction-fills请求参数#
| 参数名 | 类型 | 是否必须 | 描述 |
|---|---|---|---|
| chainShortName | String | 是 | 公链缩写符号,例如 XLAYER |
| txid | String | 是 | 交易哈希,最多可批量查询20笔交易,以英文逗号分隔 |
响应参数#
| 参数名 | 类型 | 描述 |
|---|---|---|
| chainFullName | String | 公链全称,例如:X Layer |
| chainShortName | String | 公链缩写符号,例如:XLAYER |
| txid | String | 交易哈希 |
| height | String | 交易发生的区块 |
| transactionTime | String | 交易时间;Unix时间戳的毫秒数格式,如 1597026383085 |
| transactionType | String | 交易类型 0:原始交易类型 1:EIP2930 2:EIP1559 |
| amount | String | 交易数量 |
| transactionSymbol | String | 交易数量对应的币种 |
| methodId | String | 方法 |
| errorLog | String | 交易失败日志 |
| inputData | String | 输入数据 |
| txfee | String | 手续费 |
| index | String | 交易在区块里的位置索引 |
| confirm | String | 已确认区块数 |
| inputDetails | Array | 输入地址列表 |
| > inputHash | String | 发起交易的hash地址 |
| > isContract | Bol | 发起交易的地址是否是合约地址 true:是 ;false:否 |
| > amount | String | 该地址的交易数量 |
| outputDetails | Array | 输出地址列表 |
| > outputHash | String | 接收交易的hash地址 |
| > isContract | Bol | 接收交易的地址是否是合约地址 true:是 ;false:否 |
| > amount | String | 该地址的交易数量 |
| state | String | 交易状态 success:成功 fail:失败 pending:等待确认 |
| gasLimit | String | gas限额 |
| gasUsed | String | gas消耗 |
| gasPrice | String | gas价格 |
| totalTransactionSize | String | 总交易大小 |
| virtualSize | String | 虚拟交易大小 |
| weight | String | 交易重量 |
| nonce | String | 发起者地址发起的第几笔交易 |
| isAaTransaction | Bol | 是否为AA交易 |
| tokenTransferDetails | Array | 代币转账明细,最多返回20条,可通过新接口GET /api/v5/xlayer/transaction/internal-transaction-detail和GET /api/v5/xlayer/transaction/token-transaction-detail查询更多数据 |
| > index | String | 该交易在区块里的位置索引 |
| > token | String | 代币名称 |
| > tokenContractAddress | String | 代币合约地址 |
| > symbol | String | 代币符号 |
| > from | String | 转出代币地址 |
| > to | String | 接收代币地址 |
| > isFromContract | Bol | 转出代币地址是否是合约地址 |
| > isToContract | Bol | 接收代币地址是否是合约地址 |
| > tokenId | String | NFT的ID |
| > amount | String | 转账数量 |
| contractDetails | Array | 合约调用转账明细 |
| > index | String | 该交易在区块里的位置索引 |
| > from | String | 转出代币地址 |
| > to | String | 接收代币地址 |
| > isFromContract | Bol | 转出代币地址是否是合约地址 |
| > isToContract | Bol | 接收代币地址是否是合约地址 |
| > amount | String | 转账数量 |
| > gasLimit | String | gas限额 |
请求示例#
shell
curl --location --request GET 'https://web3.okx.com/api/v5/xlayer/transaction/transaction-fills?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": [
{
"chainFullName": "X Layer",
"chainShortName": "XLAYER",
"txid": "0x88c719ff4e6be26a81d642f5bbc6408e64dbd3dfdc9ef170a14d4fcf1c1db10c",
"height": "31136282",
"transactionTime": "1755493834000",
"amount": "0.25830859001436063",
"transactionSymbol": "OKB",
"txfee": "0.000021",
"index": "2",
"confirm": "7",
"inputDetails": [
{
"inputHash": "0x55bd572ece54c253888f96bb1722fbc237c6936f",
"isContract": false,
"amount": ""
}
],
"outputDetails": [
{
"outputHash": "0xd6e86442e5227bd135cf656be48117d43ce92e3b",
"isContract": false,
"amount": ""
}
],
"state": "success",
"gasLimit": "21000",
"gasUsed": "21000",
"gasPrice": "0.000000001",
"totalTransactionSize": "",
"virtualSize": "428",
"weight": "",
"nonce": "6",
"transactionType": "0",
"methodId": "",
"errorLog": "",
"inputData": "0x",
"isAaTransaction": false,
"tokenTransferDetails": [],
"contractDetails": []
}
]
}
