[pull] main from MetaMask:main#588
Merged
pull[bot] merged 12 commits intoReality2byte:mainfrom Mar 9, 2026
Merged
Conversation
<!-- 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? --> Migrated `Label` component (in Ramp team scope only). ## **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: https://consensyssoftware.atlassian.net/browse/DSYS-276 ## **Manual testing steps** ```gherkin Feature: label migration Scenario: user checks `Label` component presence in app Given the page opened with `Label` component When user checks UI component presence Then it looks identical to what we had in the app ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> |Before|After| |-------|-----| |<img width="1206" height="2622" alt="image" src="https://github.com/user-attachments/assets/13674cca-fd74-45ce-9e1f-727090307219" />|<img width="1206" height="2622" alt="image" src="https://github.com/user-attachments/assets/007fbc4c-06dd-497b-921c-87bb0224e2a0" />| ## **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] > **Low Risk** > Low risk UI-only change that swaps the `Label` component implementation in Ramp screens; main risk is minor styling/accessibility differences and snapshot/test churn. > > **Overview** > Migrates Ramp (Aggregator + Deposit) form/field labels from the legacy `component-library` `Label` to the `@metamask/design-system-react-native` `Label`, removing the old `variant` usage where applicable. > > Updates affected unit tests and snapshots to match the new rendered output (notably style shape changes and added `fontWeight`), with no functional flow changes beyond label rendering. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit cdac396. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…ted network in deeplink flow (#27202) <!-- 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** When a user opens the mUSD conversion education screen via deeplink, the component calls getPaymentTokenForSelectedNetwork() to determine which token to convert. If the user hasn't selected a specific network (e.g., using the "Popular networks" filter), this function can return null — causing the flow to skip conversion entirely and fall through to the buy or navigate-home paths, even though the user has convertible tokens. This fix adds a fallback: when getPaymentTokenForSelectedNetwork() returns null but conversionTokens is non-empty (guarded by the hasConvertibleTokens check), the component defaults to the first available conversion token. This ensures deeplink users are always routed to the conversion flow when they have eligible tokens. <!-- 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: n/a ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/MUSD-496 ## **Manual testing steps** ```gherkin Feature: mUSD Deeplink Conversion Fallback Background: Given the user has convertible stablecoin tokens in their wallet And the user goes through deeplink flow `xcrun simctl openurl booted "metamask://earn-musd"` Scenario: Deeplink converts using first available token when no network-specific token exists Given the user has not selected a specific network filter And getPaymentTokenForSelectedNetwork returns null When the user opens the mUSD conversion deeplink And the education screen is displayed And the user presses the primary "Get Started" button Then the conversion flow initiates with the first convertible token And the education screen is marked as seen Scenario: Deeplink converts using network-specific token when available Given the user has selected a specific network And getPaymentTokenForSelectedNetwork returns a valid token When the user opens the mUSD conversion deeplink And the education screen is displayed And the user presses the primary "Get Started" button Then the conversion flow initiates with the network-specific token And the education screen is marked as seen ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** https://consensys.slack.com/files/U06EZC2Q81X/F0AKSVBC51P/screenrecording_03-09-2026_10-22-25_1.mp4 <!-- [screenshots/recordings] --> ### **After** https://github.com/user-attachments/assets/4adb4590-20e1-4555-b652-201edff1d8c1 <!-- [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** - [ ] 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** > Changes deeplink routing to auto-select a fallback conversion token and alters conversion-token ordering, which can affect which asset is preselected/converted for users in edge cases. Scope is limited to mUSD conversion entry flow and covered by added tests, but impacts user-facing navigation/selection logic. > > **Overview** > **mUSD deeplink conversion now falls back to a wallet token instead of skipping conversion.** When `getPaymentTokenForSelectedNetwork()` returns `null`, the education deeplink flow uses the first `conversionTokens` entry (validated/normalized via `safeFormatChainIdToHex` + `toChecksumAddress`) to proceed with `convert` rather than falling through to *buy* or *home*. > > **Conversion token ordering is updated.** `useMusdConversionTokens` now sorts eligible conversion tokens by descending fiat balance so the fallback token is deterministically the highest-value option. > > **Tests updated/added** to cover the fallback conversion behavior and the buy/home fall-through when the fallback token is invalid (e.g., missing `chainId`), plus token sorting by fiat balance. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5a5c5da. 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** This PR updates the pressed state of the tab bar icons so that they appear filled when they are pressed. It matches [the design specs](https://www.figma.com/design/z0panHXrMSMUSof2SaPkd4/Home-2026?node-id=3000-6211&t=cjpZAVFXH6nZaAfc-4). ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: fix: update icons when tab bar is pressed ## **Related issues** Fixes: NA ## **Manual testing steps** ```gherkin Feature: Tab bar selected state icons Scenario: user sees filled icon for selected tab and outline for others Given the user is on the app home screen with the bottom tab bar visible When the user selects the Explore tab Then the Explore tab shows the filled search icon And the other tabs (Home, Activity, Rewards) show their outline icons When the user selects the Rewards tab Then the Rewards tab shows the filled MetaMask fox icon And the other tabs show their outline icons ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** https://github.com/user-attachments/assets/c1f41d0b-0a78-462e-94f1-f9bfa96b3d3f ### **After** https://github.com/user-attachments/assets/339e8882-5a45-4246-ab58-ff17fcdf7235 ## **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** > Low risk UI-only change that switches tab icons based on selection state and adds two new SVG assets; main risk is missing/incorrect icon mappings for some tabs. > > **Overview** > Updates the bottom `TabBar` to render *filled* icon variants for the active tab (e.g., `HomeFilled`, `ClockFilled`, newly added `SearchFilled` and `MetamaskFoxFilled`) while keeping outline icons for inactive tabs. > > Adds new icon assets/types for `metamask-fox-filled` and `search-filled`, and updates the TabBar snapshot to reflect the new selected-state icon rendering. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5945f98. 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**
handle aggregated balance new home page
<!--
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: handle aggregated balance new home page
## **Related issues**
Fixes:
## **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] -->
https://github.com/user-attachments/assets/8f6fb1bb-ff9b-4ac0-9a2f-48088d1b1383
https://github.com/user-attachments/assets/2479493d-dca4-4e97-8a80-c117ce8de7f6
## **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**
> Changes core balance selectors from state-based selectors to selector
factories with optional chain filters, and wires these into
homepage/network UI; mistakes could impact displayed balances or trigger
render loops. Also alters scam-warning modal state/navigation and token
fiat-display rules, which may affect user flows around network editing
and pricing visibility.
>
> **Overview**
> **Aggregated balance selection is now chain-list aware.** Balance
selectors in `selectors/assets/balances` were refactored into selector
factories that accept optional `popularChainIds`, building a networks
map from either popular networks or enabled networks; call sites/tests
were updated accordingly.
>
> **Homepage + network selector UI now uses these selectors.**
`AccountGroupBalance` memoizes selector instances (and stabilizes
popular chain IDs) to avoid infinite render loops, and only shows the
empty-state when *both* homepage redesign and sections v1 flags are
enabled. A new `AccountGroupBalancePerChain` component renders the
selected account group’s balance for a single `caipChainId` and is shown
as a right accessory in `NetworkMultiSelector` and
`CustomNetworkSelector` (with testnet fiat display gated by
`selectShowFiatInTestnets`).
>
> **Scam warning flow is chain-specific and token fiat display is
tightened.** `ScamWarningModal` now takes a `chainId | null`, looks up
network config via `selectEvmNetworkConfigurationsByChainId`, and
navigates to edit the network using the default RPC endpoint
`networkClientId`. Token list items propagate the chain id into the scam
modal, show the warning icon for native assets when the symbol check
fails, and hide fiat pricing on testnets (unless enabled) and when the
scam warning is shown; `useIsOriginalNativeTokenSymbol` now treats
non-EVM/unknown chains as safe (no warning).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
e9fd42a. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…to navigate back (#27026) <!-- 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 bug where rapidly tapping UI elements that open a BottomSheet (e.g. PayWithRow → PayWithModal) could cause an extra `navigation.goBack()` to fire after the BottomSheet's screen was already popped. For the mUSD conversion flow, this caused the `onReject` to not be called leaving stale pending approvals and incorrectly disabling the Quick Convert view. Adds a `navigation.isFocused()` guard before `goBack()` in `BottomSheet.onCloseCB` so that stale close callbacks from Reanimated animations become no-ops when the screen is no longer active. ## Changes - `BottomSheet.tsx`: Guard `navigation.goBack()` with `navigation.isFocused()` check in `onCloseCB` <!-- 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 BottomSheet dismissing the wrong screen when rapidly opened and closed, which could leave mUSD conversion confirmation flows in a blocked state with unrejected pending approvals ## **Related issues** Fixes: [MUSD-400: Quick convert buttons disabled after switching payment tokens quickly on custom convert screen](https://consensyssoftware.atlassian.net/browse/MUSD-400) ## **Manual testing steps** ```gherkin Feature: mUSD conversion BottomSheet dismiss does not break Quick Convert view Scenario: user spam-taps Pay With on the mUSD custom conversion screen Given user is on the mUSD Quick Convert view with convertible stablecoin balances And user taps the Edit (pencil) icon on a token row to open the custom conversion screen When user rapidly taps the Pay With row and continues tapping as the Pay With modal opens Then the Pay With modal closes and the user remains on the custom conversion screen And the user is not navigated back to the Quick Convert view And the Quick Convert view does not show a loading spinner or disabled action buttons ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> https://github.com/user-attachments/assets/fcf53105-0223-43f9-9e18-975dac82ac2e ### **After** https://github.com/user-attachments/assets/7a55d8de-38fb-4507-8210-d39b4f16dfb2 <!-- [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** - [ ] 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 shared `BottomSheet` close/back-handling behavior, so regressions could affect navigation dismissal across many screens, though the change is a narrow `isFocused()` guard. > > **Overview** > Prevents rapid open/close interactions from popping the wrong screen by guarding `BottomSheet`'s `onClose` and Android hardware back handling with `navigation.isFocused()` before attempting dismissal. > > Updates a broad set of Jest navigation mocks/snapshots to include `isFocused()` so tests align with the new `BottomSheet` navigation dependency. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 583f2a0. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
… header cp-7.69.0 (#27106) ## **Description** The perps deposit flow was using `navigateToConfirmation({ stack: Routes.PERPS.ROOT })`, which did not correctly route users to the redesigned confirmations screen after initiating a deposit. Users could end up on the wrong confirmation stack or without the perps-specific header. This change updates the flow so that when the user taps the Perps balance token to deposit: 1. The current approval/confirmation is dismissed via `handleReject()` from `useApprovalRequest`. 2. `depositWithConfirmation()` runs to start the deposit flow. 3. On success, navigation goes to `REDESIGNED_CONFIRMATIONS` with `showPerpsHeader: true` instead of the previous PERPS.ROOT stack. Dependencies on `useConfirmNavigation` are removed in favor of `useNavigation` and `useApprovalRequest` so the deposit action and post-deposit navigation are explicit and aligned with the redesigned confirmations screen. ## **Changelog** CHANGELOG entry: Fixed perps deposit flow so it routes to the redesigned confirmations screen with the perps header after a successful deposit. ## **Related issues** Fixes: https://consensys.slack.com/archives/C092T3GPHQD/p1772719051867319 ## **Manual testing steps** ```gherkin Feature: Perps deposit from pay-with / token list Scenario: user initiates perps deposit from token selector Given user is on a confirmation screen with "Perps balance" in the token list (e.g. perps deposit and order) When user taps "Perps balance" to deposit Then the current confirmation is dismissed, deposit flow runs, and on success the user is taken to the redesigned confirmations screen with the perps header visible ``` ## **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_1025DB15-7197-4622-964F-F1F05143DFC8" src="https://github.com/user-attachments/assets/5e3dde3e-e91b-4966-945e-8a1b910933e0" /> <!-- [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** - [ ] 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** > Changes the perps deposit tap-handler to dismiss the current approval and navigate to a different confirmation route, so regressions could strand users on the wrong screen or break the deposit flow sequencing. > > **Overview** > Fixes the **Perps “Add funds”** action from the synthetic “Perps balance” token so it no longer uses `useConfirmNavigation`/`Routes.PERPS.ROOT`. > > The handler now calls `useApprovalRequest().onReject()` to dismiss the current approval, runs `depositWithConfirmation()`, and then navigates via React Navigation to `Routes.FULL_SCREEN_CONFIRMATIONS.REDESIGNED_CONFIRMATIONS` with `showPerpsHeader: true`. Tests were updated to mock the new hooks (`useNavigation`, `useApprovalRequest`) and assert the new call order/route using `waitFor`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 48571b0. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…le-wallet-protocol-wallet-client` to latest versions and absorb breaking changes (#27215) <!-- 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. --> ## Summary - Update the mobile SDKConnect integration to match the latest `mobile-wallet-protocol` APIs. - Switch connection setup to `SessionStore.create(...)` and add peer public key validation support in the mobile `KeyManager`. - Align the SDKConnect unit tests with the new async session store factory and key validation behavior. ## Test plan - [ ] Run `yarn jest app/core/SDKConnectV2/services/connection.test.ts app/core/SDKConnectV2/services/key-manager.test.ts --runInBand` - [ ] Verify SDKConnect deeplink connection flow still initializes and resumes sessions correctly - [ ] Smoke test trusted and untrusted connection flows if needed <!-- 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: null MetaMask Connect not released to public officially yet ## **Related issues** Fixes: ## **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] > **Medium Risk** > Medium risk due to a breaking dependency upgrade in the Mobile Wallet Protocol stack and changes to connection/session-store initialization and peer key validation that could affect SDKConnect session persistence or handshake failures. > > **Overview** > Updates SDKConnectV2 to the latest `@metamask/mobile-wallet-protocol-core`/`wallet-client` versions and absorbs API breaking changes. > > `Connection.create` now initializes the session store via async `SessionStore.create(...)` (instead of `new SessionStore(...)`), with unit tests updated to mock/expect the factory call. > > Adds `KeyManager.validatePeerKey` (using `eciesjs` `PublicKey` parsing) plus new tests covering acceptance/rejection of peer public keys. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 9d63dbd. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…cp-7.69.0 (#27218) ## **Description** When FAK (Fill-And-Kill) orders are enabled, the PredictFeeBreakdownSheet now displays a footnote below the Total row explaining that prices assume a fully filled order and actual amounts may vary if the order is only partially filled. Additionally, the component was refactored to use `@metamask/design-system-react-native` primitives (`Text`, `TextColor`, `TextVariant`, `FontWeight`) instead of the local `component-library` Text, aligning with the project's UI development guidelines. **Changes:** - Created `selectPredictFakOrdersEnabledFlag` Redux selector for the `predictFakOrders` version-gated remote feature flag - Added `fakOrdersEnabled` prop to `PredictFeeBreakdownSheet` — conditionally renders a partial fill note - Wired `PredictBuyPreview` to read the selector and pass it to the sheet - Migrated `Text`, `TextColor`, `TextVariant` imports from `component-library` to `@metamask/design-system-react-native` - Replaced `TextVariant.BodyMDBold` with `TextVariant.BodyMd` + `fontWeight={FontWeight.Bold}` ## **Changelog** CHANGELOG entry: Added a note in prediction price details explaining that prices assume a fully filled order when FAK orders are enabled ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/PRED-722 ## **Manual testing steps** ```gherkin Feature: FAK partial fill note in price details Scenario: user sees partial fill note when FAK orders flag is enabled Given the predictFakOrders remote feature flag is enabled And the user is on the buy prediction preview screen When user taps on the price details row to open the fee breakdown sheet Then a note is displayed below the Total row reading "Prices shown assume your order is fully filled. Actual amounts may vary if the order is only partially filled." Scenario: user does not see partial fill note when FAK flag is disabled Given the predictFakOrders remote feature flag is disabled And the user is on the buy prediction preview screen When user taps on the price details row to open the fee breakdown sheet Then no partial fill note is displayed below the Total row ``` ## **Screenshots/Recordings** ### **Before** <!-- Price details sheet shows Total as the last row --> <img width="420" height="865" alt="Screenshot 2026-03-09 at 1 19 11 PM" src="https://github.com/user-attachments/assets/a0c1110c-1840-401f-8807-bebe018253cd" /> ### **After** <!-- Price details sheet shows a footnote below Total when FAK is enabled --> <img width="421" height="854" alt="Screenshot 2026-03-09 at 1 20 36 PM" src="https://github.com/user-attachments/assets/056237e0-37ea-4b8e-8501-5b82befafd27" /> ## **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** > Low risk UI/feature-flag change that adds conditional copy and a new selector; main risk is incorrect flag evaluation or unintended note display. > > **Overview** > **Predict price details now conditionally shows a FAK partial-fill disclaimer** when the remote `predictFakOrders` version-gated flag is enabled. > > This introduces `selectPredictFakOrdersEnabledFlag`, wires it into `PredictBuyPreview` to pass `fakOrdersEnabled` to `PredictFeeBreakdownSheet`, and updates the sheet to render the new footnote (plus a small refactor to `@metamask/design-system-react-native` `Text` primitives via a reusable `FeeRow`). Tests and `en.json` strings are updated accordingly. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 9bf73d0. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
) ## Summary - Migrate `usePredictOrderPreview` hook from manual state management to React Query (`useQuery`) - Extract query key factory and query options into `queries/orderPreview.ts` - Simplify debounced order preview calculation by leveraging React Query for caching and automatic refetch ## Test plan - [x] Unit tests updated and passing - [ ] Verify order preview updates correctly when changing amount/side - [ ] Verify debounce still works to avoid rapid recalculations <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Behavior shifts from manual async/timer management to React Query caching and polling, which can subtly change loading states, refresh timing, and stale-data handling in UI consumers. Moderate risk due to being user-facing trading/preview flows, though logic is mostly a refactor with tests updated. > > **Overview** > Refactors `usePredictOrderPreview` from manual state/operation tracking and custom timers to a debounced `useQuery` flow, using `query.isFetching` for `isCalculating`, deriving `isLoading` from `preview === null && !error`, and using `refetchInterval` for optional auto-refresh. > > Introduces `predictQueries.orderPreview` (new `queries/orderPreview.ts`) with stable query keys, `keepPreviousData` placeholder behavior, and an `Engine.context.PredictController.previewOrder` query function; error handling now parses localized messages and logs via `Logger.error` when the query fails. > > Updates the hook’s unit tests to run under a `QueryClientProvider`, mock `Engine`/`Logger`, and align expectations with the new debounce, loading, error, and auto-refresh behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6f60a9e. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Luis Taniça <matallui@gmail.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** Uploading source maps for non debug builds so members can test performance with react native release profiler was missing when building with gh actions. https://github.com/MetaMask/metamask-mobile/actions/runs/22746710404 <!-- 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: ## **Related issues** Fixes: ## **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] > **Medium Risk** > Modifies the GitHub Actions build workflow and artifact renaming script; incorrect sourcemap paths or conditions could cause missing artifacts or noisy CI warnings in release builds. > > **Overview** > Adds **sourcemap artifact publishing** to the GitHub Actions `build` workflow: iOS device builds now upload `ios-sourcemaps-<build-name>`, and Android non-Debug builds upload `android-sourcemaps-<build-name>`. > > Updates `scripts/rename-artifacts.js` to expose `ios_sourcemap_path` and `android_sourcemap_dir` as step outputs used by the workflow, and refreshes profiling docs to point to sourcemaps from either Bitrise or GitHub Actions artifacts. > > Bumps build numbers from `3821` to `3911` in `bitrise.yml` and the iOS Xcode project. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 30d4239. 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>
… state (#27133) <!-- 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** ## Summary - Add `isClaimPending` state to `usePredictClaim` to prevent concurrent claim executions from repeated taps. - Early-return from `claim()` when a claim is already in flight, and always reset pending state in a `finally` block. - Keep retry behavior intact while making retry invocation explicit with `void claim()`. ## Tests - Extend `usePredictClaim` tests to validate pending-state behavior: - initializes with `isClaimPending = false` - sets pending while claim starts - ignores a second `claim()` call while pending - resets pending after success - resets pending after failure - Wrap async claim actions with `act(...)` to ensure stable React state assertions in hook tests. ## Why Repeated taps on Predict claim could trigger multiple confirmation flows. This change enforces a single in-flight claim request and avoids duplicate claim confirmations. <!-- 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: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/PRED-739 ## **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] > **Medium Risk** > Touches claim/transaction flow by adding per-account pending-claim tracking in `PredictController` and wiring it through UI/hook logic; bugs here could block or duplicate user claim attempts despite added tests. > > **Overview** > **Prevents duplicate claim submissions** by adding non-persisted `pendingClaims` state to `PredictController`, short-circuiting `claimWithConfirmation` when a claim is already in flight, and clearing pending state on errors and on terminal transaction status updates. > > **Propagates claim-pending state to the UI** via a new `selectPredictPendingClaimByAddress` selector and `usePredictClaim.isClaimPending`, showing an “in progress” toast on repeat taps and rendering claim buttons in a disabled loading state (spinner + new `predict.claiming_text`), including privacy-mode hiding of amounts. > > Refactors market/positions claim CTAs to reuse `PredictClaimButton` and threads `isClaimPending` through `PredictActionButtons`, game details, sport card footer, and market details actions, with updated/added tests covering the new behavior and edge cases. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 5678560. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** Fix the Predict fee calculation to match the backend order relay calculation. Previously, individual fee components (`metamaskFee`, `providerFee`) were rounded to 3 decimal places before summing, and `previewOrder` was passing `size` instead of `makerAmount` as the fee basis. This caused rounding discrepancies that led to order failures on certain amounts (e.g., $6.12 yielding a $0.244 fee instead of $0.2448). **Changes:** - Remove per-component rounding of `metamaskFee` and `providerFee` — keep full precision - Round only `totalFee` to 6 decimal places (matching backend precision) - Use `makerAmount` instead of `size` as the `userBetAmount` in `previewOrder`, aligning with the backend order relay ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/PRED-740 ## **Manual testing steps** ```gherkin Feature: Predict fee calculation accuracy Scenario: user places a bet with an amount that previously caused rounding errors Given the user is on the Predict market detail screen When user enters a bet amount of $6.12 Then the displayed fee should be $0.2448 (not $0.244) And the order should succeed without a fee mismatch error ``` ## **Screenshots/Recordings** <!-- Not applicable — logic-only change with no UI modifications --> ### **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 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 - [ ] 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] > **Medium Risk** > Updates fee math used for order previews/relaying; incorrect rounding or amount basis could still cause fee mismatches and failed orders, but the change is localized to fee computation. > > **Overview** > Adjusts Predict’s Polymarket fee calculation to **stop rounding `metamaskFee`/`providerFee` individually** and instead **round only `totalFee` to 6 decimals**, matching backend precision. > > Updates `previewOrder` (BUY) to compute fees from the rounded `makerAmount` rather than the raw input `size`, reducing client/backend fee discrepancies that can cause order submission failures. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 06004e3. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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 : )