Commit af41680
authored
fix: handle wallet:{namespace} request (#36459)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
This Pr fixes the handling of `wallet:{namespace}` permission requests.
Previously when there is an existing chain permission, this gets
ignored.
[](https://codespaces.new/MetaMask/metamask-extension/pull/36459?quickstart=1)
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: Fix requesting additional wallet namespace request when
there is an existing permission.
## **Related issues**
Fixes:
## **Manual testing steps**
1. Go to matcha.xyz
2. Connect with a solana account
3. Then connect with an evm account
4. See that both are connected.
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Properly handles wallet:{namespace} permission requests by
auto-including matching non-test chains for EIP-1193 requests and
updating default selected chains.
>
> - **Multichain Connect Page
(`ui/pages/.../multichain-accounts-connect-page.tsx`)**:
> - **Wallet namespace handling**: Detects `wallet:{namespace}`
requests; when `isEip1193Request`, auto-includes additional non-test
chains whose namespaces match `requestedNamespacesWithoutWallet`,
merging with supported requested chains and de-duplicating.
> - **State/props**: Extracts `isEip1193Request` from
`request.metadata`.
> - **Memo deps**: Updates dependencies to reflect new inputs
(`isEip1193Request`, `requestedNamespacesWithoutWallet`,
`currentlySelectedNetwork.chainId`).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
4f80d44. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent aaf52e0 commit af41680
File tree
1 file changed
+30
-6
lines changed- ui/pages/multichain-accounts/multichain-accounts-connect-page
1 file changed
+30
-6
lines changedui/pages/multichain-accounts/multichain-accounts-connect-page/multichain-accounts-connect-page.tsx
Lines changed: 30 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
| |||
238 | 239 | | |
239 | 240 | | |
240 | 241 | | |
241 | | - | |
242 | | - | |
243 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
244 | 266 | | |
245 | 267 | | |
246 | 268 | | |
| |||
278 | 300 | | |
279 | 301 | | |
280 | 302 | | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | 303 | | |
| 304 | + | |
285 | 305 | | |
| 306 | + | |
| 307 | + | |
286 | 308 | | |
| 309 | + | |
| 310 | + | |
287 | 311 | | |
288 | 312 | | |
289 | 313 | | |
| |||
0 commit comments