Skip to content

feat(sdk-core): make GoStakeOptions.walletPassphrase optional#9062

Merged
zahin-mohammad merged 1 commit into
masterfrom
zahinmohammad/wcn-1018-make-gostakeoptionswalletpassphrase-optional-in-sdk-remove
Jun 18, 2026
Merged

feat(sdk-core): make GoStakeOptions.walletPassphrase optional#9062
zahin-mohammad merged 1 commit into
masterfrom
zahinmohammad/wcn-1018-make-gostakeoptionswalletpassphrase-optional-in-sdk-remove

Conversation

@zahin-mohammad

@zahin-mohammad zahin-mohammad commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Relax GoStakeOptions.walletPassphrase from 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.
  • No runtime change needed: stake() already passes the passphrase straight through, and the remote-signing path ignores a falsy value (signs through the /tx/sign endpoint instead of decrypting the user key locally).
  • Add a unit test exercising stake() without a passphrase for an OFC wallet that signs remotely, asserting the /tx/sign endpoint is hit and the preview/finalize calls succeed.

Test plan

  • npx mocha 'test/v2/unit/staking/goStakingWalletCommon.ts' in modules/bitgo — 8 passing (new remote-signing case + existing)
  • eslint clean on changed files

Risk

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

@linear-code

linear-code Bot commented Jun 18, 2026

Copy link
Copy Markdown

WCN-1018

@zahin-mohammad zahin-mohammad force-pushed the zahinmohammad/wcn-1018-make-gostakeoptionswalletpassphrase-optional-in-sdk-remove branch from 182b41c to 0c2fe89 Compare June 18, 2026 18:56
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>
@zahin-mohammad zahin-mohammad force-pushed the zahinmohammad/wcn-1018-make-gostakeoptionswalletpassphrase-optional-in-sdk-remove branch from 0c2fe89 to d1b529a Compare June 18, 2026 19:02
@zahin-mohammad zahin-mohammad merged commit 4599120 into master Jun 18, 2026
22 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.

2 participants