Expose paginated token price history through the public HTTP service
This commit is contained in:
@@ -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: 后续点及是否还有数据
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user