Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix chain switch: back to consistent switchChain before addChain #4512

Merged
merged 2 commits into from
Jan 22, 2025

Conversation

EdouardBougon
Copy link
Collaborator

Description

Rollback #4422. In this PR, wallet_addEthereumChain was called in the first place for all non-removable chains. This method has the side effect of requiring the user to update its MetaMask RPC when it's not matching the one specified in the request.

Changes

In this PR, we're moving back to the regular flow: try wallet_switchChain, and if it fails because the chain doesn't exist, try wallet_addEthereumChain. This flow is more consistent and aligned with the consequences of each method.

Copy link

changeset-bot bot commented Jan 20, 2025

🦋 Changeset detected

Latest commit: 1b1601c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@wagmi/connectors Patch
wagmi Patch
@wagmi/vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jan 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wagmi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 3:44pm

@tmm tmm merged commit a257e8d into wevm:main Jan 22, 2025
4 of 10 checks passed
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.

3 participants