File tree Expand file tree Collapse file tree 2 files changed +14
-12
lines changed
modules/express/src/lightning Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -33,17 +33,19 @@ export const GetWalletStateResponse = t.type(
3333
3434export type GetWalletStateResponse = t . TypeOf < typeof GetWalletStateResponse > ;
3535
36- export const InitLightningWalletRequest = t . strict (
37- {
38- walletId : t . string ,
39- passphrase : t . string ,
40- signerIP : IPAddress ,
41- signerTlsCert : t . string ,
42- signerTlsKey : t . string ,
43- expressIP : IPAddress ,
44- } ,
45- 'InitLightningWalletRequest'
46- ) ;
36+ export const InitLightningWalletRequest = t . intersection ( [
37+ t . strict (
38+ {
39+ walletId : t . string ,
40+ passphrase : t . string ,
41+ signerIP : IPAddress ,
42+ signerTlsCert : t . string ,
43+ signerTlsKey : t . string ,
44+ } ,
45+ 'InitLightningWalletRequest'
46+ ) ,
47+ t . partial ( { expressIP : IPAddress } ) ,
48+ ] ) ;
4749
4850export type InitLightningWalletRequest = t . TypeOf < typeof InitLightningWalletRequest > ;
4951
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ export async function handleInitLightningWallet(req: express.Request): Promise<u
9494
9595 const encryptedSignerAdminMacaroon = bitgo . encrypt ( {
9696 password : passphrase ,
97- input : addIPCaveatToMacaroon ( adminMacaroon , expressIP ) ,
97+ input : expressIP ? addIPCaveatToMacaroon ( adminMacaroon , expressIP ) : adminMacaroon ,
9898 } ) ;
9999 const encryptedSignerTlsKey = bitgo . encrypt ( { password : passphrase , input : signerTlsKey } ) ;
100100 const watchOnly = createWatchOnly ( signerRootKey , network ) ;
You can’t perform that action at this time.
0 commit comments