Wallet API

Query UTXO#

Query the UTXO under the current wallet

Request URL#

POST https://www.okx.com/api/v5/waas/transaction/get-utxo

Request parameters#

ParameterTypeRequiredDescription
chainIdIntYesUnique identifier of the chain
utxoRequestsArrayYesUTXO request
>addressStringYesAddress
>coinAmountStringYesTransfer amount
>serviceChargeStringNoService charge (minimum unit of main coin)
>utxoTypeStringYesget UTXO info for NFT
utxoType = 1 :for transfers
utxoType = 2 :for NFTs
utxoType = 11 : for mints
>nftIdstringNoNFT id Required when UTXO is 2

Response parameters#

ParameterTypeDescription
addressstringAddress
canTransferAmountstringThe maximum transferable amount ,unit is "satoshi"
utxoTypeintget UTXO info for NFT
utxoType = 1 :for transfers
utxoType = 2 :for NFTs
utxoType = 11 : for mints
utxoListarrayUTXO List
>txHashstringTransaction hash
>voutintoutput sequence
>coinAmountintUTXO coin amount, unit is "satoshi"
>statusintstatus ,1:confirmed utxo 0:pending utxo

Request example#

shell
curl --location --request POST 'https://www.okx.com/api/v5/waas/transaction/get-utxo' \
--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' \
--data-raw '{
  "chainId": 0,
  "utxoRequests": [
    {
      "address": "bc1psnr548clz3f4fz6jmpnw5eqzj2v2musk082wp8fvq5ac3p5ete6qg05u8u",
      "coinAmount": 1500,
      "serviceCharge": 3600,
      "utxoType": 11
    }
  ]
}'

Response example#

200
{
  "code": 0,
  "msg": "success",
  "data": [{
    "address": "bc1psnr548clz3f4fz6jmpnw5eqzj2v2musk082wp8fvq5ac3p5ete6qg05u8u",
    "canTransferAmount": "86560",
    "utxoType": 11,
    "utxoList": [{
      "txHash": "a5dfa15d33577b77e68b39492a7adb5e6666bf1e34f17d6b041050e45d8abc1d",
      "vout": 1,
      "coinAmount": 86560,
      "status": 1
    }]
  }]
}