查询地址代币交易列表#
获取地址相关的代币交易交易列表。
请求路径#
GET
https://web3.okx.com/api/v5/xlayer/address/token-transaction-list请求参数#
| 参数名 | 类型 | 是否必须 | 描述 |
|---|---|---|---|
| chainShortName | String | 是 | 公链缩写符号,例如 XLAYER |
| address | String | 是 | 地址 |
| protocolType | String | 是 | 代币类型,20代币:token_20,721代币:token_721,1155代币:token_1155,10代币:token_10,默认为token_20 |
| tokenContractAddress | String | 否 | 代币合约地址 |
| startBlockHeight | String | 否 | 开始区块高度 |
| endBlockHeight | String | 否 | 最终区块高度 |
| isFromOrTo | String | 否 | from,筛选from地址为查询地址的交易;to,筛选to地址为查询地址的交易; |
| page | String | 否 | 页码,默认返回第一页 |
| limit | String | 否 | 返回条数,默认返回最近的20条,最多100条 |
响应参数#
| 参数名 | 类型 | 描述 |
|---|---|---|
| page | String | 当前页码 |
| limit | String | 当前页共多少条数据 |
| totalPage | String | 总共多少页 |
| transactionList | Array | 交易列表 |
| > txId | String | 交易哈希 |
| > blockHash | String | 区块哈希 |
| > height | String | 交易发生的区块高度 |
| > transactionTime | String | 交易时间;Unix时间戳的毫秒数格式,如 1597026383085 |
| > from | String | 发送方地址 |
| > to | String | 接收方地址 |
| > isFromContract | Bol | From地址是否是合约地址 |
| > isToContract | Bol | To地址是否是合约地址 |
| > tokenContractAddress | String | 代币的合约地址 |
| > amount | String | 交易数量 |
| > symbol | String | 交易数量对应的币种 |
| > tokenId | String | NFT 的ID |
请求示例#
shell
curl --location --request GET 'https://web3.okx.com/api/v5/xlayer/address/token-transaction-list?chainShortName=xlayer&address=0x1e4a5963abfd975d8c9021ce480b42188849d41d&protocolType=token_20&limit=1' \
--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'
响应示例#
json
{
"code": "0",
"msg": "",
"data": [
{
"limit": "1",
"page": "1",
"totalPage": "22",
"transactionList": [
{
"txId": "0x7fe5534171a274293b6c4fa84dd4364fe108d0df3991f65258ce1a5921a4e2ab",
"blockHash": "0x339f1013e5ec02b33c99ce77c96758f4ca09db1a779e544f12384413f3f2959d",
"height": "23681833",
"transactionTime": "1752298217000",
"from": "0x6fe6dc264e1c8bfa06909ee847a744b37bb346df",
"to": "0x1e4a5963abfd975d8c9021ce480b42188849d41d",
"tokenContractAddress": "0x1e4a5963abfd975d8c9021ce480b42188849d41d",
"tokenId": "",
"amount": "20.58",
"symbol": "USDT",
"isFromContract": true,
"isToContract": true
}
]
}
]
}
