Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: aggregated balance feature (#27097)
## **Description** - [x] Removes the primary currency from Settings => General - [x] Removes usage of useNativeCurrencyAsPrimaryCurrency - [x] Adds a new toggle in settings: "show native tokens as main balance" which affects only the main coin overview. - [x] When new setting is ON we will show to users the aggregated balance of their tokens in Fiat, else we show the balance in crypto for the native token. ## This final PR is the combination of the following PRs: 1- Removal of useNativeCurrencyAsPrimaryCurrency setting and adding the new setting: #26870 2- Aggregated balance logic: #27108 3- Aggregated balance UI: #27161 [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26870?quickstart=1) ## **Related issues** Fixes: https://github.com/orgs/MetaMask/projects/85/views/24?filterQuery=label%3A%22assets-aggregated%22 Figma: https://www.figma.com/design/aMYisczaJyEsYl1TYdcPUL/Portfolio-View?node-id=4098-126568&node-type=instance&focus-id=4186-130770&m=dev #27280 ## **Manual testing steps** 1. Switch to Ethereum mainnet and go to home page 2. You should see the popover telling you about the new feature. You should not be able to see the popover again once closed. 3. You should be able to see the aggregated balance in fiat of you native token and imported ERC20 tokens 4. Go to settings; notice that there is no primary currency setting and you should see the new setting. 5. Turn on "show native token as main balance" and go back to home page; you should see your balance in crypto for the native token. 6. Switch to any testnet, exp (Sepolia), notice that you wont be able to see aggregated balance unless you turn on the setting "Show conversion on test networks" in settings => Advanced ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** ### **After** https://github.com/user-attachments/assets/ddab8290-8f9f-4a27-8821-3f416ed35b53 ## **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.
- Loading branch information