Skip to content

fix(ts-sdk): export Polymarket_us alias#1290

Open
DeepCogNeural wants to merge 5 commits into
pmxt-dev:mainfrom
DeepCogNeural:codex/ts-polymarket-us-alias
Open

fix(ts-sdk): export Polymarket_us alias#1290
DeepCogNeural wants to merge 5 commits into
pmxt-dev:mainfrom
DeepCogNeural:codex/ts-polymarket-us-alias

Conversation

@DeepCogNeural

@DeepCogNeural DeepCogNeural commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Export Polymarket_us from the TypeScript SDK as a backwards-compatible alias for PolymarketUS.
  • Surface Hunch consistently across OpenAPI, Python SDK exports, TypeScript SDK exports, generated client methods, API references, and compliance docs so exchange coverage stays in sync.
  • Preserve existing hand-maintained generated client method blocks and add a focused Hunch wallet-address credential regression test.

Fixes #1285.

Test Plan

  • node core/scripts/check-exchange-drift.js
  • node sdks/typescript/scripts/generate-client-methods.js
  • node sdks/python/scripts/generate-client-methods.js
  • node core/scripts/generate-compliance.js
  • npm run build --workspace=pmxt-core
  • npm run generate:openapi --workspace=pmxt-core
  • npm run generate:mintlify --workspace=pmxt-core
  • npm run docs:llms
  • NODE_PATH=/Users/linghao/Github/pmxt/node_modules npm test -- --runTestsByPath tests/public-exports.test.ts in sdks/typescript — pass, 6 tests. NODE_PATH is only for local hoisted dependency resolution of ts-jest.
  • npm run build in sdks/typescript
  • python3 -m py_compile sdks/python/pmxt/_exchanges.py sdks/python/pmxt/__init__.py sdks/python/pmxt/client.py
  • git diff --check

Notes

The first push exposed generated-output drift around Hunch; the follow-up commits intentionally bring those generated surfaces back in sync so the PR is ready for CI/review.

@realfishsam

Copy link
Copy Markdown
Contributor

PR Review: PASS (NOT VERIFIED)

What This Does

Exports the TypeScript Polymarket_us compatibility alias and updates docs/OpenAPI exchange scoping to include Hunch in generated capability detection.

Blast Radius

TypeScript SDK public exports/client aliasing, generated OpenAPI/docs artifacts, and generate-openapi.js capability-map coverage. No venue runtime normalizer changes.

Consumer Verification

Before (base branch):
The underscore-style alias was not exported from the TypeScript SDK public surface, so consumers using the documented/wire-style polymarket_us naming convention could not import it directly.

import { Polymarket_us } from "pmxt"
// base: public export not present

After (PR branch):
Static review shows sdks/typescript/index.ts and sdks/typescript/pmxt/client.ts add the alias and public-exports.test.ts checks both constructor identity and instantiation:

expect(Polymarket_us).toBe(PolymarketUS)
expect(new Polymarket_us({ autoStartServer: false }).exchangeName).toBe("polymarket_us")

Runtime SDK verification was blocked by missing generated SDK artifacts.

Test Results

  • Build: PASS (npm run build --workspace=pmxt-core)
  • Unit tests: NOT VERIFIED. npx jest -c sdks/typescript/jest.config.cjs sdks/typescript/tests/public-exports.test.ts --runInBand failed before tests ran with sdks/typescript/pmxt/client.ts:15:8 - TS2307: Cannot find module '../generated/src/index.js'.
  • Server starts: NOT RUN (export/docs change)
  • E2E smoke: NOT VERIFIED

Findings

No blocking findings.

PMXT Pipeline Check

  • Field propagation (3-layer): N/A
  • OpenAPI sync: OK at artifact level: core/src/server/openapi.yaml and docs/api-reference/openapi.json changed alongside generate-openapi.js.
  • Financial precision: N/A
  • Type safety: OK by static review; full TS public-export test blocked by missing generated imports.
  • Auth safety: N/A

Semver Impact

patch -- additive backwards-compatible public alias/export and docs generation sync.

Risk

The docs JSON diff is large relative to the source change; I verified the intended Hunch exchange-scoping addition is present, but did not exhaustively re-review every generated docs deletion/addition line.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SDK drift: Python exports Polymarket_us (snake_case) alias for PolymarketUS; TypeScript has no equivalent alias

2 participants