Wallet API

All UTXOs#

Query confirmed UTXOs for BTC, LTC, Doge, BCH, Cardano, etc., on specified addresses of UTXO chains. Pending UTXOs are not returned.

The results are sorted in descending order by asset size, with a maximum return of 300 entries.

Request Path#

GET https://www.okx.com/api/waas/wallet/utxo/utxos

Request Parameters#

ParameterTypeRequiredDescription
chainIndexStringYesUnique chain identifier
addressStringYesAddress information, required
spendStatusStringNoSpend status:
1: spending
2: unspent
3: spending + unspent
If not provided, the default value is 3, returning all results.

Response Parameters#

ParameterTypeDescription
txHashStringTransaction hash
voutindexStringIdentifies the position of the UTXO in the output, combined with txHash uniquely maps the specified UTXO
coinAmountStringAmount of all returned UTXOs, in satoshis
spendStatusStringSpend status:
1: spending
2: unspent
containAssetsStringBitcoin chain:
1: contains assets (currently only supports BTC Ordinals inscription assets)
2: no assets
3: asset status pending, not yet parsed

Other chains: no information, returned as empty

Request Example#

shell
curl --location --request GET 'https://www.okx.com/api/v5/waas/wallet/utxo/utxos?chainIndex=0&address=bc1p4sp52y6jfnlgv86t7er3dzgxgd8n5namuvkepw3u6g6rxk5k7feqdsvx3f' \
--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'
//If the chain is not supported, an error is directly prompted

Response Example#

200
{
    "code": "0",
    "msg": "success",
    "data": [

        {
            "txHash": "5f2418f726457391a8cc5a6ebba71f8d9c039929ff0540d6e3c35b02ac98215f",
            "vout": 1,
            "coinAmount": "4652871",
            "spendStatus": "1",
            "includeExtra": "1",
            "extra": {}
        }
        
    ]
}