Skip to content

Commit

Permalink
Merge pull request #5065 from BitGo/wallet-version-6
Browse files Browse the repository at this point in the history
  • Loading branch information
dpkjnr authored Oct 25, 2024
2 parents b5dc1c1 + 6ac4ba3 commit 28fa948
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions modules/sdk-core/src/bitgo/wallet/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,22 +291,29 @@ export class Wallets implements IWallets {
walletParams.enterprise = enterprise;
}

// EVM TSS wallets must use wallet version 3 and 5
if (isTss && this.baseCoin.isEVM() && !(params.walletVersion === 3 || params.walletVersion === 5)) {
throw new Error('EVM TSS wallets are only supported for wallet version 3 and 5');
// EVM TSS wallets must use wallet version 3, 5 and 6
if (
isTss &&
this.baseCoin.isEVM() &&
!(params.walletVersion === 3 || params.walletVersion === 5 || params.walletVersion === 6)
) {
throw new Error('EVM TSS wallets are only supported for wallet version 3, 5 and 6');
}

if (isTss) {
if (!this.baseCoin.supportsTss()) {
throw new Error(`coin ${this.baseCoin.getFamily()} does not support TSS at this time`);
}
if (params.walletVersion === 5 && !this.baseCoin.getConfig().features.includes(CoinFeature.MPCV2)) {
if (
(params.walletVersion === 5 || params.walletVersion === 6) &&
!this.baseCoin.getConfig().features.includes(CoinFeature.MPCV2)
) {
throw new Error(`coin ${this.baseCoin.getFamily()} does not support TSS MPCv2 at this time`);
}
assert(enterprise, 'enterprise is required for TSS wallet');

if (type === 'cold') {
if (params.walletVersion === 5) {
if (params.walletVersion === 5 || params.walletVersion === 6) {
throw new Error('EVM TSS MPCv2 wallets are not supported for cold wallets');
}
// validate
Expand All @@ -324,7 +331,7 @@ export class Wallets implements IWallets {
}

if (type === 'custodial') {
if (params.walletVersion === 5) {
if (params.walletVersion === 5 || params.walletVersion === 6) {
throw new Error('EVM TSS MPCv2 wallets are not supported for custodial wallets');
}
return this.generateCustodialMpcWallet({
Expand Down

0 comments on commit 28fa948

Please sign in to comment.