Fix: make Kalshi API base configurable

This commit is contained in:
2026-03-15 14:40:09 -07:00
parent c3b9bf1475
commit 8c76087b6a

View File

@@ -1,6 +1,7 @@
import crypto from 'crypto'; import crypto from 'crypto';
const KALSHI_API_BASE = 'https://api.elections.kalshi.com'; const DEFAULT_KALSHI_API_BASE = 'https://api.elections.kalshi.com';
const KALSHI_API_BASE = (process.env.KALSHI_API_BASE || DEFAULT_KALSHI_API_BASE).trim().replace(/\/+$/, '');
/** /**
* Signs a Kalshi API request using RSA-PSS with SHA-256. * Signs a Kalshi API request using RSA-PSS with SHA-256.