批量获取地址普通交易列表#
批量查询多个地址在指定区块区间内的普通交易列表,地址最多 50 个,区块区间跨度不得超过 10000 个区块,结果通过 cursor+limit 游标分页返回。支持 EVM 系公链及 TRON。
支持的链:见获取交易 API 支持的链(apiName:normal-transaction-list-multi)。
请求地址#
GET
https://web3.okx.com/api/v6/explorer/transaction/normal-transaction-list-multi请求参数#
| 参数名 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| chainIndex | String | 是 | 链唯一标识,如 ETH 为 1、BTC 为 0;支持范围见获取交易 API 支持的链 |
| address | String | 是 | 地址,多个地址用逗号分隔,最多 50 个;重复地址自动去重 |
| startBlockHeight | String | 是 | 起始区块高度;与 endBlockHeight 的区间跨度不得超过 10000 个区块 |
| endBlockHeight | String | 是 | 截止区块高度 |
| isFromOrTo | String | 否 | from:筛选 from 地址为查询地址的交易;to:筛选 to 地址为查询地址的交易;不传时 from/to 任一命中即返回 |
| limit | String | 否 | 每页返回条数,默认 20,最大 100 |
| cursor | String | 否 | 上次响应返回的游标;首页不传 |
响应参数#
| 参数名 | 类型 | 描述 |
|---|---|---|
| limit | String | 本页条数上限 |
| cursor | String | 下一页游标;空串表示没有更多。请求时原样回传,客户端不应解析或构造 |
| transactionList | Array | 交易列表 |
| > txId | String | 交易哈希 |
| > methodId | String | 方法 ID;非合约调用时为空串 |
| > blockHash | String | 区块哈希 |
| > height | String | 区块高度 |
| > transactionTime | String | 交易时间;Unix 毫秒时间戳 |
| > from | String | 发送方地址 |
| > to | String | 接收方地址 |
| > isFromContract | Boolean | from 地址是否为合约地址 |
| > isToContract | Boolean | to 地址是否为合约地址 |
| > amount | String | 交易金额 |
| > symbol | String | 交易金额对应的币种 symbol |
| > txFee | String | 手续费 |
| > gasLimit | String | gas 限额 |
| > gasUsed | String | gas 使用 |
| > gasPrice | String | gas 价格 |
| > nonce | String | 发起者地址发起的第几笔交易 |
| > transactionType | String | 交易类型 |
请求示例#
shell
curl --location --request GET 'https://web3.okx.com/api/v6/explorer/transaction/normal-transaction-list-multi?chainIndex=1&address=0xd8da6bf26964af9d7eed9e03e53415d37aa96045,0x282edab8a933bc1c02649fe3ea2842ecb8e26183&startBlockHeight=18717000&endBlockHeight=18718000' \
--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": "20",
"cursor": "",
"transactionList": [
{
"txId": "0x9d918f5c1b0b04b8f5b0a2e6d9c78a3f5f89f24d43be3fb4b17e58fcbb42a95b",
"methodId": "",
"blockHash": "0x4a151d9d3e1b7fca2f9f34ea70e2ae35b6f4cd8e4a1cdbedb50ac52c1c50b1af",
"height": "18717042",
"transactionTime": "1702138715000",
"from": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"to": "0x282edab8a933bc1c02649fe3ea2842ecb8e26183",
"isFromContract": false,
"isToContract": false,
"amount": "0.1",
"symbol": "ETH",
"txFee": "0.000893972405466",
"gasLimit": "21000",
"gasUsed": "21000",
"gasPrice": "42570114546",
"nonce": "1178",
"transactionType": "2"
}
]
}
]
}
