钱包 API
查询地址交易列表

查询地址交易列表#

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

请求路径#

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

请求参数#

ParameterTypeRequiredDescription
addressStringYes具体某条链的账户地址
chainsArrayYes可传入不同 EVM chainIndex 的序号,实现批量查看不同 EVM 链的交易列表
beginStringNo开始时间,查询晚于该时间的交易历史。Unix 时间戳,用毫秒表示
endStringNo结束时间,查询早于该时间的交易历史。若 begin 和 end 都不传,查询当前时间以前的交易历史。Unix 时间戳,用毫秒表示
cursorStringNo游标
limitStringNo返回条数,默认返回最近的 20 条,最多 100 条

响应参数#

ParameterTypeDescription
transactionListArray交易列表
>chainIndexString链 ID
>txHashString交易 hash
>iTypeStringEVM 交易的层级类型
0:外层主链币转移
1:合约内层主链币转移
2:token转移
>methodIdString合约调用函数
>nonceString发起者地址发起的第几笔交易
>txTimeString交易时间;Unix时间戳的毫秒数格式,如 1597026383085
>fromArray交易输入
>>addressString发送/输入地址,多签交易时,逗号分隔
>>amountString输入数量
>toArray交易输出
>>addressString接收。输出地址,多签交易时,逗号分隔
>>amountString输出数量
>tokenAddressString代币的合约地址
>amountString交易数量
>symbolString交易数量对应的币种
>txFeeString手续费
>txStatusString交易状态、success 成功、fail 失败、pending 等待确认
>hitBlacklistBooleanfalse:不是黑名单 true:是黑名单
>tagString黑地址标签类型,包括貔貅盘、网络钓鱼以及合约漏洞等类型
cursorString游标

请求示例#

shell
curl --location --request GET 'https://www.okx.com/api//v5/wallet/post-transaction/transactions-by-address?address=0x50c476a139aab23fdaf9bca12614cdd54a4244e4&chains=1'\
--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": [
        {
            "cursor": "1706197403",
            "transactionList": [
                {
                    "chainIndex": "1",
                    "txHash": "0x963767695543cfb7804039c470b110b87adf9ab69ebc002b571523b714b828ca",
                    "methodId": "",
                    "nonce": "",
                    "txTime": "1724213411000",
                    "from": [
                        {
                            "address": 
                                "0xae7ab96520de3a18e5e111b5eaab095312d7fe84"
                                "amount": ""
                        }
                    ],
                    "to": [
                        {
                            "address": 
                                "0x50c476a139aab23fdaf9bca12614cdd54a4244e4"
                                "amount": ""
                        }
                    ],
                    "tokenAddress": "0xe13c851c331874028cd8f681052ad3367000fb13",
                    "amount": "1",
                    "symbol": "claim rewards on stethdao.net",
                    "txFee": "",
                    "txStatus": "success",
                    "hitBlacklist": true,
                    "tag": "Risk Airdrop",
                    "itype": "2"
                }
            ]
        }
    ]
}