Skip to content

SDK drift: TypeScript exports five typed parameter interfaces (HistoryFilterParams, OHLCVParams, etc.) with no Python equivalents #470

@realfishsam

Description

@realfishsam

Drift

TypeScript exports five dedicated parameter interfaces for history/filter methods. Python's equivalent methods accept a generic Optional[dict] with no type structure. The interfaces are not just convenience types — they document the exact fields each method accepts and are part of the published TypeScript API surface.

TypeScript SDK

sdks/typescript/pmxt/models.ts, lines 452–554 — five typed parameter interfaces:

// sdks/typescript/pmxt/models.ts lines 452–554

export interface HistoryFilterParams {
    fromTimestamp?: number;
    untilTimestamp?: number;
    maxSize?: number;
    order?: 'asc' | 'desc';
}

export interface OHLCVParams {
    resolution?: string;
    limit?: number;
    start?: number;
    end?: number;
}

export interface TradesParams {
    limit?: number;
    since?: number;
    start?: number;
    end?: number;
}

export interface MyTradesParams {
    outcomeId?: string;
    marketId?: string;
    limit?: number;
    since?: number;
}

export interface OrderHistoryParams {
    outcomeId?: string;
    marketId?: string;
    limit?: number;
    since?: number;
    status?: string;
}

All five are exported from the package via export type * from "./pmxt/models.js" in sdks/typescript/index.ts.

Python SDK

sdks/python/pmxt/models.py — no equivalent TypedDicts exist for any of these five interfaces.

The Python methods accept Optional[dict]:

# sdks/python/pmxt/client.py (representative examples)
async def fetch_my_trades(self, params: Optional[dict] = None) -> list[UserTrade]: ...
async def fetch_ohlcv(self, outcome_id, resolution=None, limit=None, start=None, end=None, **kwargs): ...
async def fetch_trades(self, outcome_id, limit=None, since=None, start=None, end=None, **kwargs): ...

sdks/python/pmxt/__init__.py — none of these TypedDicts appear in imports or __all__.

Expected

Python should define TypedDict equivalents (HistoryFilterParams, OHLCVParams, TradesParams, MyTradesParams, OrderHistoryParams) with the same fields, add them to __init__.py imports, and include them in __all__. Method signatures for fetch_my_trades and related methods should accept these typed dicts.

Impact

Python users have no IDE autocompletion or static type checking for the parameters these methods accept. The valid field names and types are undiscoverable from the Python API alone, requiring users to cross-reference TypeScript docs or source code. This widens the usability gap between the two SDKs.

Found by automated SDK cross-language drift audit

Metadata

Metadata

Assignees

No one assigned

    Labels

    sdk-driftCross-language SDK consistency findings (TypeScript vs Python)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions