|
10 | 10 | * into core/src/exchanges/kalshi/api.ts by `npm run fetch:openapi`. |
11 | 11 | * Do NOT put runtime config into api.ts — it will be overwritten. |
12 | 12 | * |
13 | | - * Environment mapping (aligns with the `{env}` server variable in Kalshi.yaml): |
14 | | - * env = "api" → production: https://api.external-api.kalshi.com |
15 | | - * env = "demo-api" → demo/paper: https://demo-api.external-api.kalshi.com |
| 13 | + * Environment mapping: |
| 14 | + * production: https://external-api.kalshi.com |
| 15 | + * demo/paper: https://external-api.demo.kalshi.co |
16 | 16 | */ |
17 | 17 |
|
18 | 18 | // ── Base URL constants ──────────────────────────────────────────────────────── |
19 | 19 |
|
20 | | -export const KALSHI_PROD_API_URL = process.env.KALSHI_BASE_URL || "https://api.external-api.kalshi.com"; |
21 | | -export const KALSHI_DEMO_API_URL = process.env.KALSHI_DEMO_BASE_URL || "https://demo-api.external-api.kalshi.com"; |
| 20 | +export const KALSHI_PROD_API_URL = process.env.KALSHI_BASE_URL || "https://external-api.kalshi.com"; |
| 21 | +export const KALSHI_DEMO_API_URL = process.env.KALSHI_DEMO_BASE_URL || "https://external-api.demo.kalshi.co"; |
22 | 22 |
|
23 | 23 | export const KALSHI_PROD_WS_URL = |
24 | | - "wss://api.external-api.kalshi.com/trade-api/ws/v2"; |
| 24 | + "wss://external-api-ws.kalshi.com/trade-api/ws/v2"; |
25 | 25 | export const KALSHI_DEMO_WS_URL = |
26 | | - "wss://demo-api.external-api.kalshi.com/trade-api/ws/v2"; |
| 26 | + "wss://external-api-ws.demo.kalshi.co/trade-api/ws/v2"; |
27 | 27 |
|
28 | 28 | // ── Path constants ──────────────────────────────────────────────────────────── |
29 | 29 |
|
@@ -52,12 +52,12 @@ export interface KalshiApiConfig { |
52 | 52 | /** |
53 | 53 | * Return a typed config object for the requested environment. |
54 | 54 | * |
55 | | - * @param demoMode - Pass `true` to target demo-api.external-api.kalshi.com. |
| 55 | + * @param demoMode - Pass `true` to target external-api.demo.kalshi.co. |
56 | 56 | * |
57 | 57 | * @example |
58 | 58 | * ```typescript |
59 | 59 | * const config = getKalshiConfig(true); |
60 | | - * // config.apiUrl === "https://demo-api.external-api.kalshi.com" |
| 60 | + * // config.apiUrl === "https://external-api.demo.kalshi.co" |
61 | 61 | * ``` |
62 | 62 | */ |
63 | 63 | export function getKalshiConfig(demoMode = false, baseUrlOverride?: string): KalshiApiConfig { |
|
0 commit comments