From 2df0a02e104772de527478d5871dc4b0c12db509 Mon Sep 17 00:00:00 2001 From: martinkersner <2312761+martinkersner@users.noreply.github.com> Date: Sun, 5 Jul 2026 10:41:01 +0000 Subject: [PATCH] chore: sync generated WS files with backend AsyncAPI spec --- datamaxi/_ws_endpoints.py | 16 ++++++++++++++++ datamaxi/_ws_models.py | 31 +++++++++++++++++++++++-------- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/datamaxi/_ws_endpoints.py b/datamaxi/_ws_endpoints.py index 682f69a..7cea47b 100644 --- a/datamaxi/_ws_endpoints.py +++ b/datamaxi/_ws_endpoints.py @@ -35,6 +35,22 @@ "subscribe": True, "unsubscribe": True, }, + "/front/liquidation/feed": { + "plan": "front", + "market": None, + "message": "LiquidationMessage", + "param": None, + "subscribe": False, + "unsubscribe": False, + }, + "/front/listing/deposit": { + "plan": "front", + "market": None, + "message": "DepositListingMessage", + "param": None, + "subscribe": True, + "unsubscribe": True, + }, "/funding-rate": { "plan": "basic", "market": None, diff --git a/datamaxi/_ws_models.py b/datamaxi/_ws_models.py index c909ee9..51ddf4b 100644 --- a/datamaxi/_ws_models.py +++ b/datamaxi/_ws_models.py @@ -12,6 +12,27 @@ from typing import Any, Dict, List, TypedDict # noqa: F401 +# source: asyncapi:payload +DepositListingMessage = TypedDict( + "DepositListingMessage", + { + "amount": float, + "amount_krw": float, + "amount_usd": float, + "asset": str, + "block_number": int, + "chain": str, + "exchange": str, + "from_address": str, + "timestamp": int, + "to_address": str, + "tx_hash": str, + "type": int, + }, + total=False, +) + + # source: asyncapi:payload ForexMessage = TypedDict( "ForexMessage", @@ -34,7 +55,6 @@ "f": float, "i": int, "id": str, - "p": int, "q": str, "s": str, }, @@ -62,18 +82,15 @@ "LiquidationMessage", { "b": str, - "d": str, + "d": int, "e": str, "id": str, "p": float, - "pa": str, "pfiat": float, - "pt": Dict[str, Any], "pusd": float, "q": str, "s": str, "sd": str, - "src": str, "v": float, "vfiat": float, "vusd": float, @@ -101,14 +118,12 @@ "OpenInterestMessage", { "b": str, - "d": str, + "d": int, "e": str, "id": str, "oi": float, "oifiat": float, "oiusd": float, - "pa": str, - "pt": Dict[str, Any], "q": str, "s": str, },