feat: MetaMask Connect#433
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.
| strategy: | ||
| matrix: | ||
| node-version: [18.x, 20.x] | ||
| node-version: [20.x] |
There was a problem hiding this comment.
mm-connect requires node version >=20.19.0
|
@SocketSecurity ignore-all these are all introduced by |
|
Seeing a strange first click between the SDKs gets to own the modal behavior: Screen.Recording.2026-06-30.at.2.59.15.PM.movClaude's take:
That being said this isn't a real case. We wouldn't ever expect both SDKs to be installed in the same place. This is just for this test app. |
|
Tiny nit in |
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.