Skip to content

feat: add wasm-ton package#230

Closed
lcovar wants to merge 1 commit intomasterfrom
wasm-ton
Closed

feat: add wasm-ton package#230
lcovar wants to merge 1 commit intomasterfrom
wasm-ton

Conversation

@lcovar
Copy link
Copy Markdown
Contributor

@lcovar lcovar commented Mar 26, 2026

Summary

New @bitgo/wasm-ton package implementing TON transaction building, parsing, and signing in Rust/WASM.

What's included

  • Address: encode/decode/validate V4R2 wallet addresses from Ed25519 public keys
  • Transaction: deserialize BOC, extract signable payload (SHA-256 cell hash), place Ed25519 signature, serialize for broadcast (base64 BOC)
  • Parser: standalone parseTransaction detecting Send, SendToken, TonWhalesDeposit, TonWhalesWithdrawal, SingleNominatorWithdraw
  • Builder: 5 intent types with all sub-variants:
    • payment (native + jetton TEP-74)
    • fillNonce (native + jetton)
    • consolidate (native + jetton, mode 128)
    • delegate (TON Whales, Single Nominator, Multi Nominator, vesting)
    • undelegate (TON Whales, Single Nominator, Multi Nominator, vesting)

Rust crates

  • tlb 0.7.3 (Cell/BOC serialization)
  • tlb-ton 0.7.3 (MsgAddress, Message, Grams)
  • ton-contracts 0.7.3 (V4R2/V5R1, Jetton TEP-74)

Tests

  • 52 Rust unit tests
  • 63 TypeScript tests (address, transaction, parser, builder)
  • WASM binary: 496KB (176KB gzipped)

…ntent building

Implements @bitgo/wasm-ton with full support for:
- Address encoding/decoding/validation (V4R2 wallet addresses)
- Transaction parsing (native transfers, jetton TEP-74, whales staking, single nominator)
- Transaction signing (signable payload extraction, signature placement)
- Intent-based building for all 5 intent types:
  - payment (native + jetton)
  - fillNonce (native + jetton)
  - consolidate (native + jetton)
  - delegate (TON Whales, Single Nominator, Multi Nominator, vesting)
  - undelegate (TON Whales, Single Nominator, Multi Nominator, vesting)

Rust crates: tlb + tlb-ton + ton-contracts (pure Rust, WASM-compatible)
52 Rust unit tests, 63 TypeScript tests
@lcovar lcovar closed this Mar 26, 2026
@lcovar lcovar deleted the wasm-ton branch March 26, 2026 23:23
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