From 65ba76ef3a930eed4e111c5613ded97fede57e65 Mon Sep 17 00:00:00 2001 From: Vincent Yang Date: Fri, 21 Jun 2024 13:43:03 -0400 Subject: [PATCH] feat(sdk-core): add tss coins method to BaseCoin class TICKET: WP-575 --- modules/sdk-coin-ada/src/ada.ts | 10 +--------- modules/sdk-coin-dot/src/dot.ts | 10 +--------- modules/sdk-coin-sol/src/sol.ts | 10 +--------- modules/sdk-core/src/bitgo/baseCoin/baseCoin.ts | 14 ++++++++++++++ 4 files changed, 17 insertions(+), 27 deletions(-) diff --git a/modules/sdk-coin-ada/src/ada.ts b/modules/sdk-coin-ada/src/ada.ts index 55f9f02aec..1f79e7ed81 100644 --- a/modules/sdk-coin-ada/src/ada.ts +++ b/modules/sdk-coin-ada/src/ada.ts @@ -275,15 +275,7 @@ export class Ada extends BaseCoin { return body; } - /** - * Creates funds sweep recovery transaction(s) without BitGo - * - * @param {MPCSweepRecoveryOptions} params parameters needed to combine the signatures - * and transactions to create broadcastable transactions - * - * @returns {MPCTxs} array of the serialized transaction hex strings and indices - * of the addresses being swept - */ + /** inherited doc */ async createBroadcastableSweepTransaction(params: MPCSweepRecoveryOptions): Promise { const req = params.signatureShares; const broadcastableTransactions: MPCTx[] = []; diff --git a/modules/sdk-coin-dot/src/dot.ts b/modules/sdk-coin-dot/src/dot.ts index fe5487d040..3553ac8f69 100644 --- a/modules/sdk-coin-dot/src/dot.ts +++ b/modules/sdk-coin-dot/src/dot.ts @@ -563,15 +563,7 @@ export class Dot extends BaseCoin { return { transactions: consolidationTransactions, lastScanIndex }; } - /** - * Creates funds sweep recovery transaction(s) without BitGo - * - * @param {MPCSweepRecoveryOptions} params parameters needed to combine the signatures - * and transactions to create broadcastable transactions - * - * @returns {MPCTx[]} array of the serialized transaction hex strings and indices - * of the addresses being swept - */ + /** inherited doc */ async createBroadcastableSweepTransaction(params: MPCSweepRecoveryOptions): Promise { const req = params.signatureShares; const broadcastableTransactions: MPCTx[] = []; diff --git a/modules/sdk-coin-sol/src/sol.ts b/modules/sdk-coin-sol/src/sol.ts index fa894804c6..f50f89379d 100644 --- a/modules/sdk-coin-sol/src/sol.ts +++ b/modules/sdk-coin-sol/src/sol.ts @@ -653,15 +653,7 @@ export class Sol extends BaseCoin { return []; } - /** - * Creates funds sweep recovery transaction(s) without BitGo - * - * @param {SweepRecoveryOptions} params parameters needed to combine the signatures - * and transactions to create broadcastable transactions - * - * @returns {MPCTxs} array of the serialized transaction hex strings and indices - * of the addresses being swept - */ + /** inherited doc */ async createBroadcastableSweepTransaction(params: MPCSweepRecoveryOptions): Promise { if (!params.signatureShares) { ('Missing transaction(s)'); diff --git a/modules/sdk-core/src/bitgo/baseCoin/baseCoin.ts b/modules/sdk-core/src/bitgo/baseCoin/baseCoin.ts index 77e5c7f6cf..7425fd7331 100644 --- a/modules/sdk-core/src/bitgo/baseCoin/baseCoin.ts +++ b/modules/sdk-core/src/bitgo/baseCoin/baseCoin.ts @@ -45,6 +45,7 @@ import { } from './iBaseCoin'; import { IInscriptionBuilder } from '../inscriptionBuilder'; import { Hash } from 'crypto'; +import { MPCSweepRecoveryOptions, MPCTxs } from '../utils'; export abstract class BaseCoin implements IBaseCoin { protected readonly bitgo: BitGoBase; @@ -537,4 +538,17 @@ export abstract class BaseCoin implements IBaseCoin { broadcastTransaction(params: BaseBroadcastTransactionOptions): Promise { throw new NotImplementedError('broadcastTransaction is not supported for this coin'); } + + /** + * Creates funds sweep recovery transaction(s) without BitGo + * + * @param {MPCSweepRecoveryOptions} params parameters needed to combine the signatures + * and transactions to create broadcastable transactions + * + * @returns {MPCTxs} array of the serialized transaction hex strings and indices + * of the addresses being swept + */ + async createBroadcastableSweepTransaction(params: MPCSweepRecoveryOptions): Promise { + throw new NotImplementedError('createBroadcastableSweepTransaction is not supported for this coin'); + } }