Add stream RPC client#119
Merged
Merged
Conversation
… task/add-stream-rpc-client
There was a problem hiding this comment.
Pull request overview
This PR introduces an initial WebSocket JSON-RPC (“stream RPC”) client to the SDK, along with typed models, subscription parameter helpers, tests, and an example showing how to subscribe to public topics.
Changes:
- Added
StreamRpcClient+ dispatcher to manage RPC requests, subscriptions, and reconnections over WebSockets. - Added Stream RPC response/account/update models and new deposit/withdrawal status update models.
- Updated configuration to include a
stream_rpc_url, plus tests and an example script for RPC stream subscriptions.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| x10/models/withdrawal.py | Adds withdrawal status enum + status update model for stream/RPC updates. |
| x10/models/stream_rpc.py | Introduces Stream RPC envelope + typed models for prices/orderbooks/account updates. |
| x10/models/deposit.py | Adds deposit status enum + status update model for stream/RPC updates. |
| x10/errors.py | Adds Stream RPC-specific error types (server/connection/timeout/parse). |
| x10/core/client_config.py | Extends endpoints config with stream_rpc_url. |
| x10/config.py | Populates stream_rpc_url for sepolia/mainnet configs. |
| x10/clients/streamrpc/subscription_params.py | Adds topic parameter objects (trades/orderbooks/funding/prices/candles/account). |
| x10/clients/streamrpc/streamrpc_dispatcher.py | Adds message dispatching for RPC responses vs stream frames + handler routing. |
| x10/clients/streamrpc/streamrpc_client.py | Implements the WebSocket RPC client, reconnection loop, subscribe/unsubscribe, RPC calls. |
| x10/clients/streamrpc/init.py | Stream RPC client package initializer. |
| tests/fixtures/market.py | Adjusts market fixture booleans (isRfq, isOffHours). |
| tests/fixtures/candle.py | Adds a Stream RPC candle message fixture. |
| tests/clients/test_streamrpc_client.py | Adds an integration-style test using a mock WebSocket server. |
| tests/clients/test_rest_api_client.py | Updates expected market response booleans. |
| examples/utils.py | Adds a helper to create a StreamRpcClient from config. |
| examples/cases/stream/subscribe_to_rpc_stream.py | Adds an example that subscribes to several RPC stream topics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ex10ded
previously approved these changes
Jun 30, 2026
dmitrykrasovskih
approved these changes
Jun 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Demo