Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version v12.4.0 RC #27287

Draft
wants to merge 364 commits into
base: master
Choose a base branch
from
Draft

Version v12.4.0 RC #27287

wants to merge 364 commits into from

Conversation

metamaskbot
Copy link
Collaborator

📦 🚀

montelaidev and others added 30 commits July 25, 2024 22:37
<!--
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 filters BTC accounts from the permission connect list.

## **Related issues**

Fixes: 

## **Manual testing steps**

1. Create a BTC account
2. Connect to a dapp
3. Open popup
4. Click network icon
5. Click on `Connect more accounts`
6. See that there aren't any btc accounts

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->
![Screenshot 2024-07-19 at 21 09
57](https://github.com/user-attachments/assets/91dbd13d-c136-4666-ad3d-f57bd85d073d)


### **After**

<!-- [screenshots/recordings] -->
![Screenshot 2024-07-19 at 21 04
04](https://github.com/user-attachments/assets/fded0169-c62d-4f2e-9ea0-abf345d711c6)


## **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/develop/.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/develop/.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.

---------

Co-authored-by: Charly Chevalier <[email protected]>
Co-authored-by: Daniel Rocha <[email protected]>
<!--
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**

Adds two enums for MMI use:
- AccountType
- CustodyStatus

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **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**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.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.
<!--
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?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25807?quickstart=1)

Instead of copy-pasting the implementation of add-team-label to other
repositories, such as metamask-extension and metamask-mobile, it should
be possible to call the workflow directly from the github-tools
repository, if we make it a reusable workflow. This is great, because if
we make a change to the workflow in the github-tools repository, the
changes propagate to other repositories as well.

More information about reusable workflows:
https://docs.github.com/en/actions/using-workflows/reusing-workflows

This kind of aligns with
#25509, but not
exactly. The shared library would still be needed nevertheless, as this
is only sharing the workflow definition, but not the scripts that are
run during the workflow. The scripts still need to exist in all the
repositories (for now). Ideally, we would make the shared library an npm
package that can be installed in the different repositories to allow for
the sharing of scripts.

## **Related issues**

Fixes: MetaMask/MetaMask-planning#2760

## **Manual testing steps**

1. Have the workflow run the same as before, without it being defined in
the repository.

## **Screenshots/Recordings**

Not applicable

## **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/develop/.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/develop/.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.
…ences for opening menu with MMI build (#26079)

<!--
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?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26079?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **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**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.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.
## **Description**

<!--
[TODO]
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 pull request adds a Storybook story for the `Snackbar` component in
the MetaMask extension repository. The story is created to test the
`Snackbar` component in isolation and ensure it renders correctly in the
Storybook UI.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25515?quickstart=1)

## **Related issues**

N/A

## **Manual testing steps**

1. Go to the latest build of Storybook in this PR.
2. Navigate to the `Snackbar` component in the `Components/UI` folder.

## **Screenshots/Recordings**

<img
src="https://api.devin.ai/attachments/deed578b-e19c-406d-b4bd-202986b554f9/5eeef96f-cc18-42ce-9e33-21dce026014e.png"
/>

## **Pre-merge author checklist**

- [X] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.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/develop/.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.

Link to Devin run:
https://preview.devin.ai/devin/5be2ff2370a84b619ee0027d9cbca344
Requested by: the user

---------

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: George Marshall <[email protected]>
## **Description**

The `@metamask/transaction-controller` package has been updated from v32
to v34. The `@metamask/user-operation-controller` package had to be
bumped as well to avoid new peer dependency warnings.

Primarily the only breaking changes in these ranges were peer dependency
updates and an update to the minimum supported Node.js version. The new
peer dependencies did not introduce any new warnings, they are all met.
This update has resolved some pre-existing peer dependency warnings.

The only functional change required was this update to the
TransactionController in v33.0.0:

```
- **BREAKING:** The `TransactionController` messenger must now allow the `AccountsController:getSelectedAccount` action ([#4244](MetaMask/core#4244))

...

- **BREAKING:** Remove `getSelectedAddress` option from `TransactionController` ([#4244](MetaMask/core#4244))
  - The AccountsController is used to get the currently selected address automatically.
```

That change has been applied.

See the full changelogs here:
*
[`@metamask/transaction-controller`](https://github.com/MetaMask/core/blob/%40metamask/transaction-controller%4034.0.0/packages/transaction-controller/CHANGELOG.md)
*
[`@metamask/user-operation-controller`](https://github.com/MetaMask/core/blob/%40metamask/user-operation-controller%4013.0.0/packages/user-operation-controller/CHANGELOG.md)

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26124?quickstart=1)

## **Related issues**

This helps unblock #9372

## **Manual testing steps**

N/A

## **Screenshots/Recordings**

N/A

## **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/develop/.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/develop/.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.

---------

Co-authored-by: MetaMask Bot <[email protected]>
## **Description**

This resolves a peer dependency warning; v10.0.1 of the
`@metamask/ens-controller` was requesting an older version of the
`@metamask/network-controller` package. The versions are aligned with
this update.

The only breaking changes were to this peer dependency, and to the
minimum supported Node.js version.

See here for the full changelog:
https://github.com/MetaMask/core/blob/%40metamask/ens-controller%4012.0.0/packages/ens-controller/CHANGELOG.md

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26127?quickstart=1)

## **Related issues**

This helps to unblock #9372

## **Manual testing steps**

N/A

## **Screenshots/Recordings**

N/A

## **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/develop/.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/develop/.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.

---------

Co-authored-by: MetaMask Bot <[email protected]>
A few invalid entries have been removed from the `.prettierignore` file, and the remaining entries have been alphabetized so that they are easier to quickly scan.

I did this because I was investigating a strange ESLint error, and these entries made the investigation a little more complicated than it needed to be.
## **Description**

Updates BNB network logo to the newly provided png and svg assets.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26140?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

Load app and validate that BNB chain logos are updated. Note that erc20
token logos will not update until
MetaMask/contract-metadata#1334 gets merged.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**
<img width="300" alt="Screenshot 2024-07-25 at 10 20 48 AM"
src="https://github.com/user-attachments/assets/1657af96-71b3-4d53-9308-3b5d4127d960">

<img width="300" alt="Screenshot 2024-07-25 at 10 21 06 AM"
src="https://github.com/user-attachments/assets/cbda47bf-2dcb-481c-9530-6eda74b9b3e7">

<img width="300" alt="Screenshot 2024-07-25 at 10 22 32 AM"
src="https://github.com/user-attachments/assets/8be43670-298e-4b18-900f-3943eac4d310">

<img width="300" alt="Screenshot 2024-07-25 at 10 22 52 AM"
src="https://github.com/user-attachments/assets/10762e9f-c0ce-4871-964b-10e0d2112e82">

### **After**

<img width="300" alt="Screenshot 2024-07-25 at 10 38 18 AM"
src="https://github.com/user-attachments/assets/ab3ae389-6a68-451f-ae80-b4437343bf8b">
<img width="300" alt="Screenshot 2024-07-25 at 10 38 59 AM"
src="https://github.com/user-attachments/assets/80b66ffa-1ad2-422f-86b7-852b6e3b3555">
<img width="300" alt="Screenshot 2024-07-25 at 10 39 52 AM"
src="https://github.com/user-attachments/assets/2239643d-401a-4ae8-9850-2495d0c28d69">
<img width="300" alt="Screenshot 2024-07-25 at 10 40 15 AM"
src="https://github.com/user-attachments/assets/0c549632-6a1b-4ba4-8bfc-e34b80752fd2">


## **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/develop/.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/develop/.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.
<!--
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**

This PR modifies the names of some tracked events to monitor the use of
notifications, ensuring they adhere to the conventions used.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25521?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **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/develop/.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/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.

---------

Co-authored-by: Prithpal Sooriya <[email protected]>
Co-authored-by: Prithpal Sooriya <[email protected]>
<!--
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**

This PR fixes the flaky tests that happens during the firefox e2e. A btc
balance mock was also added to reduce api call usage.
<!--
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?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26082?quickstart=1)

