开发者平台
主题

批量获取代币转移详情#

根据交易哈希批量查询交易中的代币转移(token transfer)明细,单次最多传入 20 个交易哈希(逗号分隔,重复哈希自动去重),结果通过 cursor+limit 游标分页返回。本接口仅支持 EVM 系公链。

支持的链:见获取交易 API 支持的链apiNametoken-transfer-multi)。

请求地址#

GET
https://web3.okx.com/api/v6/explorer/transaction/token-transfer-multi

请求参数#

参数名类型是否必填描述
chainIndexString链唯一标识,如 ETH 为 1、BTC 为 0;支持范围见获取交易 API 支持的链
txIdString交易哈希,多笔交易用逗号分隔,最多 20 笔;重复哈希自动去重
protocolTypeString代币协议类型:token_20、token_721、token_1155;不传时不按协议类型过滤
limitString每页返回条数,默认 20,最大 100
cursorString上次响应返回的游标;首页不传

响应参数#

参数名类型描述
limitString本页条数上限
cursorString下一页游标;空串表示没有更多。请求时原样回传,客户端不应解析或构造
transactionListArray代币转移列表
> txIdString交易哈希
> blockHashString区块哈希
> heightString区块高度
> transactionTimeString交易时间;Unix 毫秒时间戳
> fromString发送方地址
> toString接收方地址
> isFromContractBooleanfrom 地址是否是合约地址
> isToContractBooleanto 地址是否是合约地址
> amountString交易数量
> tokenIdStringNFT 的 tokenId;非 NFT 转移时为空串
> symbolString代币 symbol
> tokenContractAddressString代币合约地址

请求示例#

shell
curl --location --request GET 'https://web3.okx.com/api/v6/explorer/transaction/token-transfer-multi?chainIndex=1&txId=0x1e4996d90e77ee87f6a1a2a071603ee5d55d6dd7b272209b741ff276f4a1c34c&protocolType=token_20' \
--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": "20",
      "cursor": "",
      "transactionList": [
        {
          "txId": "0x1e4996d90e77ee87f6a1a2a071603ee5d55d6dd7b272209b741ff276f4a1c34c",
          "blockHash": "0x7c1f0d95cbc7c4c018daae6cf3cf4ffef4dee62dfc9444838f4c5122a4899c9f",
          "height": "18126486",
          "transactionTime": "1694991899000",
          "from": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
          "to": "0x5041ed759dd4afc3a72b8192c143f72f4724081a",
          "isFromContract": false,
          "isToContract": true,
          "amount": "2500",
          "tokenId": "",
          "symbol": "USDT",
          "tokenContractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7"
        }
      ]
    }
  ]
}