Skip to content

Commit d03a236

Browse files
committed
refactor: added supterests and modified request codec
TICKET: WP-5415
1 parent 678e891 commit d03a236

File tree

3 files changed

+402
-5
lines changed

3 files changed

+402
-5
lines changed

modules/express/src/clientRoutes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ export async function handleV2OFCSignPayload(
640640
export async function handleV2GenerateWallet(req: ExpressApiRouteRequest<'express.wallet.generate', 'post'>) {
641641
const bitgo = req.bitgo;
642642
const coin = bitgo.coin(req.decoded.coin);
643-
const result = await coin.wallets().generateWallet(req.body);
643+
const result = await coin.wallets().generateWallet(req.decoded as any);
644644
if ((req.decoded.includeKeychains as any) === false) {
645645
return result.wallet.toJSON();
646646
}

modules/express/src/typedRoutes/api/v2/generateWallet.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ import { multisigType, walletType } from '../../schemas/wallet';
1111
export const GenerateWalletBody = {
1212
/** Wallet label */
1313
label: t.string,
14-
/** Enterprise id. This is required for Ethereum wallets since they can only be created as part of an enterprise */
15-
enterprise: t.string,
14+
/** Enterprise id. Required for Ethereum wallets since they can only be created as part of an enterprise. Optional for other coins. */
15+
enterprise: optional(t.string),
1616
/** If absent, BitGo uses the default wallet type for the asset */
17-
multisigType: multisigType,
17+
multisigType: optional(multisigType),
1818
/** The type of wallet, defined by key management and signing protocols. 'hot' and 'cold' are both self-managed wallets. If absent, defaults to 'hot' */
19-
type: walletType,
19+
type: optional(walletType),
2020
/** Passphrase to be used to encrypt the user key on the wallet */
2121
passphrase: optional(t.string),
2222
/** User provided public key */

0 commit comments

Comments
 (0)