@@ -35,23 +35,61 @@ class ProjectXClient:
3535
3636 # Map of environment names to base URLs
3737 ENVIRONMENT_URLS = {
38- "alphaticks" : "https://gateway- api-alphaticks.s2f .projectx.com" ,
39- "blueguardian" : "https://gateway- api-blueguardian.s2f .projectx.com" ,
40- "blusky" : "https://gateway- api-blusky.s2f .projectx.com" ,
41- "e8x" : "https://gateway- api-e8x.s2f .projectx.com" ,
42- "fundingfutures" : "https://gateway- api-fundingfutures.s2f .projectx.com" ,
43- "thefuturesdesk" : "https://gateway- api-thefuturesdesk.s2f .projectx.com" ,
44- "futureselite" : "https://gateway- api-futureselite.s2f .projectx.com" ,
45- "fxifyfutures" : "https://gateway- api-fxifyfutures.s2f .projectx.com" ,
46- "goatfunded" : "https://gateway- api-goatfunded.s2f .projectx.com" ,
47- "tickticktrader" : "https://gateway- api-tickticktrader.s2f .projectx.com" ,
48- "toponefutures" : "https://gateway- api-toponefutures.s2f .projectx.com" ,
49- "topstepx" : "https://gateway- api-topstepx.s2f.projectx .com" ,
50- "tx3funding" : "https://gateway- api-tx3funding.s2f .projectx.com" ,
38+ "alphaticks" : "https://api.alphaticks .projectx.com" ,
39+ "blueguardian" : "https://api.blueguardianfutures .projectx.com" ,
40+ "blusky" : "https://api.blusky .projectx.com" ,
41+ "e8x" : "https://api.e8 .projectx.com" ,
42+ "fundingfutures" : "https://api.fundingfutures .projectx.com" ,
43+ "thefuturesdesk" : "https://api.thefuturesdesk .projectx.com" ,
44+ "futureselite" : "https://api.futureselite .projectx.com" ,
45+ "fxifyfutures" : "https://api.fxifyfutures .projectx.com" ,
46+ "goatfunded" : "https://api.goatfundedfutures .projectx.com" ,
47+ "tickticktrader" : "https://api.tickticktrader .projectx.com" ,
48+ "toponefutures" : "https://api.toponefutures .projectx.com" ,
49+ "topstepx" : "https://api.topstepx .com" ,
50+ "tx3funding" : "https://api.tx3funding .projectx.com" ,
5151 # For testing/demo
5252 "demo" : "https://gateway-api-demo.s2f.projectx.com" ,
5353 }
5454
55+ # Map of environment names to user hub URLs
56+ USER_HUB_URLS = {
57+ "alphaticks" : "https://rtc.alphaticks.projectx.com/hubs/user" ,
58+ "blueguardian" : "https://rtc.blueguardianfutures.projectx.com/hubs/user" ,
59+ "blusky" : "https://rtc.blusky.projectx.com/hubs/user" ,
60+ "e8x" : "https://rtc.e8.projectx.com/hubs/user" ,
61+ "fundingfutures" : "https://rtc.fundingfutures.projectx.com/hubs/user" ,
62+ "thefuturesdesk" : "https://rtc.thefuturesdesk.projectx.com/hubs/user" ,
63+ "futureselite" : "https://rtc.futureselite.projectx.com/hubs/user" ,
64+ "fxifyfutures" : "https://rtc.fxifyfutures.projectx.com/hubs/user" ,
65+ "goatfunded" : "https://rtc.goatfundedfutures.projectx.com/hubs/user" ,
66+ "tickticktrader" : "https://rtc.tickticktrader.projectx.com/hubs/user" ,
67+ "toponefutures" : "https://rtc.toponefutures.projectx.com/hubs/user" ,
68+ "topstepx" : "https://rtc.topstepx.com/hubs/user" ,
69+ "tx3funding" : "https://rtc.tx3funding.projectx.com/hubs/user" ,
70+ # For testing/demo
71+ "demo" : "https://gateway-api-demo.s2f.projectx.com/hubs/user" ,
72+ }
73+
74+ # Map of environment names to market hub URLs
75+ MARKET_HUB_URLS = {
76+ "alphaticks" : "https://rtc.alphaticks.projectx.com/hubs/market" ,
77+ "blueguardian" : "https://rtc.blueguardianfutures.projectx.com/hubs/market" ,
78+ "blusky" : "https://rtc.blusky.projectx.com/hubs/market" ,
79+ "e8x" : "https://rtc.e8.projectx.com/hubs/market" ,
80+ "fundingfutures" : "https://rtc.fundingfutures.projectx.com/hubs/market" ,
81+ "thefuturesdesk" : "https://rtc.thefuturesdesk.projectx.com/hubs/market" ,
82+ "futureselite" : "https://rtc.futureselite.projectx.com/hubs/market" ,
83+ "fxifyfutures" : "https://rtc.fxifyfutures.projectx.com/hubs/market" ,
84+ "goatfunded" : "https://rtc.goatfundedfutures.projectx.com/hubs/market" ,
85+ "tickticktrader" : "https://rtc.tickticktrader.projectx.com/hubs/market" ,
86+ "toponefutures" : "https://rtc.toponefutures.projectx.com/hubs/market" ,
87+ "topstepx" : "https://rtc.topstepx.com/hubs/market" ,
88+ "tx3funding" : "https://rtc.tx3funding.projectx.com/hubs/market" ,
89+ # For testing/demo
90+ "demo" : "https://gateway-api-demo.s2f.projectx.com/hubs/market" ,
91+ }
92+
5593 def __init__ (
5694 self ,
5795 username : Optional [str ] = None ,
@@ -132,7 +170,12 @@ def realtime(self) -> RealTimeClient:
132170 """
133171 if not self ._realtime :
134172 token = self .auth .get_token ()
135- self ._realtime = RealTimeClient (auth_token = token , environment = self .environment )
173+ self ._realtime = RealTimeClient (
174+ auth_token = token ,
175+ environment = self .environment ,
176+ user_hub_url = self .USER_HUB_URLS .get (self .environment ),
177+ market_hub_url = self .MARKET_HUB_URLS .get (self .environment ),
178+ )
136179 return self ._realtime
137180
138181 def request (
0 commit comments