查询地址交易列表#
获取交易列表,仅返回近1万条交易数据。
请求路径#
GET
https://web3.okx.com/api/v5/xlayer/address/transaction-list请求参数#
| 参数名 | 类型 | 是否必须 | 描述 |
|---|---|---|---|
| chainShortName | String | 是 | 公链缩写符号,例如 XLAYER |
| address | String | 是 | 地址 |
| protocolType | String | 否 | 不同类型的交易 交易:transaction 内部交易:internal 20代币:token_20 721代币:token_721 1155代币:token_1155 10代币:token_10 trx转账:trx 默认是transaction |
| tokenContractAddress | String | 否 | 代币合约地址 |
| startBlockHeight | String | 否 | 开始搜索的区块号 |
| endBlockHeight | String | 否 | 结束搜索的区块号 |
| isFromOrTo | String | 否 | from,筛选from地址为查询地址的交易;to,筛选to地址为查询地址的交易; |
| page | String | 否 | 页码,默认返回第一页 |
| limit | String | 否 | 返回条数,默认返回最近的20条,最多100条 |
响应参数#
| 参数名 | 类型 | 描述 |
|---|---|---|
| page | String | 当前页码 |
| limit | String | 当前页共多少条数据 |
| totalPage | String | 总共多少页 |
| chainFullName | String | 公链全称,例如:X Layer |
| chainShortName | String | 公链缩写符号,例如:XLAYER |
| transactionLists | Array | 交易列表 |
| > txId | String | 交易哈希 |
| > methodId | String | 方法 |
| > blockHash | String | 区块哈希 |
| > height | String | 交易发生的区块 |
| > transactionTime | String | 交易时间,pending交易返回广播时间;Unix时间戳的毫秒数格式,如 1597026383085 |
| > from | String | 发送方地址 |
| > to | String | 接收方地址 |
| > isFromContract | Bol | From地址是否是合约地址 |
| > isToContract | Bol | To地址是否是合约地址 |
| > amount | String | 交易数量 |
| > transactionSymbol | String | 交易数量对应的币种 |
| > txFee | String | 手续费 |
| > state | String | 交易状态 success 成功 fail 失败 pending 等待确认 |
| > tokenId | String | NFT的ID |
| > tokenContractAddress | String | 交易数量对应的币种的合约地址 |
| > challengeStatus | String | 挑战期状态 |
| > l1OriginHash | String | L1执行交易哈希 |
请求示例#
shell
curl --location --request GET 'https://web3.okx.com/api/v5/xlayer/address/transaction-list?chainShortName=xlayer&address=0x69c236e021f5775b0d0328ded5eac708e3b869df&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",
"transactionLists": [
{
"txId": "0x6bb9fe97af19ba7a3c887b3f96be59031a6d7026fbc1252113753d5aaedf3c6c",
"methodId": "0x9871efa4",
"blockHash": "0xe3a02cf4636b6f7442e3e5b6c2a8f4400b1f1bb68bc99b742a7c116e61a0f474",
"height": "31117930",
"transactionTime": "1755483543000",
"from": "0xd0f04833849ba63938f3bafefb55646fa642fee9",
"to": "0x69c236e021f5775b0d0328ded5eac708e3b869df",
"isFromContract": false,
"isToContract": true,
"amount": "0",
"transactionSymbol": "OKB",
"txFee": "0.000187223000748892",
"state": "fail",
"tokenId": "",
"tokenContractAddress": "",
"challengeStatus": "",
"l1OriginHash": ""
}
]
}
]
}
