It's finally here! The Custom Network API!

It has been always a pain to configure xDAI or any other “non-official” network on metamask, until now, the new Custom Network API is here!

It implements EIP-3085, and it’s as easy as call the following javascript snippet to add the xDAI network:

ethereum.request({
  method: "wallet_addEthereumChain",
  params: [{
    chainId: "0x64",
    chainName: "xDai",
    rpcUrls: ["https://xdai.poanetwork.dev/"],
    iconUrls: ["https://gblobscdn.gitbook.com/spaces%2F-Lpi9AHj62wscNlQjI-l%2Favatar.png"],
    nativeCurrency: { name: "xDAI", symbol: "xDAI", decimals: 18 },
    blockExplorerUrls: ["https://blockscout.com/poa/xdai/"]
  }]
})

And this is how it looks like!

It’s time to change the “Wrong network” message in our interfaces, folks! Let’s make some pull requests!

14 Likes

This is really cool, an extra step for our end goal of seamless UX in crypto!

Thanks for sharing @sem :honeybee:

4 Likes

It is very easy to add to anything we have. I added to the honey faucet as an example:

5 Likes

Is it something we could add to the connect wallet component? @fabriv @gabi @rperez89

3 Likes

nice work, hope it will be implemented soon in all 1hive dApps.

1 Like

Yes! We should probably expose this functionality on the use-wallet provider as you mentioned in the PR @sem. We could submit a PR on the original repo and ask Pierre or @gabi to review!

3 Likes