---
title: "工作区"
description: "本指南介绍如何使用 Fystack API 获取工作区统计与分析数据。"
url: https://docs.fystack.io/zh/workspaces
last_updated: 2026-11-13
---

> ## Documentation index
> Fetch the complete documentation index at: https://docs.fystack.io/llms.txt
> Use it to discover all available pages before exploring further.

# 工作区

工作区为你的区块链业务提供集中视图，包括钱包统计、交易量、网络手续费以及智能合约活动。

---

## 获取工作区统计数据

**Endpoint:** `GET /workspaces/{workspace_id}/stats`

获取指定工作区的全面统计与分析数据，包括交易量、网络手续费、钱包数量以及智能合约活动。

### 路径参数

- `workspace_id` (string): 要获取统计数据的工作区 UUID。

### 响应

- `success` (boolean): 表示请求是否成功。
- `message` (string): 描述操作结果的消息。
- `code` (integer): 表示结果状态的数字代码（0 表示成功）。
- `data` (object): 包含工作区统计数据。
  - `total_value` (string): 工作区中所有资产的总价值（USD）。
  - `total_wallets` (integer): 该工作区中的钱包总数。
  - `total_smart_contracts` (integer): 该工作区中已部署的智能合约总数。
  - `total_pending_transactions` (integer): 当前待处理的交易数量。
  - `daily_volume_stats` (array): 过去 8 天的每日交易量统计数组。
    - `id` (object): 每日统计的日期标识。
      - `day` (integer): 当月的第几天。
      - `month` (integer): 月份（1-12）。
    - `total` (string): 当天的总交易量（USD）。
    - `total_inflow_usd` (string): 流入交易总量（USD）。
    - `total_outflow_usd` (string): 流出交易总量（USD）。
  - `monthly_stats` (array): 每月交易统计数组。
    - `id` (object): 每月统计的日期标识。
      - `month` (integer): 月份（1-12）。
      - `year` (integer): 年份。
    - `total_transaction` (integer): 当月的交易总笔数。
    - `total_volume` (string): 当月的总交易量（USD）。
  - `monthly_total_fee_spent_per_network` (array): 每月网络手续费支出数组，按区块链网络细分。
    - `id` (object): 手续费记录的标识。
      - `month` (integer): 月份（1-12）。
      - `network_id` (string): 区块链网络的 UUID。
      - `year` (integer): 年份。
    - `total_fee_spent` (string): 以网络原生代币计的手续费总支出。
    - `value` (string): 以 USD 计的手续费总支出。
    - `network` (object): 网络详情。
      - `name` (string): 区块链网络名称（例如 "Ethereum"、"Solana mainnet"、"Base"）。
      - `native_currency` (string): 网络原生代币的符号（例如 "ETH"、"SOL"）。

> **Info.** 每日交易量统计显示最近 8 天的交易活动，每月统计则按月提供交易量和交易笔数的历史视图。

**Request** `GET /workspaces/{workspace_id}/stats`

```bash
curl -X GET https://api.fystack.io/api/v1/workspaces/ffb8c9d1-0bd2-4c30-bf4f-2a8fe7710d51/stats \
  -H "ACCESS-API-KEY: your_api_key" \
  -H "ACCESS-TIMESTAMP: 1667836889" \
  -H "ACCESS-SIGN: YourBase64EncodedSignature=="
```

