feat: port solana explain logic from wasm to sdk-coin-sol#8206
Merged
Conversation
dcbddb2 to
e9a3680
Compare
Port the transaction explanation logic from @bitgo/wasm-solana into BitGoJS per the convention that `explainTransaction` belongs in BitGoJS, not in wasm packages (PR #176). The new wasm-solana only exports `parseTransaction(tx: Transaction)` which returns plain decoded data. All explain logic now lives in `explainTransactionWasm.ts`: - Transaction type derivation (Send, StakingActivate, StakingDeactivate, StakingWithdraw, StakingAuthorize, StakingDelegate, WalletInitialization, AssociatedTokenAccountInitialization) - Combined instruction pattern detection (CreateAccount + StakeInitialize → StakingActivate, CreateAccount + NonceInitialize → WalletInitialization) - Output/input extraction with Marinade deactivate handling - Fee calculation (signatures × lamportsPerSignature + ATA rent) - Memo extraction, ATA owner mapping, staking authorize mapping - Token name resolution via @bitgo/statics Also updates the Jito WASM verification test to use the new `Transaction.fromBytes()` + `parseTransaction(tx)` API. 545 tests passing, 0 failing. Ticket: BTC-3092
e9a3680 to
d2955c9
Compare
margueriteblair
approved these changes
Feb 28, 2026
mukeshsp
approved these changes
Mar 2, 2026
abk404
approved these changes
Mar 2, 2026
2 tasks
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.
Port the transaction explanation logic from @bitgo/wasm-solana into BitGoJS per the convention that
explainTransactionbelongs in BitGoJS, not in wasm packages (PR #176).The new wasm-solana only exports
parseTransaction(tx: Transaction)which returns plain decoded data. All explain logic now lives inexplainTransactionWasm.ts:Also updates the Jito WASM verification test to use the new
Transaction.fromBytes()+parseTransaction(tx)API.545 tests passing, 0 failing.
Ticket: BTC-3092