From fcd52e9278ed422dd4f2db5a06734b21cc5362d6 Mon Sep 17 00:00:00 2001 From: "Samuel EF. Tinnerholm" Date: Fri, 19 Jun 2026 08:01:12 +0200 Subject: [PATCH] fix(sdks): use outcomeId in GET query for fetchOHLCV/fetchTrades SDKs were sending '?id=...' for GET reads, but server method-verbs spec defines the first arg as 'outcomeId'. The GET dispatcher uses spec names to peel primitive args, then bundles every other query key into the object arg. So outcomeId arrived as undefined and the raw key 'id' ended up inside params. fromMarketId(undefined) crashed with 'Cannot read properties of undefined (reading match)'. POST path was unaffected because it sends positional args directly. Also: default HL fetchOHLCV params to a benign value so the build fix from #1161 type-checks (resolution is required on OHLCVParams). Verified locally against npm run server with both Python and TS SDKs: fetch_markets, fetch_events, fetch_order_book, fetch_ohlcv, fetch_trades all return data for exchange='hyperliquid'. --- core/src/exchanges/hyperliquid/index.ts | 2 +- sdks/python/pmxt/client.py | 4 ++-- sdks/typescript/pmxt/client.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/exchanges/hyperliquid/index.ts b/core/src/exchanges/hyperliquid/index.ts index 62fcc36f..8d5e43d0 100644 --- a/core/src/exchanges/hyperliquid/index.ts +++ b/core/src/exchanges/hyperliquid/index.ts @@ -145,7 +145,7 @@ export class HyperliquidExchange extends PredictionMarketExchange { return this.normalizer.normalizeOrderBook(raw, outcomeId); } - async fetchOHLCV(outcomeId: string, params: OHLCVParams = {}): Promise { + async fetchOHLCV(outcomeId: string, params: OHLCVParams = { resolution: '1h' }): Promise { const raw = await this.fetcher.fetchRawOHLCV(outcomeId, params); return this.normalizer.normalizeOHLCV(raw, params); } diff --git a/sdks/python/pmxt/client.py b/sdks/python/pmxt/client.py index 7e256deb..cca8c805 100644 --- a/sdks/python/pmxt/client.py +++ b/sdks/python/pmxt/client.py @@ -2235,7 +2235,7 @@ def fetch_ohlcv( params_dict[key] = value args = [outcome_id, params_dict] - query = {"id": outcome_id, **params_dict} + query = {"outcomeId": outcome_id, **params_dict} data = self._handle_response( self._sidecar_read_request("fetchOHLCV", query, args) ) @@ -2295,7 +2295,7 @@ def fetch_trades( params_dict[key] = value args = [outcome_id, params_dict] - query = {"id": outcome_id, **params_dict} + query = {"outcomeId": outcome_id, **params_dict} data = self._handle_response( self._sidecar_read_request("fetchTrades", query, args) ) diff --git a/sdks/typescript/pmxt/client.ts b/sdks/typescript/pmxt/client.ts index 5fcf5740..dd4034b3 100644 --- a/sdks/typescript/pmxt/client.ts +++ b/sdks/typescript/pmxt/client.ts @@ -1750,7 +1750,7 @@ export abstract class Exchange { } const args = [resolvedOutcomeId, paramsDict]; - const query = { id: resolvedOutcomeId, ...paramsDict }; + const query = { outcomeId: resolvedOutcomeId, ...paramsDict }; const json = await this.sidecarReadRequest('fetchOHLCV', query, args); const data = this.handleResponse(json); return data.map(convertCandle); @@ -1791,7 +1791,7 @@ export abstract class Exchange { } const args = [resolvedOutcomeId, paramsDict]; - const query = { id: resolvedOutcomeId, ...paramsDict }; + const query = { outcomeId: resolvedOutcomeId, ...paramsDict }; const json = await this.sidecarReadRequest('fetchTrades', query, args); const data = this.handleResponse(json); return data.map(convertTrade);