-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat: add demo trading support #1610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add demo trading support #1610
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds demo trading support to the Binance client library, providing an alternative to the existing testnet functionality. The change introduces a new demo
parameter that can be used alongside or instead of the testnet
parameter to connect to Binance's demo trading environment.
- Adds demo URL constants for all trading endpoints (spot, futures, coin futures, websockets)
- Introduces
demo
parameter to client constructors and base client initialization - Updates URL selection logic to prioritize testnet over demo when both are enabled
- Updates documentation to reflect demo trading support and mark testnet as deprecated
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
binance/base_client.py | Adds demo URL constants and demo parameter support with URL selection logic |
binance/client.py | Adds demo parameter to synchronous client constructor |
binance/async_client.py | Adds demo parameter to asynchronous client constructor and factory method |
binance/ws/streams.py | Implements demo websocket URL selection across all socket manager methods |
README.rst | Updates documentation to mention demo trading support and mark testnet as deprecated |
Comments suppressed due to low confidence (1)
binance/client.py:8677
- The URL field has been cleared to an empty string, which appears unrelated to the demo trading feature. This change should be reverted or explained in the commit message if intentional.
"url": "",
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
binance/client.py:8748
- [nitpick] The URL field has been cleared to an empty string. This could cause issues for consumers expecting a valid URL. Consider using a placeholder URL or documenting this as intentional for demo purposes.
"url": "",
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.