资产

资产(Asset)代表 Fystack 在不同区块链网络上支持的加密代币和币种。你可以按网络、符号和白名单状态等多种条件查询资产。

资产信息

Fystack 中的每个资产都包含该代币的完整信息:

资产属性

  • 代币标识:唯一 ID、名称、符号和合约地址
  • 所属网络:资产所在的区块链网络
  • 资产类型:代币标准(ERC20、TRC20、native 等)
  • 白名单状态:资产是否已被批准在平台上使用
  • 价格:当前美元价格及最后更新时间戳
  • 视觉:用于显示的 logo URL

获取资产列表

GET
/assets

该 endpoint 用于获取所有支持网络上的加密资产。这是一个无需认证的公开 endpoint。

参数

  • Name
    network_id
    Type
    string (uuid)
    Description

    按网络 UUID 筛选资产。例如,?network_id=c03b242f-5091-499c-86c5-78dbc47ed719 只会返回 BNB 主网上的资产。

  • Name
    search
    Type
    string
    Description

    按名称或符号搜索资产。例如,?search=USDC 会返回与 "USDC" 匹配的资产。

  • Name
    is_native
    Type
    boolean
    Description

    按原生资产筛选。设置为 true 时仅返回原生币(ETH、BNB 等),设置为 false 时仅返回代币。

  • Name
    is_whitelisted
    Type
    boolean
    Description

    按白名单状态筛选。设置为 true 时仅返回已加入白名单、获准在平台上使用的资产。

  • Name
    offset
    Type
    integer
    Description

    开始收集结果集之前跳过的条目数。最大值:100000。

  • Name
    limit
    Type
    integer
    Description

    限制每页返回的条目数。最大值:1000。

响应

  • Name
    success
    Type
    boolean
    Description

    表示请求是否成功。

  • Name
    message
    Type
    string
    Description

    描述操作结果的消息。

  • Name
    code
    Type
    integer
    Description

    表示结果状态的数字代码(0 表示成功)。

  • Name
    data
    Type
    array
    Description

    资产对象数组。

  • Name
    id
    Type
    string
    Description

    资产的 UUID。

  • Name
    created_at
    Type
    string
    Description

    资产被添加到系统中的时间戳。

  • Name
    updated_at
    Type
    string
    Description

    资产最后一次更新的时间戳。

  • Name
    name
    Type
    string
    Description

    资产的完整显示名称。

  • Name
    symbol
    Type
    string
    Description

    资产的代币符号(例如 USDC、ETH)。

  • Name
    decimals
    Type
    integer
    Description

    资产的小数位数。

  • Name
    logo_url
    Type
    string
    Description

    资产 logo 图片的 URL。

  • Name
    address
    Type
    string
    Description

    资产的合约地址。原生币为空。

  • Name
    asset_type
    Type
    string
    Description

    代币标准或类型。可以是 erc20、trc20、native 等。

  • Name
    is_native
    Type
    boolean
    Description

    是否为该网络的原生币。

  • Name
    address_type
    Type
    string
    Description

    地址格式类型。可以是 evm、tron 等。

  • Name
    is_whitelisted
    Type
    boolean
    Description

    资产是否已加入白名单并获准在平台上使用。

  • Name
    network_id
    Type
    string
    Description

    该资产所属网络的 UUID。

  • Name
    network
    Type
    object
    Description

    包含网络详情的完整网络对象。

  • Name
    network.id
    Type
    string
    Description

    网络的 UUID。

  • Name
    network.name
    Type
    string
    Description

    网络的显示名称。

  • Name
    network.chain_id
    Type
    integer
    Description

    网络唯一的链标识符。

  • Name
    network.native_currency
    Type
    string
    Description

    网络原生币的符号。

  • Name
    network.is_evm
    Type
    boolean
    Description

    网络是否兼容 EVM。

  • Name
    network.explorer_tx
    Type
    string
    Description

    交易浏览器链接的 URL 模板。

  • Name
    network.explorer_address
    Type
    string
    Description

    地址浏览器链接的 URL 模板。

  • Name
    network.explorer_token
    Type
    string
    Description

    代币浏览器链接的 URL 模板。

  • Name
    price_usd
    Type
    string
    Description

    资产当前的美元价格。

  • Name
    price_usd_updated_at
    Type
    string
    Description

    美元价格最后一次更新的时间戳。

