Skip to content

Escrow class not exported from either SDK's package root despite Exchange.escrow being a public typed property #2193

Description

@realfishsam

Gap

Both SDKs attach a public escrow property of type Escrow to every hosted-trading-capable exchange instance, but neither SDK exports the Escrow class/type from its package root. A TypeScript or Python consumer can use exchange.escrow.depositTx(...) but cannot import Escrow by name to type a variable, write a function signature that accepts one, or otherwise reference the type outside the exchange instance itself.

TypeScript SDK

  • sdks/typescript/pmxt/client.ts:352public escrow?: Escrow; (public, typed property on the base Exchange class).
  • sdks/typescript/pmxt/client.ts:417this.escrow = new Escrow(this); (constructed for hosted-trading-allowlisted venues).
  • sdks/typescript/pmxt/escrow.ts:113export class Escrow { ... } (the class itself, exported from its own module).
  • sdks/typescript/index.ts — full file read; no export { Escrow } or export type { Escrow } anywhere, and no export * from "./pmxt/escrow.js". Every other file with a class/type referenced from a public property (ServerManager, FeedClient, Router) is re-exported here; escrow.ts is the one exception.

Python SDK

  • sdks/python/pmxt/client.py:419self.escrow = Escrow(self) (same pattern as TypeScript).
  • sdks/python/pmxt/escrow.py:86class Escrow: (the class itself).
  • sdks/python/pmxt/__init__.pygrep -n "Escrow" sdks/python/pmxt/__init__.py returns zero matches. Escrow is absent from both the import list and __all__.

Evidence

Read sdks/typescript/index.ts in full (119 lines) — confirmed no reference to escrow.ts anywhere in the re-export surface, even though client.ts:352's public escrow?: Escrow field type-references it. Grepped sdks/python/pmxt/__init__.py for Escrow (case-sensitive) — zero hits, confirming the same omission in Python.

Impact

Neither SDK lets a consumer import Escrow by name. In TypeScript this means no way to write function handleEscrow(e: Escrow) { ... } or declare a typed variable without reaching into the package's internal file layout (import { Escrow } from 'pmxtjs/dist/pmxt/escrow.js', unsupported by the package's exports map). In Python, static type checkers and IDEs have no importable symbol for pmxt.Escrow, and isinstance(x, pmxt.Escrow) checks are impossible without a private import. This is the same "type referenced in a public field but not exported" pattern already tracked for the custom-signer types (issue #1919) and WsClientConfig (issue #2107), but for Escrow, which neither existing issue covers.


Found by automated Core-to-SDK surface coverage audit

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions