Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/sdk-core/src/bitgo/baseCoin/iBaseCoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ export interface SupplementGenerateWalletOptions {
subType?: 'lightningCustody' | 'lightningSelfCustody' | 'onPrem';
coinSpecific?: { [coinName: string]: unknown };
evmKeyRingReferenceWalletId?: string;
lightningProvider?: 'voltage' | 'amboss';
}

export interface FeeEstimateOptions {
Expand Down
22 changes: 13 additions & 9 deletions modules/sdk-core/src/bitgo/wallet/iWallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof GenerateLightningWalletOptionsCodec>;

export const GenerateGoAccountWalletOptionsCodec = t.strict(
Expand Down
3 changes: 2 additions & 1 deletion modules/sdk-core/src/bitgo/wallet/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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();
Expand Down