Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions binance/ws/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class BinanceSocketManager:
FSTREAM_TESTNET_URL = "wss://stream.binancefuture.com/"
DSTREAM_URL = "wss://dstream.binance.{}/"
DSTREAM_TESTNET_URL = "wss://dstream.binancefuture.com/"
VSTREAM_URL = "wss://vstream.binance.{}/"
VSTREAM_URL = "wss://nbstream.binance.{}/eoptions/"
VSTREAM_TESTNET_URL = "wss://testnetws.binanceops.{}/"

WEBSOCKET_DEPTH_5 = "5"
Expand Down Expand Up @@ -136,7 +136,7 @@ def _get_options_socket(self, path: str, prefix: str = "ws/"):
path,
stream_url,
prefix,
is_binary=True,
is_binary=False,
socket_type=BinanceSocketType.OPTIONS,
)

Expand Down Expand Up @@ -1043,7 +1043,7 @@ def options_ticker_socket(self, symbol: str):
:param symbol: required
:type symbol: str
"""
return self._get_options_socket(symbol.lower() + "@ticker")
return self._get_options_socket(symbol.upper() + "@ticker")

def options_ticker_by_expiration_socket(self, symbol: str, expiration_date: str):
"""Subscribe to a 24 hour ticker info stream
Expand All @@ -1053,7 +1053,7 @@ def options_ticker_by_expiration_socket(self, symbol: str, expiration_date: str)
:param expiration_date : required
:type expiration_date: str
"""
return self._get_options_socket(symbol.lower() + "@ticker@" + expiration_date)
return self._get_options_socket(symbol.upper() + "@ticker@" + expiration_date)

def options_recent_trades_socket(self, symbol: str):
"""Subscribe to a latest completed trades stream
Expand All @@ -1063,7 +1063,7 @@ def options_recent_trades_socket(self, symbol: str):
:param symbol: required
:type symbol: str
"""
return self._get_options_socket(symbol.lower() + "@trade")
return self._get_options_socket(symbol.upper() + "@trade")

def options_kline_socket(
self, symbol: str, interval=AsyncClient.KLINE_INTERVAL_1MINUTE
Expand All @@ -1077,7 +1077,7 @@ def options_kline_socket(
:param interval: Kline interval, default KLINE_INTERVAL_1MINUTE
:type interval: str
"""
return self._get_options_socket(symbol.lower() + "@kline_" + interval)
return self._get_options_socket(symbol.upper() + "@kline_" + interval)

def options_depth_socket(self, symbol: str, depth: str = "10"):
"""Subscribe to a depth data stream
Expand All @@ -1089,7 +1089,7 @@ def options_depth_socket(self, symbol: str, depth: str = "10"):
:param depth: optional Number of depth entries to return, default 10.
:type depth: str
"""
return self._get_options_socket(symbol.lower() + "@depth" + str(depth))
return self._get_options_socket(symbol.upper() + "@depth" + str(depth))

async def _stop_socket(self, conn_key):
"""Stop a websocket given the connection key
Expand Down