Skip to content

Add chain to the Metamask if it does not exist#69

Merged
MantisClone merged 3 commits intoRequestNetwork:masterfrom
OjusWiZard:fix/#51
Oct 10, 2023
Merged

Add chain to the Metamask if it does not exist#69
MantisClone merged 3 commits intoRequestNetwork:masterfrom
OjusWiZard:fix/#51

Conversation

@OjusWiZard
Copy link
Contributor

Fixes #51

  • Modified the addEthereumChain function to await while sending the wallet_switchEthereumChain message to the Web3Provider. It was not awaiting the promise earlier, so the error was not caught if the network was absent. Now, the whole try-catch flow works as expected.
  • Also, updated the chain details to clear the metamask warnings.

Metamask warning

Screencast.from.2023-10-07.23-49-00.webm

Copy link
Member

@MantisClone MantisClone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one! Thank you for your contribution!

@MantisClone MantisClone merged commit 56d6df2 into RequestNetwork:master Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request Create error when xdai hasn't been added to Metamask

2 participants