fix(typescript): make Position fields nullable to match core#1418
fix(typescript): make Position fields nullable to match core#1418AbhilashG12 wants to merge 2 commits into
Conversation
- outcomeLabel: string → string | null - entryPrice: number → number | null - currentPrice: number → number | null - unrealizedPnL: number → number | null These fields can be null in hosted mode when mark-to-market data or fill history is unavailable. Fixes pmxt-dev#1405
PR Review: PASS (NOT VERIFIED)What This DoesUpdates the TypeScript SDK Blast RadiusTypeScript SDK model type surface only: Consumer VerificationBefore (base branch): After (PR branch): Test Results
FindingsNo blocking findings. PMXT Pipeline Check
Semver Impactpatch -- widens TypeScript SDK field types to accept runtime-null values without changing behavior. RiskFull TypeScript SDK build was not verified because generated artifacts are absent in the checkout. Also, this PR leaves inline |
Clean up noisy comments from published SDK surface. Fixes pmxt-dev#1405
✅ Ready to Merge!Thanks for the review! I've removed the inline comments from the Position interface. The build failure is due to missing generated artifacts in the review environment - the changes are correct. Ready to merge! 🚀 |
PR Review: PASS (NOT VERIFIED)What This DoesThis widens the TypeScript SDK Blast RadiusTypeScript SDK model types only: Consumer VerificationBefore (base branch): import type { Position } from './sdks/typescript/pmxt/models';
const position: Position = {
marketId: 'm1', outcomeId: 'o1', size: 1,
outcomeLabel: null,
entryPrice: null,
currentPrice: null,
unrealizedPnL: null,
};Command: ./node_modules/.bin/tsc --noEmit --strict --skipLibCheck --moduleResolution node --target ES2022 --module ESNext position-null-probe.tsBase result: After (PR branch): Sidecar HTTP verification was not applicable: this PR changes TypeScript type declarations only, not runtime server behavior or SDK mapping logic. Test Results
FindingsNo blocking findings. PMXT Pipeline Check
Semver Impactpatch -- TypeScript type correction for already-documented hosted-mode nullable fields. RiskFull |
What this PR does
Fixes TypeScript Position interface to match core and Python SDK.
The Problem
Four Position fields are typed as
string/numberbut the hosted API returnsnull:outcomeLabelentryPricecurrentPriceunrealizedPnLThe Fix
Added
| nullto all four fields.Why it matters
TypeScript users will now get proper type warnings when handling nullable fields.
Fixes #1405