Skip to content

fix(wasm-ton): preserve wide parsed amounts - #395

Draft
ralph-bitgo[bot] wants to merge 1 commit into
masterfrom
wcn-1889-preserve-ton-amounts
Draft

ralph-bitgo[bot] wants to merge 1 commit into
masterfrom
wcn-1889-preserve-ton-amounts

Conversation

@ralph-bitgo

@ralph-bitgo ralph-bitgo Bot commented Sep 24, 2026

Copy link
Copy Markdown

What

  • Preserve TON VarUInteger monetary fields as BigUint through parsing and
    export exact JavaScript BigInt values. Add boundary and signed-broadcast
    round-trip coverage for native, jetton, forward-TON, and withdrawal
    amounts.

Why

  • Valid imported TEP-74 amounts can exceed u64::MAX. Saturation made the
    review result smaller than the value retained in the same transaction's
    signable payload, undermining amount review and policy checks.

Test plan

  • cargo fmt --manifest-path packages/wasm-ton/Cargo.toml -- --check
  • cargo test --manifest-path packages/wasm-ton/Cargo.toml
  • wasm-pack test --node packages/wasm-ton

Ticket: WCN-1889

Keep VarUInteger amounts as BigUint through parsing and JS conversion.
This prevents imported jetton transactions from displaying less than the
amount retained in the payload being signed.

Ticket: WCN-1889
Session-Id: 85a83a83-7b29-4934-8272-e887c7f6dfad
Task-Id: c8bb1d41-fd1f-4c22-95b6-803aec6d72ea
@ralph-bitgo
ralph-bitgo Bot force-pushed the wcn-1889-preserve-ton-amounts branch from 9fd5297 to 9e467e8 Compare September 24, 2026 00:34
@linear-code

linear-code Bot commented Sep 24, 2026

Copy link
Copy Markdown

WCN-1889

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant