feat(sdk-core): make GoStakeOptions.walletPassphrase optional#9062
Merged
zahin-mohammad merged 1 commit intoJun 18, 2026
Conversation
182b41c to
0c2fe89
Compare
OFC wallets that sign remotely via the BitGo key (userKeySigningRequired === false) never read the wallet passphrase, but the required type forced callers to pass one anyway. Relaxing the field to optional lets those callers omit it; the runtime already passes it through and ignores a falsy value on the remote-signing path. Add a unit test covering stake() without a passphrase for an OFC wallet that signs remotely, asserting the /tx/sign endpoint is hit and the preview and finalize calls succeed. Ticket: WCN-1018 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0c2fe89 to
d1b529a
Compare
noel-bitgo
approved these changes
Jun 18, 2026
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
GoStakeOptions.walletPassphrasefrom required to optional in@bitgo/sdk-core. OFC wallets that sign remotely via the BitGo key (userKeySigningRequired === false) never read the passphrase, so requiring it forced callers to pass one anyway.stake()already passes the passphrase straight through, and the remote-signing path ignores a falsy value (signs through the/tx/signendpoint instead of decrypting the user key locally).stake()without a passphrase for an OFC wallet that signs remotely, asserting the/tx/signendpoint is hit and the preview/finalize calls succeed.Test plan
npx mocha 'test/v2/unit/staking/goStakingWalletCommon.ts'inmodules/bitgo— 8 passing (new remote-signing case + existing)eslintclean on changed filesRisk
Low / backward compatible. Relaxing a required field to optional doesn't break existing callers that pass a string; the passphrase guard for wallets that sign locally is unchanged.
Ticket: WCN-1018
🤖 Generated with Claude Code