diff --git a/modules/sdk-core/src/bitgo/baseCoin/iBaseCoin.ts b/modules/sdk-core/src/bitgo/baseCoin/iBaseCoin.ts index 1404ab5111..ac0925ee1b 100644 --- a/modules/sdk-core/src/bitgo/baseCoin/iBaseCoin.ts +++ b/modules/sdk-core/src/bitgo/baseCoin/iBaseCoin.ts @@ -239,6 +239,7 @@ export interface SupplementGenerateWalletOptions { subType?: 'lightningCustody' | 'lightningSelfCustody' | 'onPrem'; coinSpecific?: { [coinName: string]: unknown }; evmKeyRingReferenceWalletId?: string; + lightningProvider?: 'voltage' | 'amboss'; } export interface FeeEstimateOptions { diff --git a/modules/sdk-core/src/bitgo/wallet/iWallets.ts b/modules/sdk-core/src/bitgo/wallet/iWallets.ts index f1389a5ab5..1aedf827c0 100644 --- a/modules/sdk-core/src/bitgo/wallet/iWallets.ts +++ b/modules/sdk-core/src/bitgo/wallet/iWallets.ts @@ -82,17 +82,21 @@ export interface GenerateWalletOptions { evmKeyRingReferenceWalletId?: string; } -export const GenerateLightningWalletOptionsCodec = t.strict( - { - label: t.string, - passphrase: t.string, - enterprise: t.string, - passcodeEncryptionCode: t.string, - subType: t.union([t.literal('lightningCustody'), t.literal('lightningSelfCustody')]), - }, +export const GenerateLightningWalletOptionsCodec = t.intersection( + [ + t.strict({ + label: t.string, + passphrase: t.string, + enterprise: t.string, + passcodeEncryptionCode: t.string, + subType: t.union([t.literal('lightningCustody'), t.literal('lightningSelfCustody')]), + }), + t.partial({ + lightningProvider: t.union([t.literal('amboss'), t.literal('voltage')]), + }), + ], 'GenerateLightningWalletOptions' ); - export type GenerateLightningWalletOptions = t.TypeOf; export const GenerateGoAccountWalletOptionsCodec = t.strict( diff --git a/modules/sdk-core/src/bitgo/wallet/wallets.ts b/modules/sdk-core/src/bitgo/wallet/wallets.ts index 77faeeac69..323f2250f0 100644 --- a/modules/sdk-core/src/bitgo/wallet/wallets.ts +++ b/modules/sdk-core/src/bitgo/wallet/wallets.ts @@ -169,7 +169,7 @@ export class Wallets implements IWallets { const reqId = new RequestTracer(); this.bitgo.setRequestTracer(reqId); - const { label, passphrase, enterprise, passcodeEncryptionCode, subType } = params; + const { label, passphrase, enterprise, passcodeEncryptionCode, subType, lightningProvider } = params; // TODO BTC-1899: only userAuth key is required for custodial lightning wallet. all 3 keys are required for self custodial lightning. // 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 { enterprise, keys: [userKeychain.id], coinSpecific: { [this.baseCoin.getChain()]: { keys: [userAuthKeychain.id, nodeAuthKeychain.id] } }, + lightningProvider, }; const newWallet = await this.bitgo.post(this.baseCoin.url('/wallet/add')).send(walletParams).result();