diff --git a/src/mpcCoreKit.ts b/src/mpcCoreKit.ts index 5ab77a0..56ada72 100644 --- a/src/mpcCoreKit.ts +++ b/src/mpcCoreKit.ts @@ -196,12 +196,14 @@ export class Web3AuthMPCCoreKit implements ICoreKit { return this.options.uxMode === UX_MODE.REDIRECT; } + // use dkg is always false for ed25519 key type and for secp256k1 key type when options.useDKG is false private get useDKG(): boolean { return this.keyType === KeyType.ed25519 ? false : this.options.useDKG; } + // import flow is used when this.options.useDKG is undefined or false private get useImportFlow(): boolean { - return this.keyType === KeyType.ed25519 && this.options.useDKG === undefined ? false : this.options.useDKG; + return !this.options.useDKG; } // RecoverTssKey only valid for user that enable MFA where user has 2 type shares : @@ -886,7 +888,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit { const existingUser = await this.isMetadataPresent(this.state.postBoxKey); let importTssKey = providedImportTssKey; if (!existingUser) { - if (!importTssKey && !this.useImportFlow) { + if (!importTssKey && this.useImportFlow) { if (this.keyType === KeyType.ed25519) { const k = generateEd25519Seed(); importTssKey = k.toString("hex");