Skip to content

feat(sdk-core,express): plumb userKeySigningRequired through generateWallet#9315

Draft
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
masterfrom
WCN-1442-userkeysigningrequired-generatewallet
Draft

feat(sdk-core,express): plumb userKeySigningRequired through generateWallet#9315
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
masterfrom
WCN-1442-userkeysigningrequired-generatewallet

Conversation

@bitgo-ai-agent-dev

Copy link
Copy Markdown

What

  • Added optional userKeySigningRequired?: boolean to GenerateWalletOptions interface and GenerateGoAccountWalletOptionsCodec in @bitgo/sdk-core
  • Extended generateGoAccountWallet() in wallets.ts to forward the field into coinSpecific.<chain> of the POST /wallet/add request body when provided
  • Added userKeySigningRequired to the Express GenerateWalletBody io-ts codec so the POST /api/v2/{coin}/wallet/generate route accepts and forwards the field
  • Added unit tests (walletsGoAccount.ts) verifying all three cases: false forwarded, true forwarded, omitted → no coinSpecific
  • Added Express typed-route tests for the new field (happy path + codec rejection of non-boolean)

Why

CAAS clients create OFC wallets through Express or the BitGoJS SDK (generateWallet), not by hitting the wallet-platform v2.wallet.add endpoint directly. The WP endpoint already accepts userKeySigningRequired at wallet creation time (WCN-1441), but this was unreachable from the public SDK/Express surface — generateWallet builds 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-test in modules/sdk-core passes (new walletsGoAccount.ts suite: 3 tests)
  • yarn unit-test in modules/express passes (new userKeySigningRequired typed-route tests)
  • Integration: SDK generateWallet({ type: 'trading', userKeySigningRequired: false }) on an OFC coin → created wallet has coinSpecific.ofc.userKeySigningRequired === false
  • Integration: userKeySigningRequired omitted → coinSpecific absent from request body (WP default preserved)

Ticket: WCN-1442

…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
@linear-code

linear-code Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

WCN-1442

@bitgo-ai-agent-dev
bitgo-ai-agent-dev Bot force-pushed the WCN-1442-userkeysigningrequired-generatewallet branch from 64a139c to ab48ac7 Compare July 21, 2026 16:56
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.

1 participant