Skip to content

feat: port solana explain logic from wasm to sdk-coin-sol#8206

Merged
lcovar merged 1 commit intomasterfrom
BTC-0.sol-parse-refactor
Mar 2, 2026
Merged

feat: port solana explain logic from wasm to sdk-coin-sol#8206
lcovar merged 1 commit intomasterfrom
BTC-0.sol-parse-refactor

Conversation

@lcovar
Copy link
Contributor

@lcovar lcovar commented Feb 27, 2026

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

@lcovar lcovar force-pushed the BTC-0.sol-parse-refactor branch 4 times, most recently from dcbddb2 to e9a3680 Compare February 27, 2026 19:29
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
@lcovar lcovar force-pushed the BTC-0.sol-parse-refactor branch from e9a3680 to d2955c9 Compare February 27, 2026 19:31
@lcovar lcovar marked this pull request as ready for review February 27, 2026 19:32
@lcovar lcovar requested review from a team as code owners February 27, 2026 19:32
@lcovar lcovar merged commit f57cee0 into master Mar 2, 2026
21 checks passed
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.

4 participants