feat: MetaMask Connect#433
Open
wenfix wants to merge 25 commits into
Open
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring alerts on:
|
`@metamask/connect-evm` raises the project's node floor to >=20.19.0 (reflected in package.json engines and .nvmrc), so testing on node 18.x no longer matches a supported runtime. Run the matrix on 20.x only.
`yarn allow-scripts` failed in CI because the @metamask/connect-evm dependency tree introduced a package with an install script (protobufjs, via connect-multichain > mobile-wallet-protocol-core > centrifuge) and re-resolved keccak/secp256k1 under ethereum-cryptography, which no longer matched the existing allowlist paths. Ran `yarn allow-scripts auto`; the new entries default to false (scripts disabled), consistent with every other entry in the config.
wenfix
commented
Jun 25, 2026
| strategy: | ||
| matrix: | ||
| node-version: [18.x, 20.x] | ||
| node-version: [20.x] |
Contributor
Author
There was a problem hiding this comment.
mm-connect requires node version >=20.19.0
Contributor
Author
|
@SocketSecurity ignore-all these are all introduced by |
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.
Summary
@metamask/connect-evmpackage.processshim so the production bundle resolves Connect EVM's ESM dependencies.Notable behavior
MetaMask Connect; the connected state isMetaMask Connect - Disconnect.net_versionis optional. Providers that do not support it fall back to the decimal value derived frometh_chainId.Node version bump
@metamask/connect-evm@1.4.0(and several of its transitive deps) declareengines.node: ">=20.19.0"and rely on Node 20.19+ runtime behavior. This PR mirrors that floor inpackage.jsonengines and.nvmrc, and drops Node18.xfrom thebuild-lint-testCI matrix so CI only runs against a supported runtime.Verification
fnm exec --using=20.19.1 yarn lintfnm exec --using=20.19.1 yarn buildBuild completed with warnings only:
@react-native-async-storage/async-storageManual testing still recommended
Notes for reviewers
@metamask/connect-evmand its transitive tree (network-access and obfuscated-code alerts, plus aprotobufjsCVE). These require supply-chain triage via@SocketSecurity ignore ...comments rather than a code change.Note
Medium Risk
Touches core provider switching/teardown used by all wallet flows; new third-party Connect EVM dependency tree adds supply-chain surface, though changes are localized to the test dapp.
Overview
Adds a MetaMask Connect flow using
@metamask/connect-evm, with a new UI button, shareddapp-metadata, and registration of the Connect EVM EIP-1193 provider (supported networks + chain IDs).Provider lifecycle is refactored so switching and disconnecting across extension, EIP-6963, SDK, WalletConnect, and Connect EVM does not leave stale state: teardown uses
removeListener/off, clears contract/ethers context on close, only resets the UI when the active provider is removed, and treats any provider withrequest(not onlyisMetaMask) as usable.net_versionis optional with fallback frometh_chainId; WalletConnect subscriptions are registered once with duplicate-transition guards.Tooling: Node floor raised to ≥20.19.0 (
.nvmrc,package.jsonengines, CI matrix drops 18.x); webpackprocessshim points atprocess/browser.js; Lavamoat allow-scripts entries for Connect EVM transitive deps; ESLintecmaVersion: 2020forsrc/**/*.js.Reviewed by Cursor Bugbot for commit 1f3fb25. Bugbot is set up for automated code reviews on this repo. Configure here.