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
{{ message }}
Repository navigation
SDK drift: fetchOHLCV/fetchTrades crash when called without a params argument in TypeScript; Python's equivalents are fully optional #1556
TypeScript's fetchOHLCV/fetchTrades declare params with no default and no ? marker, and immediately dereference it (params.resolution). Calling either method with only the outcome id throws a native TypeError, re-wrapped as a PmxtError. Python's equivalents accept the outcome id alone and work fine, since every other parameter is independently optional with a None default. This is distinct from already-filed #1383/#1425 (which are about the opaque params: anytyping style vs. named kwargs) — this issue is about the default-value/optionality gap that causes a runtime crash.
TypeScript SDK
sdks/typescript/pmxt/client.ts:1844-1847 (fetchOHLCV) and :1882-1885 (fetchTrades):
client.ts:1851 immediately does const paramsDict: any = { resolution: params.resolution }; — if params is undefined this throws, caught and re-wrapped as PmxtError at client.ts:1868-1869.
Python SDK
sdks/python/pmxt/client.py:2224-2232 (fetch_ohlcv) and :2287-2296 (fetch_trades) — resolution, limit, since, start, end are all independently optional with None defaults; fetch_ohlcv(outcome_id) and fetch_trades(outcome_id) work with zero extra arguments.
Expected
TypeScript's fetchOHLCV/fetchTrades should accept an omitted/undefined params argument without crashing, matching Python's ability to call with only the outcome id.
Impact
Any TypeScript caller doing exchange.fetchOHLCV(outcomeId) or exchange.fetchTrades(outcomeId) gets PmxtError: Failed to fetch OHLCV: TypeError: Cannot read properties of undefined (reading 'resolution') instead of a working call, unlike the equivalent Python call.
Activity
realfishsam commentedon Jul 11, 2026
Fix opened in #1617. The PR adds one-argument regression coverage for both
fetchOHLCVandfetchTradesand makes their history params optional.