|
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"; |
13 | 2 | import { CoreError } from "@tkey/core"; |
14 | 3 | import { ShareSerializationModule } from "@tkey/share-serialization"; |
15 | 4 | import { TorusStorageLayer } from "@tkey/storage-layer-torus"; |
@@ -775,7 +764,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit, IMPCContext { |
775 | 764 | nodeIndexesReturned: participatingServerDKGIndexes, |
776 | 765 | } = generateTSSEndpoints(torusNodeTSSEndpoints, parties, clientIndex, nodeIndexes); |
777 | 766 |
|
778 | | - const factor = Point.fromSEC1(secp256k1, this.state.remoteClient.remoteFactorPub); |
| 767 | + const factor = Point.fromSEC1(secp256k1, this.state.remoteClient?.remoteFactorPub); |
779 | 768 | const factorEnc = this.tKey.getFactorEncs(factor); |
780 | 769 |
|
781 | 770 | // Compute account nonce only supported for secp256k1 |
@@ -1207,7 +1196,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit, IMPCContext { |
1207 | 1196 | factorKey: "", |
1208 | 1197 | tssShareIndex: tssShareIndex as number, |
1209 | 1198 | tssPubKey: Buffer.from(tssPubKey).toString("hex"), |
1210 | | - signatures: this.signatures, |
| 1199 | + signatures: await this.getSessionSignatures(), |
1211 | 1200 | userInfo, |
1212 | 1201 | remoteClientState: this.state.remoteClient, |
1213 | 1202 | }; |
@@ -1360,7 +1349,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit, IMPCContext { |
1360 | 1349 |
|
1361 | 1350 | // skip input share store if factor key is not present |
1362 | 1351 | // tkey will be at state initalized |
1363 | | - if (!factorKey) { |
| 1352 | + if (!result.factorKey) { |
1364 | 1353 | return; |
1365 | 1354 | } |
1366 | 1355 |
|
@@ -1695,7 +1684,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit, IMPCContext { |
1695 | 1684 | const factorPub = Point.fromSEC1(secp256k1, this.state.remoteClient.remoteFactorPub); |
1696 | 1685 | const params: ICustomFrostSignParams = { |
1697 | 1686 | sessionId: session, |
1698 | | - signatures: this.signatures, |
| 1687 | + signatures: await this.getSessionSignatures(), |
1699 | 1688 | tssCommits: this.tKey.getTSSCommits().map((commit) => pointToHex(commit)), |
1700 | 1689 | factorEnc: this.tKey.getFactorEncs(factorPub), |
1701 | 1690 | serverXCoords, |
|
0 commit comments