Skip to content

refactor: follow parse convention for wasm-solana#181

Merged
lcovar merged 1 commit intomasterfrom
BTC-0.sol-parse-refactor
Feb 27, 2026
Merged

refactor: follow parse convention for wasm-solana#181
lcovar merged 1 commit intomasterfrom
BTC-0.sol-parse-refactor

Conversation

@lcovar
Copy link
Contributor

@lcovar lcovar commented Feb 27, 2026

Remove explainTransaction from wasm-solana per the convention that explain logic belongs in BitGoJS, not in wasm packages (PR #176).

  • Delete explain.ts — type derivation, output/input extraction, fee calculation all move to BitGoJS sdk-coin-sol
  • Change parseTransaction to accept a Transaction object instead of raw bytes, avoiding double deserialization when the caller already has a Transaction from fromBytes()
  • Add parse_from_transaction Rust entry point that accepts a pre-deserialized Transaction, with shared logic in parse_transaction_inner
  • Remove all explain-related exports from index.ts (ExplainedTransaction, TransactionType, StakingAuthorizeInfo, etc.)
  • Fix pre-existing clippy warnings in intent/build.rs

The wasm package now only provides:

  • Transaction.fromBytes(bytes) for deserialization/signing
  • parseTransaction(tx) for decoded instruction data
  • Builder functions for transaction construction

Ticket: BTC-3091

@lcovar lcovar force-pushed the BTC-0.sol-parse-refactor branch 4 times, most recently from b562665 to cbf5895 Compare February 27, 2026 09:24
@lcovar lcovar marked this pull request as ready for review February 27, 2026 09:28
@lcovar lcovar requested a review from a team as a code owner February 27, 2026 09:28
Remove `explainTransaction` from wasm-solana per the convention that
explain logic belongs in BitGoJS, not in wasm packages (PR #176).

- Delete `explain.ts` — type derivation, output/input extraction, fee
  calculation all move to BitGoJS sdk-coin-sol
- Change `parseTransaction` to accept a `Transaction` object instead
  of raw bytes, avoiding double deserialization when the caller already
  has a Transaction from `fromBytes()`
- Add `parse_from_transaction` Rust entry point that accepts a
  pre-deserialized Transaction, with shared logic in `parse_transaction_inner`
- Remove all explain-related exports from index.ts
  (ExplainedTransaction, TransactionType, StakingAuthorizeInfo, etc.)
- Fix pre-existing clippy warnings in intent/build.rs

The wasm package now only provides:
- `Transaction.fromBytes(bytes)` for deserialization/signing
- `parseTransaction(tx)` for decoded instruction data
- Builder functions for transaction construction

Ticket: BTC-3091
@lcovar lcovar merged commit 3901b52 into master Feb 27, 2026
12 checks passed
@lcovar lcovar deleted the BTC-0.sol-parse-refactor branch February 27, 2026 17:47
lcovar added a commit that referenced this pull request Feb 27, 2026
The parse convention refactor (PR #181) was merged with a refactor:
prefix which did not trigger a version bump.

Ticket: BTC-3091
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.

3 participants