该 endpoint 是公开的,无需认证。你可以在没有 API 凭证的情况下使用它获取资产信息。

请求

GET
/assets
curl -X GET "https://api.fystack.io/api/v1/assets?search=USDC"

Response

200
{
  "success": true,
  "message": "success",
  "code": 0,
  "data": [
    {
      "id": "bf130274-e80c-43f3-aac3-c7dbfcbd74cd",
      "created_at": "2026-01-21T12:27:39.902081+07:00",
      "updated_at": "2026-01-21T12:27:39.902081+07:00",
      "name": "USDC (Binance-Peg USD Coin)",
      "symbol": "USDC",
      "decimals": 18,
      "logo_url": "https://bscscan.com/token/images/centre-usdc_28.png",
      "address": "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
      "asset_type": "erc20",
      "is_native": false,
      "address_type": "evm",
      "is_whitelisted": true,
      "network_id": "c03b242f-5091-499c-86c5-78dbc47ed719",
      "network": {
        "id": "c03b242f-5091-499c-86c5-78dbc47ed719",
        "created_at": "2024-11-03T20:18:36.254727+07:00",
        "updated_at": "2025-08-22T08:32:32.534204+07:00",
        "name": "BNB Mainnet",
        "description": "BNB Mainnet",
        "is_evm": true,
        "chain_id": 56,
        "native_currency": "BNB",
        "internal_code": "BSC_MAINNET",
        "explorer_tx": "https://bscscan.com/tx/%s",
        "explorer_address": "https://bscscan.com/address/%s",
        "explorer_token": "https://bscscan.com/token/%s",
        "confirmation_blocks": 12,
        "block_interval_in_seconds": 3.2,
        "disabled": false,
        "logo_url": "https://s2.coinmarketcap.com/static/img/coins/64x64/1839.png"
      },
      "price_usd": "1",
      "price_usd_updated_at": "2026-02-03T06:47:55.879075+07:00"
    },
    {
      "id": "a52495a7-39b3-4ee9-9a94-e461e2057748",
      "created_at": "2026-01-09T11:09:23.092265+07:00",
      "updated_at": "2026-01-09T11:15:12.374079+07:00",
      "name": "Bridged USDC on Lisk",
      "symbol": "USDC",
      "decimals": 6,
      "logo_url": "https://assets-cdn.trustwallet.com/blockchains/base/assets/0xEB466342C4d449BC9f53A865D5Cb90586f405215/logo.png",
      "address": "0xF242275d3a6527d877f2c927a82D9b057609cc71",
      "asset_type": "erc20",
      "is_native": false,
      "address_type": "evm",
      "is_whitelisted": true,
      "network_id": "d2d90216-2530-4704-bc58-48719dacb76f",
      "network": {
        "id": "d2d90216-2530-4704-bc58-48719dacb76f",
        "created_at": "2026-01-08T11:58:34.277954+07:00",
        "updated_at": "2026-01-08T11:58:34.277954+07:00",
        "name": "Lisk",
        "description": "Lisk is an Ethereum Layer-2 blockchain network.",
        "is_evm": true,
        "chain_id": 1135,
        "native_currency": "ETH",
        "is_testnet": true,
        "internal_code": "LISK_MAINNET",
        "explorer_tx": "https://blockscout.lisk.com/tx/%s",
        "explorer_address": "https://blockscout.lisk.com/address/%s",
        "explorer_token": "https://blockscout.lisk.com/token/%s",
        "confirmation_blocks": 5,
        "block_interval_in_seconds": 2,
        "disabled": false,
        "logo_url": "https://avatars.githubusercontent.com/u/16600915?s=200&v=4"
      },
      "price_usd": "1",
      "price_usd_updated_at": "2026-02-03T06:47:55.879075+07:00"
    }
  ]
}

向钱包添加资产

PUT
/wallets/{wallet_id}/asset/{asset_id}

该 endpoint 用于向钱包添加资产,使钱包可以持有和接收该资产。如果该资产之前已被移除,它会被自动恢复。

钱包必须已拥有支持该资产所在网络的地址类型。例如,添加 ERC-20 代币要求钱包拥有 EVM 地址。

