reason: 'could not detect network',
code: 'NETWORK_ERROR',
event: 'noNetwork'
async _uncachedDetectNetwork(): Promise<Network> {
--
347 | await timer(0);
348 |
349 | let chainId = null;
350 | try {
351 | chainId = await this.send("eth_chainId", [ ]);
352 | } catch (error) {
353 | try {
354 | chainId = await this.send("net_version", [ ]);
355 | } catch (error) { }
356 | }
357 |
358 | if (chainId != null) {
359 | const getNetwork = getStatic<(network: Networkish) => Network>(this.constructor, "getNetwork");
360 | try {
361 | return getNetwork(BigNumber.from(chainId).toNumber());
362 | } catch (error) {
363 | return logger.throwError("could not detect network", Logger.errors.NETWORK_ERROR, {
364 | chainId: chainId,
365 | event: "invalidNetwork",
366 | serverError: error
367 | });
368 | }
369 | }
370 |
371 | return logger.throwError("could not detect network", Logger.errors.NETWORK_ERROR, {
372 | event: "noNetwork"
373 | });
374 | }