Conversation
…ade-update feat: update connector
7 tasks
…name dappMetadata is typed with all-optional fields for backwards compat, but the underlying connect-evm SDK requires `name`. Merge with defaultDappParams instead of replacing so a partial dappMetadata always gets a valid `name` filled in.
jiexi
approved these changes
Mar 19, 2026
626195d to
eebc173
Compare
github-merge-queue bot
pushed a commit
to MetaMask/metamask-extension
that referenced
this pull request
Mar 26, 2026
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> Adds E2E tests for the Multichain API using [Metamask Connect](connect-monorepo) (formerly SDK). Five scenarios: 1. **Simultaneous multi-chain + Solana connection** — Verifies `wallet_createSession` can grant 3 EVM chains + Solana scope simultaneously and that all ScopeCards render. 2. **Per-chain `personal_sign` routing** — Confirms `personal_sign` requests are routed to the correct chain scope and return valid signatures. 3. **Per-chain `eth_chainId` isolation** — Validates that `eth_chainId` returns the correct hex chain ID for each connected scope. 4. **Permission removal reflection** — Tests that removing a chain permission via the extension UI immediately reflects in the dapp (ScopeCard disappears). 5. **Full session termination** — Verifies `wallet_revokeSession` (via `sdkDisconnect()`) clears session state on both dapp and wallet sides. ### New Test Dapp and Page Object Adds the [MM Connect Test Dapp](https://github.com/MetaMask/connect-monorepo/tree/main/playground/browser-playground) (`test/e2e/page-objects/pages/test-dapp-mm-connect.ts`): - The dapp exposes the MM Connect connectors. - Replicates `@metamask/playground-ui` test ID logic in-tree for stable selectors - Provides clean abstraction: `selectNetworks()`, `clickConnect()`, `triggerMethod()`, `checkMethodResult()`, `checkScopeCardVisible()` - Handles async dialog flow correctly (trigger → approve → assert result via `waitForSelector`) ### Infrastructure - Added `DAPP_PATH.TEST_DAPP_MM_CONNECT` constant - Added `MM_CONNECT_EVM_CHAINS` and `MM_CONNECT_FEATURED_CHAIN_IDS` constants - Added `@metamask/browser-playground@0.3.0` devDependency - Updated `privacy-snapshot.json` with `eth.merkle.io` (RPC) and `mm-sdk-analytics.api.cx.metamask.io` (telemetry) - All tests use `FixtureBuilderV2` ### Privacy Changes Adds two entries: - **`https://eth.merkle.io`**: is the default RPC for Ethereum mainnet chain definition at [viem](https://github.com/wevm/viem/blob/0f7837ce96b5791b5ad45c2b2d2fe9cdabbe98b5/src/chains/definitions/mainnet.ts#L10), the base library on top of which `wagmi` is built. `wagmi` is used by the `browser-playground` to enable testing the new MM Connect [wagmi connector](wevm/wagmi#4960). - **`mm-sdk-analytics.api.cx.metamask.io`**: is the analytics endpoint for SDK related metrics. [](https://codespaces.new/MetaMask/metamask-extension/pull/40818?quickstart=1) ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: ## **Related issues** Fixes: [WAPI-1044](https://consensyssoftware.atlassian.net/browse/WAPI-1044) ## **Manual testing steps** 1. `yarn && yarn build:test` 2. `yarn test:e2e:single test/e2e/tests/sdk/connect-multichain.spec.ts --browser=chrome` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Primarily adds E2E tests and test infrastructure, but introduces a new dev dependency (`@metamask/browser-playground`) and expands the privacy allowlist, which can affect CI stability and policy expectations. > > **Overview** > Adds a new MM Connect multichain E2E suite (`connect-multichain.spec.ts`) that exercises `wallet_createSession` across multiple EVM chains plus Solana, per-scope signing/`eth_chainId`, permission removal propagation, and `wallet_revokeSession` disconnect behavior. > > Introduces a dedicated page object (`test-dapp-mm-connect.ts`) and new E2E constants (`DAPP_PATH.TEST_DAPP_MM_CONNECT`, `MM_CONNECT_EVM_CHAINS`, `MM_CONNECT_FEATURED_CHAIN_IDS`) to drive the `@metamask/browser-playground` dapp, and refactors permission-page navigation by extracting `getPermissionsPageForHost` into `permissions.flow.ts`. > > Updates test tooling/config by adding `@metamask/browser-playground@0.3.0` to dev deps and depcheck ignores, plus extends `privacy-snapshot.json` with `eth.merkle.io` and `mm-sdk-analytics.api.cx.metamask.io`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 35ed097. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [WAPI-1044]: https://consensyssoftware.atlassian.net/browse/WAPI-1044?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
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.
Migrates MetaMask connector to MetaMask Connect SDK. To continue using the MetaMask connector, install the
@metamask/connect-evmpackage. Note this is a Breaking Change.Please see documentation for the new expect params here
Related #4936
Here's a concise breaking changes section you can paste into the wagmi PR #4960 description:
Breaking Changes
The MetaMask connector now uses
@metamask/connect-evminstead of@metamask/sdk.Consumer action required
Install the new peer dependency:
Update connector configuration:
@metamask/sdk)@metamask/connect-evm)dappMetadata: { name, url }dapp: { name, url, iconUrl? }useDeeplink: booleanmobile: { useDeeplink: boolean }preferredOpenLink: fnmobile: { preferredOpenLink: fn }logging: { ... }debug: booleanforceDeleteProviderforceInjectProviderinjectProviderreadonlyRPCMapdappMetadataandloggingstill work but are deprecated.Minimal config example:
We're also publishing a cursor plugin to help guide AI assisted migrations here -> MetaMask/metamask-connect-cursor-plugin#3.