Skip to content

SDK drift: Python HOSTED_UNSUPPORTED_METHODS gates fetch_closed_orders/fetch_all_orders in hosted mode; TypeScript has no equivalent gating #1121

@realfishsam

Description

@realfishsam

Summary

Python's hosted-routing layer defines a HOSTED_UNSUPPORTED_METHODS set that explicitly marks fetch_closed_orders and fetch_all_orders as unsupported in hosted mode, raising NotSupported when they are called. TypeScript has no equivalent check: fetchClosedOrders and fetchAllOrders are callable in hosted mode without any guard, and either pass through to a missing endpoint or fail silently.

Python

sdks/python/pmxt/_hosted_routing.py (~line 156):

HOSTED_UNSUPPORTED_METHODS: frozenset[str] = frozenset({
    "fetch_closed_orders",
    "fetch_all_orders",
})

When a hosted client calls one of these methods, the routing layer raises NotSupported with a message indicating these methods are not available in hosted mode. Users get a clear, immediate error.

TypeScript

sdks/typescript/pmxt/hosted-routing.ts and sdks/typescript/pmxt/client.ts: No HOSTED_UNSUPPORTED_METHODS set exists. Neither fetchClosedOrders nor fetchAllOrders is guarded for hosted mode. A TypeScript hosted client can call them; the request either reaches an endpoint that does not exist or produces an unintelligible HTTP error from the hosted trading API.

Impact

  • Python hosted users receive a clean NotSupported error with a helpful message when they call fetch_closed_orders/fetch_all_orders.
  • TypeScript hosted users receive an opaque HTTP error (or timeout) from the trading API with no indication that the method is conceptually unsupported in hosted mode.
  • The disparity makes TypeScript hosted mode harder to use and debug than Python hosted mode.
  • HOSTED_METHOD_ROUTES in TypeScript (hosted-routing.ts) does not include fetchClosedOrders or fetchAllOrders, so calls do fall through to sidecar routing — but the sidecar is not running in hosted mode, so this also fails unexpectedly.
  • Related: TypeScript gating logic differences are tracked in SDK drift: TypeScript gates trading methods on isHostedTradingMode() (venue allowlist); Python gates on self.is_hosted (any hosted URL) #1012.

Metadata

Metadata

Assignees

No one assigned

    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