> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lfg.rich/llms.txt
> Use this file to discover all available pages before exploring further.

# 公开 API

> 集成可使用的 LFG.RICH 公开 API。

LFG.RICH App 提供 BSC 公开 API，用于代币列表、代币详情、交易、K 线、余额、投资组合、借款仓位、推荐和合约配置。

<CardGroup cols={2}>
  <Card title="代币" icon="coins">
    列表、搜索、筛选并查看官方 LFG.RICH 代币。
  </Card>

  <Card title="市场活动" icon="chart-line">
    读取交易、K 线、价格、成交量、地板价和活动 feed。
  </Card>

  <Card title="协议配置" icon="gear">
    获取集成使用的公共合约地址和 ABI payload。
  </Card>

  <Card title="用户数据" icon="wallet">
    在公共端点开放的范围内读取投资组合和用户状态数据。
  </Card>
</CardGroup>

基础路径：

```txt theme={null}
/api/bsc
```

## 代币接口

| 接口                                      | 描述        |
| --------------------------------------- | --------- |
| `GET /api/bsc`                          | 代币列表。     |
| `GET /api/bsc/:address`                 | 代币详情。     |
| `GET /api/bsc/:address/trades`          | 代币交易。     |
| `GET /api/bsc/:address/candles`         | 图表 K 线。   |
| `GET /api/bsc/:address/balance/:wallet` | 某钱包的代币余额。 |
| `GET /api/bsc/creator/:wallet`          | 某钱包创建的代币。 |

## 投资组合接口

| 接口                                        | 描述      |
| ----------------------------------------- | ------- |
| `GET /api/bsc/portfolio/:wallet/summary`  | 投资组合摘要。 |
| `GET /api/bsc/portfolio/:wallet`          | 持仓代币。   |
| `GET /api/bsc/portfolio/:wallet/activity` | 钱包近期活动。 |
| `GET /api/bsc/portfolio/:wallet/borrows`  | 借款仓位。   |

## 推荐接口

| 接口                                  | 描述      |
| ----------------------------------- | ------- |
| `GET /api/bsc/referrals/:wallet`    | 推荐面板数据。 |
| `GET /api/bsc/referrals/code/:code` | 解析推荐码。  |

## 配置接口

| 接口                                       | 描述                  |
| ---------------------------------------- | ------------------- |
| `GET /api/bsc/config/native-price`       | App 使用的 BNB/USD 价格。 |
| `GET /api/bsc/config/contracts`          | 合约地址和人类可读 ABI。      |
| `GET /api/bsc/jsonconfig/contracts`      | 合约地址和 JSON ABI。     |
| `GET /api/bsc/config/owner-data/:wallet` | 连接钱包的管理员所有权数据。      |

API 响应可能随 App 演进而变化。集成应容忍额外字段，不应假设未记录字段会永久保持不变。
