查询地址代币交易列表#

获取地址相关的代币交易交易列表。

请求路径#

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

请求参数#

参数名类型是否必须描述
chainShortNameString公链缩写符号,例如 XLAYER
addressString地址
protocolTypeString代币类型,20代币:token_20,721代币:token_721,1155代币:token_1155,10代币:token_10,默认为token_20
tokenContractAddressString代币合约地址
startBlockHeightString开始区块高度
endBlockHeightString最终区块高度
isFromOrToStringfrom,筛选from地址为查询地址的交易;to,筛选to地址为查询地址的交易;
pageString页码,默认返回第一页
limitString返回条数,默认返回最近的20条,最多100条

响应参数#

参数名类型描述
pageString当前页码
limitString当前页共多少条数据
totalPageString总共多少页
transactionListArray交易列表
> txIdString交易哈希
> blockHashString区块哈希
> heightString交易发生的区块高度
> transactionTimeString交易时间;Unix时间戳的毫秒数格式,如 1597026383085
> fromString发送方地址
> toString接收方地址
> isFromContractBolFrom地址是否是合约地址
> isToContractBolTo地址是否是合约地址
> tokenContractAddressString代币的合约地址
> amountString交易数量
> symbolString交易数量对应的币种
> tokenIdStringNFT 的ID

请求示例#

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'

响应示例#

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
                }
            ]
        }
    ]
}