feat: multichain initial request+deeplinks#1351
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1351 +/- ##
==========================================
+ Coverage 74.93% 74.99% +0.05%
==========================================
Files 184 184
Lines 4513 4519 +6
Branches 1105 1108 +3
==========================================
+ Hits 3382 3389 +7
+ Misses 1131 1130 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
04c3b12 to
65e816c
Compare
| import { addValidAccounts, getOptionalScopes, getValidAccounts } from '../../utils'; | ||
|
|
||
| const DEFAULT_REQUEST_TIMEOUT = 60 * 1000; | ||
| const DEFAULT_CONNECTION_TIMEOUT = DEFAULT_REQUEST_TIMEOUT; |
There was a problem hiding this comment.
We should use these two combined
This will will request timeout + some grace period for the user to go back to the wallet. But the QR code will still have the same request timeout only
There was a problem hiding this comment.
So DEFAULT_REQUEST_TIMEOUT = 60s, DEFAULT_CONNECTION_TIMEOUT = 120s (DEFAULT_REQUEST_TIMEOUT + grace period for user to come back to the dapp)
|



Explanation
This PR is adding support for mobile wallet protocol latest features (initial RPC Request) and deeplink management.
In Depth
Right now the unitary tests are able to reproduce the following environments:
References
Checklist
Note
Adds deeplink/universal-link connection with MWP initial payload, introduces explicit Default/MWP transports, updates state/notifications and UI, and overhauls tests and playground.
MWPTransport(initial payload, reconnect on focus, request timeouts) and newDefaultTransport(browser extension) with session create/upgrade logic.stateChangedviaonNotification; refactor state flow; removegetCurrentSessionfromMultichainCore.metamask://,https://metamask.app.link); makeunload/onCloseasync and adjust OTP modal callbacks.isSecure,hasExtension; newMETAMASK_CONNECT_BASE_URLandMETAMASK_DEEPLINK_BASE.mobile.preferredOpenLink,mobile.useDeeplink,transport.onNotification); addExtendedTransport; tweak RPC error message wording.tests/*harness, mocks, and envs; add web-mobile coverage; expand connect/invoke/session error scenarios.@metamask/mobile-wallet-protocol-*to^0.2.x; add@types/jsdom; adjust@metamask/utilsin playground.Written by Cursor Bugbot for commit a3fed68. This will update automatically on new commits. Configure here.