查询代币转帐详情#
获取链上指定代币的转账详情。
请求路径#
GET
https://web3.okx.com/api/v5/xlayer/token/transaction-list请求参数#
| 参数名 | 类型 | 是否必须 | 描述 |
|---|---|---|---|
| chainShortName | String | 是 | 公链缩写符号,例如 XLAYER |
| tokenContractAddress | String | 是 | 代币合约地址 |
| maxAmount | String | 否 | 筛选交易数量区间,最大数量 |
| minAmount | String | 否 | 筛选交易数量区间,最小数量 |
| page | String | 否 | 页码 |
| limit | String | 否 | 返回条数,默认返回最近的20条,最多100条 |
响应参数#
| 参数名 | 类型 | 描述 |
|---|---|---|
| page | String | 当前页码 |
| limit | String | 当前页共多少条数据 |
| totalPage | String | 总共多少页 |
| chainFullName | String | 公链全称,例如:X Layer |
| chainShortName | String | 公链缩写符号,例如:XLAYER |
| totalTransfer | String | 代币总转账次数 |
| transactionList | Array | 交易列表 |
| > txid | String | 交易哈希 |
| > blockHash | String | 区块哈希 |
| > height | String | 交易发生的区块高度 |
| > transactionTime | String | 交易时间;Unix时间戳的毫秒数格式,如 1597026383085 |
| > to | String | 接收方,多个地址,逗号分隔 |
| > from | String | 发送方,多个地址,逗号分隔 |
| > isFromContract | Bol | input地址是否是合约地址 |
| > isToContract | Bol | output地址是否是合约地址 |
| > amount | String | 交易数量 |
| > transactionSymbol | String | 交易数量对应的币种 |
| > methodId | String | 方法 |
| > tokenContractAddress | String | 代币合约地址 |
| > protocolType | String | 代币协议类型 |
| > state | String | 交易状态 成功:success 失败:fail 等待确认:pending |
| > tokenId | String | NFT代币ID,适用于721和1155代币 |
请求示例#
shell
curl --location --request GET 'https://web3.okx.com/api/v5/xlayer/token/transaction-list?chainShortName=xlayer&tokenContractAddress=0x1e4a5963abfd975d8c9021ce480b42188849d41d&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": [
{
"page": "1",
"limit": "1",
"totalPage": "10000",
"chainFullName": "X Layer",
"chainShortName": "XLAYER",
"totalTransfer": "1332602",
"transactionList": [
{
"txid": "0xfb049c749434287e1064cbfccc800d2c35b35b1b2659b4686a3bc6ad6efd663b",
"blockHash": "0xab788f2c037770b00ee5eade14257caa85aa92f2c7b0212329cc0e76661b1d89",
"height": "31129117",
"transactionTime": "1755489752000",
"from": "0xee796e9e58ae7b248ee34b752835b4eda11ec8a5",
"to": "0xc71f9e1de80eb505c0cb3bbf90ae6593130e5d25",
"isToContract": true,
"amount": "500",
"transactionSymbol": "USDT",
"methodId": "0x751962f6",
"tokenContractAddress": "0x1e4a5963abfd975d8c9021ce480b42188849d41d",
"protocolType": "ERC20",
"state": "success",
"tokenId": ""
}
]
}
]
}