## **Related issues**

Fixes: MetaMask/accounts-planning#531

## **Manual testing steps**

N/a

## **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/develop/.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/develop/.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.

---------

Co-authored-by: Charly Chevalier <[email protected]>
<!--
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**

This PR fixes a flaky test for the MMI build where clicking on the
Settings menu option was problematic.
I've added a conditional check to wait for the 'Portfolio Dashboard' to
load if the build is MMI.
<!--
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?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26111?quickstart=1)

## **Related issues**

Fixes:
#26110

## **Manual testing steps**

Execute below commands local or in codespaces run in chrome the browser
yarn
yarn build:test:mmi
yarn test:e2e:single test/e2e/tests/settings/4byte-directory.spec.js
--browser=chrome

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.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.
## **Description**

Adds another supported portfolio URL.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26163?quickstart=1)

## **Related issues**

N/A

## **Manual testing steps**

N/A

## **Screenshots/Recordings**

### **Before**

N/A

### **After**

N/A

## **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/develop/.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/develop/.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.
<!--
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**

Moves Custody component to TS.

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **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**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.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.

---------

Co-authored-by: Albert Olive <[email protected]>
## **Description**

Changes the add snap account flow to include a final modal that allows
snaps to suggest a name for the new account or for the user to input a
name for their new account. The new snap account is now created with a
name either inputted by the user, suggested by the snap, or the default
fallback account name.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25191?quickstart=1)

## **Related issues**

Fixes: MetaMask/accounts-planning#261

## **Manual testing steps**

<details>
  <summary>Testing with preinstalled snap</summary>
  <br />

1. Go to settings > experimental > toggle on "Enable Add a new Bitcoin
account (Beta)"
2. Click on the account list and select "+ Add account or hardware
wallet" then "Add new Bitcoin account (Beta)"
3. Go through the flow to add a Bitcoin account without inputting a
name, with inputting a name, and canceling adding the account
</details>

