You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Money risk. If a caller sets demo=True while also passing base_url (or sets KALSHI_DEMO=true together with KALSHI_API_BASE_URL=<prod>), setdefault leaves base_url at the explicit value but still pins ws_base_url to DEMO_WS_URL. REST hits production (real money) while WS data feeds come from demo. A WS-driven strategy can place live orders against signals derived from a demo book.
Symmetric case: base_url=DEMO_BASE_URL with demo=False (default) leaves ws_base_url at production.
KalshiConfig.__post_init__ validates the two URLs independently and never cross-checks that REST and WS resolve to the same Kalshi environment.
Reject mixed REST/WS environments in KalshiConfig.__post_init__ (or in the client constructor) unless an explicit allow_mixed_env=True is set; alternatively raise when demo=True is combined with a non-demo base_url instead of silently honoring base_url and overriding only ws_base_url. Add an integration test for the env-var combination.
Activity
fix(config): reject split REST/WS environment from demo + base_url co…