Skip to content

Commit da3499f

Browse files
authored
Merge pull request #7527 from BitGo/BTC-2760
feat: add support for specifying lightning provider
2 parents 3b4d2b4 + d8fba3a commit da3499f

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

modules/sdk-core/src/bitgo/baseCoin/iBaseCoin.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ export interface SupplementGenerateWalletOptions {
239239
subType?: 'lightningCustody' | 'lightningSelfCustody' | 'onPrem';
240240
coinSpecific?: { [coinName: string]: unknown };
241241
evmKeyRingReferenceWalletId?: string;
242+
lightningProvider?: 'voltage' | 'amboss';
242243
}
243244

244245
export interface FeeEstimateOptions {

modules/sdk-core/src/bitgo/wallet/iWallets.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,21 @@ export interface GenerateWalletOptions {
8282
evmKeyRingReferenceWalletId?: string;
8383
}
8484

85-
export const GenerateLightningWalletOptionsCodec = t.strict(
86-
{
87-
label: t.string,
88-
passphrase: t.string,
89-
enterprise: t.string,
90-
passcodeEncryptionCode: t.string,
91-
subType: t.union([t.literal('lightningCustody'), t.literal('lightningSelfCustody')]),
92-
},
85+
export const GenerateLightningWalletOptionsCodec = t.intersection(
86+
[
87+
t.strict({
88+
label: t.string,
89+
passphrase: t.string,
90+
enterprise: t.string,
91+
passcodeEncryptionCode: t.string,
92+
subType: t.union([t.literal('lightningCustody'), t.literal('lightningSelfCustody')]),
93+
}),
94+
t.partial({
95+
lightningProvider: t.union([t.literal('amboss'), t.literal('voltage')]),
96+
}),
97+
],
9398
'GenerateLightningWalletOptions'
9499
);
95-
96100
export type GenerateLightningWalletOptions = t.TypeOf<typeof GenerateLightningWalletOptionsCodec>;
97101

98102
export const GenerateGoAccountWalletOptionsCodec = t.strict(

modules/sdk-core/src/bitgo/wallet/wallets.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export class Wallets implements IWallets {
169169
const reqId = new RequestTracer();
170170
this.bitgo.setRequestTracer(reqId);
171171

172-
const { label, passphrase, enterprise, passcodeEncryptionCode, subType } = params;
172+
const { label, passphrase, enterprise, passcodeEncryptionCode, subType, lightningProvider } = params;
173173

174174
// TODO BTC-1899: only userAuth key is required for custodial lightning wallet. all 3 keys are required for self custodial lightning.
175175
// to avoid changing the platform for custodial flow, let us all 3 keys both wallet types.
@@ -203,6 +203,7 @@ export class Wallets implements IWallets {
203203
enterprise,
204204
keys: [userKeychain.id],
205205
coinSpecific: { [this.baseCoin.getChain()]: { keys: [userAuthKeychain.id, nodeAuthKeychain.id] } },
206+
lightningProvider,
206207
};
207208

208209
const newWallet = await this.bitgo.post(this.baseCoin.url('/wallet/add')).send(walletParams).result();

0 commit comments

Comments
 (0)