You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use Binance MessageRouter subscribe payload instead of WsMessage::Subscribe #40
BinanceWs currently calls WsClient::subscribe(...) (defined in ccxt-core/src/ws_client/mod.rs), which serializes the generic WsMessage::Subscribe enum as
The repository already contains a correct implementation in ccxt-exchanges/src/binance/ws/handlers.rs::MessageRouter::subscribe(), which builds the Binance-specific JSON and calls client.send(...) directly. However, nothing uses MessageRouter — BinanceWs still goes through WsClient::subscribe, so the Binance-specific format is never actually sent.
Because of that, Binance rejects important streams such as funding rate updates and other symbol-specific streams, and existing integration tests (e.g., ccxt-exchanges/tests/binance_ws_subscribe_payload_test.rs) need the true Binance payload.
Suggested fix
Wire BinanceWs to create/connect a MessageRouter (or otherwise use the same serde_json::json!({ "method": "SUBSCRIBE", "params": streams, "id": ... }) payload) for every subscribe/unsubscribe path so that the correct Binance-format JSON goes over the wire. Keeping or expanding the existing payload test will prevent regressions once the router is used.
Activity
Praying commentedon Jan 25, 2026
@daniil4udo Thank you for your feedback. I've made some adjustments based on your comments. If you have time, I'd like to review them with you. PR42
daniil4udo commentedon Jan 26, 2026
That was very fast @Praying ! Lets see what you've got
Praying commentedon Jan 30, 2026
@daniil4udo I've released v0.1.4 of ccxt-rust, I think it should have fixed the issue you raised, try it if you have time https://crates.io/crates/ccxt-rust