查询交易列表#
获取交易列表,仅返回近1万条交易数据。
请求路径#
GET
https://web3.okx.com/api/v5/xlayer/transaction/transaction-list请求参数#
| 参数名 | 类型 | 是否必须 | 描述 |
|---|---|---|---|
| chainShortName | String | 是 | 公链缩写符号,例如 XLAYER |
| blockHash | String | 否 | 区块哈希 |
| height | String | 否 | 区块高度 |
| limit | String | 否 | 每一页返回的条数,默认返回最近的20条,最多100条 |
| page | String | 否 | 页码 |
响应参数#
| 参数名 | 类型 | 描述 |
|---|---|---|
| page | String | 当前页码 |
| limit | String | 当前页共多少条数据 |
| totalPage | String | 总共多少页 |
| chainFullName | String | 公链全称,例如:X Layer |
| chainShortName | String | 公链缩写符号,例如:XLAYER |
| transactionList | Array | 交易列表 |
| > txid | String | 交易哈希 |
| > blockHash | String | 区块哈希 |
| > height | String | 交易发生的区块高度 |
| > transactionTime | String | 交易时间;Unix时间戳的毫秒数格式,如 1597026383085 |
| > input | String | 输入地址,如果存在多个地址,以英文逗号分隔 |
| > output | String | 输出地址 ,如果存在多个地址,以英文逗号分隔 |
| > isFromContract | Bol | input地址是否是合约地址 |
| > isToContract | Bol | output地址是否是合约地址 |
| > amount | String | 交易数量 |
| > transactionSymbol | String | 交易数量对应的币种 |
| > txfee | String | 手续费 |
| > methodId | String | 方法 |
| > transactionType | String | 交易类型0:原始交易类型 1:EIP2930 2:EIP1559 |
| > state | String | 交易状态 success 成功 fail 失败 pending 等待确认 |
请求示例#
shell
curl --location --request GET 'https://web3.okx.com/api/v5/xlayer/transaction/transaction-list?limit=1&chainShortName=xlayer' \
--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",
"transactionList": [
{
"txid": "0x7db1728b0825fe747a0fbea9e5c5a07fec01e77c8684a6e2df912db408189dc7",
"blockHash": "0x6af529ac10583632da1ad9a74ed5f303c52c7ed98b3d35590c8be9f3d1ace7f9",
"height": "31136625",
"transactionTime": "1755494041000",
"input": "0xf6ead32d92fb5ad6b99749f9083e20d58bdcdcdc",
"output": "0x99594db61870ef0bc825547b242114488e32521e",
"isInputContract": false,
"isOutputContract": true,
"amount": "0",
"transactionSymbol": "OKB",
"txfee": "0.000277729000277729",
"methodId": "0x786809ad",
"transactionType": "0",
"state": "success"
}
]
}
]
}
