diff --git a/src/mpcCoreKit.ts b/src/mpcCoreKit.ts index 2b2362b6..4ea24604 100644 --- a/src/mpcCoreKit.ts +++ b/src/mpcCoreKit.ts @@ -7,7 +7,6 @@ import { KEY_TYPE, SIGNER_MAP } from "@toruslabs/constants"; import { AGGREGATE_VERIFIER, TORUS_METHOD, TorusAggregateLoginResponse, TorusLoginResponse, UX_MODE } from "@toruslabs/customauth"; import type { UX_MODE_TYPE } from "@toruslabs/customauth/dist/types/utils/enums"; import { Ed25519Curve } from "@toruslabs/elliptic-wrapper"; -import { NodeDetailManager } from "@toruslabs/fetch-node-details"; import { fetchLocalConfig } from "@toruslabs/fnd-base"; import { keccak256 } from "@toruslabs/metadata-helpers"; import { SessionManager } from "@toruslabs/session-manager"; @@ -85,8 +84,6 @@ export class Web3AuthMPCCoreKit implements ICoreKit { private currentStorage: AsyncStorage; - private nodeDetailManager!: NodeDetailManager; - private _storageBaseKey = "corekit_store"; private enableLogging = false; @@ -132,11 +129,6 @@ export class Web3AuthMPCCoreKit implements ICoreKit { this.options = options as Web3AuthOptionsWithDefaults; this.currentStorage = new AsyncStorage(this._storageBaseKey, options.storage); - - this.nodeDetailManager = new NodeDetailManager({ - network: this.options.web3AuthNetwork, - enableLogging: options.enableLogging, - }); } get tKey(): TKeyTSS { @@ -232,11 +224,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit { this.resetState(); if (params.rehydrate === undefined) params.rehydrate = true; - const nodeDetails = await this.nodeDetailManager.getNodeDetails({ verifier: "test-verifier", verifierId: "test@example.com" }); - - if (!nodeDetails) { - throw CoreKitError.nodeDetailsRetrievalFailed(); - } + const nodeDetails = fetchLocalConfig(this.options.web3AuthNetwork, this.keyType); if (this.keyType === KEY_TYPE.ED25519 && this.options.useDKG) { throw CoreKitError.invalidConfig("DKG is not supported for ed25519 key type"); @@ -296,6 +284,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit { (window?.location.hash.includes("#state") || window?.location.hash.includes("#access_token")) ) { // on failed redirect, instance is reseted. + // skip check feature gating on redirection as it was check before login await this.handleRedirectResult(); // if not redirect flow try to rehydrate session if available } else if (params.rehydrate && this.sessionManager.sessionId) { @@ -1264,10 +1253,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit { const { tssShareIndex } = this.state; const tssPubKey = await this.getPubKeyPoint(); - const { torusNodeTSSEndpoints } = await this.nodeDetailManager.getNodeDetails({ - verifier: this.tkey.serviceProvider.verifierName, - verifierId: this.tkey.serviceProvider.verifierId, - }); + const { torusNodeTSSEndpoints } = fetchLocalConfig(this.options.web3AuthNetwork, this.keyType); if (!this.state.factorKey) { throw CoreKitError.factorKeyNotPresent("factorKey not present in state when signing.");