Add or Switch to Harmony chain on Metamask
This tutorial help developers to interact with Metamask installed on a user's device, to add (or switch to) the Harmony chain's network.
Last updated
This tutorial help developers to interact with Metamask installed on a user's device, to add (or switch to) the Harmony chain's network.
Last updated
Harmony is a multi-sharded chain, currently with shard 0, 1, 2 and 3 running on Mainnet. To execute the code snippet below successfull, you can test on a device that has Metamask extension / add-on installed and visible to your app.
When this code snippet is executed, users will see message to approve adding or switching to correct Harmony chain.
Please note that window.web3
has been . Use window.ethereum
instead. To migrate, use .
You can see more information about Metamask documentation related to the Ethereum Provider API at
To see a full list of Chain IDs, please visit and search for Harmony