Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 119 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,29 @@
}
},
"dependencies": {
"@tkey/common-types": "^15.1.0",
"@tkey/core": "^15.1.0",
"@tkey/common-types": "^15.2.1-alpha.0",
"@tkey/core": "^15.2.1-alpha.0",
"@tkey/share-serialization": "^15.1.0",
"@tkey/storage-layer-torus": "^15.1.0",
"@tkey/tss": "^15.1.0",
"@tkey/tss": "^15.2.1-alpha.0",
"@toruslabs/constants": "^14.2.0",
"@toruslabs/customauth": "^20.3.0",
"@toruslabs/elliptic-wrapper": "^0.1.1",
"@toruslabs/fetch-node-details": "^14.2.0",
"@toruslabs/fnd-base": "^14.2.0",
"@toruslabs/http-helpers": "^7.0.0",
"@toruslabs/metadata-helpers": "^6.0.0",
"@toruslabs/openlogin-utils": "^8.2.1",
"@toruslabs/torus.js": "15.2.0-alpha.0",
"@toruslabs/session-manager": "^3.1.0",
"@toruslabs/torus.js": "15.2.0-alpha.0",
"@toruslabs/tss-client": "^3.3.0-alpha.0",
"@toruslabs/tss-frost-client": "^1.0.1-alpha.0",
"@toruslabs/tss-frost-common": "^1.0.2-alpha.0",
"@web3auth/auth": "^9.6.1",
"bn.js": "^5.2.1",
"bowser": "^2.11.0",
"elliptic": "^6.5.7",
"hi-base32": "^0.5.1",
"loglevel": "^1.9.2"
},
"devDependencies": {
Expand Down
5 changes: 4 additions & 1 deletion src/helper/browserStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class MemoryStorage implements IStorage {
}
}

export class AsyncStorage {
export class AsyncStore {
public storage: IAsyncStorage | IStorage;

private _storeKey: string;
Expand Down Expand Up @@ -66,3 +66,6 @@ export class AsyncStorage {
await this.storage.setItem(this._storeKey, JSON.stringify(store));
}
}

// Deprecated
export class AsyncStorage extends AsyncStore {}
4 changes: 4 additions & 0 deletions src/helper/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,10 @@ class CoreKitError extends AbstractCoreKitError {
return CoreKitError.fromCode(1214, extraMessage);
}

public static notSupportedForRemoteFactor(extraMessage = ""): ICoreKitError {
return CoreKitError.fromCode(1215, extraMessage);
}

// Initialization and session management
public static commitChangesBeforeMFA(extraMessage = ""): ICoreKitError {
return CoreKitError.fromCode(1301, extraMessage);
Expand Down
11 changes: 6 additions & 5 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KeyType, Point as TkeyPoint, ShareDescriptionMap } from "@tkey/common-types";
import { BNString, KeyType, Point as TkeyPoint, ShareDescriptionMap } from "@tkey/common-types";
import { TKeyTSS, TSSTorusServiceProvider } from "@tkey/tss";
import { WEB3AUTH_SIG_TYPE } from "@toruslabs/constants";
import type {
Expand All @@ -22,6 +22,7 @@ import { SafeEventEmitter } from "@web3auth/auth";
import BN from "bn.js";

import { FactorKeyTypeShareDescription, TssShareType, USER_PATH, WEB3AUTH_NETWORK } from "./constants";
import { IRemoteClientState, IRemoteSignerContext } from "./plugins/ICustomSigner";
import { ISessionSigGenerator } from "./plugins/ISessionSigGenerator";

export type CoreKitMode = UX_MODE_TYPE | "nodejs" | "react-native";
Expand Down Expand Up @@ -109,15 +110,15 @@ export interface EnableMFAParams {
/**
* A BN used for encrypting your Device/ Recovery TSS Key Share. You can generate it using `generateFactorKey()` function or use an existing one.
*/
factorKey?: BN;
factorKey?: BNString;
/**
* Setting the Description of Share - Security Questions, Device Share, Seed Phrase, Password Share, Social Share, Other. Default is Other.
*/
shareDescription?: FactorKeyTypeShareDescription;
/**
* Additional metadata information you want to be stored alongside this factor for easy identification.
*/
additionalMetadata?: Record<string, string>;
additionalMetadata?: Record<string, string | number>;
}

export interface CreateFactorParams extends EnableMFAParams {
Expand Down Expand Up @@ -176,7 +177,6 @@ export interface JWTLoginParams {
*/
prefetchTssPublicKeys?: number;
}

export interface Web3AuthState {
postBoxKey?: string;
signatures?: string[];
Expand All @@ -186,6 +186,7 @@ export interface Web3AuthState {
tssPubKey?: Buffer;
accountIndex: number;
factorKey?: BN;
remoteClient?: IRemoteClientState;
}

export type WEB3AUTH_NETWORK_TYPE = (typeof WEB3AUTH_NETWORK)[keyof typeof WEB3AUTH_NETWORK];
Expand Down Expand Up @@ -336,7 +337,7 @@ export interface Web3AuthOptions {
}
export type Web3AuthOptionsWithDefaults = Required<Web3AuthOptions>;

export interface IMPCContext {
export interface IMPCContext extends IRemoteSignerContext {
stateEmitter: SafeEventEmitter;
config: Web3AuthOptionsWithDefaults;
status: COREKIT_STATUS;
Expand Down
Loading
Loading