Utvecklingsportal
Tema

Batch Get Transactions By Hash#

This allows for querying transactions of up to 20 transaction at once.

Request Path#

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

Request Parameters#

ParameterTypeRequiredDescription
chainShortNameStringYesThe abbreviated name of the blockchain network, e.g. XLAYER
txIdArrayYesTransaction hash , multiple transactions separated by , Maximum 20 txIds

Response Parameters#

ParameterTypeDescription
txIdStringTransaction hash
blockHashStringBlock hash
heightStringBlock height
transactionTimeStringTransaction time;Unix timestamp format in milliseconds
fromStringSender address
toStringRecipient address
isFromContractBolIs the From address a contract address
isToContractBolIs the To address a contract address
amountStringTransaction amount
symbolStringToken symbol
nonceStringThe number of transactions initiated by the sender's address
gasLimitStringGas limit
gasUsedStringActual amount of gas used
gasPriceStringGas price
txFeeStringTransaction Fees
stateStringTrading state
transactionTypeStringTransaction type 0:original transaction 1:EIP2930 2:EIP1559
methodIdStringMethod ID
> isFromContractBolIs the From address a contract address
> isToContractBolIs the To address a contract address
> amountStringTransaction amount
> stateStringtrading state success fail pending
> methodStringMethod ID
> symbolStringSymbol
> nonceStringNonce
> gasUsedStringGas
> gasLimitStringGas limit
> gasPriceStringGas avg price
> txFeeStringTransaction Fees
> stateStringTransaction status success fail pending

Request Example#

shell
curl --location --request GET 'https://web3.okx.com/api/v5/xlayer/transaction/transaction-multi?chainShortName=xlayer&txId=0x88c719ff4e6be26a81d642f5bbc6408e64dbd3dfdc9ef170a14d4fcf1c1db10c' \
--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": [
        {
            "txId": "0x88c719ff4e6be26a81d642f5bbc6408e64dbd3dfdc9ef170a14d4fcf1c1db10c",
            "methodId": "",
            "blockHash": "0x3ad8f2db660966e4f5b1bc54fb16e7d10ce43d23831f3ded93f27b5f8e1fa343",
            "height": "31136282",
            "transactionTime": "1755493834000",
            "from": "0x55bd572ece54c253888f96bb1722fbc237c6936f",
            "to": "0xd6e86442e5227bd135cf656be48117d43ce92e3b",
            "isFromContract": false,
            "isToContract": false,
            "amount": "0.258308590014360608",
            "symbol": "OKB",
            "nonce": "6",
            "txFee": "0.000021",
            "gasPrice": "1000000000",
            "gasLimit": "21000",
            "gasUsed": "21000",
            "state": "success",
            "transactionType": "0"
        }
    ]
}