Skip to content

fix(sdks): align order book field types#1417

Open
realfishsam wants to merge 1 commit into
mainfrom
fix/orderbook-field-drift-1392-1395
Open

fix(sdks): align order book field types#1417
realfishsam wants to merge 1 commit into
mainfrom
fix/orderbook-field-drift-1392-1395

Conversation

@realfishsam

Copy link
Copy Markdown
Contributor

Summary

  • Add orderCount to TypeScript OrderLevel and order_count to Python OrderLevel.
  • Add isNegRisk, lastTradePrice, and sourceMetadata to TypeScript OrderBook.
  • Add is_neg_risk, last_trade_price, and source_metadata to Python OrderBook.

Fixes #1392
Fixes #1393
Fixes #1394
Fixes #1395

Test Plan

  • python3 -m py_compile sdks/python/pmxt/models.py sdks/python/pmxt/client.py
  • git diff --check

Note: local TypeScript compiler validation was blocked in this fresh worktree because node_modules/.bin/tsc is not installed; GitHub generated-sync/CodeQL checks will validate the committed TypeScript surface.

@realfishsam

Copy link
Copy Markdown
Contributor Author

PR Review: PASS (NOT VERIFIED)

What This Does

Adds missing SDK model fields for order book metadata that core/OpenAPI already expose: per-level orderCount / order_count, and order-book isNegRisk / is_neg_risk, lastTradePrice / last_trade_price, and sourceMetadata / source_metadata. This matters to SDK consumers because those fields can already appear in sidecar/OpenAPI responses but were not declared in the hand-written SDK models.

Blast Radius

SDK model type surfaces only: sdks/typescript/pmxt/models.ts and sdks/python/pmxt/models.py. No exchange normalizer, server route, OpenAPI schema, or SDK converter logic changed.

Consumer Verification

Before (base branch):
Core/OpenAPI already advertise these fields (core/src/types.ts has OrderLevel.orderCount and OrderBook.isNegRisk/lastTradePrice/sourceMetadata; docs/api-reference/openapi.json also contains these order book fields), but the SDK model files did not declare them. A TypeScript consumer assigning orderCount, isNegRisk, lastTradePrice, or sourceMetadata to OrderLevel/OrderBook would get excess-property type errors.

After (PR branch):
On PR head f73d4d5, sdks/typescript/pmxt/models.ts:154 declares orderCount?: number, and :174, :177, :180 declare isNegRisk?: boolean, lastTradePrice?: number, and sourceMetadata?: Record<string, unknown>. sdks/python/pmxt/models.py:313, :333, :336, :339 add the Python equivalents. A focused TypeScript consumer probe assigning those fields to OrderLevel/OrderBook passed (tsc --noEmit --skipLibCheck ...), and python3 -m py_compile sdks/python/pmxt/models.py passed.

Test Results

  • Build: NOT VERIFIED — npm run build --workspace=pmxtjs is blocked in this review checkout by missing generated SDK artifacts: pmxt/client.ts(15,8): error TS2307: Cannot find module '../generated/src/index.js' and pmxt/server-manager.ts(7,43): error TS2307.
  • Unit tests: NOT RUN because the TypeScript SDK build is blocked by missing generated artifacts.
  • Server starts: N/A — model-only SDK typing change.
  • E2E smoke: PASS (focused type/compile smoke only): TypeScript model assignment probe accepted the new fields; Python model file py_compile passed.

Findings

No blocking findings.

PMXT Pipeline Check

  • Field propagation (3-layer): OK — core types/OpenAPI already include these fields; this PR closes the SDK model-surface gap.
  • OpenAPI sync: OK — no OpenAPI change needed for the observed fields.
  • Financial precision: N/A — no arithmetic or runtime conversion changed.
  • Type safety: OK — additive optional fields in both SDK model surfaces.
  • Auth safety: N/A

Semver Impact

patch -- additive SDK type/model declarations for fields already exposed by core/OpenAPI responses.

Risk

Full package build and generated-client verification were not possible because generated SDK artifacts are missing in the checkout; this review therefore verifies the hand-written model surfaces and existing schema/core presence, not a packaged SDK build.

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