Portal pentru dezvoltatori
Temă

Batch Get Cross-chain Transactions#

Batch query the detail of multiple cross-chain transactions. A maximum of 20 transaction hashes can be queried in a single request.

Request Path#

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

Request Parameters#

ParameterTypeRequiredDescription
chainShortNameStringYesThe abbreviated name of the blockchain network, e.g, TRADE_ZONE
txIdStringYesComma-separated list of cross-chain transaction hashes (TradeZone side). Max 20 per request.

Response Parameters#

ParameterTypeDescription
idStringCross-chain transaction hash
txTypeStringTransaction direction: XLayerToTZ / TZToXLayer
crossTypeStringOperation type: Deposit / Withdraw / BatchWithdraw
statusStringTransaction status: 0x1 success / 0x0 failure
xlayerTxHashStringXLayer transaction hash
xlayerBlockHeightStringXLayer block height
xlayerBlockTimeStringXLayer block time (ms)
tzTxHashStringTZ transaction hash
tzBlockHeightStringTZ block height
tzBlockTimeStringTZ block time (ms)
fromStringLink-layer signer address
toStringTransaction destination address
sourceAddressStringActual sender address
targetAddressStringActual recipient address
valueStringCross-chain amount (token precision applied)
valueRawStringCross-chain amount (raw integer, smallest unit)
tokenContractAddressStringToken contract address
tokenTypeStringToken type: ERC20 / ERC1155
tokenIdStringToken ID, only returned for ERC-1155
tokenNameStringToken name
tzEventIndexStringTZ event index (block-wide unique, equivalent to EVM logIndex)
tzBlockHashStringTZ block hash
batchDetailStringBatch withdrawal detail JSON string (empty for non-batch records)
updateTimeStringLast update time of the record (ms)
blockHeightStringPublishing-side block height

Request Example#

shell
curl --location --request GET 'https://web3.okx.com/api/v5/xlayer/tz/cross/transaction-multi?chainShortName=TRADE_ZONE&txId=0x6029262cf3b3f9a9c0ca1f2600f94b9c77a7b5d76cf625ac00d65992245afa69' \
--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": [
        {
            "id": "0x83494ba71664be7566ceff70fad8d80addbd5e86286055a6261bc3260322f23d",
            "txType": "XLayerToTZ",
            "crossType": "Deposit",
            "status": "0x1",
            "xlayerTxHash": "0x83494ba71664be7566ceff70fad8d80addbd5e86286055a6261bc3260322f23d",
            "xlayerBlockHeight": "60344989",
            "xlayerBlockTime": "1779114025000",
            "tzTxHash": "0x6029262cf3b3f9a9c0ca1f2600f94b9c77a7b5d76cf625ac00d65992245afa69",
            "tzBlockHeight": "20790237",
            "tzBlockTime": "1779114025417",
            "from": "0x7ad674c0595de0885f7335b8dcaa91ca5d1723e5",
            "to": "0xe87356f600529dc2d17ac420a1bd478f17af91f9",
            "sourceAddress": "0xf593d6073a1028ac457d02b202251f0e71fffc75",
            "targetAddress": "0xe87356f600529dc2d17ac420a1bd478f17af91f9",
            "value": "500000000",
            "valueRaw": "500000000000000",
            "tokenContractAddress": "0xf593d6073a1028ac457d02b202251f0e71fffc75",
            "tokenType": "ERC20",
            "tokenId": "",
            "tokenName": "PT",
            "tzEventIndex": "0",
            "tzBlockHash": "0x1c41b3fe0cccbc947342d5b76e0b0fdab589a3d6a5ea46f33f593267a0802054",
            "batchDetail": "",
            "updateTime": "1779114025417",
            "blockHeight": "20790237"
        }
    ]
}