You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SDK drift: orderFromV0 in TypeScript does not map filledShares, feeRateBps, txHash, chain, blockNumber from V0 payload; Python order_from_v0 does #1122
The V0-wire-to-Order mappers diverge in which fields they extract from the hosted API response. Python's order_from_v0 reads tx_hash, chain, block_number, and raw from the V0 payload and surfaces them on the returned Order object. TypeScript's orderFromV0 maps only the basic trading fields and silently discards all on-chain provenance fields. An Order returned from a hosted call in TypeScript is therefore missing fields that the same call in Python populates.
// Fields mapped:id,marketId,outcomeId,side,type,amount,status,filled,remaining,timestamp,price?,fee?
// NOT mapped from V0 payload:// filledShares, feeRateBps, txHash, chain, blockNumber, raw
Order in models.ts does define filledShares?, feeRateBps?, txHash?, chain?, blockNumber? on the interface, but orderFromV0 never reads those keys from the wire payload.
# Extra fields mapped from V0 payload:tx_hash->order.tx_hashchain->order.chainblock_number->order.block_numberraw->order.raw (entirepayloadstoredverbatim)
Impact
A TypeScript hosted-mode caller that inspects order.txHash after createOrder / submitOrder always receives undefined, even when the trading API populated tx_hash in the response.
The filledShares field (V0 key filled_shares) and feeRateBps field (V0 key fee_rate_bps) are defined on the TypeScript Order interface but are never set by orderFromV0, making them perpetually undefined for hosted orders.
Python callers can access the full on-chain provenance (tx_hash, chain, block_number) and the raw server payload; TypeScript callers cannot without re-parsing the raw HTTP response themselves.
Summary
The V0-wire-to-Order mappers diverge in which fields they extract from the hosted API response. Python's
order_from_v0readstx_hash,chain,block_number, andrawfrom the V0 payload and surfaces them on the returnedOrderobject. TypeScript'sorderFromV0maps only the basic trading fields and silently discards all on-chain provenance fields. AnOrderreturned from a hosted call in TypeScript is therefore missing fields that the same call in Python populates.TypeScript
sdks/typescript/pmxt/hosted-mappers.ts(orderFromV0, ~lines 47–77) maps:Orderinmodels.tsdoes definefilledShares?,feeRateBps?,txHash?,chain?,blockNumber?on the interface, butorderFromV0never reads those keys from the wire payload.Python
sdks/python/pmxt/_hosted_mappers.py(order_from_v0, ~lines 32–53) additionally maps:Impact
order.txHashaftercreateOrder/submitOrderalways receivesundefined, even when the trading API populatedtx_hashin the response.filledSharesfield (V0 keyfilled_shares) andfeeRateBpsfield (V0 keyfee_rate_bps) are defined on the TypeScriptOrderinterface but are never set byorderFromV0, making them perpetuallyundefinedfor hosted orders.tx_hash,chain,block_number) and the raw server payload; TypeScript callers cannot without re-parsing the raw HTTP response themselves.built_order_from_v0(missing entirely in TypeScript) is tracked in SDK drift: Python_hosted_mappers.pyhasbuilt_order_from_v0/built_order_to_v0; TypeScripthosted-mappers.tshas no equivalents #1027.