How to get network name and chain Id to which metamask wallet is connected using Ether.js library? #2902
Unanswered
DeadmanAbir
asked this question in
Q&A
Replies: 1 comment 3 replies
-
hey @DeadmanAbir to get the chain ID try this:
or this would work as well
for getting the network name, try this.
Let me know if this work. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey I am looking for a solution that I would use in my Dapp to get the network name and the chain Id of the network to which the wallet is connected using Ether.js library.
For eg- If my wallet is connected to goerli network then I should get network name as goerli and chain Id as 5. What would be the code for that?
Beta Was this translation helpful? Give feedback.
All reactions