<details>
  <summary>Testing with account management snap</summary>
  
1. Go to the
[SSK](https://metamask.github.io/snap-simple-keyring/latest/) and
connect the snap
2. Go through the flow to create an account without inputting a name,
with inputting a name, and canceling adding the account
</details>

## **Screenshots/Recordings**

### **Demos**

Preinstalled snap flow


https://github.com/MetaMask/metamask-extension/assets/91970214/3782a417-4fd0-4b56-b4b7-30f64e75c6e8

Account management snap flow


https://github.com/MetaMask/metamask-extension/assets/91970214/9f53a67d-13c5-44ac-b286-78eddbfb89ae


## **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/develop/.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/develop/.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.

---------

Co-authored-by: Charly Chevalier <[email protected]>
Co-authored-by: David Walsh <[email protected]>
Co-authored-by: Brian Bergeron <[email protected]>
Co-authored-by: Nidhi Kumari <[email protected]>
Co-authored-by: Ariella Vu <[email protected]>
Co-authored-by: Jyoti Puri <[email protected]>
Co-authored-by: Mark Stacey <[email protected]>
Co-authored-by: Monte Lai <[email protected]>
Co-authored-by: Jony Bursztyn <[email protected]>
Co-authored-by: Mircea Nistor <[email protected]>
Co-authored-by: NidhiKJha <[email protected]>
Co-authored-by: legobeat <[email protected]>
Co-authored-by: Hassan Malik <[email protected]>
Co-authored-by: Frederik Bolding <[email protected]>
Co-authored-by: Gustavo Antunes <[email protected]>
<!--
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**

This PR updates the logos for Flare Mainnet and Songbird. The motivation
behind this change is to ensure that the Flare Network's branding is
accurately represented in MetaMask, providing users with a more reliable
and visually consistent experience across the platform.

The previous logo used in the wallet was outdated, and this update
brings the visual in line with the current branding guidelines of the
Flare network. This improvement enhances the user interface by aligning
the network's visual representation with its most current branding,
ensuring that users can easily recognize and associate Flare Mainnet and
Songbird within MetaMask.



<!--
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?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25560?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

1. Navigate to the MetaMask extension and select the network dropdown.
2. Choose the Flare Mainnet and Songbird from the list of available
networks.
3. Observe the updated Flare Mainnet and Songbird logo, confirming it
matches the current branding guidelines provided by Flare.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<img width="319" alt="metamask_flare_songbird_logos"
src="https://github.com/MetaMask/metamask-extension/assets/15251343/49d99244-3cc4-4c2a-9752-7b72c4d9da6a">


### **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/develop/.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/develop/.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.

Co-authored-by: Brian Bergeron <[email protected]>
…queue (#26171)

<!--
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**

Currently it's possible for the afterRequest hook for
ConfirmationRejectionRule to be added (and block) to the queue before
the transport addToQueue because of the execution flow.

the transport doesnt await so that afterRequest can get called, this
lets things happen like click the reject button while the request is
still pending. see related lines in [api-specs coverage
tool](https://github.com/open-rpc/test-coverage/blob/master/src/coverage.ts#L126-L134).

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26171?quickstart=1)

## **Related issues**

Fixes: #26156

## **Manual testing steps**

1. Trigger the api-spec job in CI (because this is not reproducible
locally it seems) multiple times. It should always pass.

## **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/develop/.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/develop/.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.

---------

Co-authored-by: Shane Jonas <[email protected]>
# **Description**

Bump the BTC Snap to version 0.3.0.
- This new release adds the fee estimation feature.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25808?quickstart=1)

## **Related issues**

N/A

## **Manual testing steps**

N/A

## **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/develop/.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/develop/.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.
<!--
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?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26115?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **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/develop/.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/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.
… test environment (#26182)

<!--
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**

We have noticed significant performance issues when accessing the
'Settings' menu option due to delays in loading the 'Portfolio
Dashboard'. This delay has caused flakiness in many of our automated
tests. The issue appears to have started after changes were made in PR
#25899.

**Root Cause:**
The performance issue is linked to an HTTP request to
`https://configuration.dev.metamask-institutional.io/v2/configuration/default`
to check if `portfolio.enabled` is true. This request is made in the
`onSubmitPassword` method in the `mmi-controller` file, resulting in
delays.

**Solution:**
To mitigate this issue, we have decided to set the `portfolio.enabled`
variable to `true` by default in the test environment. This will ensure
the 'Portfolio Dashboard' item always appears in the menu during tests,
thereby preventing delays caused by the HTTP request and stabilizing our
automated tests.

**Changes Made:**
- Updated the `getMmiPortfolioEnabled` function to return `true` if the
`IN_TEST` environment variable is set.
- This change applies only in the test environment, ensuring that the
production environment remains unaffected.

```diff
export function getMmiPortfolioEnabled(state) {
  if (process.env.IN_TEST) {
    return true;
  }

  return state.metamask.mmiConfiguration?.portfolio?.enabled;
}
```

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26182?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

1.	Attempt to click on the Settings menu option.
2.	Observe the delay in the ‘Portfolio Dashboard’ loading.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

[<!-- [screenshots/recordings]
-->](https://consensys.slack.com/archives/CTQAGKY5V/p1721994785419869?thread_ts=1721902891.054169&cid=CTQAGKY5V)

### **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/develop/.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/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.
## **Description**

This PR addresses a problem which had the following surface level
symptoms: when the UI is closed, the extension continues to send network
requests to the provider.

Upon some investigation, we discovered that these requests were the
result of polling initiated from the account tracker. And then upon
further investigation, we discovered that the callback in the
`outstream` `'end'` listener in `setupControllerConnection` of
`metamask-controller.js` was not being called when the UI was closed.

This problem was introduced with
#24533. That PR
updates the `object-multiplex` dependency to v2.0.0. The major change in
that update is the update of the `readable-stream` dependency from a v2
version to a v3 version. With that update, we see new `premature-close`
errors in the background. It seems that these errors are still present
in v2, but they are handled differently, resulting in an `'error'` event
instead of an `'end'` event. We still have not established a definitive
understanding of why this is happening, and follow up investigation will
be needed.

However, this PR still puts forward a fix that safely resolves the
issue. The solution added here is to make use of the
`readableStream.finished` function. The callback passed to this function
will be called when the stream is ended. This function has the same
behaviour as the `outstream.on('end'` listener had prior to the
aforementioned PR.

Instead of fully replacing the existing listener, we have added the
`readableStream.finished` call in addition to the existing listener. The
reason for this is explained in a code comment:

> The presence of both of the below handlers may be redundant. After
upgrading metamask/object-multiples to v2.0.0, which included an upgrade
of readable-streams from v2 to v3, we saw that the `outStream.on('end'`
handler was almost never being called. This seems to related to how v3
handles errors vs how v2 handles errors; there are "premature close"
errors in both cases, although in the case of v2 they don't prevent
`outStream.on('end'` from being called. At the time that this comment
was committed, it was known that we need to investigate and resolve the
underlying error, however, for expediency, we are not addressing them at
this time. Instead, we can observe that `readableStream.finished`
preserves the same functionality as we had when we relied on
readable-stream v2. Meanwhile, the `outStream.on('end'` handler was
observed to have been called at least once. As we do not yet fully
understand the conditions under which both of these are being called, we
include both handlers at the risk of redundancy. Logic has been added to
the handler to ensure that calling it more than once does not have any
affect.

To achieve "Logic has been added to the handler to ensure that calling
it more than once does not have any affect.", the PR adds a unique id to
each stream passed to `setupControllerConnection`, and uses a `Set` to
ensure the handler code only runs once per stream.

This PR then adds automated tests. The added unit tests are focused on
validating both pre-existing and new behaviour of
`setupControllerChanged`. The added e2e tests focus on the inititially
mentioned surface level symptoms: it confirms that `eth_call` and
`eth_getBalance` calls, the calls coming from the account-tracker
initiated polling, are not continued after the UI is closed. This e2e
test fails on current develop but passes on this branch.

MetaMask team members can see more details in this thread:
https://consensys.slack.com/archives/CTQAGKY5V/p1721653870583869

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26141?quickstart=1)

## **Related issues**

Fixes: #26002

## **Manual testing steps**

To observe the bug on develop:
1. Install and onboard
2. Open the service worker dev console and go to the network tab
3. Observe `eth_call` and `eth_getBalance` requests to infura
4. Close the UI, observe that the requests from step 3 continue

On this branch, in step 4, after closing the UI, those requests will not
continue.

## **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/develop/.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
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.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.

---------

Co-authored-by: legobt <[email protected]>
Co-authored-by: legobeat <[email protected]>
Co-authored-by: Danica Shen <[email protected]>
<!--
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?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26052?quickstart=1)

This PR uses the `setup-environment` workflow to reduce duplicated code
and optimize performance for cases where Node.js was being setup twice
during a workflow.

## **Related issues**

Fixes: #25683

## **Manual testing steps**

1. CI should pass

## **Screenshots/Recordings**

Not applicable

## **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/develop/.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/develop/.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.
<!--
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?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26104?quickstart=1)

