[pull] main from MetaMask:main#528
Merged
Merged
Conversation
<!-- CURSOR_SUMMARY --> > [!NOTE] > **Low Risk** > Localization-only changes; risk is limited to UI copy regressions or missing translations (some strings remain in English). > > **Overview** > Refreshes `de.json`, `el.json`, and `es.json` with updated Crowdin translations across the UI (navigation, browser, token/market labels, warnings, card onboarding, etc.). > > Adds a handful of new localization entries (e.g., `transactions.unavailable`, perps `transactions.activity.*`, and some swap/confirmation modal labels like `pay_with_modal.title_receive`), and adjusts existing strings—though a few entries remain/are reverted to English (notably perps `deposited_amount`/`withdrew_amount`, `confirm.labels.receive_as`/`you_receive`/`transaction_fees`, and `confirm.available_balance`). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 67b6921. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: metamaskbot <metamaskbot@users.noreply.github.com>
<!-- 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** Moved getPriceChangeFieldKey from TrendingTokenRowItem.tsx to utils.ts to fix React Fast Refresh triggering a full app restart instead of a hot reload. Fast Refresh requires modules to exclusively export React components. TrendingTokenRowItem.tsx was exporting both the component and a utility function, which caused Metro to fall back to a full restart on every save. <!-- 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? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: prevent full app reload when editing Trending files ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-2684 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **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 Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.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-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Pure refactor of a small helper function and import paths; no changes to business logic or data handling beyond module boundaries. > > **Overview** > Prevents Metro/React Fast Refresh from doing full app restarts by removing the non-component export (`getPriceChangeFieldKey`) from `TrendingTokenRowItem.tsx` and relocating it to `TrendingTokenRowItem/utils.ts`. > > Updates all call sites (including `sortTrendingTokens`) to import `getPriceChangeFieldKey` from the new utils module; runtime behavior should be unchanged aside from improved hot reload behavior during development. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit aaa2c9b. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…ent-caching (#26003) <!-- 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 are moving away from using the portfolio API across mobile and extension. After reviewing the code, the only place where the portfolio API was still being used was in the Explore page to retrieve the list of sites which essentially come from Contentful. After speaking with @Prithpal-Sooriya, we have decided that we (Assets team) will be creating a proxy for Contentful hosted in our NFT api (which we will rename in the future to assets-api) to stop relying on the portfolio API. We wont call Contentful directly from the client just so that we can change providers in the future if we wanted to move away from Contentful. [Here](consensys-vertical-apps/va-mmcx-nft-api#210) is my PR which creates this new proxy hosted on the Assets backend. This has been deployed to production today. Here are the previous and new URLs (you should be able to see a 1:1 response from both URLs): - Previous: https://portfolio.api.cx.metamask.io/explore/sites - New: https://nft.api.cx.metamask.io/explore/sites Furthermore I have added caching to sites so that we lower the number of API calls ad improve the app performance <!-- 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? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: stop using portfolio API to fetch contentful sites ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-2535 & https://consensyssoftware.atlassian.net/browse/ASSETS-2693 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** https://portfolio.api.cx.metamask.io/explore/sites <!-- [screenshots/recordings] --> ### **After** https://nft.api.cx.metamask.io/explore/sites <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.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-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Medium risk because it changes the sites data source and request semantics (new base URL, default limit, and module-level caching), which could affect freshness and error behavior across the Explore/Trending surfaces. > > **Overview** > Moves the Explore “sites” fetch from the Portfolio API to the NFT API proxy (`https://nft.api.cx.metamask.io/explore/sites`) and changes the default request limit to `100`. > > Updates `useSitesData` to **cache fetched sites in-memory across mounts**, adds `clearSitesCache()` (used by tests), and makes `refetch` explicitly bypass the cache. Call sites are updated to the new hook signature (no `limit` param), and test/e2e mocking allowlists and URL matchers are adjusted to the new host. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 645cce3. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Juanmi <juanmigdr@users.noreply.github.com>
<!-- 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** Fixed the Token List Item V2 component to display prices for non-EVM tokens (e.g. Solana, Bitcoin). The V2 layout was only computing fiat prices using EVM market data, causing non-EVM tokens to show no price. This PR adds a lookup to MultichainAssetsRatesController for non-EVM assets so their fiat rate is used when available. Additionally, the [feature flag](https://app.launchdarkly.com/projects/metamask-client-config-api-mobile/flags/token-list-item-v2-abtest-versioned/targeting?env=production&env=flask-prod&env=qa-prod&env=test&selected-env=test) selector was updated to read from the new tokenListItemV2AbtestVersioned key (a version-gated flag shape), and the corresponding tests were updated to match. Minor UI fix: long token names now properly shrink with flexShrink instead of overflowing the row. <!-- 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? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: fixed token prices not displaying for non-EVM tokens in the V2 token list layout. ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-2683 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <img width="407" height="846" alt="image" src="https://github.com/user-attachments/assets/4fee4925-ad57-4d0d-bd3e-83b3f0c9025b" /> <!-- [screenshots/recordings] --> ### **After** <img width="414" height="846" alt="image" src="https://github.com/user-attachments/assets/1b69b1e0-ccf2-407a-9169-d73e99606f59" /> <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.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-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Touches token price computation/rendering and the feature-flag gate for the V2 layout; a mistake could hide prices or flip layout enablement for some app versions. > > **Overview** > Fixes `TokenListItemV2` fiat price display for non-EVM assets by first looking up rates from `selectMultichainAssetsRates` (CAIP asset IDs) and falling back to the existing EVM market-data + native-currency conversion path. > > Updates the token list V2 layout feature flag selector to use the new version-gated LaunchDarkly flag (`tokenListItemV2AbtestVersioned`) via `validatedVersionGatedFeatureFlag`, adds comprehensive selector tests for invalid/missing shapes and version failures, and adjusts `TokenListItemV2` styles so long token names shrink instead of overflowing. Test coverage is expanded to validate multichain/EVM price paths, percentage-change edge cases, and null-asset rendering. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 81740a7. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!-- 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** Part 1 of the hardware wallet connection & error management overhaul. This does not introduce user facing changes. Cursor summary mentions the PR being medium risk, but nothing is wired yet, so this is largely low risk. Final implementation will look like this ([Figma designs](https://www.figma.com/design/1F3yNWYLOVPFpTPeJugH20/SWAP?node-id=11110-19571&t=tPMZNNiwCgbDfegd-0)): <img width="1404" height="631" alt="image" src="https://github.com/user-attachments/assets/68850711-f53b-4060-8b47-6faceb67f82f" /> Reference feature branch: #25519 ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Fixes: ## **Manual testing steps** No manual testing steps ## **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 Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Adds new error normalization and parsing logic that will affect how hardware-wallet failures are classified and surfaced once wired into flows. While mostly additive and well-tested, the breadth of parsing heuristics (names/status codes/message patterns) increases the chance of misclassification or unexpected fallbacks. > > **Overview** > Introduces a new `app/core/HardwareWallet/errors` module that standardizes hardware-wallet failures into `HardwareWalletError` instances, combining SDK-provided `severity`/`category` with mobile-specific localized titles/messages, icons/colors, and a `RecoveryAction` hint. > > Adds a robust `parseErrorByType` pipeline that converts raw errors (SDK codes, `LedgerCommunicationErrors`, JS error names, transport status codes, and message pattern matches) into structured errors while preserving `cause` and extra metadata (e.g., `statusCode`, `hexCode`, `errorName`). Also adds helpers to derive UI presentation details from an `ErrorCode`, plus generic wallet-type helpers (name + address-to-type detection), and extends `LedgerCommunicationErrors` with `DeviceUnresponsive`. > > Pulls in `@metamask/hw-wallet-sdk@^0.4.0` and adds comprehensive unit tests for factories, mappings, helpers, and parsing behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 817c71a. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…t payment method cp-7.66.0 (#26149) 1. **What is the reason for the change?** The previous error "No funds available. Please deposit first" was unclear when the user had some funds but not enough, and did not mention the option to choose another payment method. 2. **What is the improvement/solution?** Copy is updated to: "Not enough funds available. Deposit funds or select a different payment method". This clarifies insufficient (not zero) funds and explicitly suggests depositing or changing payment method. Only the English locale and the tests that assert on this string were updated. ## **Changelog** CHANGELOG entry: Fixed the Perps error message when funds are insufficient to show clearer guidance (deposit or select a different payment method). ## **Related issues** Fixes: Jira issue https://consensyssoftware.atlassian.net/browse/TAT-2569 ## **Manual testing steps** ```gherkin Feature: Perps order – insufficient funds messaging Scenario: user sees updated error when they have no/insufficient funds for selected payment method Given the user is on the Perps order flow with a payment method that has no or insufficient funds When the amount/payment state would show the "no funds" warning Then the message shown is "Not enough funds available. Deposit funds or select a different payment method" ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <img width="1206" height="2622" alt="simulator_screenshot_397C9500-3F3C-4165-A136-686935C8A0F1" src="https://github.com/user-attachments/assets/6f280947-fd5d-4316-a90b-3b7728bce2ec" /> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Text-only i18n copy change with corresponding test updates; no business logic or data flow changes. > > **Overview** > Updates the English i18n string for `perps.deposit.no_funds_available` to a clearer insufficient-funds message that also suggests selecting a different payment method. > > Adjusts Perps UI tests (`PerpsOrderView` and `PerpsAmountDisplay`) to assert against the new copy. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 15f9708. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )