Portal pentru dezvoltatori
Temă

Get Normal Transactions By Address And Block#

This allows for querying ordinary transactions of up to 20 addresses at once. It is necessary to limit the starting block height and the ending block height, the difference between which cannot exceed 10,000 blocks.

Request Path#

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

Request Parameters#

ParameterTypeRequiredDescription
chainShortNameStringYesChain abbreviation
addressStringYesAddresses, up to 20 addresses separated by ,
startBlockHeightStringYesStarting block number for the search
endBlockHeightStringYesEnding block number for the search
isFromOrToStringNofrom, filter transactions where the from address is the query address. to, filter transactions where the to address is the query address
pageStringNoPage number
limitStringNoNumber of records per page, default min 20, max 100

Response Parameters#

ParameterTypeDescription
pageStringPage number
limitStringNumber of records per page, default min 20, max 100
totalPageStringTotal number of pages
transactionListArrayList of transactions
> txIdStringTransaction hash
> methodIdStringShort hash identifying the smart contract function
> nonceStringThe number of transactions initiated by the sender's address
> blockHashStringBlock hash
> heightStringBlock height of the transaction
> transactionTimeStringThe Unix timestamp of the transaction time, in milliseconds format, e.g., 1597026383085
> fromStringTransaction sender's address, multiple addresses separated by ,
> toStringTransaction receiver's address, multiple addresses separated by ,
> isFromContractBoolWhether the from address is a contract address
> isToContractBoolWhether the to address is a contract address
> amountStringToken amount
> symbolStringSymbol of the transaction token
> txFeeStringTransaction fee (in OKB)
> gasLimitStringMaximum gas amount
> gasUsedStringActual amount of gas used (in Wei)
> gasPriceStringGas price (in Wei)
> transactionTypeStringTransaction type 0:original transaction 1:EIP2930 2:EIP1559

Request Example#

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'

Response Example#

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"
                }
            ]
        }
    ]
}