From 7d3326cb5296b861fe366035887dd99be12fdb8e Mon Sep 17 00:00:00 2001 From: Luminous13 <34308876+Luminous13@users.noreply.github.com> Date: Mon, 29 Mar 2021 05:52:57 +0800 Subject: [PATCH] Individual symbol ticker stream to websockets. --- binance/websockets.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/binance/websockets.py b/binance/websockets.py index fb344ccd..af479787 100644 --- a/binance/websockets.py +++ b/binance/websockets.py @@ -529,6 +529,24 @@ def start_symbol_ticker_futures_socket(self, symbol, callback): ] """ return self._start_futures_socket(symbol.lower() + '@bookTicker', callback) + + def start_individual_symbol_ticker_futures_socket(self, symbol, callback): + """Start a futures websocket for a single symbol's ticker data + https://binance-docs.github.io/apidocs/futures/en/#individual-symbol-ticker-streams + :param symbol: required + :type symbol: str + :param callback: callback function to handle messages + :type callback: function + :returns: connection key string if successful, False otherwise + .. code-block:: python + { + "e": "24hrTicker", // Event type + "E": 123456789, // Event time + "s": "BTCUSDT", // Symbol + "p": "0.0015", // Price change + } + """ + return self._start_futures_socket(symbol.lower() + '@ticker', callback) def start_all_ticker_futures_socket(self, callback): """Start a websocket for all ticker data