Repository navigation
TypeScript SDK now exposes preWarmMarket/getEventById/getEventBySlug on base Exchange class — same misclassification as Python issue #1428 #1510
Description
Gap
PR #1492 (commit c8938f0, "fix(typescript): add documented event helper methods") closed the absence gaps tracked by issues #187 (preWarmMarket) and #188 (getEventById/getEventBySlug) by adding all three methods directly onto the base Exchange class in the TypeScript SDK, rather than scoping them to the Polymarket and Probable subclasses. This reproduces, in TypeScript, the exact misclassification pattern already identified for the Python SDK in issue #1428 (itself an extension of the pattern from issue #862).
In core, preWarmMarket exists only on PolymarketExchange and getEventById/getEventBySlug exist only on ProbableExchange. After this fix, every TypeScript SDK exchange class — Kalshi, KalshiDemo, Limitless, Metaculus, Smarkets, Opinion, Myriad, Baozi, Rain, Hunch, SuiBets, GeminiTitan, Hyperliquid, Mock, PolymarketUS — now exposes preWarmMarket(), getEventById(), and getEventBySlug() with no compile-time signal that these are unsupported. Calling them on any exchange other than Polymarket/Probable sends the sidecar an unrecognized method name and fails at runtime instead of being caught by the type system.
Core
preWarmMarket(outcomeId: string): Promise<void>—core/src/exchanges/polymarket/index.ts:219. Only onPolymarketExchange.getEventById(id: string): Promise<UnifiedEvent | null>—core/src/exchanges/probable/index.ts:158. Only onProbableExchange.getEventBySlug(slug: string): Promise<UnifiedEvent | null>—core/src/exchanges/probable/index.ts:177. Only onProbableExchange.
grep -rn "preWarmMarket\|getEventById\|getEventBySlug" core/src/ | grep -v .test. confirms these are the only three definitions in core, on the two named exchanges, and nowhere on BaseExchange/PredictionMarketExchange.
TypeScript SDK
sdks/typescript/pmxt/client.ts lines 866–920 (inside export abstract class Exchange):
async preWarmMarket(outcomeId: string): Promise<void> { ... } // line 874
async getEventById(id: string): Promise<UnifiedEvent | null> { ... } // line 891
async getEventBySlug(slug: string): Promise<UnifiedEvent | null> { ... } // line 909All three are defined on the abstract base Exchange class (added by commit c8938f0, PR #1492, 2026-07-03), not narrowed to Polymarket/Probable subclasses in the same file (Polymarket class at line ~3200+, Probable class at line 3358).
Python SDK
Already tracked separately in issue #1428 — Python's sdks/python/pmxt/client.py has the identical placement bug (pre_warm_market line 2888, get_event_by_id line 2901, get_event_by_slug line 2914, all on the base Exchange class). Not re-filing; noting only because the TS fix now mirrors it exactly.
Evidence
grep -n "async preWarmMarket\|async getEventById\|async getEventBySlug" sdks/typescript/pmxt/client.ts → all three appear inside the base Exchange class body (before any subclass definition), confirming they're inherited by every exchange, not just Polymarket/Probable.
git show c8938f0 shows the three methods added at client.ts:866-920, inside export abstract class Exchange.
Impact
Every TypeScript SDK consumer now sees preWarmMarket, getEventById, getEventBySlug in autocomplete on unrelated exchanges (e.g. new Kalshi().preWarmMarket(...), new Metaculus().getEventById(...)), which compiles fine and fails only at runtime with an opaque sidecar error. This is worse than the pre-fix state of "missing entirely" (issues #187/#188) because it actively misleads callers into thinking the capability is universally supported, rather than surfacing as absent. Fixing #187/#188 should have scoped these methods to Polymarket/Probable only, matching the intended fix that issue #1428 already recommends for Python.
Found by automated Core-to-SDK surface coverage audit
Activity