بوابة المطوّرين
النمط

Batch Get Block Transactions#

Batch query the transaction list for certain blocks on a blockchain, and only return the latest 10,000 transaction data.

Request Path#

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

Request Parameters#

ParameterTypeRequiredDescription
chainShortNameStringYesThe abbreviated name of the blockchain network, e.g, XLAYER
startBlockHeightStringYesThe starting block height
endBlockHeightStringYesThe end block height
protocolTypeStringNoProtocol type transaction: normal transaction internal: internal transaction token_20 token_721 token_1155 The default is transaction
limitStringNoThe number of results returned per request. The maximum is 100. The default is 20.
pageStringNoPage

Response Parameters#

ParameterTypeDescription
pageStringCurrent page number
limitStringThe amount of data
totalPageStringTotal number of pages
chainFullNameStringThe full name of the blockchain network, e.g. X Layer
chainShortNameStringThe abbreviated name of the blockchain network, e.g. XLAYER
transactionListArrayBlock transaction list
> txIdStringTransaction hash
> blockHashStringBlock hash
> heightStringBlock height
> transactionTimeStringThe Unix timestamp of the transaction time, in milliseconds format, e.g., 1597026383085.
> fromStringSender address
> isFromContractBolIs the From address a contract address
> isToContractBolIs the To address a contract address
> toStringRecipient address
> amountStringNumber of transactions
> transactionSymbolStringSymbol
> txFeeStringTransaction Fees
> stateStringTransaction status success fail pending
> tokenContractAddressStringToken Contract Address
> tokenIdStringNFT token Id
> methodIdStringMethod ID

Request Example#

shell
curl --location --request GET 'https://web3.okx.com/api/v5/xlayer/block/transaction-list-multi?chainShortName=xlayer&startBlockHeight=31118669&endBlockHeight=31118670&limit=1' \
--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": "1",
            "totalPage": "12",
            "transactionList": [
                {
                    "height": "31118670",
                    "txId": "0x41c1001e8fb26edd4b2ccf9856daa0e90a0c523466bb90378529536269523619",
                    "methodId": "0xc480dd84",
                    "blockHash": "0xe5472915fcd492f0c0b65103959925888d4bae32ae008ba87bca85b48fc59225",
                    "transactionTime": "1755483960000",
                    "from": "0x4323c64481650c3edcad6be9f4feaa85931005ac",
                    "isFromContract": false,
                    "isToContract": true,
                    "to": "0xed65f249af632aba04737b570be3680e98d5ea37",
                    "amount": "0",
                    "transactionSymbol": "OKB",
                    "txFee": "0.000865481865481",
                    "state": "success",
                    "tokenId": "",
                    "tokenContractAddress": ""
                }
            ]
        }
    ]
}