Skip to content

Commit 946c061

Browse files
Merge pull request #176 from Web3Auth/feat/updateNodeDetails
Feat/update node details
2 parents 840c2de + 3b1d0c0 commit 946c061

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

src/mpcCoreKit.ts

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { KEY_TYPE, SIGNER_MAP } from "@toruslabs/constants";
77
import { AGGREGATE_VERIFIER, TORUS_METHOD, TorusAggregateLoginResponse, TorusLoginResponse, UX_MODE } from "@toruslabs/customauth";
88
import type { UX_MODE_TYPE } from "@toruslabs/customauth/dist/types/utils/enums";
99
import { Ed25519Curve } from "@toruslabs/elliptic-wrapper";
10-
import { NodeDetailManager } from "@toruslabs/fetch-node-details";
1110
import { fetchLocalConfig } from "@toruslabs/fnd-base";
1211
import { keccak256 } from "@toruslabs/metadata-helpers";
1312
import { SessionManager } from "@toruslabs/session-manager";
@@ -85,8 +84,6 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
8584

8685
private currentStorage: AsyncStorage;
8786

88-
private nodeDetailManager!: NodeDetailManager;
89-
9087
private _storageBaseKey = "corekit_store";
9188

9289
private enableLogging = false;
@@ -132,11 +129,6 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
132129
this.options = options as Web3AuthOptionsWithDefaults;
133130

134131
this.currentStorage = new AsyncStorage(this._storageBaseKey, options.storage);
135-
136-
this.nodeDetailManager = new NodeDetailManager({
137-
network: this.options.web3AuthNetwork,
138-
enableLogging: options.enableLogging,
139-
});
140132
}
141133

142134
get tKey(): TKeyTSS {
@@ -232,11 +224,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
232224
this.resetState();
233225
if (params.rehydrate === undefined) params.rehydrate = true;
234226

235-
const nodeDetails = await this.nodeDetailManager.getNodeDetails({ verifier: "test-verifier", verifierId: "[email protected]" });
236-
237-
if (!nodeDetails) {
238-
throw CoreKitError.nodeDetailsRetrievalFailed();
239-
}
227+
const nodeDetails = fetchLocalConfig(this.options.web3AuthNetwork, this.keyType);
240228

241229
if (this.keyType === KEY_TYPE.ED25519 && this.options.useDKG) {
242230
throw CoreKitError.invalidConfig("DKG is not supported for ed25519 key type");
@@ -296,6 +284,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
296284
(window?.location.hash.includes("#state") || window?.location.hash.includes("#access_token"))
297285
) {
298286
// on failed redirect, instance is reseted.
287+
// skip check feature gating on redirection as it was check before login
299288
await this.handleRedirectResult();
300289
// if not redirect flow try to rehydrate session if available
301290
} else if (params.rehydrate && this.sessionManager.sessionId) {
@@ -1264,10 +1253,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
12641253
const { tssShareIndex } = this.state;
12651254
const tssPubKey = await this.getPubKeyPoint();
12661255

1267-
const { torusNodeTSSEndpoints } = await this.nodeDetailManager.getNodeDetails({
1268-
verifier: this.tkey.serviceProvider.verifierName,
1269-
verifierId: this.tkey.serviceProvider.verifierId,
1270-
});
1256+
const { torusNodeTSSEndpoints } = fetchLocalConfig(this.options.web3AuthNetwork, this.keyType);
12711257

12721258
if (!this.state.factorKey) {
12731259
throw CoreKitError.factorKeyNotPresent("factorKey not present in state when signing.");

0 commit comments

Comments
 (0)