Commit 88bd7f5
chore: MMConnect Configuration Improvements (#91)
Makes improvements to MM Connect configurability and testabilty
- **Scope selection for MMConnect**: Auto Connect via MM Connect now
passes selected scopes from checkboxes instead of hardcoding
`['eip155:1']`.
- **Network checkboxes**: Removed `disabled` attribute so scopes can be
selected before connecting.
- **Supported networks configuration**: Added RPC URLs for all featured
networks (Ethereum, Linea, Arbitrum, Avalanche, BNB, Optimism, Polygon,
zkSync, Base, Localhost, Solana) in `MetaMaskConnectProvider`.
- **Disconnect button**: Added red "Disconnect MMConnect Session" button
that appears when a MMConnect session is active.
This enables users to select desired scopes via checkboxes before
auto-connecting via MMConnect, improving the test dapp's flexibility for
multi-chain testing.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Enables scope-selectable MM Connect auto-connect, configures supported
networks, and adds a session disconnect button.
>
> - **UI (App.tsx)**:
> - Auto Connect via `MM_CONNECT_ID` now passes selected scopes from
checkboxes/custom inputs.
> - Network checkboxes enabled for pre-connection scope selection.
> - Shows red "Disconnect MMConnect Session" button when an MM Connect
session is active.
> - **SDK**:
> - `SDK.setExtensionIdAndConnect` accepts optional `scopes:
CaipChainId[]` and forwards to provider for MM Connect.
> - `useSDK.connect` signature updated to accept optional scopes and
propagate to SDK.
> - **MetaMaskConnectProvider**:
> - `connect(scopes?: Scope[])` accepts scopes; defaults to
`['eip155:1']` when none provided.
> - Adds `supportedNetworks` RPC URLs for featured chains (Ethereum,
Linea, Arbitrum, Avalanche, BNB, OP, Polygon, zkSync, Base, Localhost,
Solana).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
243190e. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: ffmcgee <joao.carlos@consensys.net>1 parent e948733 commit 88bd7f5
4 files changed
Lines changed: 61 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
859 | 859 | | |
860 | 860 | | |
861 | 861 | | |
862 | | - | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
863 | 870 | | |
864 | 871 | | |
865 | 872 | | |
| |||
869 | 876 | | |
870 | 877 | | |
871 | 878 | | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
872 | 899 | | |
873 | 900 | | |
874 | 901 | | |
| |||
907 | 934 | | |
908 | 935 | | |
909 | 936 | | |
910 | | - | |
911 | 937 | | |
912 | 938 | | |
913 | 939 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
113 | 116 | | |
114 | 117 | | |
115 | 118 | | |
| |||
118 | 121 | | |
119 | 122 | | |
120 | 123 | | |
121 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
122 | 127 | | |
123 | 128 | | |
124 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
24 | 37 | | |
25 | 38 | | |
26 | 39 | | |
| |||
39 | 52 | | |
40 | 53 | | |
41 | 54 | | |
42 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
43 | 60 | | |
44 | 61 | | |
45 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
138 | 141 | | |
139 | 142 | | |
140 | 143 | | |
| |||
0 commit comments