From 4ac5e62ca5a6efef20d46f081700f144816fccb3 Mon Sep 17 00:00:00 2001 From: ieow Date: Fri, 13 Dec 2024 18:28:27 +0800 Subject: [PATCH] feat: remove remote copy and refresh functionality --- src/mpcCoreKit.ts | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/mpcCoreKit.ts b/src/mpcCoreKit.ts index b286add..1d9fdb9 100644 --- a/src/mpcCoreKit.ts +++ b/src/mpcCoreKit.ts @@ -641,15 +641,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit { } return this.atomicSync(async () => { - if (this.state.remoteClient) { - if (shareType === this.state.tssShareIndex) { - await this.tkey.remoteCopyFactorPub({ newFactorPub: factorPub, tssIndex: shareType, remoteClient: this.state.remoteClient }); - } else { - await this.tkey.remoteAddFactorPub({ newFactorPub: factorPub, newFactorTSSIndex: shareType, remoteClient: this.state.remoteClient }); - } - } else { - await this.copyOrCreateShare(shareType, factorPub); - } + await this.copyOrCreateShare(shareType, factorPub); await this.backupMetadataShare(factorKey); await this.addFactorDescription({ factorKey, shareDescription, additionalMetadata, updateMetadata: false }); @@ -848,11 +840,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit { throw CoreKitError.factorInUseCannotBeDeleted("Cannot delete current active factor"); } - if (this.state.remoteClient) { - await this.tkey.remoteDeleteFactorPub({ factorPubToDelete: factorPub, remoteClient: this.state.remoteClient }); - } else { - await this.tKey.deleteFactorPub({ factorKey: this.state.factorKey, deleteFactorPub: factorPub, authSignatures: this.signatures }); - } + await this.tKey.deleteFactorPub({ factorKey: this.state.factorKey, deleteFactorPub: factorPub, authSignatures: this.signatures }); const factorPubHex = fpp.toSEC1(factorKeyCurve, true).toString("hex"); const allDesc = this.tKey.metadata.getShareDescription(); const keyDesc = allDesc[factorPubHex];