根据 orderId 查询某个交易的详情,需要指定钱包账户唯一标识 accountId。
GET https://www.okx.com/api/waas/wallet/post-transaction/transaction-detail-by-ordid
Parameter | Type | Required | Description |
---|---|---|---|
chainIndex | String | Yes | 链唯一标识 |
accountId | String | Yes | 钱包账户唯一标识 |
orderId | String | Yes | 交易唯一标识 |
Parameter | Type | Description |
---|---|---|
chainIndex | String | 链唯一标识 |
orderId | String | 订单唯一标识 |
blockHash | String | 区块哈希 |
blockHeight | String | 区块高度 |
blockTime | String | 区块时间 |
txHash | String | 交易哈希 |
feeUsdValue | String | 手续费,以美元计价。pending 时展示的是预估数量,上链后更新成实际花费数量 |
fees | String | 手续费,EVM 交易单位为 wei,UTXO 交易单位为 sats。pending 时展示的是预估数量,上链后更新成实际花费数量 |
gasLimt | String | gas limit,不适用于 UTXO |
gasPrice | String | gas price,单位为 wei,不适用于 UTXO |
gasUsed | String | 已使用 gaslimit 的数量,不适用于 UTXO |
txTime | String | 交易时间,时间戳格式 |
txType | String | 交易类型(transfer): 1 : 接收代币 2 : 发送代币 3 : 合约交互 4 : 授权 50 :BRC20_MINT 51 :BRC20_INSCRIBE 52 :BRC20_TRADE 53 :BRC20_SEND 54 :BRC20_RECEIVE 60 :BRC20_DEPLOY |
txStatus | String | 交易状态: 1 : 排队中 2 : 成功 3 : 失败 |
evmDetails | Array | EVM链子交易详情 |
>fromAddr | String | 来源地址 |
>toAddr | String | 目的地址 |
>txAmount | String | 转账整数,转账数量=转账整数/10^精度 |
>iType | String | 子交易类型: 0 : 外层主链币转移 1 : 内层主链币转移 2 : token转移 |
>tokenAddress | String | 合约地址 |
>contractCall | Boolean | 合约调用 |
>logIndex | String | 日志索引 |
>nonce | String | nonce |
>status | String | 子交易状态: 1 : 排队中 2 : 成功 3 : 失败 |
utxoDetail | Object | UTXO 子交易详情 |
>vin | Array | 输入 |
>>addr | String | 地址 |
>>number | String | 序号 |
>>txHash | String | 交易哈希 |
>>amount | String | 数量 |
>>voutIndex | String | 输出 |
>voutIndex | Array | 输出 |
>>addr | String | 地址 |
>>addrInVin | Boolean | 这个输出地址是否同时也在 vin 里 |
>>number | String | 序号 |
>>amount | String | 数量 |
curl --location --request GET 'https://www.okx.com/api/api/v5/waas/wallet/post-transaction/transaction-detail-by-ordid?orderId=tx-001&chainIndex=111' \
--header 'Content-Type: application/json' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--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'
以 ETH 为例
{
"code": "0",
"data":[
{
"chainIndex": "3",
"orderId": "String",
"txHash": "String",
"blockHash" : "0x3ee63382b883fc40e35da6023fb341dd01cd2ec011f992bb54cf312f517740c9",
"blockHeight" : "19235519",
"blockTime" : "1708026551000",
"txHash": "String",
"feeUsdValue" : "138.846919",
"fees" : "49102595635945621",
"gasLimit" : "2000000",
"gasPrice" : "87504603347",
"gasUsed" : "561143",
"txType": "0",
"txTime": "0",
"txStatus": "0",
"evmDetails": [
{
"iType" : "0",
"txAmount": "0",
"tokenAddress":""
"contractCall" : true,
"fromAddr" : "0x3ee63382b883fc40e35da6023fb341dd01cd2ec011f992bb54cf312f517740c9",
"toAddr" : "0x3ee63382b883fc40e35da6023fb341dd01cd2ec011f992bb54cf312f517740c9",
"logIndex" : "-1",
"status" : "SUCCESS"
}
]
}
],
"msg": "success"
}
以 BTC 为例
{
"code": "0",
"data":[
{
"chainIndex": "3",
"orderId": "String",
"txHash": "String",
"blockHash" : "0x3ee63382b883fc40e35da6023fb341dd01cd2ec011f992bb54cf312f517740c9",
"blockHeight" : "19235519",
"blockTime" : "1708026551000",
"txHash": "String",
"feeUsdValue" : "138.846919",
"fees" : "49102595635945621",
"gasLimit" : "2000000",
"gasPrice" : "87504603347",
"gasUsed" : "561143",
"txType": "0",
"txTime": "0",
"txStatus": "0",
"utxoDetail":{
"vin" : [
{
"addr" : "bc1p077evnzjv9w697a523jxvhyyt0aptmgunkk2a8wsppy3mty7gj7q9j6azc",
"number" : "0",
"txHash" : "3aead5cb471bf2d30b6c2bc9961a579a91ad0a7562800356e6c29f9c5b05a964",
"amount" : "2990241",
"voutIndex" : "1"
}
],
"voutIndex" : [
{
"addr":"",
"addrInVin" : false,
"number" : "0",
"amount" : "0"
},
{
"addr" : "bc1p6eu0hkl3jy449wrm52exssure7a8083dcsfkydh02c4vyrs2y83shdcmsy",
"addrInVin" : false,
"number" : "1",
"amount" : "330"
}
]
}
}
],
"msg": "success"
}