This PR converts the global unit tests from Mocha to Jest. It removes
the `test-unit-global` CircleCI pipeline and runs the global unit tests
on GitHub actions along with the normal unit tests, contributing to the
coverage report.

Upon discussion with @Gudahtt the ignored dysfunctional unit test
`test/unit-global/protect-intrinsics.test.js` which was not compatible
with the Jest environment will be re-introduced in a separate PR. The
test will be ported to run as part of the e2e test suite, as the browser
would be a better test environment, closer to production.

## **Related issues**

Fixes: #25496

## **Manual testing steps**

1. Tests should be in Jest syntax, and should still pass
2. Tests should run on GitHub actions with normal unit tests, not on
CircleCI

## **Screenshots/Recordings**

Not applicable

## **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/develop/.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/develop/.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.
It's usually not a problem, but sometimes errors are received in
multiple parts, and then that prevents us from being able to ignore
them. The most recent example is trying to ignore
`SES_UNHANDLED_REJECTION: (Error#1)`

Discussed in #26084
)

<!--
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**

Ensures that we correctly call the preinstalled snap when the wallet is
unlocked. Also prevents unlock confirmations being created due to snap
calls when wallet is locked

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26189?quickstart=1)

## **Related issues**

[Ticket](https://consensyssoftware.atlassian.net/browse/NOTIFY-865)

Fixes: #26064

## **Manual testing steps**

1. Install the extension and enable notifications
2. Restart the browser, or reload the extension
3. Should see no auto opening of the wallet, and no unlock confirmations
being made.

## **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/develop/.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/develop/.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.
ccharly and others added 28 commits August 28, 2024 15:48
## **Description**

Bump the BTC Snap to version 0.5.0.

- This new release adds the new `getMaxSpendableBalance` method to fetch
the max spendable amount/balance from your account.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26701?quickstart=1)

