Portal para programadores
Tema

Get Block Transaction List#

Get the list of transactions in a block under the blockchain.

Request Path#

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

Request Parameters#

ParameterTypeRequiredDescription
chainShortNameStringYesThe abbreviated name of the blockchain network, e.g, XLAYER
heightStringYesHeight
protocolTypeStringNoProtocol type transaction: normal transaction internal: internal transaction token_20 token_721 token_1155 token_10 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
blockListArrayBlock 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?chainShortName=xlayer&height=31118669&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": "4",
            "chainFullName": "X Layer",
            "chainShortName": "XLAYER",
            "blockList": [
                {
                    "txid": "0xc2ff505188032d2aee7b5debeac40fdc54bed3f25dfded07093aebb74dbd7841",
                    "methodId": "0xa53711f9",
                    "blockHash": "0xb697649cd67e790749dee213a430e40c109565d7cc76db631032330365ab4550",
                    "height": "31118669",
                    "transactionTime": "1755483959000",
                    "from": "0x2aff4f126e0c44a565583edbf512be316e13883f",
                    "isFromContract": false,
                    "isToContract": true,
                    "to": "0x47fc11bbe1fef8f07d5797f3b2b43345417603bd",
                    "amount": "0",
                    "transactionSymbol": "OKB",
                    "txfee": "0.000274528",
                    "state": "success",
                    "tokenId": "",
                    "tokenContractAddress": ""
                }
            ]
        }
    ]
}