钱包 API
按地址查询交易列表

按地址查询交易列表#

查询当前地址下的交易历史,时间倒序排列。

请求路径#

GET https://www.okx.com/api/waas/wallet/post-transaction/transactions-by-address

请求参数#

ParameterTypeRequiredDescription
chainIndexStringYes链唯一标识
addressStringYes地址。
tokenAddressesArrayNo代币地址列表。不填默认查询所有代币(包括主网币)
beginStringNo开始时间,查询晚于该时间的交易历史。Unix 时间戳,用毫秒表示
endStringNo结束时间,查询早于该时间的交易历史。若begin和end都不传,查询当前时间以前的交易历史。Unix 时间戳,用毫秒表示
limitStringNo每次查询多少条,默认值为 50,最大100
cursorStringNo游标位置,默认为第一个

响应参数#

ParameterTypeDescription
cursorString游标
transactionsArray交易列表
>chainIndexString链唯一标识
>orderIdStringorderId
>txHashString交易hash
>fromAddrString来源地址
>toAddrString目的地址
txTypeString交易类型(transfer):
1: 接收代币
2: 发送代币
3: 合约交互
4: 授权
50:BRC20_MINT
51:BRC20_INSCRIBE
52:BRC20_TRADE
53:BRC20_SEND
54:BRC20_RECEIVE
60:BRC20_DEPLOY
>txTimeString交易时间,UNIX 时间戳,毫秒格式。
>txStatusString交易状态:
1: 排队中
2: 成功
3:失败
>assetSummaryArray交易概要
>>tokenAddressString代币返回合约地址。主币返回空。
>>directionString代币数量变化:
1: 数量减少
2: 数量增加
>>tokenAmountString交易代币数量
>>tokenAmountNumString交易代币整数 = 交易代币数 * (10 ^ 精度)
>>precisionString精度
>>tokenSymbolString代币 symbol
>>tokenNameString代币名称
>>tokenLogoUrlString币种 logo 图片 Url(oss)
>>tokenAddressString代币地址。主网币返回空。

请求示例#

shell
curl --location --request GET 'https://www.okx.com/api/v5/waas/wallet/post-transaction/transactions-by-address?accountId=44486e05-3235-2f8e-5fe2-a8ab46217863&chains=111,333&chainIndex=1&tokenAddress=xxx&cursor=1&limit=20&begin=168000021888"&end=168000031888 \
--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",
    "data": [
        {
            "chainIndex": 3,  
            "orderId": "string", 
            "txHash": "0xcbf411766d65f3cf92839ababa73c4afec69a83442e8b67a68b5104b50a04ejb",
            "fromAddr": "0x5ffe4eabaf030jg7a1a75d309ead7ad31a0ef980",
            "toAddr": "0x5ffe4eabaf03ff67a1a75d309ead7ad31a0ef817",
            "txType": "2",
            "txTime": "0",
            "txStatus": "1",
            "assetSummary": [{
                "tokenAmount": "5.5",
                "tokenAmountNum": "5",
                "direction":"1",
                "precision": "8",
                "tokenSymbol": "ETH",
                "tokenName": "ETH",
                "tokenLogoUrl": "http://",
                "tokenAddress": ""
            }] 
        }
    ],
    "msg": "success"
}