fix: load MetaMask Connect EVM connector when extension is installed#720
Open
shahbaz17 wants to merge 1 commit into
Open
fix: load MetaMask Connect EVM connector when extension is installed#720shahbaz17 wants to merge 1 commit into
shahbaz17 wants to merge 1 commit into
Conversation
Make the `@metamask/connect-evm` wagmi connector the canonical MetaMask entry whether or not the extension is installed. Previously the SDK connector was skipped when the extension was detected, leaving desktop on wagmi's EIP-6963 (`io.metamask`) path and mobile on the SDK path - divergent connector behavior across the two. `createDefaultWagmiConfig`: drop the extension-presence gate. Wagmi's `multiInjectedProviderDiscovery` uses the connector's `rdns: 'io.metamask'` to dedupe against the EIP-6963 announcement, so no extra entry is added by wagmi itself. Broaden the lazy-load gate to match any prior MetaMask connection (`io.metamask` or `metaMaskSDK`) so a user who first connects via EIP-6963 still gets the SDK connector loaded on subsequent visits. `useCombinedWallets`: keep only the first EVM connector per wallet entry. Configured connectors are unshifted to the front of the wagmi connector list, so they take precedence over auto-discovered EIP-6963 announcements. Fixes the duplicate-key React warning under MetaMask. `walletTags`: tag `metaMaskSDK` as `Installed` (instead of `GetStarted`) when the extension is detected so MetaMask sorts to the top of the multi-ecosystem picker. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make the
@metamask/connect-evmwagmi connector the canonical MetaMask entry whether or not the extension is installed. Previously the SDK connector was skipped when the extension was detected, leaving desktop on wagmi's EIP-6963 (io.metamask) path and mobile on the SDK path - divergent connector behavior across the two.createDefaultWagmiConfig: drop the extension-presence gate. Wagmi'smultiInjectedProviderDiscoveryuses the connector'srdns: 'io.metamask'to dedupe against the EIP-6963 announcement, so no extra entry is added by wagmi itself. Broaden the lazy-load gate to match any prior MetaMask connection (io.metamaskormetaMaskSDK) so a user who first connects via EIP-6963 still gets the SDK connector loaded on subsequent visits.useCombinedWallets: keep only the first EVM connector per wallet entry. Configured connectors are unshifted to the front of the wagmi connector list, so they take precedence over auto-discovered EIP-6963 announcements. Fixes the duplicate-key React warning under MetaMask.walletTags: tagmetaMaskSDKasInstalled(instead ofGetStarted) when the extension is detected so MetaMask sorts to the top of the multi-ecosystem picker.Which Linear task is linked to this PR?
Why was it implemented this way?
Explain the reasoning behind the implementation. Were there alternative approaches? Why was this solution chosen?
Visual showcase (Screenshots or Videos)
If applicable, attach screenshots, GIFs, or videos to showcase the functionality, UI changes, or bug fixes.
Checklist before requesting a review