feat: add demo trading support#1610
Conversation
There was a problem hiding this comment.
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
demoparameter 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.
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.
* update gitignore * bump version * feat: add demo trading support * update url * add futures helper methods * update conf test * fix missing url * 8911 * rm proxy none * update ws_futures_demo_url * skip failing test and update options symbol * remove 3.7 * temporarly only test 3.12 * add several fixes including parallel testing * fix failing tests * run all tox versions * update proxy on github action * add timeout * fix ws proxy * add proxy fix for async ws client * add fix for for options tests * fix failing tests * fix lint * run all tox versions * add max parallel to 1 * skip ws proxy for py37 * comment options test for py37 * remove 3.7 * increase max parallel to 2 --------- Co-authored-by: Pablo <pablo@criadoperez.com>
Uh oh!
There was an error while loading. Please reload this page.