Skip to content

Commit b1b2c8f

Browse files
Merge pull request #8086 from BitGo/CGARD-273
refactor(abstract-eth): support signing by default
2 parents 4a7d819 + 71121f6 commit b1b2c8f

File tree

10 files changed

+10
-94
lines changed

10 files changed

+10
-94
lines changed

modules/abstract-eth/src/abstractEthLikeNewCoins.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,16 @@ export abstract class AbstractEthLikeNewCoins extends AbstractEthLikeCoin {
531531
return true;
532532
}
533533

534+
/** @inheritDoc */
535+
supportsMessageSigning(): boolean {
536+
return true;
537+
}
538+
539+
/** @inheritDoc */
540+
supportsSigningTypedData(): boolean {
541+
return true;
542+
}
543+
534544
/**
535545
* Default expire time for a contract call (1 week)
536546
* @returns {number} Time in seconds

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,6 @@ export class Arbeth extends AbstractEthLikeNewCoins {
3232
return 'ecdsa';
3333
}
3434

35-
/** @inheritDoc */
36-
supportsMessageSigning(): boolean {
37-
return true;
38-
}
39-
40-
/** @inheritDoc */
41-
supportsSigningTypedData(): boolean {
42-
return true;
43-
}
44-
4535
/**
4636
* Make a query to Arbiscan for information such as balance, token balance, solidity calls
4737
* @param {Object} query key-value pairs of parameters to append after /api

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,6 @@ export class Bsc extends AbstractEthLikeNewCoins {
3030
return true;
3131
}
3232

33-
/** @inheritDoc */
34-
supportsMessageSigning(): boolean {
35-
return true;
36-
}
37-
38-
/** @inheritDoc */
39-
supportsSigningTypedData(): boolean {
40-
return true;
41-
}
42-
4333
/** inherited doc */
4434
getDefaultMultisigType(): MultisigType {
4535
return multisigTypes.tss;

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -549,14 +549,4 @@ export class Eth extends AbstractEthLikeNewCoins {
549549
protected getTransactionBuilder(): TransactionBuilder {
550550
return new TransactionBuilder(coins.get(this.getBaseChain()));
551551
}
552-
553-
/** @inheritDoc */
554-
supportsMessageSigning(): boolean {
555-
return true;
556-
}
557-
558-
/** @inheritDoc */
559-
supportsSigningTypedData(): boolean {
560-
return true;
561-
}
562552
}

modules/sdk-coin-evm/src/evmCoin.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,6 @@ export class EvmCoin extends AbstractEthLikeNewCoins {
4444
return 'ecdsa';
4545
}
4646

47-
/** @inheritDoc */
48-
supportsMessageSigning(): boolean {
49-
return true;
50-
}
51-
52-
/** @inheritDoc */
53-
supportsSigningTypedData(): boolean {
54-
return true;
55-
}
56-
5747
protected async buildUnsignedSweepTxnTSS(params: RecoverOptions): Promise<OfflineVaultTxInfo | UnsignedSweepTxMPCv2> {
5848
if (this.staticsCoin?.features.includes(CoinFeature.MPCV2)) {
5949
return this.buildUnsignedSweepTxnMPCv2(params);

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,6 @@ export class Flr extends AbstractEthLikeNewCoins {
8585
return 'ecdsa';
8686
}
8787

88-
/** @inheritDoc */
89-
supportsMessageSigning(): boolean {
90-
return true;
91-
}
92-
93-
/** @inheritDoc */
94-
supportsSigningTypedData(): boolean {
95-
return true;
96-
}
97-
9888
protected async buildUnsignedSweepTxnTSS(params: RecoverOptions): Promise<OfflineVaultTxInfo | UnsignedSweepTxMPCv2> {
9989
return this.buildUnsignedSweepTxnMPCv2(params);
10090
}

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,6 @@ export class Mon extends AbstractEthLikeNewCoins {
4646
return 'ecdsa';
4747
}
4848

49-
/** @inheritDoc */
50-
supportsMessageSigning(): boolean {
51-
return true;
52-
}
53-
54-
/** @inheritDoc */
55-
supportsSigningTypedData(): boolean {
56-
return true;
57-
}
58-
5949
protected async buildUnsignedSweepTxnTSS(params: RecoverOptions): Promise<OfflineVaultTxInfo | UnsignedSweepTxMPCv2> {
6050
return this.buildUnsignedSweepTxnMPCv2(params);
6151
}

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,6 @@ export class Opeth extends AbstractEthLikeNewCoins {
3232
return 'ecdsa';
3333
}
3434

35-
/** @inheritDoc */
36-
supportsMessageSigning(): boolean {
37-
return true;
38-
}
39-
40-
/** @inheritDoc */
41-
supportsSigningTypedData(): boolean {
42-
return true;
43-
}
44-
4535
/**
4636
* Make a query to Optimism Etherscan for information such as balance, token balance, solidity calls
4737
* @param {Object} query key-value pairs of parameters to append after /api

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,6 @@ export class Polygon extends AbstractEthLikeNewCoins {
5252
return await recoveryBlockchainExplorerQuery(query, explorerUrl as string, apiToken);
5353
}
5454

55-
/** @inheritDoc */
56-
supportsMessageSigning(): boolean {
57-
return true;
58-
}
59-
60-
/** @inheritDoc */
61-
supportsSigningTypedData(): boolean {
62-
return true;
63-
}
64-
6555
/** @inheritDoc */
6656
supportsTss(): boolean {
6757
return true;

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,6 @@ export class Tempo extends AbstractEthLikeNewCoins {
7171
return 'ecdsa';
7272
}
7373

74-
/**
75-
* Check if message signing is supported
76-
*/
77-
supportsMessageSigning(): boolean {
78-
return true;
79-
}
80-
8174
/**
8275
* Evaluates whether an address string is valid for Tempo
8376
* Supports addresses with optional memoId query parameter (e.g., 0x...?memoId=123)
@@ -174,13 +167,6 @@ export class Tempo extends AbstractEthLikeNewCoins {
174167
return true;
175168
}
176169

177-
/**
178-
* Check if typed data signing is supported (EIP-712)
179-
*/
180-
supportsSigningTypedData(): boolean {
181-
return true;
182-
}
183-
184170
/**
185171
* Build unsigned sweep transaction for TSS
186172
* TODO: Implement sweep transaction logic

0 commit comments

Comments
 (0)