路径参数

  • Name
    wallet_id
    Type
    string (uuid)
    Description

    要添加资产的钱包的 UUID。

  • Name
    asset_id
    Type
    string (uuid)
    Description

    要添加的资产的 UUID。

响应

  • Name
    success
    Type
    boolean
    Description

    表示请求是否成功。

  • Name
    message
    Type
    string
    Description

    描述操作结果的消息。

  • Name
    code
    Type
    integer
    Description

    表示结果状态的数字代码(0 表示成功)。

  • Name
    data
    Type
    object
    Description

    钱包资产记录。

  • Name
    id
    Type
    string
    Description

    钱包资产记录的 UUID。

  • Name
    wallet_id
    Type
    string
    Description

    钱包的 UUID。

  • Name
    asset_id
    Type
    string
    Description

    资产的 UUID。

  • Name
    deposit_address
    Type
    string
    Description

    该钱包上为此资产分配的充值地址。

如果钱包中已存在该资产,则返回现有记录。重新添加之前移除的资产会将其恢复,而不会创建重复记录。

请求

PUT
/wallets/:wallet_id/asset/:asset_id
curl -X PUT https://api.fystack.io/api/v1/wallets/c2b71329-34c9-45aa-89d3-ddde8b15dec5/asset/bf130274-e80c-43f3-aac3-c7dbfcbd74cd \
  -H "ACCESS-API-KEY: your_api_key" \
  -H "ACCESS-TIMESTAMP: 1667836889" \
  -H "ACCESS-SIGN: YourBase64EncodedSignature=="

Response

200
{
  "success": true,
  "message": "success",
  "code": 0,
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "wallet_id": "c2b71329-34c9-45aa-89d3-ddde8b15dec5",
    "asset_id": "bf130274-e80c-43f3-aac3-c7dbfcbd74cd",
    "deposit_address": "0xA793457d84CFD255Ed68295984300C4f799E759F",
    "hidden": false
  }
}

从钱包移除资产

DELETE
/wallets/{wallet_id}/asset/{asset_id}

该 endpoint 用于从钱包中移除资产。只有当资产余额为零时才能移除。如果该资产仍有资金,你必须先将其转出或提现。

路径参数

  • Name
    wallet_id
    Type
    string (uuid)
    Description

    要移除资产的钱包的 UUID。

  • Name
    asset_id
    Type
    string (uuid)
    Description

    要移除的资产的 UUID。

响应

  • Name
    success
    Type
    boolean
    Description

    表示请求是否成功。

  • Name
    message
    Type
    string
    Description

    描述操作结果的消息。

  • Name
    code
    Type
    integer
    Description

    表示结果状态的数字代码(0 表示成功)。

无法移除余额不为零的资产。请在移除资产前转出或提现所有资金。

请求

DELETE
/wallets/:wallet_id/asset/:asset_id
curl -X DELETE https://api.fystack.io/api/v1/wallets/c2b71329-34c9-45aa-89d3-ddde8b15dec5/asset/bf130274-e80c-43f3-aac3-c7dbfcbd74cd \
  -H "ACCESS-API-KEY: your_api_key" \
  -H "ACCESS-TIMESTAMP: 1667836889" \
  -H "ACCESS-SIGN: YourBase64EncodedSignature=="

Response

200
{
  "success": true,
  "message": "success",
  "code": 0,
  "data": null
}

常见使用场景

查找稳定币

查找各网络上的所有稳定币(如 USDC 和 USDT):

curl -X GET "https://api.fystack.io/api/v1/assets?search=USD&is_whitelisted=true"

获取原生币

获取所有原生币(ETH、BNB 等)用于 gas 估算:

curl -X GET "https://api.fystack.io/api/v1/assets?is_native=true"

列出特定网络上的资产

获取特定网络(例如 BNB 主网)上所有可用的资产:

curl -X GET "https://api.fystack.io/api/v1/assets?network_id=c03b242f-5091-499c-86c5-78dbc47ed719&is_whitelisted=true"

分页

对于较大的结果集,请使用分页分批获取资产:

# First page
curl -X GET "https://api.fystack.io/api/v1/assets?limit=50&offset=0"

# Second page
curl -X GET "https://api.fystack.io/api/v1/assets?limit=50&offset=50"