Check Which Chain is Connected

Is there currently a way to check which chain the user is connected to on their wallet? Using either Moralis, or the web3 library?

eg, something along the lines of:

let currentChain = await Moralis.Web3API.currentChain();
console.log(currentChain)

That would return something like

matic

or

0x89 

Hi, maybe this helps you:

1 Like

Yes! thank you so much! This works perfectly! :smile:

1 Like