Skip to content

Commit

Permalink
fix type names
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshuchawla009 committed Sep 9, 2024
1 parent aa8ca1e commit c670a2a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import { FactorKeyTypeShareDescription, TssShareType, USER_PATH, WEB3AUTH_NETWOR

export type CoreKitMode = UX_MODE_TYPE | "nodejs" | "react-native";

export type v3TSSLibType = { keyType: string; lib: unknown };
export type V3TSSLibType = { keyType: string; lib: unknown };

export type NewTSSLibType = typeof TssFrostLib | typeof TssDklsLib;
export type TssLibType = NewTSSLibType | v3TSSLibType;
export type V4TSSLibType = typeof TssFrostLib | typeof TssDklsLib;
export type TssLibType = V4TSSLibType | V3TSSLibType;
export interface IStorage {
getItem(key: string): string | null;
setItem(key: string, value: string): void;
Expand Down
12 changes: 6 additions & 6 deletions src/mpcCoreKit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ import {
InitParams,
JWTLoginParams,
MPCKeyDetails,
NewTSSLibType,
OAuthLoginParams,
SessionData,
SubVerifierDetailsParams,
TkeyLocalStoreData,
TssLibType,
UserInfo,
v3TSSLibType,
V3TSSLibType,
V4TSSLibType,
Web3AuthOptions,
Web3AuthOptionsWithDefaults,
Web3AuthState,
Expand Down Expand Up @@ -1383,11 +1383,11 @@ export class Web3AuthMPCCoreKit implements ICoreKit {

private async loadTssWasm() {
if (this.wasmLib) return this.wasmLib;
if (typeof (this._tssLib as NewTSSLibType).load === "function") {
if (typeof (this._tssLib as V4TSSLibType).load === "function") {
// dont wait for wasm to be loaded, we can reload it during signing if not loaded
return (this._tssLib as NewTSSLibType).load();
} else if ((this._tssLib as v3TSSLibType).lib) {
return (this._tssLib as v3TSSLibType).lib as DKLSWasmLib | FrostWasmLib;
return (this._tssLib as V4TSSLibType).load();
} else if ((this._tssLib as V3TSSLibType).lib) {
return (this._tssLib as V3TSSLibType).lib as DKLSWasmLib | FrostWasmLib;
}
}
}

0 comments on commit c670a2a

Please sign in to comment.