钱包 API
查询指定 UTXO

查询指定 UTXO#

查询 BTC 、LTC、 Doge 、BCH、Cardano 等链,指定 UTXO 下的详细数据。

请求路径#

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

请求参数#

ParameterTypeRequiredDescription
chainIndexStringYes链唯一标识
addressStringYes地址信息,必填
txhashStringYes交易哈希
voutindexStringYes标识 UTXO 位于输出的第几位,和 txhash 一起,可以唯一映射指定的 UTXO

响应参数#

ParameterTypeDescription
coinAmountStringUTXO 上的资产数量,单位是聪
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&txHash=5f2418f726457391a8cc5a6ebba71f8d9c039929ff0540d6e3c35b02ac98215f' \
--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": [
        {
            "coinAmount": "4652871",
            "spendStatus":"1",
            "includeExtra":"1"
        }
    ]
}