feat(sdk-core,express): plumb userKeySigningRequired through generateWallet#9315
Draft
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
Draft
feat(sdk-core,express): plumb userKeySigningRequired through generateWallet#9315bitgo-ai-agent-dev[bot] wants to merge 1 commit into
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
Conversation
…Wallet
Add optional `userKeySigningRequired?: boolean` to `GenerateWalletOptions`
and `GenerateGoAccountWalletOptionsCodec` in `@bitgo/sdk-core`, and forward
it into the `coinSpecific` payload sent to `POST /wallet/add` when creating
OFC trading wallets via `generateGoAccountWallet`.
Add the same field to the Express `GenerateWalletBody` io-ts codec so that
the Express route `POST /api/v2/{coin}/wallet/generate` accepts and forwards
the field to the SDK. Because Express routes pass `req.decoded` directly to
`coin.wallets().generateWallet()`, no additional handler changes are required.
Why: CAAS clients create OFC wallets through Express or the SDK, not by
hitting the raw wallet-platform endpoint directly. Without this change, the
`userKeySigningRequired` flag accepted by the WP `v2.wallet.add` endpoint
(WCN-1441) was unreachable via the public SDK/Express surface, so CAAS
clients had no way to opt out of user-key signing at wallet creation time.
Tests: new `walletsGoAccount.ts` unit tests verify that
`userKeySigningRequired: false` is forwarded in `coinSpecific.ofc`, that
`true` is also forwarded when explicitly set, and that `coinSpecific` is
omitted when the field is absent. Express typed-route tests verify the codec
accepts `false` and rejects non-boolean values.
Ticket: WCN-1442
Session-Id: 59053095-e233-45ac-87ae-816c84beb3fd
Task-Id: 161e3fff-cf2b-4145-8924-0b3a51a9f676
Contributor
bitgo-ai-agent-dev
Bot
force-pushed
the
WCN-1442-userkeysigningrequired-generatewallet
branch
from
July 21, 2026 16:56
64a139c to
ab48ac7
Compare
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.
What
userKeySigningRequired?: booleantoGenerateWalletOptionsinterface andGenerateGoAccountWalletOptionsCodecin@bitgo/sdk-coregenerateGoAccountWallet()inwallets.tsto forward the field intocoinSpecific.<chain>of thePOST /wallet/addrequest body when provideduserKeySigningRequiredto the ExpressGenerateWalletBodyio-ts codec so thePOST /api/v2/{coin}/wallet/generateroute accepts and forwards the fieldwalletsGoAccount.ts) verifying all three cases:falseforwarded,trueforwarded, omitted → nocoinSpecificWhy
CAAS clients create OFC wallets through Express or the BitGoJS SDK (
generateWallet), not by hitting the wallet-platformv2.wallet.addendpoint directly. The WP endpoint already acceptsuserKeySigningRequiredat wallet creation time (WCN-1441), but this was unreachable from the public SDK/Express surface —generateWalletbuilds its own request body and arbitrary passthrough is not guaranteed. Without this change, CAAS clients managing thousands of Go Account wallets have no programmatic way to opt out of user-key signing at creation time, forcing them to store encrypted private keys and maintain wallet passwords at scale.Test plan
yarn unit-testinmodules/sdk-corepasses (newwalletsGoAccount.tssuite: 3 tests)yarn unit-testinmodules/expresspasses (newuserKeySigningRequiredtyped-route tests)generateWallet({ type: 'trading', userKeySigningRequired: false })on an OFC coin → created wallet hascoinSpecific.ofc.userKeySigningRequired === falseuserKeySigningRequiredomitted →coinSpecificabsent from request body (WP default preserved)Ticket: WCN-1442