Skip to content

Add new methods to Binance API class #373

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sangshanrupesh
Copy link

@sangshanrupesh sangshanrupesh commented Apr 23, 2025

Add new methods to API class in binance/api.py to fetch server time, exchange information, and order book.

  • API Class Enhancements

    • Add get_server_time method to fetch server time from the Binance API.
    • Add get_exchange_info method to fetch exchange information from the Binance API.
    • Add get_order_book method to fetch the order book for a specific symbol from the Binance API.
  • Error Handling Enhancements

    • Add ExchangeError class to handle errors related to exchange information.
    • Add OrderBookError class to handle errors related to fetching the order book.
  • Utility Functions Enhancements

    • Add validate_symbol function to validate the format of a trading symbol.
    • Add parse_order_book function to parse the order book data returned by the Binance API.
  • WebSocket Manager Enhancements

    • Add subscribe_to_agg_trades method to subscribe to aggregate trade streams.
    • Add subscribe_to_kline method to subscribe to kline/candlestick streams.
    • Add subscribe_to_order_book method to subscribe to order book streams.

For more details, open the Copilot Workspace session.

Add new methods to `API` class in `binance/api.py` to fetch server time, exchange information, and order book.

* **API Class Enhancements**
  - Add `get_server_time` method to fetch server time from the Binance API.
  - Add `get_exchange_info` method to fetch exchange information from the Binance API.
  - Add `get_order_book` method to fetch the order book for a specific symbol from the Binance API.

* **Error Handling Enhancements**
  - Add `ExchangeError` class to handle errors related to exchange information.
  - Add `OrderBookError` class to handle errors related to fetching the order book.

* **Utility Functions Enhancements**
  - Add `validate_symbol` function to validate the format of a trading symbol.
  - Add `parse_order_book` function to parse the order book data returned by the Binance API.

* **WebSocket Manager Enhancements**
  - Add `subscribe_to_agg_trades` method to subscribe to aggregate trade streams.
  - Add `subscribe_to_kline` method to subscribe to kline/candlestick streams.
  - Add `subscribe_to_order_book` method to subscribe to order book streams.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/binance/binance-connector-python?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant