查询指定地址区块普通交易列表#
可以批量查询最多20个地址的普通交易,需要限制查询的开始区块高度以及结束的区块高度,两者差距不能超过10000个区块。
请求路径#
GET
https://web3.okx.com/api/v5/xlayer/address/normal-transaction-list-multi请求参数#
| 参数名 | 类型 | 必须 | 描述 |
|---|---|---|---|
| chainShortName | String | 是 | 公链缩写符号,例如 XLAYER |
| address | String | 是 | 地址,最多可以输入20个地址,以,分隔 |
| startBlockHeight | String | 是 | 开始搜索的区块号 |
| endBlockHeight | String | 是 | 结束搜索的区块号 |
| isFromOrTo | String | 否 | from,筛选from地址为查询地址的交易;to,筛选to地址为查询地址的交易 |
| page | String | 否 | 页码 |
| limit | String | 否 | 每页返回的数据条数,默认最小20条,最多100条 |
响应参数#
| 参数名 | 类型 | 描述 |
|---|---|---|
| page | String | 页码 |
| limit | String | 每页返回的数据条数,默认最小20条,最多100条 |
| totalPage | String | 总共的页数 |
| transactionList | Array | 交易列表 |
| > txId | String | 交易哈希 |
| > methodId | String | 标识智能合约函数的短哈希 |
| > blockHash | String | 区块哈希 |
| > height | String | 交易发生的区块高度 |
| > transactionTime | String | 交易发生的时间;Unix时间戳的毫秒数格式,如1597026383085 |
| > from | String | 交易发送方的地址,多个地址,以,分隔 |
| > to | String | 交易接受方的地址,多个地址,以,分隔 |
| > isFromContract | Bol | from地址是否是合约地址 |
| > isToContract | Bol | to地址是否是合约地址 |
| > amount | String | 代币数量 |
| > symbol | String | 交易代币的符号 |
| > txFee | String | 交易的手续费(单位ETH) |
| > gasLimit | String | gas最大使用量 |
| > gasUsed | String | 实际的gas使用量(单位Wei) |
| > gasPrice | String | gas价格(单位Wei) |
| > nonce | String | 发起者地址发起的第几笔交易 |
| > transactionType | String | 交易类型 0:原始交易类型 1:EIP2930 2:EIP1559 |
请求示例#
shell
curl --location --request GET 'https://web3.okx.com/api/v5/xlayer/address/normal-transaction-list-multi?chainShortName=xlayer&address=0x69c236e021f5775b0d0328ded5eac708e3b869df,0xa1d2c4533d867ce4623681f68df84d9cad73cb6b&endBlockHeight=30666228&startBlockHeight=30666225' \
--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": "20",
"totalPage": "1",
"transactionList": [
{
"txId": "0x05203bf6a5537085f04f9aea12df9cb0dd84e838e2b9a176507dd268d240c546",
"methodId": "0xb80c2f09",
"blockHash": "0x0544b739806c5c28e953e6cba7be1df160407a083a9e295dc2900e6c338f43dc",
"height": "30666228",
"transactionTime": "1755241379000",
"from": "0xb574f51e9f1ff7df6b0965a49a5656b30d2d9dab",
"to": "0x69c236e021f5775b0d0328ded5eac708e3b869df",
"isFromContract": false,
"isToContract": true,
"amount": "0",
"symbol": "OKB",
"txFee": "0.0002503569034629",
"gasLimit": "920976",
"gasUsed": "230490",
"gasPrice": "1086194210",
"nonce": "1",
"transactionType": "0"
}
]
}
]
}
