TransWikia.com

How to check the current MetaMask network?

Ethereum Asked on November 24, 2021

How to check the current MetaMask network?

For example, if the current network is Rinkeby, I need the string "rinkeby".

One Answer

You can check the current network chain ID like this:

console.log(window.ethereum.networkVersion, 'window.ethereum.networkVersion');

And these are the chain IDs for the most used ethereum networks:

  1. Mainnet: 1
  2. Kovan: 42
  3. Ropsten: 3
  4. Rinkeby: 4
  5. Goerli: 5

Answered by Miroslav Nedelchev on November 24, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP