Skip to content

Commit f6af5d8

Browse files
Sync generated WS files with backend AsyncAPI spec (#191)
* chore: sync generated WS files with backend AsyncAPI spec * fix(ws): drop announcement_internal accessor (channel spec-excluded) Backend AsyncAPI spec no longer emits /announcement/listing/internal, so the regenerated WS_CHANNELS drops it and the hand-written client's announcement_internal Subscription failed _require_channel at construction, breaking every WS client test. Remove the accessor and its docstring/README/docs rows to match the generated surface.
1 parent 09529f1 commit f6af5d8

6 files changed

Lines changed: 2 additions & 31 deletions

File tree

‎README.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,6 @@ you can also read the expected shape at runtime via `ws.<channel>.param_format`.
572572
| `ws.liquidation` | `subscribe(*p)` | `SYMBOL@exchange` | Basic |
573573
| `ws.liquidation_feed` | `stream()` | — (firehose, no params) | Basic |
574574
| `ws.announcement` | `subscribe()` | — (no params) | Pro+ |
575-
| `ws.announcement_internal` | `subscribe()` | — (no params) | Pro+ |
576575

577576
### Multiplexing and filtering
578577

‎datamaxi/_ws_endpoints.py‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,6 @@
1919
"subscribe": True,
2020
"unsubscribe": True,
2121
},
22-
"/announcement/listing/internal": {
23-
"plan": "pro_plus",
24-
"market": None,
25-
"message": "InternalListingMessage",
26-
"param": None,
27-
"subscribe": True,
28-
"unsubscribe": True,
29-
},
3022
"/forex": {
3123
"plan": "basic",
3224
"market": None,

‎datamaxi/_ws_models.py‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,6 @@
6262
)
6363

6464

65-
# source: asyncapi:payload
66-
InternalListingMessage = TypedDict(
67-
"InternalListingMessage",
68-
{
69-
"b": str,
70-
"d": int,
71-
"e": str,
72-
"s": str,
73-
"t": str,
74-
"u": str,
75-
},
76-
total=False,
77-
)
78-
79-
8065
# source: asyncapi:payload
8166
LiquidationMessage = TypedDict(
8267
"LiquidationMessage",

‎datamaxi/aio/ws.py‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
Channels (accessors driven by the generated ``WS_CHANNELS`` registry):
2424
``ticker`` (market-keyed), ``forex``, ``premium``, ``funding_rate``,
2525
``open_interest``, ``liquidation`` (subscribe), ``liquidation_feed``
26-
(firehose, no params), ``announcement`` / ``announcement_internal`` (Pro+).
26+
(firehose, no params), ``announcement`` (Pro+).
2727
2828
Consumes the **generated** WS surface — ``WS_CHANNELS`` / ``WS_BASE_PATH`` /
2929
``WS_AUTH_HEADER`` from ``datamaxi._ws_endpoints`` and the per-channel message
@@ -419,7 +419,7 @@ class AsyncDatamaxiWS:
419419
Accessors are driven by the generated ``WS_CHANNELS`` registry:
420420
``ticker`` (market-keyed), ``forex``, ``premium``, ``funding_rate``,
421421
``open_interest``, ``liquidation`` (subscribe), ``liquidation_feed``
422-
(firehose), ``announcement`` / ``announcement_internal`` (Pro+).
422+
(firehose), ``announcement`` (Pro+).
423423
424424
Use as an async context manager so open connections are closed, or call
425425
:meth:`aclose` explicitly.
@@ -449,9 +449,6 @@ def __init__(
449449
self.liquidation = Subscription(self, "/liquidation")
450450
self.liquidation_feed = Feed(self, "/liquidation/feed")
451451
self.announcement = Subscription(self, "/announcement/listing")
452-
self.announcement_internal = Subscription(
453-
self, "/announcement/listing/internal"
454-
)
455452

456453
async def _conn(self, path: str) -> AsyncWSConnection:
457454
conn = self._conns.get(path)

‎docs/websocket.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ strings shown below; you can also inspect the expected format at runtime via
5353
| `ws.liquidation` | `subscribe(*p)` | `SYMBOL@exchange` | Basic |
5454
| `ws.liquidation_feed` | `stream()` | — (firehose, no params) | Basic |
5555
| `ws.announcement` | `subscribe()` | — (no params) | Pro+ |
56-
| `ws.announcement_internal` | `subscribe()` | — (no params) | Pro+ |
5756

5857
`ticker` is market-keyed — pass `market="spot"` (default) or `market="futures"`.
5958
The announcement channels require a **Pro+** plan.

‎tests/test_ws.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ def test_ws_every_channel_has_a_generated_model_and_accessor():
6363
"liquidation",
6464
"liquidation_feed",
6565
"announcement",
66-
"announcement_internal",
6766
):
6867
assert hasattr(ws, name), f"client missing ws.{name}"
6968

0 commit comments

Comments
 (0)