查询地址普通交易列表#
获取地址相关的普通交易列表。
请求路径#
GET
https://web3.okx.com/api/v5/xlayer/address/normal-transaction-list请求参数#
| 参数名 | 类型 | 是否必须 | 描述 |
|---|---|---|---|
| chainShortName | String | 是 | 公链缩写符号,例如 XLAYER |
| address | 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 | 交易哈希 |
| > methodId | String | 方法 |
| > nonce | String | 发起者地址发起的第几笔交易 |
| > gasPrice | String | gas价格 |
| > gasLimit | String | gas限额 |
| > gasUsed | String | gas消耗 |
| > blockHash | String | 区块哈希 |
| > height | String | 交易发生的区块 |
| > transactionTime | String | 交易时间;Unix时间戳的毫秒数格式,如 1597026383085 |
| > from | String | 发送方地址 |
| > to | String | 接收方地址 |
| > isFromContract | Bol | From地址是否是合约地址 |
| > isToContract | Bol | To地址是否是合约地址 |
| > amount | String | 交易数量 |
| > symbol | String | 交易数量对应的币种 |
| > txFee | String | 手续费 |
| > state | String | 交易状态 success 成功 fail 失败 pending 等待确认 |
| > transactionType | String | 交易类型 0:原始交易类型 1:EIP2930 2:EIP1559 |
请求示例#
shell
curl --location --request GET 'https://web3.okx.com/api/v5/xlayer/address/normal-transaction-list?chainShortName=xlayer&limit=1&address=0x69c236e021f5775b0d0328ded5eac708e3b869df' \
--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": "10000",
"transactionList": [
{
"txId": "0xac13f71830c237aaae8debab0a37ed03c5baf3525c76d5fd2dcb3a20ca201ae2",
"methodId": "0x9871efa4",
"nonce": "7",
"gasPrice": "1017500300",
"gasLimit": "456747",
"gasUsed": "129549",
"blockHash": "0x0bfa9e97961084aa399288c81ac03e46bfc9d055ae38598ffb8e060af0c420f6",
"height": "30664630",
"transactionTime": "1755240660000",
"from": "0x7b63a9eaaa7f1e651f3dceea1c9935fab217624a",
"to": "0x69c236e021f5775b0d0328ded5eac708e3b869df",
"isFromContract": false,
"isToContract": true,
"amount": "0.05",
"symbol": "OKB",
"txFee": "0.0001318161463647",
"state": "success",
"transactionType": "0"
}
]
}
]
}
