chore: upgrade @metamask/connect-evm to v2 - #5151
Conversation
🦋 Changeset detectedLatest commit: 34282e7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
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. |
@wagmi/cli
@wagmi/connectors
@wagmi/core
create-wagmi
wagmi
@wagmi/solid
@wagmi/vue
commit: |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Size Change: +161 B (+0.01%) Total Size: 1.2 MB
ℹ️ View Unchanged
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5151 +/- ##
=======================================
Coverage 88.51% 88.51%
=======================================
Files 303 303
Lines 2812 2812
Branches 816 816
=======================================
Hits 2489 2489
Misses 124 124
Partials 199 199 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
…er dep connect-evm 2.1.0 bundles @metamask/connect-multichain as a regular dependency again (the peer-dep move was reverted in MetaMask/connect-monorepo#323), so consumers no longer install it separately. Remove the connect-multichain peer dependency, catalog entry, knip ignore, and docs install instructions, bump connect-evm to 2.1.0, and regenerate the lockfile.
…2.0.0 # Conflicts: # pnpm-lock.yaml
Description
Upgrades
@metamask/connect-evmfrom1.3.1to2.1.0(a major release) in@wagmi/connectors, and setsskipAutoAnnounce: trueon themetaMaskconnector.skipAutoAnnounce: trueprevents the MetaMask SDK from announcing its own EIP-1193 provider via EIP-6963. wagmi already discovers the native MetaMask provider through MIPD/EIP-6963 (the connector's pre-connect fast path relies on it), so letting the SDK announce a second time would register a duplicate, competing provider entry. Forcing it on is the correct behavior for this connector.Changes
@metamask/connect-evm→2.1.0— catalog pin (pnpm-workspace.yaml) and peer range (packages/connectors/package.json) bumped to^2.1.0.skipAutoAnnounce: trueset on themetaMaskconnector'screateEVMClient(...)call, placed after the...parametersspread so it's always enforced and can't be overridden by callers.getProvider()cast fix — connect-evm v2 changes the exportedEIP1193Providerfrom a structural type to a concrete class (extends EventEmitter, private fields), so the structurally-compatible injected EIP-6963 provider now needs a cast throughunknown.majorfor@wagmi/connectors).Breaking changes handled (connect-evm v2)
EIP1193Provideris now a concrete classgetProvider()cast no longer type-checksunknowntransport.onNotificationfromcreateEVMClient()MetaMaskParametersis derived fromParameters<typeof createEVMClient>[0], so it drops out automaticallytransportaccessorinstance.transportNote on
@metamask/connect-multichainconnect-evm
2.0.0briefly made@metamask/connect-multichaina required peer dependency. That was reverted in MetaMask/connect-monorepo#323 and shipped in2.1.0, where connect-multichain is once again a bundled (regular) dependency of connect-evm. So consumers of themetaMaskconnector only need@metamask/connect-evm— no separate peer install.Consumer migration
Apps using the
metaMaskconnector install only:Notes for reviewers
skipAutoAnnounceis hard-forced and omitted fromMetaMaskParameters(viaOmit), so callers cannot override it. wagmi already surfaces the native MetaMask provider via MIPD — this is intentional.injected as unknown as EIP1193Providerdouble-cast is required by the v2 class-based provider type; it's commented inline.connect-evm@2.1.0pulls in@metamask/connect-multichain@1.1.0transitively (along with itscentrifuge/protobufjsmobile-wallet-protocol transport deps).@metamask/connect-multichainis kept inminimumReleaseAgeExcludeso the freshly-published1.1.0resolves.Testing
pnpm check:types(connectors)pnpm vitest run --project connectors metaMask(theforces skipAutoAnnouncetest covers the connector behavior)Connector source is unchanged from the previously-passing revision; only the dependency version moved
2.0.0→2.1.0(same v2 API surface). CI re-verifies.