Conversation
Wire @bitgo/wasm-ton into sdk-coin-ton for address derivation, transaction parsing, and signing — replacing the TonWeb-based paths with offline Rust/WASM. - package.json: add @bitgo/wasm-ton dependency - explainTransactionWasm.ts: WASM-based explainTransaction using parseTransaction(), maps ParsedTransaction to TonTransactionExplanation shape, handles Send, SendToken (Jetton), SingleNominatorWithdraw, TonWhalesDeposit, TonWhalesWithdrawal - wasmAddress.ts: synchronous getAddressFromPublicKey using encodeAddress(), replaces async TonWeb wallet.getAddress() call - wasmSigner.ts: getSignablePayload() and applySignature() using Transaction.fromBase64() / signablePayload() / addSignature() / toBroadcastFormat() - utils.ts: getAddressFromPublicKey delegates to wasmAddress (async signature preserved) - ton.ts: explainTransaction uses WASM parser, getSignablePayload uses WASM - tests: wasmExplainTransaction, wasmAddress, wasmSigner unit test suites TICKET: BTC-3200
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Integrates
@bitgo/wasm-tonintosdk-coin-ton, replacing TonWeb-basedtransaction parsing, address derivation, and signing payload extraction with
offline Rust/WASM.
what changed
explainTransactionWasm.ts: new module with
explainTonTransaction()thatparses TON transactions via WASM and maps to the
TonTransactionExplanationshape. handles Send, SendToken (Jetton), SingleNominatorWithdraw,
TonWhalesDeposit, and TonWhalesWithdrawal.
wasmAddress.ts: synchronous
getAddressFromPublicKey()usingencodeAddress()from@bitgo/wasm-ton, replacing the async TonWebwallet.getAddress()call. async signature preserved inutils.tsforbackward compatibility.
wasmSigner.ts:
getSignablePayload()andapplySignature()wiring —uses
Transaction.fromBase64()→signablePayload()→addSignature()→toBroadcastFormat().ton.ts:
explainTransactionandgetSignablePayloadnow route throughWASM. the legacy
TransactionBuilderpath is preserved for unsignedtransaction building and the
recover()flow.package.json: adds
@bitgo/wasm-ton: "*"dependency.tests: three new test suites —
wasmExplainTransaction.ts,wasmAddress.ts,wasmSigner.ts— covering all transaction types usingexisting fixtures.
scope
explainTransactionandgetSignablePayloadinton.tsnow use the WASMpath for all transaction types. the legacy builder path (
TransactionBuilder,TransferBuilder, etc.) remains in place for transaction construction.TICKET: BTC-3200