Retrieve details of a transaction based on its txHash. Supports querying by sub-transaction type iType and index logIndex.
OKX WaaS decomposes each transaction and its internal transactions into sub-transactions, providing different sub-transaction types based on the type of assets changed: 0: Outer chain coin transfer 1: Inner chain coin transfer within contract 2: Token transfer
GET https://www.okx.com/api/waas/wallet/post-transaction/transaction-detail-by-txhash
Parameter | Type | Required | Description |
---|---|---|---|
chainIndex | String | Yes | Unique identifier for the chain |
txHash | String | Yes | Transaction hash |
iType | String | No | Sub-transaction type:0 : Outer chain coin transfer 1 : Inner chain coin transfer 2 : Token transfer |
logIndex | String | No | Index value. When subscribing to webhook, logIndex is attached to sub-transactions in transaction history |
Parameter | Type | Description |
---|---|---|
chainIndex | String | Unique identifier for the chain |
orderId | String | Unique order identifier |
blockHash | String | Block hash |
blockHeight | String | Block height |
blockTime | String | Block time |
txHash | String | Transaction hash |
feeUsdValue | String | Fee in USD. Shown as estimated amount when pending, updated to actual cost after confirmation |
fees | String | Fees in wei for EVM transactions, sats for UTXO transactions. Shown as estimated amount when pending, updated to actual cost after confirmation |
gasLimt | String | Gas limit. Not applicable for UTXO |
gasPrice | String | Gas price in wei. Not applicable for UTXO |
gasUsed | String | Amount of gas used, not applicable for UTXO |
txTime | String | Transaction time in timestamp format |
txType | String | Transaction type (transfer): 1 : Receive token 2 : Send token 3 : Contract interaction 4 : Authorization 50 :BRC20_MINT 51 :BRC20_INSCRIBE 52 :BRC20_TRADE 53 :BRC20_SEND 54 :BRC20_RECEIVE 60 :BRC20_DEPLOY |
txStatus | String | Transaction status: 1: Queued 2: Successful 3: Failed |
evmDetails | Array | Details of EVM chain sub-transactions |
>fromAddr | String | Source address |
>toAddr | String | Destination address |
>txAmount | String | Amount of main chain coin transferred |
>iType | String | Sub-transaction type: 0 : Outer chain coin transfer 1 : Inner chain coin transfer 2 : Token transfer |
>tokenAddress | String | Contract address |
>contractCall | Boolean | Contract call |
>logIndex | String | Log index |
>nonce | String | Nonce |
>status | String | Sub-transaction status: 1 : Queued 2 : Successful 3 : Failed |
utxoDetail | Object | Details of UTXO sub-transactions |
>vin | Array | Input |
>>addr | String | Address |
>>number | String | Sequence number |
>>txHash | String | Transaction hash |
>>amount | String | Amount |
>>voutIndex | String | Output |
>voutIndex | Array | Output |
>>addr | String | Address |
>>addrInVin | Boolean | Whether this output address is also in vin |
>>number | String | Sequence number |
>>amount | String | Amount |
curl --location --request GET 'https://www.okx.com/api/v5/waas/wallet/post-transaction/transaction-detail-by-txhash?txHash=0x3jjdx99hkljbxk138791001&chainIndex=111&iType=0&index=1' \
--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'
Example with 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"
}
Example with 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"
}