Skip to content

Commit 49d2251

Browse files
committed
fix: merge issue
1 parent 5c24c46 commit 49d2251

File tree

4 files changed

+62
-30
lines changed

4 files changed

+62
-30
lines changed

package-lock.json

Lines changed: 54 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
"@toruslabs/http-helpers": "^7.0.0",
6161
"@toruslabs/metadata-helpers": "^6.0.0",
6262
"@toruslabs/openlogin-utils": "^8.2.1",
63-
"@toruslabs/torus.js": "15.2.0-alpha.0",
6463
"@toruslabs/session-manager": "^3.1.0",
64+
"@toruslabs/torus.js": "15.2.0-alpha.0",
6565
"@toruslabs/tss-client": "^3.3.0-alpha.0",
6666
"@toruslabs/tss-frost-client": "^1.0.0-alpha.0",
6767
"@toruslabs/tss-frost-common": "^1.0.1",

src/interfaces.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ import type {
1313
UX_MODE_TYPE,
1414
} from "@toruslabs/customauth";
1515
import { TorusKey } from "@toruslabs/torus.js";
16-
import { Client } from "@toruslabs/tss-client";
17-
import { PointHex } from "@toruslabs/tss-client";
16+
import { Client, PointHex } from "@toruslabs/tss-client";
1817
// TODO: move the types to a base class for both dkls and frost in future
1918
import type { tssLib as TssDklsLib } from "@toruslabs/tss-dkls-lib";
2019
import type { tssLib as TssFrostLibEd25519 } from "@toruslabs/tss-frost-lib";
@@ -552,7 +551,7 @@ export type RemoteDklsSignParams = {
552551
curve: SupportedCurve;
553552
};
554553

555-
export type RemoteFrostSignParams = {
554+
export type ICustomFrostSignParams = {
556555
sessionId: string;
557556
signatures: string[];
558557
tssCommits: PointHex[];

src/mpcCoreKit.ts

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
1-
import {
2-
BNString,
3-
EncryptedMessage,
4-
FactorEnc,
5-
KeyType,
6-
ONE_KEY_DELETE_NONCE,
7-
Point,
8-
secp256k1,
9-
SHARE_DELETED,
10-
ShareStore,
11-
StringifiedType,
12-
} from "@tkey/common-types";
1+
import { BNString, KeyType, ONE_KEY_DELETE_NONCE, Point, secp256k1, SHARE_DELETED, ShareStore, StringifiedType } from "@tkey/common-types";
132
import { CoreError } from "@tkey/core";
143
import { ShareSerializationModule } from "@tkey/share-serialization";
154
import { TorusStorageLayer } from "@tkey/storage-layer-torus";
@@ -775,7 +764,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit, IMPCContext {
775764
nodeIndexesReturned: participatingServerDKGIndexes,
776765
} = generateTSSEndpoints(torusNodeTSSEndpoints, parties, clientIndex, nodeIndexes);
777766

778-
const factor = Point.fromSEC1(secp256k1, this.state.remoteClient.remoteFactorPub);
767+
const factor = Point.fromSEC1(secp256k1, this.state.remoteClient?.remoteFactorPub);
779768
const factorEnc = this.tKey.getFactorEncs(factor);
780769

781770
// Compute account nonce only supported for secp256k1
@@ -1207,7 +1196,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit, IMPCContext {
12071196
factorKey: "",
12081197
tssShareIndex: tssShareIndex as number,
12091198
tssPubKey: Buffer.from(tssPubKey).toString("hex"),
1210-
signatures: this.signatures,
1199+
signatures: await this.getSessionSignatures(),
12111200
userInfo,
12121201
remoteClientState: this.state.remoteClient,
12131202
};
@@ -1360,7 +1349,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit, IMPCContext {
13601349

13611350
// skip input share store if factor key is not present
13621351
// tkey will be at state initalized
1363-
if (!factorKey) {
1352+
if (!result.factorKey) {
13641353
return;
13651354
}
13661355

@@ -1695,7 +1684,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit, IMPCContext {
16951684
const factorPub = Point.fromSEC1(secp256k1, this.state.remoteClient.remoteFactorPub);
16961685
const params: ICustomFrostSignParams = {
16971686
sessionId: session,
1698-
signatures: this.signatures,
1687+
signatures: await this.getSessionSignatures(),
16991688
tssCommits: this.tKey.getTSSCommits().map((commit) => pointToHex(commit)),
17001689
factorEnc: this.tKey.getFactorEncs(factorPub),
17011690
serverXCoords,

0 commit comments

Comments
 (0)