File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -641,7 +641,7 @@ export async function handleV2GenerateWallet(req: ExpressApiRouteRequest<'expres
641641 const bitgo = req . bitgo ;
642642 const coin = bitgo . coin ( req . decoded . coin ) ;
643643 const result = await coin . wallets ( ) . generateWallet ( req . body ) ;
644- if ( req . query . includeKeychains === ' false' ) {
644+ if ( ( req . decoded . includeKeychains as any ) === false ) {
645645 return result . wallet . toJSON ( ) ;
646646 }
647647 return { ...result , wallet : result . wallet . toJSON ( ) } ;
Original file line number Diff line number Diff line change 11import * as t from 'io-ts' ;
2+ import { BooleanFromString } from 'io-ts-types' ;
23import { httpRoute , httpRequest , optional } from '@api-ts/io-ts-http' ;
34import { BitgoExpressError } from '../../schemas/error' ;
45import { UserKeychainCodec , BackupKeychainCodec , BitgoKeychainCodec } from '../../schemas/keychain' ;
@@ -80,7 +81,7 @@ export const GenerateWalletV2Params = {
8081 */
8182export const GenerateWalletV2Query = {
8283 /** Include user, backup and bitgo keychains along with generated wallet */
83- includeKeychains : optional ( t . string ) ,
84+ includeKeychains : optional ( BooleanFromString ) ,
8485} ;
8586
8687/**
Original file line number Diff line number Diff line change @@ -101,12 +101,13 @@ describe('Generate Wallet', () => {
101101 coin,
102102 } ,
103103 query : {
104- includeKeychains : ' true' ,
104+ includeKeychains : true ,
105105 } ,
106106 body : walletGenerateBody ,
107107 decoded : {
108108 ...walletGenerateBody ,
109109 coin,
110+ includeKeychains : true ,
110111 } ,
111112 } as unknown as ExpressApiRouteRequest < 'express.wallet.generate' , 'post' > ;
112113
@@ -186,12 +187,13 @@ describe('Generate Wallet', () => {
186187 coin,
187188 } ,
188189 query : {
189- includeKeychains : ' false' ,
190+ includeKeychains : false ,
190191 } ,
191192 body : walletGenerateBody ,
192193 decoded : {
193194 ...walletGenerateBody ,
194195 coin,
196+ includeKeychains : false ,
195197 } ,
196198 } as unknown as ExpressApiRouteRequest < 'express.wallet.generate' , 'post' > ;
197199
You can’t perform that action at this time.
0 commit comments