查询当前地址下的交易历史,时间倒序排列。
GET https://www.okx.com/api/waas/wallet/post-transaction/transactions-by-address
Parameter | Type | Required | Description |
---|---|---|---|
chainIndex | String | Yes | 链唯一标识 |
address | String | Yes | 地址。 |
tokenAddresses | Array | No | 代币地址列表。不填默认查询所有代币(包括主网币) |
begin | String | No | 开始时间,查询晚于该时间的交易历史。Unix 时间戳,用毫秒表示 |
end | String | No | 结束时间,查询早于该时间的交易历史。若begin和end都不传,查询当前时间以前的交易历史。Unix 时间戳,用毫秒表示 |
limit | String | No | 每次查询多少条,默认值为 50,最大100 |
cursor | String | No | 游标位置,默认为第一个 |
Parameter | Type | Description |
---|---|---|
cursor | String | 游标 |
transactions | Array | 交易列表 |
>chainIndex | String | 链唯一标识 |
>orderId | String | orderId |
>txHash | String | 交易hash |
>fromAddr | String | 来源地址 |
>toAddr | String | 目的地址 |
txType | String | 交易类型(transfer): 1 : 接收代币 2 : 发送代币 3 : 合约交互 4 : 授权 50 :BRC20_MINT 51 :BRC20_INSCRIBE 52 :BRC20_TRADE 53 :BRC20_SEND 54 :BRC20_RECEIVE 60 :BRC20_DEPLOY |
>txTime | String | 交易时间,UNIX 时间戳,毫秒格式。 |
>txStatus | String | 交易状态: 1 : 排队中 2 : 成功 3 :失败 |
>assetSummary | Array | 交易概要 |
>>tokenAddress | String | 代币返回合约地址。主币返回空。 |
>>direction | String | 代币数量变化: 1 : 数量减少 2 : 数量增加 |
>>tokenAmount | String | 交易代币数量 |
>>tokenAmountNum | String | 交易代币整数 = 交易代币数 * (10 ^ 精度) |
>>precision | String | 精度 |
>>tokenSymbol | String | 代币 symbol |
>>tokenName | String | 代币名称 |
>>tokenLogoUrl | String | 币种 logo 图片 Url(oss) |
>>tokenAddress | String | 代币地址。主网币返回空。 |
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' \
{
"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"
}