Any2Any 整合商
跨鏈聚合走 獨立 host(<aggregator-api-host>),使用 X-Integrator-Api-Key 下單。
| 接口 | 鑑權 | 用途 |
|---|---|---|
GET /api/v2/quote/stream | 無 | SSE 詢價 |
POST /api/v1/integrator/orders | X-Integrator-Api-Key | 按下單 |
POST /api/v1/integrator/orders/:orderNo/request_refund | 同上 | 對已參與訂單退款 |
金額是目標 token 最小單位整數字串。slippage 為 (0, 1),例如 0.01 = 1%。
詢價
GET /api/v2/quote/stream?src_token_id=&dst_token_id=&amount_in=&slippage= HTTP/1.1
Accept: text/event-stream
事件:channel(單通道報價)、error(單通道失敗)、done。可中途關連線。
下單
POST /api/v1/integrator/orders
X-Integrator-Api-Key: <api_key>
在詢價結果上提交 amount_in、min_acceptable_out_amount、所選 channel_id。Key 的 fee_rate 會快照進訂單。
非 SSE 回應:
{"code": 0, "msg": "ok", "data": {}}
此處 msg 是 Any2Any 自己的信封,不要當成 Gel Labs gateway 的 message。
退款
POST /api/v1/integrator/orders/:orderNo/request_refund
X-Integrator-Api-Key: <api_key>
只能退該 Key 參與過的訂單。Key 在 Any2Any 整合商後台管理。