查询指定地址区块普通交易列表#

可以批量查询最多20个地址的普通交易,需要限制查询的开始区块高度以及结束的区块高度,两者差距不能超过10000个区块。

请求路径#

GET
https://web3.okx.com/api/v5/xlayer/address/normal-transaction-list-multi

请求参数#

参数名类型必须描述
chainShortNameString公链缩写符号,例如 XLAYER
addressString地址,最多可以输入20个地址,以,分隔
startBlockHeightString开始搜索的区块号
endBlockHeightString结束搜索的区块号
isFromOrToStringfrom,筛选from地址为查询地址的交易;to,筛选to地址为查询地址的交易
pageString页码
limitString每页返回的数据条数,默认最小20条,最多100条

响应参数#

参数名类型描述
pageString页码
limitString每页返回的数据条数,默认最小20条,最多100条
totalPageString总共的页数
transactionListArray交易列表
> txIdString交易哈希
> methodIdString标识智能合约函数的短哈希
> blockHashString区块哈希
> heightString交易发生的区块高度
> transactionTimeString交易发生的时间;Unix时间戳的毫秒数格式,如1597026383085
> fromString交易发送方的地址,多个地址,以,分隔
> toString交易接受方的地址,多个地址,以,分隔
> isFromContractBolfrom地址是否是合约地址
> isToContractBolto地址是否是合约地址
> amountString代币数量
> symbolString交易代币的符号
> txFeeString交易的手续费(单位ETH)
> gasLimitStringgas最大使用量
> gasUsedString实际的gas使用量(单位Wei)
> gasPriceStringgas价格(单位Wei)
> nonceString发起者地址发起的第几笔交易
> transactionTypeString交易类型 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"
                }
            ]
        }
    ]
}