钱包 API
查询全量 UTXO

查询全量 UTXO#

查询 BTC 、LTC、 Doge 、BCH、Cardano 等 UTXO 链指定地址下已确认的 UTXO,不返回 Pending 中的 UTXO。

按照资产大小倒序排序,最多返回 300 条。

请求路径#

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

请求参数#

ParameterTypeRequiredDescription
chainIndexStringYes链唯一标识
addressStringYes地址信息,必填
spendStatusStringNo花费状态:
1: spending(花费中)
2: unspend(未花费)
3: spending + unspend
如果不传,默认使用 3,返回全部结果

响应参数#

txHashString交易 hash
voutindexString标识 UTXO 位于输出的第几位,和 txhash 一起,可以唯一映射指定的 UTXO
coinAmountString所有返回的 UTXO 数量,单位是聪
spendStatusString花费状态:
1: spending(花费中)
2: unspend(未花费)
containAssetsStringBitcoin 链:
1: 包含资产(目前仅支持 BTC Ordinals 铭文资产)
2: 不包含资产
3: 资产状态待定,未解析完成

其他链: 没有该信息,返回为空

请求示例#

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'
//如果不支持的链,直接提示错误

响应示例#

200
{
    "code": "0",
    "msg": "success",
    "data": [
        {
            "txHash": "5f2418f726457391a8cc5a6ebba71f8d9c039929ff0540d6e3c35b02ac98215f",
            "vout": 1,
            "coinAmount": "4652871",
            "spendStatus":"1",
            "includeExtra":"1",
            "extra":{}
        }
    ]
}