-
-
Notifications
You must be signed in to change notification settings - Fork 225
Conversation
realfishsam
commented
Jun 17, 2026
Focused validation passed:
npm test --workspace=pmxtjs -- --runTestsByPath tests/hosted-mappers.test.ts --runInBandgit diff --check
CI generated-sync blockers appear unrelated to this focused mapper change: the failed diffs are in generated client methods/API reference (fetch_order_book/fetchMatchedMarkets signatures and UnifiedMarket.question docs), while this PR only touches sdks/typescript/pmxt/hosted-mappers.ts and a focused regression test. Per PMXT focused-PR generated-drift guidance, I am keeping this PR scoped rather than committing broad unrelated generator churn into it.
realfishsam
commented
Jun 17, 2026
PR Review: PASS (NOT VERIFIED)
What This Does
Adds TypeScript hosted-v0 order mapper coverage for provenance/fill fields (filledShares, feeRateBps, txHash, chain, blockNumber). This matters because hosted order responses could already include these fields, but TypeScript SDK consumers lost them when orderFromV0 converted the wire payload to the public Order shape.
Blast Radius
TypeScript SDK hosted trading mapper only: sdks/typescript/pmxt/hosted-mappers.ts plus a focused Jest test. No sidecar route, OpenAPI schema, Python SDK, or exchange normalizer change.
Consumer Verification
Before (base branch):
orderFromV0 only copied the base order fields plus optional price and fee; provenance/fill metadata such as filled_shares, fee_rate_bps, tx_hash, chain, and block_number was dropped from the public Order object.
After (PR branch):
Focused Jest coverage verifies a hosted-v0 payload containing:
{"filled_shares":"19","fee_rate_bps":"100","tx_hash":"0xabc123","chain":"polygon","block_number":"12345678"}maps to:
filledShares=19, feeRateBps=100, txHash="0xabc123", chain="polygon", blockNumber=12345678
I did not hit the live hosted API because this review environment does not have hosted PMXT credentials.
Test Results
- Build: NOT VERIFIED (
npm run build --workspace=pmxtjsis blocked by missing generated TypeScript SDK artifacts:../generated/src/index.js;npm run build --workspace=pmxt-coreis separately blocked by missing@buidlrrr/rain-sdk/ Rain type errors) - Unit tests: PASS for the focused new test (
npm test --workspace=pmxtjs -- tests/hosted-mappers.test.ts: 1 suite, 1 test passed); full workspace test is NOT VERIFIED because suites importingpmxt/client.tsfail on the missing generated SDK artifacts, while unrelated mapper/error/ws tests pass - Server starts: NOT VERIFIED (not needed for mapper-only static conversion)
- E2E smoke: NOT VERIFIED (hosted API credentials unavailable)
Findings
No blocking findings.
PMXT Pipeline Check
- Field propagation (3-layer): OK for this layer — the TypeScript hosted-v0 mapper now preserves fields already present in the hosted order wire payload/public
Ordertype; no OpenAPI/sidecar response field is introduced here - OpenAPI sync: N/A
- Financial precision: OK for mapper parity; it uses the repository's existing numeric
floatOrUndefinedapproach for order metadata fields - Type safety: OK — no new
anysurface beyond the existingRecord<string, unknown>mapper input - Auth safety: N/A
Semver Impact
patch -- fixes TypeScript SDK field preservation for hosted order objects.
Risk
Not live-verified against hosted PMXT, so this confirms mapper behavior but not that every upstream hosted order endpoint currently emits these fields with exactly these snake/camel spellings.
Summary
Orderobject.filled_shares,fee_rate_bps,tx_hash,chain, andblock_number, with camelCase fallbacks for already-normalized payloads.Fixes #1122
Test Plan
npm test --workspace=pmxtjs -- --runTestsByPath tests/hosted-mappers.test.ts --runInBandgit diff --checkBlocked/local environment note:
npm run build --workspace=pmxtjscurrently fails before this change is typechecked because this focused checkout does not include generated TypeScript artifacts atsdks/typescript/generated/src/index.js.