```json
{
  "success": true,
  "message": "success",
  "code": 0,
  "data": {
    "total_value": "1534.84534320254792485502487275776",
    "total_wallets": 39,
    "total_smart_contracts": 0,
    "total_pending_transactions": 0,
    "daily_volume_stats": [
      {
        "id": {
          "day": 16,
          "month": 11
        },
        "total": "0",
        "total_inflow_usd": "0",
        "total_outflow_usd": "0"
      },
      {
        "id": {
          "day": 15,
          "month": 11
        },
        "total": "0",
        "total_inflow_usd": "0",
        "total_outflow_usd": "0"
      },
      {
        "id": {
          "day": 14,
          "month": 11
        },
        "total": "0",
        "total_inflow_usd": "0",
        "total_outflow_usd": "0"
      },
      {
        "id": {
          "day": 13,
          "month": 11
        },
        "total": "0",
        "total_inflow_usd": "0",
        "total_outflow_usd": "0"
      },
      {
        "id": {
          "day": 12,
          "month": 11
        },
        "total": "0",
        "total_inflow_usd": "0",
        "total_outflow_usd": "0"
      },
      {
        "id": {
          "day": 11,
          "month": 11
        },
        "total": "0",
        "total_inflow_usd": "0",
        "total_outflow_usd": "0"
      },
      {
        "id": {
          "day": 10,
          "month": 11
        },
        "total": "0",
        "total_inflow_usd": "0",
        "total_outflow_usd": "0"
      },
      {
        "id": {
          "day": 9,
          "month": 11
        },
        "total": "0",
        "total_inflow_usd": "0",
        "total_outflow_usd": "0"
      }
    ],
    "monthly_stats": [
      {
        "id": {
          "month": 2,
          "year": 2025
        },
        "total_transaction": 1,
        "total_volume": "3.0232548466894343"
      },
      {
        "id": {
          "month": 3,
          "year": 2025
        },
        "total_transaction": 0,
        "total_volume": "0"
      },
      {
        "id": {
          "month": 4,
          "year": 2025
        },
        "total_transaction": 2,
        "total_volume": "5.38689432482736497038665"
      },
      {
        "id": {
          "month": 5,
          "year": 2025
        },
        "total_transaction": 2,
        "total_volume": "3.4820715177482234"
      },
      {
        "id": {
          "month": 6,
          "year": 2025
        },
        "total_transaction": 3,
        "total_volume": "6016.123408531333541256"
      },
      {
        "id": {
          "month": 7,
          "year": 2025
        },
        "total_transaction": 24,
        "total_volume": "716.62394897558719889991228"
      },
      {
        "id": {
          "month": 8,
          "year": 2025
        },
        "total_transaction": 0,
        "total_volume": "0"
      },
      {
        "id": {
          "month": 9,
          "year": 2025
        },
        "total_transaction": 19,
        "total_volume": "61.99795033878070467252234"
      },
      {
        "id": {
          "month": 10,
          "year": 2025
        },
        "total_transaction": 2,
        "total_volume": "10.997992387864311"
      },
      {
        "id": {
          "month": 11,
          "year": 2025
        },
        "total_transaction": 0,
        "total_volume": "0"
      }
    ],
    "monthly_total_fee_spent_per_network": [
      {
        "id": {
          "month": 7,
          "network_id": "ab3553b6-1472-4ee2-bbb7-7a3df71db90d",
          "year": 2025
        },
        "total_fee_spent": "0.000000408265132",
        "value": "0.0012847633534240739867953232",
        "network": {
          "name": "Base",
          "native_currency": "ETH"
        }
      },
      {
        "id": {
          "month": 7,
          "network_id": "8ae1f43f-d428-484d-8ad4-ee9ccc65a9ac",
          "year": 2025
        },
        "total_fee_spent": "0.00004",
        "value": "0.0055775034112016304",
        "network": {
          "name": "Solana mainnet",
          "native_currency": "SOL"
        }
      },
      {
        "id": {
          "month": 6,
          "network_id": "8ae1f43f-d428-484d-8ad4-ee9ccc65a9ac",
          "year": 2025
        },
        "total_fee_spent": "0.000005",
        "value": "0.0006971879264002038",
        "network": {
          "name": "Solana mainnet",
          "native_currency": "SOL"
        }
      },
      {
        "id": {
          "month": 4,
          "network_id": "8ae1f43f-d428-484d-8ad4-ee9ccc65a9ac",
          "year": 2025
        },
        "total_fee_spent": "0.00001",
        "value": "0.0013943758528004076",
        "network": {
          "name": "Solana mainnet",
          "native_currency": "SOL"
        }
      },
      {
        "id": {
          "month": 6,
          "network_id": "dd21bfb5-f809-4070-a789-18ec8abbee1b",
          "year": 2025
        },
        "total_fee_spent": "0.0001131949830806",
        "value": "0.35621157589674587496249666856",
        "network": {
          "name": "Ethereum",
          "native_currency": "ETH"
        }
      },
      {
        "id": {
          "month": 2,
          "network_id": "dd21bfb5-f809-4070-a789-18ec8abbee1b",
          "year": 2025
        },
        "total_fee_spent": "0.0000294725852381",
        "value": "0.09274683159711570977946276556",
        "network": {
          "name": "Ethereum",
          "native_currency": "ETH"
        }
      },
      {
        "id": {
          "month": 9,
          "network_id": "8ae1f43f-d428-484d-8ad4-ee9ccc65a9ac",
          "year": 2025
        },
        "total_fee_spent": "0.00001",
        "value": "0.0013943758528004076",
        "network": {
          "name": "Solana mainnet",
          "native_currency": "SOL"
        }
      },
      {
        "id": {
          "month": 5,
          "network_id": "8ae1f43f-d428-484d-8ad4-ee9ccc65a9ac",
          "year": 2025
        },
        "total_fee_spent": "0.00001",
        "value": "0.0013943758528004076",
        "network": {
          "name": "Solana mainnet",
          "native_currency": "SOL"
        }
      },
      {
        "id": {
          "month": 6,
          "network_id": "ab3553b6-1472-4ee2-bbb7-7a3df71db90d",
          "year": 2025
        },
        "total_fee_spent": "0.000000012727953",
        "value": "0.0000400534023035403443967228",
        "network": {
          "name": "Base",
          "native_currency": "ETH"
        }
      }
    ]
  }
}
```

---

## 按代币符号获取工作区余额

**Endpoint:** `GET /workspaces/{workspace_id}/balances`

