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

# 求解器 API 概述

> 面向 LI.FI Intents 求解器的端点、身份验证与集成面。

求解器 API 是供求解器提交报价、管理账户和跟踪信誉的、需要身份验证的接口。所有求解器端点都需要 API 密钥。

<Note>
  有关面向集成商的端点（报价、订单、状态跟踪），请参阅 [Intents API 概述](/lifi-intents/intents-api/api-overview)。
</Note>

***

## 基础 URL

| 环境         | 基础 URL                    | 求解器 UI                                        |
| ---------- | ------------------------- | --------------------------------------------- |
| Production | `https://order.li.fi`     | [intents.li.fi](https://intents.li.fi/)       |
| Testnet    | `https://order-dev.li.fi` | [devintents.li.fi](https://devintents.li.fi/) |

两个环境上均可在 [`/docs`](https://order.li.fi/docs) 获取交互式 API 文档。

***

## 身份验证

所有求解器 API 端点都需要通过 `api-key` 请求头传入 API 密钥。请在上面链接的求解器 UI 中注册密钥。有关完整细节，请参阅[身份验证](/lifi-intents/authentication#solvers-api-key-required)。

```bash theme={"system"}
curl -X POST 'https://order.li.fi/quotes/submit' \
  -H 'Content-Type: application/json' \
  -H 'api-key: YOUR_SOLVER_API_KEY' \
  -d '{ ... }'
```

***

## 端点

### 报价管理

| Method | Path                 | 说明                   |
| ------ | -------------------- | -------------------- |
| `POST` | `/quotes/submit`     | 一次提交或更新最多 20 万条求解器报价 |
| `GET`  | `/solver-api/quotes` | 获取你当前已上传的报价库存        |

报价定义了你愿意填充的路由、价格曲线和金额范围。订单服务器使用你的报价来匹配意图，因此你无需响应单个报价请求。有关完整的报价格式和策略，请参阅[报价订单](/lifi-intents/for-solvers/quoting)。

### 账户管理

| Method | Path                             | 说明      |
| ------ | -------------------------------- | ------- |
| `POST` | `/solver-api/account/register`   | 注册求解器账户 |
| `POST` | `/solver-api/account/unregister` | 注销求解器账户 |

### 信誉

| Method | Path                            | 说明              |
| ------ | ------------------------------- | --------------- |
| `GET`  | `/solver-api/solver/identities` | 获取为信誉跟踪注册的求解器身份 |

有关求解器表现如何被跟踪的信息，请参阅[信誉](/lifi-intents/for-solvers/reputation)。

### 订单收集

求解器通过两种渠道接收订单：

1. **WebSocket（推荐）：** 连接到订单服务器以进行实时订单流传输。
2. **链上监控：** 监视 `InputSettlerEscrow` 或 `InputSettlerCompact` 合约上的 `Open` 事件。

有关连接细节和订单验证，请参阅[订单流](/lifi-intents/for-solvers/orderflow)。

***

## 求解器流程摘要

```
Register account → Submit quotes → Receive orders → Fill outputs → Validate via oracle → Settle
```

| 步骤               | 你要做的事                                     | 参考                                                 |
| ---------------- | ----------------------------------------- | -------------------------------------------------- |
| **注册（Register）** | 通过 `/solver-api/account/register` 创建求解器账户 | 本页                                                 |
| **报价（Quote）**    | 将库存推送到 `/quotes/submit`                   | [报价](/lifi-intents/for-solvers/quoting)            |
| **接收（Receive）**  | 连接到 WebSocket 或监控链上事件                     | [订单流](/lifi-intents/for-solvers/orderflow)         |
| **填充（Fill）**     | 通过 `OutputSettlerSimple.fill()` 交付资产      | [填充订单](/lifi-intents/for-solvers/filling-orders)   |
| **证明（Prove）**    | 通过预言机系统提交填充证明                             | [预言机系统](/lifi-intents/architecture/oracle-systems) |
| **结算（Settle）**   | 在输入结算器上调用 `finalise` 以收款                  | [结算](/lifi-intents/for-solvers/settlement)         |

***

## 后续步骤

<CardGroup cols={2}>
  <Card title="解算 LI.FI Intents" icon="gears" href="/lifi-intents/for-solvers/intro">
    完整的求解器集成指南，含订单类型与填充
  </Card>

  <Card title="报价订单" icon="chart-line" href="/lifi-intents/for-solvers/quoting">
    报价格式、价格曲线与库存管理
  </Card>

  <Card title="订单流" icon="arrows-split-up-and-left" href="/lifi-intents/for-solvers/orderflow">
    WebSocket 连接、订单验证与链上监控
  </Card>

  <Card title="身份验证" icon="key" href="/lifi-intents/authentication#solvers-api-key-required">
    API 密钥注册与环境细节
  </Card>
</CardGroup>
