Portal para programadores
Tema

Get Token Transaction List By Address#

Get a list of token trading transactions associated with the address.

Request Path#

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

Request Parameters#

ParameterTypeRequiredDescription
chainShortNameStringYesThe abbreviated name of the blockchain network, e.g. XLAYER
addressStringYesAddress
protocolTypeStringYesToken protocol Type token_20 token_721 token_1155 token_10The default is token_20
tokenContractAddressStringNoToken contract address
startBlockHeightStringNoThe starting block height
endBlockHeightStringNoThe end block height
isFromOrToStringNofrom, filter transactions where the from address is the query address. to, filter transactions where the to address is the query address
pageStringNoPage
limitStringNoThe number of results returned per request. The maximum is 50. The default is 20.

Response Parameters#

ParameterTypeDescription
pageStringCurrent page number
limitStringThe amount of data
totalPageStringTotal number of pages
transactionListArrayTransaction list
> txIdStringTransaction hash
> blockHashStringBlock hash
> heightStringBlock height
> transactionTimeStringThe Unix timestamp of the transaction time, in milliseconds format, e.g., 1597026383085
> fromStringSender address
> toStringRecipient address
> tokenContractAddressStringToken contract address
> isFromContractBolIs the From address a contract address
> isToContractBolIs the To address a contract address
> amountStringTransaction amount
> symbolStringToken symbol
> tokenIdStringNFT token ID

Request Example#

shell
curl --location --request GET 'https://web3.okx.com/api/v5/xlayer/address/token-transaction-list?chainShortName=xlayer&address=0x1e4a5963abfd975d8c9021ce480b42188849d41d&protocolType=token_20&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": [
        {
            "limit": "1",
            "page": "1",
            "totalPage": "22",
            "transactionList": [
                {
                    "txId": "0x7fe5534171a274293b6c4fa84dd4364fe108d0df3991f65258ce1a5921a4e2ab",
                    "blockHash": "0x339f1013e5ec02b33c99ce77c96758f4ca09db1a779e544f12384413f3f2959d",
                    "height": "23681833",
                    "transactionTime": "1752298217000",
                    "from": "0x6fe6dc264e1c8bfa06909ee847a744b37bb346df",
                    "to": "0x1e4a5963abfd975d8c9021ce480b42188849d41d",
                    "tokenContractAddress": "0x1e4a5963abfd975d8c9021ce480b42188849d41d",
                    "tokenId": "",
                    "amount": "20.58",
                    "symbol": "USDT",
                    "isFromContract": true,
                    "isToContract": true
                }
            ]
        }
    ]
}