Drift
TypeScript's normalizeAmountWei deliberately converts the bigint amountWei to a decimal string (.toString()) before putting it in the request body, avoiding IEEE-754 double precision loss for large values. Python's _amount_wei returns the raw int unchanged, which then serializes as a native JSON number literal via json.dumps(body, default=str).
TypeScript SDK
sdks/typescript/pmxt/escrow.ts:51-62, used in the request body at line 130:
function normalizeAmountWei(amountWei: bigint | undefined): string | undefined {
...
return amountWei.toString(); // returns a decimal STRING
}
Python SDK
sdks/python/pmxt/escrow.py:46-56, used in the request body at line 121:
def _amount_wei(value: int | None) -> int | None:
...
return value # returns the raw int, unchanged
Expected
Both SDKs should serialize amount_wei on the wire the same way — Python should stringify large integer values before including them in the request body, matching TypeScript.
Impact
This is different from existing issue #1025, which only concerns the SDK-facing parameter type (bigint vs int), not the wire serialization. amount_wei values for ERC-20 approvals are frequently very large (e.g. near uint256 max for "unlimited" approvals). Sending them as a bare JSON number risks precision loss/misinterpretation by any downstream JSON consumer that treats numbers as IEEE-754 doubles (e.g. a JS-based service) — exactly the failure mode TypeScript's pre-stringification is designed to avoid.
Found by automated SDK cross-language drift audit
Drift
TypeScript's
normalizeAmountWeideliberately converts thebigintamountWeito a decimal string (.toString()) before putting it in the request body, avoiding IEEE-754 double precision loss for large values. Python's_amount_weireturns the rawintunchanged, which then serializes as a native JSON number literal viajson.dumps(body, default=str).TypeScript SDK
sdks/typescript/pmxt/escrow.ts:51-62, used in the request body at line 130:Python SDK
sdks/python/pmxt/escrow.py:46-56, used in the request body at line 121:Expected
Both SDKs should serialize
amount_weion the wire the same way — Python should stringify large integer values before including them in the request body, matching TypeScript.Impact
This is different from existing issue #1025, which only concerns the SDK-facing parameter type (
bigintvsint), not the wire serialization.amount_weivalues for ERC-20 approvals are frequently very large (e.g. near uint256 max for "unlimited" approvals). Sending them as a bare JSON number risks precision loss/misinterpretation by any downstream JSON consumer that treats numbers as IEEE-754 doubles (e.g. a JS-based service) — exactly the failure mode TypeScript's pre-stringification is designed to avoid.Found by automated SDK cross-language drift audit