## **Related issues**

N/A

## **Manual testing steps**

N/A

## **Screenshots/Recordings**

### **Before**

### **After**

## **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/develop/.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/develop/.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.
Add a property location to the Signature Rejected event depending on
where it was rejected from.
location: `confirmation` or `alert_friction_modal`

## **Description**


[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26469?quickstart=1)

## **Related issues**

Fixes:
[#2703](MetaMask/MetaMask-planning#2703)

## **Manual testing steps**
 NOTE: All scenarios below have an E2E test in place along with this PR.

TC1: 
1. Go to the test dapp
2. Initiate any signature
3.  Reject it from the confirmation screen
4. Look for the Signature Rejected event in the network tab, the request
should have the property location: "confirmation"

TC2:
1. Go to the test dapp
2. Initiate the signature 'SIGN IN WITH EHTEREUM (BAD DOMAIN)
3. Click on confirm
4.  Reject it from the alert
5. Look for the Signature Rejected event in the network tab, the request
should have the property location: "alert_friction_modal"


## **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/develop/.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
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.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.
…ng `defer`ed script tags (#26555)

This PR removes `load-*.js` helpers and load scripts using the `defer`
property instead.

This change drastically improves the performance of the extension but
greatly reduces perceived performance because the browser won't display
the popup until the DOMContentLoaded event.

But improve perceived performance is mostly regained by initially
loading an asset-less HTML file, `popup-init.html`, that then redirects
to the slower (but much faster than before this PR) `popup.html`.

This was initially authored by @Gudahtt, I've just updated and optimized
it to work with the both build systems.

One change I did not make was moving scripts to the `head`. I don't
think putting the scripts in the head does anything in our case[^1]
other than potentially require that we wait for `DOMContentLoaded`
before querying for the app container.

Note: In Firefox we continue to use `popup.html`. Firefox is very slow
to render the `popup-init.html` redirect, and it renders the page only
partially anyway, making the UX feel very janky. It also doesn't delay
opening the popup until `DOMContentLoaded`, like Chrome does, so the
issue `popup-init.html` solves doesn't do anything anyway.

---

Here is side-by-side video comparison of `develop` vs
`popup-defer-scripts`.

This video displays the elapsed time from clicking the MetaMask Fox to
Lock Screen render.

The end of the video is a frame-by-frame comparison of the new "jank"
this PR introduces. The develop branch renders the fox immediately,
whereas the popup-defer-scripts branch renders an empty page for about
15 milliseconds.

These stats aren't representative of real world performance, but are
intended to illustrate relative performance and perceived performance.

Both builds were created by running `yarn build dist`.


https://github.com/user-attachments/assets/38b856ca-d269-48f7-b305-19f4b9c6dce8

---

### Manual Testing

1. build with `yarn dist`
2. install into your browser and go through onboarding
3. open MetaMask
4. Marvel at how much faster it is

---

Closes
[#25721](#25721)

[^1]: our HTML files are very tiny, and thus will be loaded all in one
go, we don't have to worry about packets being lost and retransmitted
over the network, delaying the browser's preload scanner.

Co-authored-by: Mark Stacey <[email protected]>
<!--
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**

Since we want to ship Approve, increaseAllowance and Revoke pages on the
same release, we're holding off shipping the page for the Approve
transaction type for the time being.

This is accomplished by creating two separate arrays
`REDESIGN_USER_TRANSACTION_TYPES` and `REDESIGN_DEV_TRANSACTION_TYPES`
to control which transaction types are shown for the user feature toggle
and for the developer settings toggle respectively.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26676?quickstart=1)

## **Related issues**

Fixes: MetaMask/MetaMask-planning#3080

## **Manual testing steps**

1. Go to this page...
2.
3.

## **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**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.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.
<!--
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**

Adds an integration test to check that the alert is displayed when
network is busy.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26679?quickstart=1)

## **Related issues**

Fixes:
[#2977](MetaMask/MetaMask-planning#2977)

## **Manual testing steps**

1. Go to this page...
2.
3.

## **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**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.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.
## **Description**

Adds icons for IoTeX network: https://chainlist.org/chain/4689

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26723?quickstart=1)

## **Related issues**

Fixes: https://consensyssoftware.atlassian.net/browse/MMASSETS-353

## **Manual testing steps**

1. Add IoTeX network as custom network
2. Icon should display in Network List as well as Native token for IoTeX

## **Screenshots/Recordings**

<img width="362" alt="Screenshot 2024-08-28 at 8 38 03 AM"
src="https://github.com/user-attachments/assets/fe6f3ef5-aa8c-4309-8bc7-39d711297ff7">

## **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/develop/.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/develop/.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.
…in conditions (#26726)

## **Description**

Fix issue where `wallet_addEthereumChain` does not attach a result to
the response object when the currently selected rpcUrl matches the
request.

This would cause the request to get "stuck" in the
`QueuedRequestController` queue, preventing the queue from progressing
and causing confusing behavior.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26726?quickstart=1)

## **Related issues**

Fixes: #26706

## **Manual testing steps**

1. Go to https://chainlist.org/?chain=56&search=blast
2. Connect the wallet and add Blast Mainnet 
(For other chains it appears Chainlist cycles to the next rpcUrl you
don't have which avoids this bug, so use Blast)
3. After successfully adding the network, attempt to add Blast again.
Nothing should happen.
4. Then go to https://faucet.quicknode.com/blast/sepolia (or any dapp
where your wallet isn't already connected) and attempt to connect
5. You should be able to connect as usual

## **Screenshots/Recordings**

### **Before**


https://github.com/user-attachments/assets/b997027f-1c62-4279-87c6-0fe70989abb3


### **After**


https://github.com/user-attachments/assets/08307a88-8f6f-44cd-9b75-877aadb1805a


## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.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.
…tiates and queues multiple signatures and confirms` (#26707)

<!--
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**

There is a known race-condition that can display the signature queue in
unexpected order, so the test had a delay to address that, but this
doesn't fix the issue in all occasions. In this PR we add a
deterministic condition, to ensure this doesn't happen: we wait until we
find an element for the given signature, before triggering a new one,
making sure signatures are ordered.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26707?quickstart=1)

## **Related issues**

Fixes: #26507

## **Manual testing steps**

1. Check ci

## **Screenshots/Recordings**
The artifacts and local run show how sometimes we start with the
signature page 2, instead of the1, making the subsequent steps to fail.


![image](https://github.com/user-attachments/assets/08cab78b-8805-4b69-b2ff-eb703d68e0a6)


## **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/develop/.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/develop/.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.
… asset overview when flag is turned off` (#26654)

<!--
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**

This test is flaky at the step of importing the token and then clicking
the asset. Instead of going to the asset page, we remain at the home
page. This is likely due to a re-render, but after checking the test
steps, we can see how several steps are not needed and we can tweak
fixtures to achieve the desired state.
Once using fixtures, the flaky step is removed, so there's no need to
fix that, as that step will not occur now.


[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26654?quickstart=1)

## **Related issues**

Fixes: #26437

## **Manual testing steps**

1. Check ci

## **Screenshots/Recordings**
The test was flaky at the point after importing the token and then
clicking the asset (nothing happens). See pic:


![image](https://github.com/user-attachments/assets/ef274da7-690b-4673-af24-3a1e05a69d8d)





## **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/develop/.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/develop/.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.
<!--
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**

Adds an integration test to check the gas estimate failure alert

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26681?quickstart=1)

## **Related issues**

Fixes:
[#2972](MetaMask/MetaMask-planning#2972)

## **Manual testing steps**

1. Go to this page...
2.
3.

## **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**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.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.
#26725)

<!--
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**
Made changes to remove deprecated method for switching to dialog window,
as well as changing some click elements to
clickElementAndWaitForWindowToClose

<!--
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?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26725?quickstart=1)

## **Related issues**

Fixes: #26574 

## **Manual testing steps**

1. Run test individually multiple times and check that CI passes

## **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**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.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.
<!--
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**

Adds integration test for checking insufficient gas alert

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26711?quickstart=1)

## **Related issues**

Fixes:
[#2976](MetaMask/MetaMask-planning#2976)

## **Manual testing steps**

1. Go to this page...
2.
3.

## **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**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.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.
<!--
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**

Passing the state to route using history.push in order to get these
values in the final view.
They were not arriving before.

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **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**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.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.
<!--
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**

Fixes a mistake not caught during review where
`NotificationListItemSnap` uses a hardcoded example Snap ID for the icon
of all Snaps.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26739?quickstart=1)
<!--
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**
Updating the sentry app state to show a null value when the data is null
when the property is not masked.


<!--
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?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26522?quickstart=1)

## **Related issues**

Fixes:
#25959 

## **Manual testing steps**

Run `this.stateHooks.getSentryAppState()` in the console and check if
the unmasked null values are stored as null.


## **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**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.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.
This PR renames migration 126 to 121.1. The reason for this renaming is that commit 759b92e is being cherry-picked into version 12.1.1.

Between version 12.1.1 and the develop branch, there are missing migrations. To avoid skipping these migrations in subsequent releases, we need to rename migration 126 to 121.1.
)

