Summary
Python fetch_market accepts a bare str as a shorthand for market_id, automatically wrapping it into {"market_id": params}. TypeScript fetchMarket only accepts a MarketFetchParams object (or undefined); passing a string would be a type error.
Python (sdks/python/pmxt/client.py, line 1422–1426)
def fetch_market(self, params: Optional[Union[dict, str]] = None, **kwargs) -> UnifiedMarket:
...
if isinstance(params, str):
params = {"market_id": params} # str shorthand → dict
So Python callers can write either:
exchange.fetch_market("some-market-id") # str shorthand
exchange.fetch_market({"market_id": "some-id"}) # dict form
TypeScript (sdks/typescript/pmxt/client.ts, line 1056)
async fetchMarket(params?: MarketFetchParams): Promise<UnifiedMarket> {
// No string shorthand — params must be an object or undefined
TypeScript callers must always use the object form:
exchange.fetchMarket({ marketId: "some-market-id" });
Impact
Python's string shorthand is a convenience that TypeScript doesn't match. Code shared between Python and TypeScript (e.g. documentation examples, migration guides) must use the dict/object form only, and this shorthand cannot be documented as a cross-SDK pattern. TypeScript should either add a string overload to fetchMarket, or Python's string shorthand should be removed to unify the API surface.
Summary
Python
fetch_marketaccepts a barestras a shorthand formarket_id, automatically wrapping it into{"market_id": params}. TypeScriptfetchMarketonly accepts aMarketFetchParamsobject (orundefined); passing a string would be a type error.Python (
sdks/python/pmxt/client.py, line 1422–1426)So Python callers can write either:
TypeScript (
sdks/typescript/pmxt/client.ts, line 1056)TypeScript callers must always use the object form:
Impact
Python's string shorthand is a convenience that TypeScript doesn't match. Code shared between Python and TypeScript (e.g. documentation examples, migration guides) must use the dict/object form only, and this shorthand cannot be documented as a cross-SDK pattern. TypeScript should either add a string overload to
fetchMarket, or Python's string shorthand should be removed to unify the API surface.