查询钱包下有所有或某条链的交易历史,按时间倒序排列。
GET https://www.okx.com/api/waas/wallet/post-transaction/transactions
Parameter | Type | Required | Description |
---|---|---|---|
accountId | String | Yes | 账户唯一标识 |
chainIndex | String | No | 链唯一标识 |
tokenAddress | String | No | 不传,则查询该链所有交易历史 传“”,查询该链主网币相关交易历史 传值,查询该链指定代币相关交易历史 |
limit | String | No | 每次查询多少条,默认值为 50,最大100 |
cursor | String | No | 游标位置,默认为第一个 |
begin | String | No | 开始时间,查询晚于该时间的交易历史。Unix 时间戳,用毫秒表示 |
end | String | No | 结束时间,查询早于该时间的交易历史。若begin和end都不传,查询当前时间以前的交易历史。Unix 时间戳,用毫秒表示 |
Parameter | Type | Description |
---|---|---|
cursor | String | 游标 |
transactions | Array | 交易列表 |
>chainIndex | String | 链唯一标识 |
>orderId | String | 交易历史唯一标识 |
>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 | 交易时间,时间戳 |
>txStatus | String | 交易状态: 1 : 排队中 2 : 成功 3 :失败 |
>assetSummary | Array | 交易概要 |
>>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?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"
}