Portal deweloperski
Motyw

Get Transaction Details By Hash#

Get the basic transaction information on the chains.

Request Path#

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

Request Parameters#

ParameterTypeRequiredDescription
chainShortNameStringYesThe abbreviated name of the blockchain network, e.g, XLAYER
txidStringYesTransaction hash, batch query up to 20 transactions, separated by English commas.

Response Parameters#

ParameterTypeDescription
chainFullNameStringThe full name of the blockchain network, e.g. X Layer
chainShortNameStringThe abbreviated name of the blockchain network, e.g. XLAYER
txidStringTransaction hash
heightStringBlock height of the transaction
transactionTimeStringThe Unix timestamp of the transaction time, in milliseconds format, e.g., 1597026383085
transactionTypeStringTransaction type 0:original transaction 1:EIP2930 2:EIP1559
amountStringTransaction amount
methodIdStringMethod ID
errorLogStringTransaction failure logs
inputDataStringInput data
transactionSymbolStringToken symbol of the transaction
txfeeStringTransaction fee
indexStringThe position index of the transaction in the block
confirmStringConfirmed block count
inputDetailsArrayInput details
> inputHashStringThe hash address that initiated the transaction
> isContractBolContract address truefalse
> amountStringTransaction amount
outputDetailsArrayOutput details
> outputHashStringThe hash address to receive the transaction
> isContractBolContract address truefalse
> amountStringTransaction amount
stateStringTransaction state success fail pending
gasLimitStringGas limit
gasUsedStringActual amount of gas used
gasPriceStringGas price
totalTransactionSizeStringTotal transaction size
virtualSizeStringVirtual size
weightStringWeight
nonceStringThe number of transactions initiated by the sender's address
isAaTransactionBolWhether it is an AA transaction
tokenTransferDetailsArrayToken transfer details. Request the new interface GET /api/v5/xlayer/transaction/internal-transaction-detail and GET /api/v5/xlayer/transaction/token-transaction-detail to query more transaction data
> indexStringThe positional index of the transaction in the block
> tokenStringToken name
> tokenContractAddressStringToken contract address
> symbolStringToken symbol
> fromStringToken transfer out address
> toStringToken arrival address
> isFromContractBolIs the transfer out token address a contract address
> isToContractBolWhether the receiving token address is a contract address
> tokenIdStringNFT token id
> amountStringToken transfer amount
contractDetailsArrayContract call transfer details
> indexStringThe positional index of the transaction in the block
> fromStringToken transfer out address
> toStringToken arrival address
> isFromContractBolIs the transfer out token address a contract address
> isToContractBolIs the receiving token address a contract address
> amountStringTransaction amount
> gasLimitStringGas limit

Request Example#

shell
curl --location --request GET 'https://web3.okx.com/api/v5/xlayer/transaction/transaction-fills?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": [
        {
            "chainFullName": "X Layer",
            "chainShortName": "XLAYER",
            "txid": "0x88c719ff4e6be26a81d642f5bbc6408e64dbd3dfdc9ef170a14d4fcf1c1db10c",
            "height": "31136282",
            "transactionTime": "1755493834000",
            "amount": "0.25830859001436063",
            "transactionSymbol": "OKB",
            "txfee": "0.000021",
            "index": "2",
            "confirm": "7",
            "inputDetails": [
                {
                    "inputHash": "0x55bd572ece54c253888f96bb1722fbc237c6936f",
                    "isContract": false,
                    "amount": ""
                }
            ],
            "outputDetails": [
                {
                    "outputHash": "0xd6e86442e5227bd135cf656be48117d43ce92e3b",
                    "isContract": false,
                    "amount": ""
                }
            ],
            "state": "success",
            "gasLimit": "21000",
            "gasUsed": "21000",
            "gasPrice": "0.000000001",
            "totalTransactionSize": "",
            "virtualSize": "428",
            "weight": "",
            "nonce": "6",
            "transactionType": "0",
            "methodId": "",
            "errorLog": "",
            "inputData": "0x",
            "isAaTransaction": false,
            "tokenTransferDetails": [],
            "contractDetails": []
        }
    ]
}