Skip to content

Fix/metamask connect issue#2452

Draft
tanguyenvn wants to merge 9 commits intofeat/metamask-connectfrom
fix/metamask-connect-issue
Draft

Fix/metamask connect issue#2452
tanguyenvn wants to merge 9 commits intofeat/metamask-connectfrom
fix/metamask-connect-issue

Conversation

@tanguyenvn
Copy link
Copy Markdown
Contributor

@tanguyenvn tanguyenvn commented Apr 13, 2026

Jira Link

Description

Fix issues when integrating with MM Connect SDK

  • cannot use Solana wallet
  • loader is not showing correctly when connecting with MM wallet

How has this been tested?

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • My code follows the code style of this project. (run lint)
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Note

Medium Risk
Changes core connector behavior for switchChain, Solana wallet initialization, and token auth selection across Auth/MetaMask/WC connectors, which could affect multichain login flows. Large dependency/lockfile churn (notably MetaMask/Solana packages) increases integration risk.

Overview
Fixes multichain connection edge cases by updating connector chain-switching and Solana wallet behavior across Auth, MetaMask, and WalletConnect.

AuthConnector.switchChain now switches via CAIP chain IDs and no longer blocks when multiple namespaces are configured; it also always sets up connection.solanaWallet when Solana chains are present. AuthSolanaWallet is reworked to support multiple Solana chain configs and to lazily fetch accounts on first use, emitting Wallet Standard change events.

Solana providers (packages/modal and packages/no-modal) now derive the Solana RPC config from coreOptions.chains instead of requiring the current chain to be Solana. The MetaMask connector’s getAuthTokenInfo selects an EVM chain more robustly and switchChain becomes a no-op for Solana targets; WalletConnect V2 similarly removes the multi-namespace switchChain restriction. Demo UI updates remove the chains prop from AppDashboard and add a button/translation to print the current Solana chain.

Reviewed by Cursor Bugbot for commit bb6586e. Bugbot is set up for automated code reviews on this repo. Configure here.

@tanguyenvn tanguyenvn requested review from a team as code owners April 13, 2026 17:04
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web3auth-web Ready Ready Preview, Comment Apr 14, 2026 10:14am

Request Review

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit bb6586e. Configure here.

@tanguyenvn tanguyenvn marked this pull request as draft April 13, 2026 17:16
// when having multiple namespaces, ask user to select one
if (wallet.chainNamespaces?.length > 1) {
const isCustomMetaMaskConnectorAndHasInjected = wallet.name === WALLET_CONNECTORS.METAMASK && wallet.isInstalled && wallet.hasInjectedWallet;
if (wallet.chainNamespaces?.length > 1 && !isCustomMetaMaskConnectorAndHasInjected) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

skip for MM as it already support multi chains, no need to manually select chain namespace

dapp,
api: { supportedNetworks: solanaSupportedNetworks },
debug: this.connectorSettings?.debug,
skipAutoRegister: true,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

don't register it to wallet standard registry

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.

1 participant