Portal deweloperski
Motyw

Batch Get Block Transactions#

Batch query transactions across a range of TradeZone blocks. The block range (endBlockHeight - startBlockHeight) cannot exceed 10000.

Request Path#

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

Request Parameters#

ParameterTypeRequiredDescription
chainShortNameStringYesThe abbreviated name of the blockchain network, e.g, TRADE_ZONE
startBlockHeightLongYesThe starting block height (inclusive)
endBlockHeightLongYesThe end block height (inclusive).
limitIntegerNoThe number of results returned per request. The maximum is 100. The default is 20.
pageIntegerNoPage number, default 1

Response Parameters#

ParameterTypeDescription
hashStringTransaction hash
blockHeightStringBlock height
blockHashStringBlock hash
blockTimeStringBlock time (ms)
statusStringTransaction status: 0x1 success / 0x0 failure
fromStringBusiness executing user address
actionTypeStringAction type
indexStringExecution order
valueStringTransaction amount (token precision applied)
valueRawStringTransaction amount (raw integer, smallest unit)

Request Example#

shell
curl --location --request GET 'https://web3.okx.com/api/v5/xlayer/tz/block/transaction-list-multi?chainShortName=TRADE_ZONE&startBlockHeight=21225378&endBlockHeight=21225378&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": [
        {
            "hash": "0x9820e1ab0c60b13c2decc923728d79c814cad59f61a401cf69402e20e8390988",
            "blockHeight": "21225378",
            "blockHash": "0x416bcebf9f71ae4d583f7a02bc3a4761be282977778705e9fa68e4cd0b7c7df8",
            "blockTime": "1779157539517",
            "status": "0x1",
            "from": "0x4febcb57fd90a8cbadb57f162118822e0f7165c6",
            "actionType": "predictionSplit",
            "index": "0",
            "value": "",
            "valueRaw": ""
        }
    ]
}