Expose paginated event and market discovery with closed-state filters

This commit is contained in:
2026-12-03 12:00:52 +08:00
parent 6f620089b6
commit ddbb96c799
9 changed files with 433 additions and 6 deletions
+22
View File
@@ -267,3 +267,25 @@ sequenceDiagram
```
加载 [主题事件样例](../../docs/examples/topic.jsonl) 后即可按上图读取。事件与市场均支持按数字 ID 和按 slug 查询,缺失资源返回 404。路径段按 UTF-8 百分号编码,路径中的加号表示加号。当前详情入口支持无查询参数的 GET。
### 浏览目录
`GET /markets` 和 `GET /events` 返回数组。支持 limit、offset、ascending、order、active、closed,以及可重复的 id 和 slug。市场列表也支持重复的 condition_ids 和 clob_token_ids。同类标识取并集,提供多类标识时取交集。查询字符串中的加号需要编码成 %2B。
```mermaid
flowchart LR
H["market_http.rs · GET /markets 与 /events"] --> P["exchange/gamma_list.rs"] --> D["exchange/gamma_directory.rs"]
```
```mermaid
sequenceDiagram
participant C as 客户端
participant H as market-http
participant E as Exchange
C->>H: GET /events?limit=1&order=id&ascending=true
H->>E: gamma_list(Events),保留重复参数
E-->>C: 一个事件及其可见子盘
C->>H: GET /markets?slug=nvda-300&closed=any
H->>E: gamma_list(Markets),按 slug 查询开放或已关闭的盘口
E-->>C: 匹配市场数组
```