Skip to content

Commit 8fdc351

Browse files
Rewrite ws_client.py against the documented WebSocket API
Replaces the previous order-book/account-only client with a full implementation of the channels documented at https://apidocs.lighter.xyz/docs/websocket-reference. The new WsClient supports every documented channel (order book, ticker, market_stats, spot_market_stats, trade, candle, all account_* streams, user_stats, notification, pool_data, pool_info, height) plus jsonapi/sendtx and jsonapi/sendtxbatch transaction submission. It keeps the existing public surface used in examples/ws.py and examples/ws_async.py (order_book_ids, account_ids, on_order_book_update, on_account_update, run(), run_async()) and adds add_* helpers, async subscribe/unsubscribe, send_tx/send_tx_batch, readonly mode, ping/pong handling, configurable WebSocket keepalive, and optional auto-reconnect.
1 parent ed7e3d0 commit 8fdc351

1 file changed

Lines changed: 757 additions & 130 deletions

File tree

0 commit comments

Comments
 (0)