MCPcopy Create free account
hub / github.com/Modulus-Labs/RockyBot / getCurrentConnectedNetwork

Function getCurrentConnectedNetwork

front-end/src/util/interact.ts:104–111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102 * @returns Currently connected network
103 */
104export const getCurrentConnectedNetwork = async (): Promise<ethers.providers.Network> => {
105
106 // --- Unfortunate check we must do ---
107 if (ethersProvider === null) return { name: "", chainId: -1 };
108
109 const network = await ethersProvider.getNetwork();
110 return network;
111}
112
113/**
114 * Returns the current balance of the given Eth account to the user.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected