@@ -94,7 +94,6 @@ def reconnect_subscriptions(self):
9494 self .market .reconnect_subscriptions ()
9595
9696
97- # Class for backward compatibility with tests
9897class RealtimeService :
9998 """
10099 Legacy service class for real-time communication.
@@ -113,18 +112,8 @@ def __init__(self, client):
113112 self ._client = client
114113 self ._user = None
115114 self ._market = None
116-
117- # For backward compatibility with tests, always set base_hub_url
118- self ._base_hub_url = f"wss://gateway-rtc-{ client .environment } .s2f.projectx.com"
119-
120- # Check if we should use the new URL pattern from client.USER_HUB_URLS
121- if hasattr (client , "USER_HUB_URLS" ) and client .environment in client .USER_HUB_URLS :
122- self ._user_hub_url = client .USER_HUB_URLS .get (client .environment )
123- self ._market_hub_url = client .MARKET_HUB_URLS .get (client .environment )
124- else :
125- # Fallback to old URL pattern
126- self ._user_hub_url = None
127- self ._market_hub_url = None
115+ self ._user_hub_url = client .USER_HUB_URLS .get (client .environment )
116+ self ._market_hub_url = client .MARKET_HUB_URLS .get (client .environment )
128117
129118 @property
130119 def user (self ):
@@ -135,10 +124,7 @@ def user(self):
135124 UserHub: The user hub instance
136125 """
137126 if self ._user is None :
138- if self ._user_hub_url :
139- self ._user = UserHub (self ._client , self ._base_hub_url , self ._user_hub_url )
140- else :
141- self ._user = UserHub (self ._client , self ._base_hub_url )
127+ self ._user = UserHub (self ._client , None , self ._user_hub_url )
142128 return self ._user
143129
144130 @property
@@ -152,10 +138,7 @@ def market(self):
152138 if self ._market is None :
153139 from projectx_sdk .realtime .market_hub import MarketHub
154140
155- if self ._market_hub_url :
156- self ._market = MarketHub (self ._client , self ._base_hub_url , self ._market_hub_url )
157- else :
158- self ._market = MarketHub (self ._client , self ._base_hub_url )
141+ self ._market = MarketHub (self ._client , None , self ._market_hub_url )
159142 return self ._market
160143
161144 def start (self ):
0 commit comments