Skip to content

fix(ts-sdk): register Limitless cancel typed-data routes#1151

Open
realfishsam wants to merge 2 commits into
mainfrom
fix/limitless-cancel-typeddata-1144
Open

fix(ts-sdk): register Limitless cancel typed-data routes#1151
realfishsam wants to merge 2 commits into
mainfrom
fix/limitless-cancel-typeddata-1144

Conversation

@realfishsam

@realfishsam realfishsam commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Registers the TypeScript SDK Limitless hosted cancel typed-data routes in HostedRoute and SCHEMAS.
  • Extends TypeScript economic validation so Limitless buy/sell typed-data routes reject mismatched tokenId, matching the Python guard.
  • Adds focused regression tests for the Limitless cancel route registry and Limitless tokenId economics.

Fixes #1144
Fixes #1143

Test Plan

  • npm test -- --runTestsByPath tests/hosted-typed-data-routes.test.ts
  • git diff --check

Notes

  • npm test -- --runTestsByPath tests/hosted-dispatch.test.ts is blocked in this focused worktree because sdks/typescript/generated/src/index.js is absent; no generated drift was committed for this focused hosted typed-data validation fix.

@realfishsam

Copy link
Copy Markdown
Contributor Author

Focused verification for this PR:

  • PASS: npm test -- --runTestsByPath tests/hosted-typed-data-routes.test.ts
  • PASS: git diff --check
  • BLOCKED (environment/focused checkout): npm test -- --runTestsByPath tests/hosted-dispatch.test.ts cannot load ../generated/src/index.js because generated TypeScript SDK artifacts are absent in this worktree.

CI generated-sync failures appear unrelated to this two-file route-registry fix:

  • Verify client.ts methods are up-to-date wants fetchMatchedMarkets(params?: any) in sdks/typescript/pmxt/client.ts.
  • Verify client.py methods are up-to-date wants fetch_order_book(..., params: Optional[dict]) in sdks/python/pmxt/client.py.
  • Verify API_REFERENCE.md files are up-to-date wants to remove Market.question from sdks/typescript/API_REFERENCE.md.

I am leaving those broad generator/client/API-reference drifts out of this focused PR per PMXT generated-drift policy; the Limitless cancel route regression test and implementation remain scoped to #1144.

@realfishsam

Copy link
Copy Markdown
Contributor Author

Follow-up verification after extending this PR to also close #1143:

  • PASS: npm test -- --runTestsByPath tests/hosted-typed-data-routes.test.ts (5 tests: Limitless cancel route registry + Limitless tokenId economics)
  • PASS: git diff --check
  • BLOCKED (focused checkout): npm test -- --runTestsByPath tests/hosted-dispatch.test.ts cannot load absent generated SDK artifacts (sdks/typescript/generated/src/index.js).

The red generated-sync CI checks are still the same unrelated drift from origin/main (client method generation and API reference output); I am not folding that broad client/docs churn into this focused hosted typed-data validation PR.

@realfishsam

Copy link
Copy Markdown
Contributor Author

PR Review: PASS (NOT VERIFIED)

What This Does

Registers the missing TypeScript SDK Limitless cancel typed-data routes and extends the hosted typed-data economics guard so Limitless buy/sell typed-data responses reject mismatched token IDs. This matters to hosted SDK consumers because typed-data generation should fail before signing if the route/market response does not match the requested token.

Blast Radius

TypeScript SDK hosted typed-data helpers and a focused TypeScript Jest regression test only: sdks/typescript/pmxt/hosted-typed-data.ts and sdks/typescript/tests/hosted-typed-data-routes.test.ts. No core sidecar routing, Python SDK, OpenAPI schema, or exchange implementation changes.

Consumer Verification

Before (base branch):
HostedRoute/SCHEMAS did not include cancel_limitless_polygon or cancel_limitless_base_pull, so TypeScript SDK consumers could not validate/build those cancel typed-data routes. The validateEconomics token-id check covered Opinion routes but not Limitless routes.

validateEconomics({ message: {} } as any, 'cancel_limitless_polygon', {}, {})
// base behavior: route is not registered in HostedRoute/SCHEMAS

After (PR branch):
Focused Jest coverage exercises the consumer-visible helpers directly:

PASS tests/hosted-typed-data-routes.test.ts
✓ recognizes cancel_limitless_polygon as a cancel route
✓ recognizes cancel_limitless_base_pull as a cancel route
✓ validates tokenId economics for limitless_buy
✓ validates tokenId economics for limitless_sell_polygon
✓ validates tokenId economics for limitless_sell_base_pull

The full TypeScript package build could not be verified in this checkout because generated TypeScript OpenAPI artifacts are missing.

Test Results

  • Build: core build PASS (npm run build --workspace=pmxt-core)
  • Unit tests: PASS (5 passed, 0 failed: npm --workspace=pmxtjs test -- --runTestsByPath tests/hosted-typed-data-routes.test.ts)
  • Server starts: N/A (SDK typed-data helper only)
  • E2E smoke: NOT VERIFIED (no sidecar endpoint involved; full TS build blocked by missing generated artifacts)

Findings

No blocking findings.

PMXT Pipeline Check

  • Field propagation (3-layer): N/A
  • OpenAPI sync: N/A
  • Financial precision: N/A
  • Type safety: OK (routes are added to HostedRoute and the schema map)
  • Auth safety: OK (no credentials logged or exposed; change only validates typed-data inputs)

Semver Impact

patch -- fixes missing SDK route registration/validation behavior.

Risk

Full package build remains unverified here because pmxt/client.ts and pmxt/server-manager.ts import missing generated TypeScript artifacts (../generated/src/index.js). The focused route/economics tests pass.

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

Labels

None yet

Projects

None yet

1 participant