Skip to content

Commit

Permalink
add check to use import flow
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshuchawla009 committed Sep 6, 2024
1 parent f28288b commit 70ab326
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/mpcCoreKit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
}

private get useDKG(): boolean {
return this.keyType === KeyType.ed25519 ? false : this.options.useDKG;
}

private get useImportFlow(): boolean {
return this.keyType === KeyType.ed25519 && this.options.useDKG === undefined ? false : this.options.useDKG;
}

Expand Down Expand Up @@ -882,7 +886,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
const existingUser = await this.isMetadataPresent(this.state.postBoxKey);
let importTssKey = providedImportTssKey;
if (!existingUser) {
if (!importTssKey && !this.useDKG) {
if (!importTssKey && !this.useImportFlow) {
if (this.keyType === KeyType.ed25519) {
const k = generateEd25519Seed();
importTssKey = k.toString("hex");
Expand Down

0 comments on commit 70ab326

Please sign in to comment.