Wallet API
Transaction Details by Order Id

Transaction Details by Order Id#

Retrieve transaction details based on the orderId, requiring the unique account identifier accountId.

Request Path#

GET https://www.okx.com/api/v5/waas/wallet/post-transaction/transaction-detail-by-ordid

Request Parameters#

ParameterTypeRequiredDescription
chainIndexStringYesUnique chain identifier
accountIdStringYesUnique account identifier
orderIdStringYesUnique transaction identifier

Response Parameters#

ParameterTypeDescription
chainIndexStringUnique chain identifier
orderIdStringUnique transaction identifier
blockHashStringBlock hash
blockHeightStringBlock height
blockTimeStringBlock time
txHashStringTransaction hash
feeUsdValueStringFee in USD (estimated when pending, actual after confirmation)
feesStringFees (wei for EVM transactions, sats for UTXO transactions)
gasLimitStringGas limit (not applicable for UTXO)
gasPriceStringGas price (wei, not applicable for UTXO)
gasUsedStringGas used (not applicable for UTXO)
txTimeStringTransaction time in timestamp format
txTypeStringTransaction type:
1: Receive tokens
2: Send tokens
3: Contract interaction
4: Authorization
50: BRC20_MINT
51: BRC20_INSCRIBE
52: BRC20_TRADE
53: BRC20_SEND
54: BRC20_RECEIVE
60: BRC20_DEPLOY
txStatusStringTransaction status:
1: Pending
2: Successful
3: Failed
evmDetailsArrayEVM chain transaction details
>fromAddrStringSource address
>toAddrStringDestination address
>txAmountStringTransfer amount (integer, amount = txAmount / 10^precision)
>iTypeStringSub-transaction type:
0: Outer chain coin transfer
1: Inner chain coin transfer
2: Token transfer
>tokenAddressStringContract address
>contractCallBooleanContract call indicator
>logIndexStringLog index
>nonceStringNonce
>statusStringSub-transaction status:
1: Pending
2: Successful
3: Failed
utxoDetailObjectUTXO sub-transaction details
>vinArrayInputs
>>addrStringAddress
>>numberStringNumber
>>txHashStringTransaction hash
>>amountStringAmount
>>voutIndexStringOutput
>voutIndexArrayOutput
>>addrStringAddress
>>addrInVinBooleanWhether this output address is also in vin
>>numberStringNumber
>>amountStringAmount

Request Example#

shell
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'

Response Example#

200
For ETH

{
    "code": "0",
    "data":[ 
        {
            "chainIndex": "0",  
            "orderId": "String", 
            "txHash": "String", 
            "blockHash" : "0x3ee63382b883fc40e35da6023fb341dd01cd2ec011f992bb54cf312f517740c9",
            "blockHeight" : "19235519",
            "blockTime" : "1708026551000",
            "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"
}

For BTC

{
    "code": "0",
    "data":[ 
        {
            "chainIndex": "0",  
            "orderId": "String", 
            "txHash": "String", 
            "blockHash" : "0x3ee63382b883fc40e35da6023fb341dd01cd2ec011f992bb54cf312f517740c9",
            "blockHeight" : "19235519",
            "blockTime" : "1708026551000",
            "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"
}