Skip to content
Open
Show file tree
Hide file tree
Changes from 8 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
283 changes: 78 additions & 205 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,20 @@
}
},
"dependencies": {
"@tkey/common-types": "^15.1.0",
"@tkey/core": "^15.1.0",
"@tkey/common-types": "file:../tkey/packages/common-types",
"@tkey/core": "file:../tkey/packages/core/tkey-core-15.2.1-alpha.0.tgz",
"@tkey/share-serialization": "^15.1.0",
"@tkey/storage-layer-torus": "^15.1.0",
"@tkey/tss": "^15.1.0",
"@tkey/storage-layer-torus": "file:../tkey/packages/storage-layer-torus/tkey-storage-layer-torus-15.2.1-alpha.0.tgz",
"@tkey/tss": "file:../tkey/packages/tss/tkey-tss-15.2.1-alpha.0.tgz",
"@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/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": "file:../torus.js/toruslabs-torus.js-15.1.1.tgz",
"@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",
Expand Down
46 changes: 28 additions & 18 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,16 @@ export type MPCKeyDetails = {
requiredFactors: number;
totalFactors: number;
shareDescriptions: ShareDescriptionMap;
keyType: KeyType;
tssPubKey?: TkeyPoint;
supportedKeyType: KeyType[];
};

export type OAuthLoginParams = (SubVerifierDetailsParams | AggregateVerifierLoginParams) & {
/**
* Key to import key into Tss during first time login.
*/
importTssKey?: string;
importTssKey?: {
[K in KeyType]: string;
};

/**
* For new users, use SFA key if user was registered with SFA before.
Expand Down Expand Up @@ -161,7 +162,9 @@ export interface JWTLoginParams {
/**
* Key to import key into Tss during first time login.
*/
importTssKey?: string;
importTssKey?: {
[K in KeyType]?: string;
};

/**
* For new users, use SFA key if user was registered with SFA before.
Expand All @@ -183,7 +186,6 @@ export interface Web3AuthState {
postboxKeyNodeIndexes?: number[];
userInfo?: UserInfo;
tssShareIndex?: number;
tssPubKey?: Buffer;
accountIndex: number;
factorKey?: BN;
}
Expand All @@ -199,9 +201,9 @@ export interface Web3AuthOptions {
web3AuthClientId: string;

/**
* The threshold signing library to use.
* The supported curve key type.
*/
tssLib: TssLibType;
supportedKeyTypes: KeyType[];

/**
* @defaultValue `false`
Expand Down Expand Up @@ -333,6 +335,15 @@ export interface Web3AuthOptions {
* only scalar will be exported, scalar can be used for signing outside of this sdk but not for importing the key in other wallets.
*/
useClientGeneratedTSSKey?: boolean;

/**
* @defaultValue `false`
* Set this flag to true to use the legacy flag for signing
* legacy flag do not support multicurve mode
* legacy ed25519 customAuth is only supported in legacy mode
* Note: This option is set to false by default.
*/
legacyFlag?: boolean;
}
export type Web3AuthOptionsWithDefaults = Required<Web3AuthOptions>;

Expand All @@ -345,7 +356,7 @@ export interface IMPCContext {
updateState: (newState: Partial<Web3AuthState>) => void;
getUserInfo: () => UserInfo;
setupTkey: (params?: {
providedImportKey?: string;
providedImportKey?: { [key in KeyType]?: string };
sfaLoginResponse?: TorusKey | TorusLoginResponse | TorusAggregateLoginResponse;
userInfo?: UserInfo;
importingSFAKey?: boolean;
Expand Down Expand Up @@ -474,14 +485,14 @@ export interface ICoreKit {
* - secp256k1Precompute: Provide a precomputed client for faster signing. Only works for ecdsa-secp256k1.
* - keyTweak: Provide a bip340 key tweak. Only works for bip340.
*/
sign(
data: Buffer,
opts?: {
hashed?: boolean;
secp256k1Precompute?: Secp256k1PrecomputedClient;
keyTweak?: BN;
}
): Promise<Buffer>;
// sign(
// data: Buffer,
// opts?: {
// hashed?: boolean;
// secp256k1Precompute?: Secp256k1PrecomputedClient;
// keyTweak?: BN;
// }
// ): Promise<Buffer>;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove if not needed.

why does the core kit interface no longer have a sign method? isn't this the most important method?

Copy link
Copy Markdown
Contributor Author

@ieow ieow Feb 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update with relevant function signatures and comments


/**
* WARNING: Use with caution. This will export the private signing key.
Expand All @@ -490,7 +501,7 @@ export interface ICoreKit {
*
* For keytype ed25519, consider using _UNSAFE_exportTssEd25519Seed.
*/
_UNSAFE_exportTssKey(): Promise<string>;
_UNSAFE_exportTssKey(keyType: KeyType): Promise<string>;

/**
* WARNING: Use with caution. This will export the private signing key.
Expand All @@ -510,7 +521,6 @@ export interface SessionData {
postboxKeyNodeIndexes?: number[];
factorKey: string;
tssShareIndex: number;
tssPubKey: string;
signatures: string[];
userInfo: UserInfo;
}
Expand Down
Loading