<!--
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**
The goal of this PR is to make the AssetPicker component
experience-agnostic so that it can be reused within other experiences.

Since the AssetPicker was initially built for the Swap+Send experience,
most changes here are for moving send-specific logic out of the
component, including:
* move Send event tracking callbacks to send page
* add new AssetPicker props for setting custom modal header and visible
tabs
* define an experience-agnostic `asset` prop, which contains the minimal
required information about the selected asset
* use accurate type definitions for assets and props

<!--This also includes a style change to make spacing consistent between
the AssetPicker modal header and contents.-->

<!--
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?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26349?quickstart=1)

## **Related issues**

Fixes: https://consensyssoftware.atlassian.net/browse/METABRIDGE-890

## **Manual testing steps**

1. Swap+Send asset selection experience should not change

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before -> After**


![Screenshot 2024-08-20 at 6 50
34 PM](https://github.com/user-attachments/assets/1b907e17-c204-478f-8590-b286166893e1)
![Screenshot 2024-08-20 at 6 52
10 PM](https://github.com/user-attachments/assets/363e994b-9a7a-44b6-ad41-2effa3f79d2d)

![Screenshot 2024-08-20 at 6 50
44 PM](https://github.com/user-attachments/assets/4fb081f4-d404-4eca-9034-64facf95ee5c)
![Screenshot 2024-08-20 at 6 52
18 PM](https://github.com/user-attachments/assets/a5c8f693-867d-427b-aac8-bfa8f1343706)





<!-- [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/develop/.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/develop/.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.
## **Description**
Bump snaps packages to latest and handle breaking changes.

Summary of changes in the snaps deps:
- Add `Selector` component
- Add `Icon` component
- Add `color` prop to `Text` component
- `Button` children are now allowed to be `Image` and `Icon`

Closes MetaMask/snaps#2640
Closes MetaMask/MetaMask-planning#1615
Closes MetaMask/snaps#2658
Closes MetaMask/snaps#2639

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26675?quickstart=1)

---------

Co-authored-by: Hassan Malik <[email protected]>
Co-authored-by: Olaf Tomalka <[email protected]>
## **Description**

Migration 121.1 has been updated to include more state validation, so
that it does not throw an error in the event that state is corrupted in
some unexpected way. Unexpected corrupted state is now reported to
Sentry as well.


[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26773?quickstart=1)

## **Related issues**

Related: #26377

## **Manual testing steps**

The unit tests outline the scenarios that the added validation are meant
to cover. Probably not worth anyone's time to manually test those.

To test the migration in general though, here are the steps:

* Create a dev build from v12.1.0
* Install the dev build from the `dist/chrome` directory and proceed
through onboarding
* Run this command in the background console: ```
chrome.storage.local.get( null, (state) => {
state.data.AccountsController.internalAccounts.selectedAccount =
'unknown id';
chrome.storage.local.set(state, () => chrome.runtime.reload()); } ); ```
  * The extension should now be in a broken state
* Note that you can use this same script to corrupt state in other ways
to test other scenarios
* Disable the extension
* Switch to this branch and create a dev build
* Enable and reload the extension
* You should see in the console that migration 121.1 has run without
error
* You can run `chrome.storage.local.get(console.log)` to check that the
AccountsController state is now valid
  * The extension should no longer be broken

## **Screenshots/Recordings**

N/A

## **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/develop/.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/develop/.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.
## **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?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25839?quickstart=1)

This PR introduces three new updates to the MetaMask extension with the
new phishing controller version 12.0.0.

1. **Removal of PhishFort List References**: MetaMask no longer has a
contract with PhishFort and has also been introducing false positives to
the blocklist, all references to the PhishFort blocklist have been
removed as we no longer use their list in the new PhishingController
version.

2. **Support for Checking Malicious IPFS Domains**: The phishing
controller now includes support for detecting and blocking known
malicious IPFS domains.

3. **Management of a C2 Domain Blocklist**: The PhishingController now
supports a client-side blocklist specifically for Command & Control (C2)
domains. The extension now checks network requests against this
blocklist and redirects users the the phishing warning page.

## **Manual testing steps**

1. Go to a website known to be on the C2 domain blocklist. For now we
made our test website `https://develop.d3bkcslj57l47p.amplifyapp.com/`
have a malicious C2 Request that is on our blocklist.
2. Attempt to interact with the site.
3. Verify that on visiting the website you get redirected to the red
Metamask phishing page.
5. Repeat with a site that is not on the blocklist to confirm normal
operation.

<!-- [Insert screenshots/recordings showing network requests being
blocked with a warning message] -->

## **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/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability.
- [x] I’ve included tests for the new client-side detection feature.
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
where applicable.
- [x] I’ve applied the right labels on the PR.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g., pulled and built the branch,
run the app, tested the code changes).
- [ ] 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.

---------

Co-authored-by: Jacob Lebowitz <[email protected]>
Co-authored-by: MetaMask Bot <[email protected]>
## **Description**

Add `POL` token image, and maps it to Polygon Network config. See [blog
post](https://polygon.technology/blog/save-the-date-matic-pol-migration-coming-september-4th-everything-you-need-to-know)
for more context.

Adds chain collision check to not flag `POL` as scam token

Adds migration to overwrite `MATIC` ticker to `POL`

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26671?quickstart=1)

## **Related issues**

Fixes: https://consensyssoftware.atlassian.net/browse/MMASSETS-362

## **Manual testing steps**

1. When adding Polygon as a network from `FEATURED_RPCS`, ticker symbol
should be POL
2. When switching to Polygon Mainnet, ticker should be POL (not MATIC)
2. Can import `Polygon Network Token` on Ethereum Mainnet
3. Can import `Matic Network Token` on Ethereum Mainnet (backward
compatibility)

> Note, that both `MATIC` and `POL` erc20 tokens can already be imported
on Ethereum Mainnet, so this behavior should remain unchanged.

Additionally, when a user upgrades to this build, migration should run
and overwrite ticker from MATIC to POL:

1. Install a previous build (checkout `develop` and `yarn && yarn start`
should be fine here) -> Polygon Network should show `MATIC` as ticker.
You may need to remove and re-add Polygon Network, as migrations are
incremental.
2. checkout to this branch, `yarn && yarn start`, migration 128 should
run (Running migration 128... in console) -> Polygon Network should show
`POL` as ticker

## **Screenshots/Recordings**

Before:

<img width="358" alt="Screenshot 2024-08-27 at 2 39 15 PM"
src="https://github.com/user-attachments/assets/241b6d60-03a9-49fa-9b1e-61aeeb8b3f9f">
<img width="358" alt="Screenshot 2024-08-27 at 2 39 36 PM"
src="https://github.com/user-attachments/assets/fc3f933e-3b27-4dbe-943b-3453a9967687">


After:

<img width="356" alt="Screenshot 2024-08-27 at 1 47 40 PM"
src="https://github.com/user-attachments/assets/5e849387-3a16-471c-8587-33ea40ca7a81">
<img width="357" alt="Screenshot 2024-08-27 at 1 48 11 PM"
src="https://github.com/user-attachments/assets/fd96c3c8-560b-4e06-aa0a-07c3838d5e0b">


## **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/develop/.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/develop/.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.
…s` (#26792)

<!--
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**
The snap fails at the point of trying to find the scrolll element. The
problem is that the previous `Connect` action takes several seconds, and
the default timeout for the next action is not enough (1000ms) -- see
video.
In this PR we increase the timeout to 3000ms.
Note: having a bigger timeout is safe, as if the condition is met
earlier, it will jump to the next step, so we won't wait for the
complete 3000ms when it's not needed.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26792?quickstart=1)

## **Related issues**

Fixes: #26793

## **Manual testing steps**

1. Check ci

## **Screenshots/Recordings**
See how the Connect action takes some time, making the subsequent action
to fail, as the scroll element cannot be located within the timeout


https://github.com/user-attachments/assets/5c38cf2c-a15f-47a1-8279-6f200747f69e



## **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/develop/.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/develop/.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.
<!--
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.
-->

Cherry picks: #26867
into V12.5.0

## **Description**

Moves the portfolio button so that it's next to the token price amount.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26867?quickstart=1)

## **Related issues**

Fixes: MetaMask/MetaMask-planning#3201

## **Manual testing steps**

1. Go to the portfolio page
2. Check that the Portfolio button is present next to the price amount
of token
3. Click it to test it works fine

## **Screenshots/Recordings**

<img width="324" alt="Screenshot 2024-09-03 at 22 57 32"
src="https://github.com/user-attachments/assets/ab9a9818-d9d1-438e-9b66-1335c4e8c1c6">
<img width="331" alt="Screenshot 2024-09-03 at 22 58 54"
src="https://github.com/user-attachments/assets/f260799c-9e22-40dd-8fb8-1d26d3c011ed">



### **Before**

<img width="348" alt="Screenshot 2024-09-03 at 15 46 36"
src="https://github.com/user-attachments/assets/ca261c96-dd93-4699-8e51-d73cf5823cb2">


### **After**

<img width="331" alt="Screenshot 2024-09-03 at 22 58 54"
src="https://github.com/user-attachments/assets/f260799c-9e22-40dd-8fb8-1d26d3c011ed">


## **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/develop/.github/guidelines/CODING_GUIDELINES.md).
- [X] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] 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/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [X] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [X] 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.
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.