Add new methods to Binance API class #373
Open
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.
Add new methods to
API
class inbinance/api.py
to fetch server time, exchange information, and order book.API Class Enhancements
get_server_time
method to fetch server time from the Binance API.get_exchange_info
method to fetch exchange information from the Binance API.get_order_book
method to fetch the order book for a specific symbol from the Binance API.Error Handling Enhancements
ExchangeError
class to handle errors related to exchange information.OrderBookError
class to handle errors related to fetching the order book.Utility Functions Enhancements
validate_symbol
function to validate the format of a trading symbol.parse_order_book
function to parse the order book data returned by the Binance API.WebSocket Manager Enhancements
subscribe_to_agg_trades
method to subscribe to aggregate trade streams.subscribe_to_kline
method to subscribe to kline/candlestick streams.subscribe_to_order_book
method to subscribe to order book streams.For more details, open the Copilot Workspace session.