feat(sdk-core,express): plumb userKeySigningRequired through generateWallet#9335
feat(sdk-core,express): plumb userKeySigningRequired through generateWallet#9335zahin-mohammad wants to merge 1 commit into
Conversation
e4d1cab to
dec1f81
Compare
|
@claude can you please review this PR? Also, could you check this specific comment (#9335 (comment)) and let me know if it is valid? |
|
Claude finished @rishikeshdadam136's task —— View job PR Review Analysis: Critical Data Structure Mismatch Found
|
dec1f81 to
0644990
Compare
…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`, 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
0644990 to
805a095
Compare
|
@rishikeshdadam136 Thanks for the review. The flagged
|
Summary
userKeySigningRequired?: booleantoGenerateWalletOptionsandGenerateGoAccountWalletOptionsCodecin@bitgo/sdk-core, forwarded into thecoinSpecificpayload ofPOST /wallet/addwhen creating OFC trading wallets viagenerateGoAccountWallet.GenerateWalletBodyio-ts codec soPOST /api/v2/{coin}/wallet/generateaccepts and forwards it to the SDK.userKeySigningRequiredflag accepted at wallet creation time (WCN-1441) was unreachable via the public SDK/Express surface, leaving clients no way to opt out of user-key signing at creation.Test plan
yarn unit-testinmodules/sdk-corepasses (newwalletsGoAccount.tssuite: 3 tests —falseforwarded,trueforwarded, omitted → nocoinSpecific)yarn unit-testinmodules/expresspasses (new typed-route tests: happy path + codec rejection of non-boolean)generateWallet({ type: 'trading', userKeySigningRequired: false })on an OFC coin → created wallet hascoinSpecific.ofc.userKeySigningRequired === falseuserKeySigningRequiredomitted →coinSpecificabsent from request body (default preserved)Ticket: WCN-1442