feat: add --tx-version option to build legacy transactions - #109
Merged
Conversation
Member
trevor-cortex
approved these changes
Aug 29, 2026
trevor-cortex
left a comment
There was a problem hiding this comment.
Summary
Adds a global --tx-version <version> CLI option (legacy | 0, default 0) so exported transactions can be built as legacy transactions — needed because Squads v3 only accepts legacy transactions when importing base58-encoded transactions. The option is threaded into the transaction planner via a new getTransactionConfig helper, and the README documents both the flag and the Squads v3 workflow.
The implementation looks solid:
TransactionPlannerConfigin@solana/kit-plugin-rpcacceptsversion: 0 | 'legacy'(defaulting to0), so passing the parsed value through is correct, and the explicitversion: 0default preserves the previous behavior.- The
.choices()+.default()+.argParser()pattern matches the existing house style inoptions.ts(compressionOption,encodingOption, etc.). Nice touch using the parsed representation (0as a number) for the default value, since Commander doesn't runargParseron defaults — an easy trap to fall into. - The custom
InvalidArgumentErrormessage mirrors Commander's own choices-validation wording, which matters since.argParser()replaces the validator that.choices()installs.
Notes for reviewers
- One non-blocking inline suggestion on
getTransactionConfig: the exhaustive switch is a nice future-proofing pattern, but since this tsconfig doesn't enablenoImplicitReturns, the compiler won't actually catch the missing case when a version1is added later — see inline comment. - Out of scope for this PR, but adjacent to the new code path:
priorityFeesOptionuses.default('100000')with a string default, and since Commander doesn't runargParseron defaults,microLamportsPerComputeUnitreceives the string'100000'(not aMicroLamportsbigint) whenever the flag isn't passed. Pre-existing behavior, just worth a follow-up look.
lorisleiva
approved these changes
Aug 29, 2026
lorisleiva
left a comment
Member
There was a problem hiding this comment.
That's a great improvement and it'll make it easier for us to add tx v1 support so thank you!
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.
Summary
Adds a global
--tx-version <version>option to the CLI so users can build legacy transactions instead of version 0 transactions. Squads v3 only accepts legacy transactions when importing a base58 encoded transaction, so exports for a v3 multisig failed to import.Usage