Vývojářský portál
Motiv

Get Cross-chain Transaction List#

Get the list of cross-chain transactions between X Layer and TradeZone with optional filtering by block range, address, sender, recipient, and token contract.

Request Path#

GET
https://web3.okx200.com/api/v5/xlayer/tz/cross/transaction-list

Request Parameters#

ParameterTypeRequiredDescription
chainShortNameStringYesThe abbreviated name of the blockchain network, e.g, TRADE_ZONE
txidStringNoFilter by transaction hash
heightIntegerNoFilter by block height
startBlockHeightLongNoStart block height (inclusive)
endBlockHeightLongNoEnd block height (inclusive)
addressStringNoFilter cross-chain transactions involving this address
fromStringNoFilter by sender address
toStringNoFilter by recipient address
tokenContractAddressStringNoFilter by token contract address
limitIntegerNoThe number of results returned per request. The maximum is 100. The default is 20.
pageIntegerNoPage number, default 1

Response Parameters#

ParameterTypeDescription
pageStringCurrent page number
limitStringNumber of results per page
totalPageStringTotal number of pages
totalStringTotal number of records
dataArrayCross-chain transaction list
> 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

Request Example#

shell
curl --location --request GET 'https://web3.okx200.com/api/v5/xlayer/tz/cross/transaction-list?chainShortName=TRADE_ZONE&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": "334",
            "total": "334",
            "data": [
                {
                    "id": "",
                    "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"
                }
            ]
        }
    ]
}