Skip to content

Commit 952df91

Browse files
committed
fetch node details with sig type
1 parent 217edd2 commit 952df91

File tree

3 files changed

+14
-19
lines changed

3 files changed

+14
-19
lines changed

package-lock.json

Lines changed: 8 additions & 8 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
@@ -53,7 +53,7 @@
5353
"@toruslabs/customauth": "^20.3.0",
5454
"@toruslabs/elliptic-wrapper": "^0.1.1",
5555
"@toruslabs/fetch-node-details": "^14.0.1",
56-
"@toruslabs/fnd-base": "^14.0.0",
56+
"@toruslabs/fnd-base": "^14.2.0",
5757
"@toruslabs/metadata-helpers": "^6.0.0",
5858
"@toruslabs/openlogin-utils": "^8.2.1",
5959
"@toruslabs/session-manager": "^3.1.0",

src/mpcCoreKit.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,20 +1429,15 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
14291429
throw CoreKitError.default(`hashed data not supported for ${this._sigType}`);
14301430
}
14311431

1432-
const serverEndpoints = (() => {
1433-
// We have to fix the key type to `ed25519` for now, because we would get
1434-
// the DKLS tss server endpoints otherwise.
1435-
const nodeDetails = fetchLocalConfig(this.options.web3AuthNetwork, "ed25519");
1436-
// Endpoints must end with backslash, but URLs returned by
1437-
// `fetch-node-details` don't have it.
1438-
return nodeDetails.torusNodeTSSEndpoints.map((ep, i) => ({ index: nodeDetails.torusIndexes[i], url: `${ep}/` }));
1439-
})();
1440-
1441-
const nodeDetails = fetchLocalConfig(this.options.web3AuthNetwork, this.keyType);
1432+
const nodeDetails = fetchLocalConfig(this.options.web3AuthNetwork, this.keyType, this._sigType);
14421433
if (!nodeDetails.torusNodeTSSEndpoints) {
14431434
throw CoreKitError.default("could not fetch tss node endpoints");
14441435
}
14451436

1437+
// Endpoints must end with backslash, but URLs returned by
1438+
// `fetch-node-details` don't have it.
1439+
const serverEndpoints = nodeDetails.torusNodeTSSEndpoints.map((ep, i) => ({ index: nodeDetails.torusIndexes[i], url: `${ep}/` }));
1440+
14461441
// Select endpoints and derive party indices.
14471442
const serverThreshold = Math.floor(serverEndpoints.length / 2) + 1;
14481443
const endpoints = sampleEndpoints(serverEndpoints, serverThreshold);

0 commit comments

Comments
 (0)