按一个或多个资产符号筛选查询工作区余额。该 endpoint 会汇总指定符号在所有网络上的余额，提供资产持有情况的统一视图。

### 路径参数

- `workspace_id` (string): 要获取余额的工作区 UUID。

### 查询参数

- `symbol` (string): 用于筛选的资产符号（例如 USDC、SOL、ETH）。可多次指定以查询多个符号：`?symbol=USDC&symbol=SOL&symbol=ETH`

### 响应

- `success` (boolean): 表示请求是否成功。
- `message` (string): 描述操作结果的消息。
- `code` (integer): 表示结果状态的数字代码（0 表示成功）。
- `data` (array): 按符号分组的余额信息数组。
  - `symbol` (string): 资产符号（例如 "USDC"、"SOL"、"ETH"）。
  - `total_balance` (string): 该资产在所有网络上的总余额。
  - `total_value_usd` (string): 该资产以 USD 计的总价值。
  - `total_wallet_count` (integer): 持有该资产的钱包总数。
  - `networks` (array): 按网络划分的余额信息数组。
    - `asset_id` (string): 资产的 UUID。
    - `asset_name` (string): 资产名称（例如 "USDC Sepolia test"）。
    - `asset_logo` (string): 资产 logo 图片的 URL。
    - `network_id` (string): 区块链网络的 UUID。
    - `network_name` (string): 区块链网络名称（例如 "Sepolia Ethereum Testnet"、"Solana devnet"）。
    - `network_logo` (string): 网络 logo 图片的 URL。
    - `balance` (string): 该资产在此网络上的余额。
    - `wallet_count` (integer): 在此网络上持有该资产的钱包数量。

> **Info.** 你可以通过重复 `symbol` 参数在单个请求中查询多个符号。响应会按符号对余额进行分组，并显示其在不同网络上的分布。

**Request** `GET /workspaces/{workspace_id}/balances`

```bash
curl -X GET "https://api.fystack.io/api/v1/workspaces/ffb8c9d1-0bd2-4c30-bf4f-2a8fe7710d51/balances?symbol=USDC&symbol=SOL" \
  -H "ACCESS-API-KEY: your_api_key" \
  -H "ACCESS-TIMESTAMP: 1667836889" \
  -H "ACCESS-SIGN: YourBase64EncodedSignature=="
```

```json
{
  "success": true,
  "message": "success",
  "code": 0,
  "data": [
    {
      "symbol": "SOL",
      "total_balance": "0.22379716",
      "total_value_usd": "29.8080102529293016511548",
      "total_wallet_count": 7,
      "networks": [
        {
          "asset_id": "d10f85c1-a89d-439f-b488-57cd06b064d5",
          "asset_name": "Solana dev net",
          "asset_logo": "https://upload.wikimedia.org/wikipedia/en/b/b9/Solana_logo.png",
          "network_id": "2e89cd02-8585-47b3-90e3-a92185f6ca5f",
          "network_name": "Solana devnet",
          "network_logo": "https://upload.wikimedia.org/wikipedia/en/b/b9/Solana_logo.png",
          "balance": "0.22379716",
          "wallet_count": 7
        }
      ]
    },
    {
      "symbol": "USDC",
      "total_balance": "36515.008265",
      "total_value_usd": "36510.1973390962088334367595",
      "total_wallet_count": 25,
      "networks": [
        {
          "asset_id": "f1be472d-1338-43ff-b547-06faba7ecce7",
          "asset_name": "USDC Sepolia test",
          "asset_logo": "https://assets-cdn.trustwallet.com/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",
          "network_id": "23d13c03-1f3c-4e2a-9aef-1771a244b7f6",
          "network_name": "Sepolia Ethereum Testnet",
          "network_logo": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR-lzp6jMVVHdxHiK4q5Xy2FbJIrC-GPmTREA&s",
          "balance": "33426.996114",
          "wallet_count": 16
        },
        {
          "asset_id": "af836c8e-3199-426d-bb00-17ae3a5c2f5a",
          "asset_name": "USDC-Test",
          "asset_logo": "https://s2.coinmarketcap.com/static/img/coins/64x64/3408.png",
          "network_id": "2e89cd02-8585-47b3-90e3-a92185f6ca5f",
          "network_name": "Solana devnet",
          "network_logo": "https://upload.wikimedia.org/wikipedia/en/b/b9/Solana_logo.png",
          "balance": "35.012151",
          "wallet_count": 5
        },
        {
          "asset_id": "60cd62ac-f100-42aa-a16e-d1a8ed28e39f",
          "asset_name": "USDC( Tron testnet)",
          "asset_logo": "https://assets-cdn.trustwallet.com/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",
          "network_id": "c5725221-fa98-4d6c-a6ca-8c5cd65cd884",
          "network_name": "Tron testnet",
          "network_logo": "https://s2.coinmarketcap.com/static/img/coins/64x64/1958.png",
          "balance": "3053",
          "wallet_count": 4
        }
      ]
    }
  ]
}
```
