Fix metamask extension detection#1371
Merged
Merged
Conversation
wenfix
reviewed
Oct 15, 2025
wenfix
reviewed
Oct 15, 2025
wenfix
reviewed
Oct 15, 2025
wenfix
previously approved these changes
Oct 15, 2025
wenfix
approved these changes
Oct 15, 2025
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1371 +/- ##
=======================================
Coverage 74.99% 74.99%
=======================================
Files 184 184
Lines 4519 4519
Branches 1108 1108
=======================================
Hits 3389 3389
Misses 1130 1130 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
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.



Explanation
This PR refactor the extension detection code to use EIP-6963
References
Checklist
Note
Switches MetaMask extension detection to async EIP-6963 flow and updates SDK logic to await it; also improves MWP transport focus listener handling and adds a test platform mock.
src/domain/platform):hasExtension(): Promise<boolean>backed by a shareddetectionPromise.src/multichain):hasExtension()in transport selection (getStoredTransport) and connection flow (connect), includingisDesktopPreferredlogic.src/multichain/transports/mwp):windowfocus listener with a saved handler and remove it ondisconnect; minor cleanup.tests/mocks/platform.tsto mock asynchasExtension; include intests/mocks/index.ts.Written by Cursor Bugbot for commit 4845d17. This will update automatically on new commits. Configure here.