Skip to content

Commit

Permalink
add channel option
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosmiei committed Oct 27, 2024
1 parent 1ebf4c1 commit e7ef096
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions binance/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -997,10 +997,12 @@ def individual_symbol_ticker_futures_socket(self, symbol: str, futures_type: Fut
"""
return self._get_futures_socket(symbol.lower() + '@ticker', futures_type=futures_type)

def all_ticker_futures_socket(self, futures_type: FuturesType = FuturesType.USD_M):
def all_ticker_futures_socket(self, channel: str = '!bookTicker', futures_type: FuturesType = FuturesType.USD_M):
"""Start a websocket for all ticker data
By default all markets are included in an array.
https://binance-docs.github.io/apidocs/futures/en/#all-book-tickers-stream
https://binance-docs.github.io/apidocs/futures/en/#all-market-tickers-streams
:param channel: optional channel type, default '!bookTicker', but '!ticker@arr' is also available
:param futures_type: use USD-M or COIN-M futures default USD-M
:returns: connection key string if successful, False otherwise
Message Format
Expand All @@ -1017,7 +1019,7 @@ def all_ticker_futures_socket(self, futures_type: FuturesType = FuturesType.USD_
]
"""

return self._get_futures_socket('!bookTicker', futures_type=futures_type)
return self._get_futures_socket(channel, futures_type=futures_type)

def symbol_book_ticker_socket(self, symbol: str):
"""Start a websocket for the best bid or ask's price or quantity for a specified symbol.
Expand Down

0 comments on commit e7ef096

Please sign in to comment.