查询 BTC 、LTC、 Doge 、BCH、Cardano 等 UTXO 链指定地址下已确认的 UTXO,不返回 Pending 中的 UTXO。
按照资产大小倒序排序,最多返回 300 条。
GET https://www.okx.com/api/waas/wallet/utxo/utxos
Parameter | Type | Required | Description |
---|---|---|---|
chainIndex | String | Yes | 链唯一标识 |
address | String | Yes | 地址信息,必填 |
spendStatus | String | No | 花费状态: 1 : spending(花费中) 2 : unspend(未花费)3 : spending + unspend 如果不传,默认使用 3,返回全部结果 |
txHash | String | 交易 hash |
---|---|---|
voutindex | String | 标识 UTXO 位于输出的第几位,和 txhash 一起,可以唯一映射指定的 UTXO |
coinAmount | String | 所有返回的 UTXO 数量,单位是聪 |
spendStatus | String | 花费状态: 1 : spending(花费中) 2 : unspend(未花费) |
containAssets | String | Bitcoin 链: 1 : 包含资产(目前仅支持 BTC Ordinals 铭文资产)2 : 不包含资产 3 : 资产状态待定,未解析完成 其他链: 没有该信息,返回为空 |
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'
//如果不支持的链,直接提示错误
{
"code": "0",
"msg": "success",
"data": [
{
"txHash": "5f2418f726457391a8cc5a6ebba71f8d9c039929ff0540d6e3c35b02ac98215f",
"vout": 1,
"coinAmount": "4652871",
"spendStatus":"1",
"includeExtra":"1",
"extra":{}
}
]
}