Expose paginated token price history through the public HTTP service

This commit is contained in:
2026-12-03 08:12:01 +08:00
parent 2ef0784ddc
commit 9b25fdc424
11 changed files with 292 additions and 2 deletions
+22
View File
@@ -100,3 +100,25 @@ sequenceDiagram
E-->>H: 一个数据库快照中的盘口列表
H-->>C: 单盘 JSON 对象或批量 JSON 数组
```
同一个 HTTP 监听器提供 `GET /v2/prices-history`。客户端按资产查询历史,接续页可以只发同一资产和上一页的游标。[请求样例](../../docs/examples/clob-http.http)
```mermaid
flowchart LR
main["main.rs"] --> http["market_http.rs"]
http --> history["exchange::HistoryQuery"]
```
```mermaid
sequenceDiagram
participant C as 图表客户端
participant H as market_http
participant E as Exchange
C->>H: GET /v2/prices-history 含资产与窗口
H->>E: 查询历史点与分页状态
E-->>H: data 与 pagination
H-->>C: JSON 中的 next_cursor
C->>H: 同一 token_id 和 cursor
H->>E: 读取该窗口下一页
E-->>C: 后续点及是否还有数据
```