Skip to content

Commit d9c9ec4

Browse files
feat: add tss support for arbeth and opeth
TICKET: COIN-3598
1 parent 1dedc91 commit d9c9ec4

File tree

5 files changed

+44
-10
lines changed

5 files changed

+44
-10
lines changed

modules/bitgo/test/v2/unit/wallets.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,20 @@ describe('V2 Wallets:', function () {
988988
custodialMultiSigTypeVersion: 'MPCv2',
989989
},
990990
},
991+
arbeth: {
992+
walletCreationSettings: {
993+
multiSigTypeVersion: 'MPCv2',
994+
coldMultiSigTypeVersion: 'MPCv2',
995+
custodialMultiSigTypeVersion: 'MPCv2',
996+
},
997+
},
998+
opeth: {
999+
walletCreationSettings: {
1000+
multiSigTypeVersion: 'MPCv2',
1001+
coldMultiSigTypeVersion: 'MPCv2',
1002+
custodialMultiSigTypeVersion: 'MPCv2',
1003+
},
1004+
},
9911005
},
9921006
};
9931007
nock('https://bitgo.fakeurl').get(`/api/v2/tss/settings`).times(2).reply(200, tssSettings);
@@ -998,7 +1012,7 @@ describe('V2 Wallets:', function () {
9981012
sandbox.verifyAndRestore();
9991013
});
10001014

1001-
['hteth', 'tbsc', 'tpolygon', 'ttia', 'tatom', 'tbera'].forEach((coin) => {
1015+
['hteth', 'tbsc', 'tpolygon', 'ttia', 'tatom', 'tbera', 'tarbeth', 'topeth'].forEach((coin) => {
10021016
it(`should create a new ${coin} TSS MPCv2 hot wallet`, async function () {
10031017
const testCoin = bitgo.coin(coin);
10041018
const stubbedKeychainsTriplet: KeychainsTriplet = {

modules/sdk-coin-arbeth/src/arbeth.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @prettier
33
*/
4-
import { BaseCoin, BitGoBase, common, MultisigType, multisigTypes } from '@bitgo/sdk-core';
4+
import { BaseCoin, BitGoBase, common, MPCAlgorithm, MultisigType, multisigTypes } from '@bitgo/sdk-core';
55
import { BaseCoin as StaticsBaseCoin, coins, ethGasConfigs } from '@bitgo/statics';
66
import {
77
AbstractEthLikeNewCoins,
@@ -23,6 +23,15 @@ export class Arbeth extends AbstractEthLikeNewCoins {
2323
return new TransactionBuilder(coins.get(this.getBaseChain()));
2424
}
2525

26+
supportsTss(): boolean {
27+
return true;
28+
}
29+
30+
/** @inheritDoc */
31+
getMPCAlgorithm(): MPCAlgorithm {
32+
return 'ecdsa';
33+
}
34+
2635
/**
2736
* Make a query to Arbiscan for information such as balance, token balance, solidity calls
2837
* @param {Object} query key-value pairs of parameters to append after /api
@@ -59,6 +68,6 @@ export class Arbeth extends AbstractEthLikeNewCoins {
5968

6069
/** inherited doc */
6170
getDefaultMultisigType(): MultisigType {
62-
return multisigTypes.onchain;
71+
return multisigTypes.tss;
6372
}
6473
}

modules/sdk-coin-opeth/src/opeth.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @prettier
33
*/
4-
import { BaseCoin, BitGoBase, common, MultisigType, multisigTypes } from '@bitgo/sdk-core';
4+
import { BaseCoin, BitGoBase, common, MPCAlgorithm, MultisigType, multisigTypes } from '@bitgo/sdk-core';
55
import { BaseCoin as StaticsBaseCoin, coins, ethGasConfigs } from '@bitgo/statics';
66
import {
77
AbstractEthLikeNewCoins,
@@ -23,6 +23,15 @@ export class Opeth extends AbstractEthLikeNewCoins {
2323
return new TransactionBuilder(coins.get(this.getBaseChain()));
2424
}
2525

26+
supportsTss(): boolean {
27+
return true;
28+
}
29+
30+
/** @inheritDoc */
31+
getMPCAlgorithm(): MPCAlgorithm {
32+
return 'ecdsa';
33+
}
34+
2635
/**
2736
* Make a query to Optimism Etherscan for information such as balance, token balance, solidity calls
2837
* @param {Object} query key-value pairs of parameters to append after /api
@@ -59,6 +68,6 @@ export class Opeth extends AbstractEthLikeNewCoins {
5968

6069
/** inherited doc */
6170
getDefaultMultisigType(): MultisigType {
62-
return multisigTypes.onchain;
71+
return multisigTypes.tss;
6372
}
6473
}

modules/statics/src/coinFeatures.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,9 @@ export const TON_FEATURES = [
333333
];
334334
export const ARBETH_FEATURES = [
335335
...ETH_FEATURES,
336+
CoinFeature.TSS,
337+
CoinFeature.TSS_COLD,
338+
CoinFeature.MPCV2,
336339
CoinFeature.MULTISIG_COLD,
337340
CoinFeature.EVM_WALLET,
338341
CoinFeature.USES_NON_PACKED_ENCODING_FOR_TXDATA,
@@ -343,6 +346,9 @@ export const ARBETH_FEATURES = [
343346
];
344347
export const OPETH_FEATURES = [
345348
...ETH_FEATURES,
349+
CoinFeature.TSS,
350+
CoinFeature.TSS_COLD,
351+
CoinFeature.MPCV2,
346352
CoinFeature.MULTISIG_COLD,
347353
CoinFeature.EVM_WALLET,
348354
CoinFeature.USES_NON_PACKED_ENCODING_FOR_TXDATA,

modules/statics/test/unit/fixtures/expectedColdFeatures.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
export const expectedColdFeatures = {
2-
both: ['eth', 'eth2', 'gteth', 'teth2', 'polygon', 'tpolygon', 'hteth'],
2+
both: ['eth', 'eth2', 'gteth', 'teth2', 'polygon', 'tpolygon', 'hteth', 'opeth', 'topeth', 'arbeth', 'tarbeth'],
33
justMultiSig: [
44
'algo',
5-
'arbeth',
65
'avaxc',
76
'avaxp',
87
'bch',
@@ -18,11 +17,9 @@ export const expectedColdFeatures = {
1817
'etc',
1918
'hbar',
2019
'ltc',
21-
'opeth',
2220
'rbtc',
2321
'stx',
2422
'talgo',
25-
'tarbeth',
2623
'tavaxc',
2724
'tavaxp',
2825
'tbch',
@@ -40,7 +37,6 @@ export const expectedColdFeatures = {
4037
'tetc',
4138
'thbar',
4239
'tltc',
43-
'topeth',
4440
'trbtc',
4541
'trx',
4642
'tstx',

0 commit comments

Comments
 (0)