File tree Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -663,7 +663,7 @@ export async function handleV2GenerateWallet(req: express.Request) {
663
663
export async function handleV2CreateAddress ( req : ExpressApiRouteRequest < 'express.v2.wallet.createAddress' , 'post' > ) {
664
664
const bitgo = req . bitgo ;
665
665
const coin = bitgo . coin ( req . decoded . coin ) ;
666
- const wallet = await coin . wallets ( ) . get ( { id : req . decoded . walletId } ) ;
666
+ const wallet = await coin . wallets ( ) . get ( { id : req . decoded . id } ) ;
667
667
return wallet . createAddress ( req . decoded ) ;
668
668
}
669
669
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export const CreateAddressParams = {
10
10
/** Coin ticker / chain identifier */
11
11
coin : t . string ,
12
12
/** The ID of the wallet. */
13
- walletId : t . string ,
13
+ id : t . string ,
14
14
} as const ;
15
15
16
16
/**
@@ -62,6 +62,7 @@ export const CreateAddressResponse = {
62
62
/**
63
63
* Create address for a wallet
64
64
*
65
+ * @tag express
65
66
* @operationId express.v2.wallet.createAddress
66
67
*/
67
68
export const PostCreateAddress = httpRoute ( {
Original file line number Diff line number Diff line change @@ -31,15 +31,15 @@ describe('Create Address', () => {
31
31
bitgo : bitgoStub ,
32
32
params : {
33
33
coin : 'tbtc' ,
34
- walletId : '23423423423423' ,
34
+ id : '23423423423423' ,
35
35
} ,
36
36
query : { } ,
37
37
body : {
38
38
chain : 0 ,
39
39
} ,
40
40
decoded : {
41
41
coin : 'tbtc' ,
42
- walletId : '23423423423423' ,
42
+ id : '23423423423423' ,
43
43
chain : 0 ,
44
44
} ,
45
45
} as unknown as ExpressApiRouteRequest < 'express.v2.wallet.createAddress' , 'post' > ;
Original file line number Diff line number Diff line change @@ -193,16 +193,16 @@ describe('io-ts decode tests', function () {
193
193
} ) ;
194
194
195
195
it ( 'express.v2.wallet.createAddress params' , function ( ) {
196
- // missing walletId
196
+ // missing id
197
197
assert . throws ( ( ) => assertDecode ( t . type ( CreateAddressParams ) , { coin : 'btc' } ) ) ;
198
198
// coin must be string
199
199
assert . throws ( ( ) =>
200
- assertDecode ( t . type ( CreateAddressParams ) , { coin : 123 , walletId : '59cd72485007a239fb00282ed480da1f' } )
200
+ assertDecode ( t . type ( CreateAddressParams ) , { coin : 123 , id : '59cd72485007a239fb00282ed480da1f' } )
201
201
) ;
202
- // walletId must be string
203
- assert . throws ( ( ) => assertDecode ( t . type ( CreateAddressParams ) , { coin : 'btc' , walletId : 123 } ) ) ;
202
+ // id must be string
203
+ assert . throws ( ( ) => assertDecode ( t . type ( CreateAddressParams ) , { coin : 'btc' , id : 123 } ) ) ;
204
204
// valid params
205
- assertDecode ( t . type ( CreateAddressParams ) , { coin : 'btc' , walletId : '59cd72485007a239fb00282ed480da1f' } ) ;
205
+ assertDecode ( t . type ( CreateAddressParams ) , { coin : 'btc' , id : '59cd72485007a239fb00282ed480da1f' } ) ;
206
206
// invalid body
207
207
assert . throws ( ( ) => assertDecode ( t . type ( CreateAddressBody ) , { chain : '1' } ) ) ;
208
208
assert . throws ( ( ) => assertDecode ( t . type ( CreateAddressBody ) , { format : 'invalid' } ) ) ;
You can’t perform that action at this time.
0 commit comments