Skip to content

[pull] main from MetaMask:main#326

Merged
pull[bot] merged 17 commits into
Reality2byte:mainfrom
MetaMask:main
Nov 14, 2025
Merged

[pull] main from MetaMask:main#326
pull[bot] merged 17 commits into
Reality2byte:mainfrom
MetaMask:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Nov 14, 2025

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 : )

ffmcgee725 and others added 17 commits November 14, 2025 09:42
…#22692)

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

While connected to a dapp, if the user tries to switch networks from
dapp permissions, this has no effect. When switching networks, the icon
displayed is always the same. This happens because
`MultichainPermissionsSummary.tsx` uses `.hostname` while
`SelectedNetworkController` stores domains by origin (e.g.,
"https://example.com"). This mismatch prevents the lookup from finding
the per-dapp network.

This PR proposes a fix by using `.origin` instead.

<!--
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: fix issue where switching networks from dapp
permissions dapp icon has no effect

## **Related issues**

Fixes: #22423

## **Manual testing steps**

```gherkin
Feature: fix switching networks from dapp permissions dapp icon having no effect

  Scenario: user switches network
    Given it's done via top right icon of In App Browser

    When user switches network
    Then network icon should update accordingly
```

## **Screenshots/Recordings**

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

### **Before**

<!-- [screenshots/recordings] -->

### **After**


https://github.com/user-attachments/assets/472ff108-8e39-4a96-899a-93c9983bb260

<!-- [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]
> Replaces hostname with full URL origin for dapp host handling in
MultichainPermissionsSummary, updating navigation params and tests.
> 
> - **MultichainPermissionsSummary**:
>   - Compute `hostname` as `URL.origin` instead of `URL.hostname`.
> - Pass origin to `useNetworkInfo`, titles, and navigation params for
`CONNECTION_DETAILS` and `REVOKE_ALL_ACCOUNT_PERMISSIONS`
(`hostInfo.metadata.origin`).
> - **Tests**:
> - Update expectations to use `https://mock-dapp.example.com` for
`origin` in navigation assertions.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
ffbe2d1. 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 adds to the current implementation of MetaMask Connect toasts to
ensure that error messages are displayed in the Wallet when a user
rejects a request or when other errors occur during the request
lifecycle.

<!--
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/WAPI-825

## **Manual testing steps**

```gherkin
Feature: MM Connect toasts for non-success states

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


https://github.com/user-attachments/assets/e977ff69-aedd-4136-99a9-9e9e90f5e663

<!-- [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]
> Show an error toast when bridge responses contain JSON-RPC errors and
use the connection id for error notifications; add tests for
success/error paths.
> 
> - **SDKConnectV2**:
> - **Connection (`services/connection.ts`)**: On bridge `response`,
detect JSON-RPC errors (`error` in payload) and call
`hostApp.showConnectionError(this.info)`; otherwise call
`showReturnToApp(this.info)`. Always forward payload to client.
> - **Host App Adapter (`adapters/host-application-adapter.ts`)**:
Change `showConnectionError` signature to `conninfo?` and use
`conninfo.id` when provided (fallback to timestamp).
> - **Types (`types/host-application-adapter.ts`)**: Update interface
for `showConnectionError(conninfo?)` and clarify return-to-app success
doc.
> - **Tests**:
> - Add/update cases validating error vs success toasts and that error
notifications use the connection id; ensure responses without `id` don’t
trigger return-to-app.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
803a6b5. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…22541)

<!--
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 adds the total available fiat value when user switch to fiat
mode.

## **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: Change available value text to total fiat value when
fiat mode is enabled

## **Related issues**

Fixes: MetaMask/MetaMask-planning#6204

## **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="559" height="1062" alt="Screenshot 2025-11-12 at 14 58 39"
src="https://github.com/user-attachments/assets/12c0ef3c-f6e6-4f84-beed-11cf488a474a"
/>


### **After**

<img width="559" height="1062" alt="Screenshot 2025-11-12 at 14 58 27"
src="https://github.com/user-attachments/assets/151af694-88b9-44f5-9788-a347e28802ed"
/>


## **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]
> Display available balance in fiat when fiat mode is on, with memoized
computation and updated tests.
> 
> - **Send Amount UI**:
> - Compute `balanceDisplayValue` via `useMemo`; in fiat mode shows
`getFiatDisplayValue(balance) + " available"`, otherwise `${balance}
${balanceUnit} available`.
> - Replace inline balance text with `balanceDisplayValue` in
`amount.tsx`.
> - **Tests**:
> - Update `amount.test.tsx` to assert `$ 250.00 available` when fiat
mode is active.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
ea1e325. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…ction flow (#22604)

<!--
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 removes browser navigation when a user clicks the account group
in the initial connection flow.

<!--
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: Fixes navigation on account group click in initial
connection flow

## **Related issues**

Fixes: https://consensyssoftware.atlassian.net/browse/WAPI-829

## **Manual testing steps**

```gherkin
Feature: my feature name

  Scenario: user clicks account group
    Given it's on initial connection flow

    When user clicks account group
    Then selected account is changed, and no navigation to in app browser happens
```

## **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/fc58a302-7177-4d14-90c0-4b73a89eecf6

<!-- [screenshots/recordings] -->

### **After**


https://github.com/user-attachments/assets/d1a079aa-74bc-43e1-925d-cc4c964e1bec

<!-- [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]
> Selecting an account during the initial connection flow now only
updates the selected account group without showing a toast or
navigating; wiring and tests updated accordingly.
> 
> - **MultichainAccountsConnectedList
(`MultichainAccountsConnectedList.tsx`)**
>   - Add `isConnectionFlow` prop (default `false`).
> - Update `handleSelectAccount` to early-return in connection flow
(only sets `AccountTreeController.setSelectedAccountGroup`).
> - Maintain existing toast + `navigation.navigate(Routes.BROWSER.HOME)`
when not in connection flow; update hook deps.
> - **MultichainPermissionsSummary
(`MultichainPermissionsSummary.tsx`)**
> - Pass `isConnectionFlow={!isAlreadyConnected}` to
`MultichainAccountsConnectedList` and update memo deps.
> - **Tests (`MultichainAccountsConnectedList.test.tsx`)**
> - Add/adjust cases to verify: selection-only in connection flow; toast
+ navigation when not in connection flow.
> - Explicitly set `isConnectionFlow` in relevant tests and validate
correct group IDs and side effects.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
952b327. 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**

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

NonEVM transacion confirmations are getting stuck on recipient page
after cancelling the transaction confirmation.

The reason why this is not happening on EVM is the recipient route is
unmounting when it navigates to EVM confirmation but for nonEVM
recipient page is still there, not reset submit loading state persist
and it doesn't allow you to submit again.

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

## **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://github.com/user-attachments/assets/57ea1d2d-d43a-4f1a-89f6-ad45e0742813



### **After**



https://github.com/user-attachments/assets/cd09d89d-adff-4f8a-a48c-ced51374adca



## **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]
> Await submit and clear `isSubmittingTransaction` in recipient review
and list-selection flows to prevent stuck loading.
> 
> - **Send/Recipient (`recipient.tsx`)**:
> - Make `handleReview` and `onRecipientSelected(...)` async and `await`
`handleSubmitPress(...)`.
> - After awaiting, explicitly call `setIsSubmittingTransaction(false)`
to reset submit/loading state.
>   - Preserve prechecks and guards; no other logic changes.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
112ad13. 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**

<!--
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: Fix the issue when user removes fiat amount in send
flow via keypad but error state persist on fiat symbol

## **Related issues**

Fixes: #22338

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

- [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]
> `getNativeValueFn` now returns an empty string when the input amount
is empty, and tests are updated to reflect this behavior.
> 
> - **Logic**
> - Adjust `getNativeValueFn` in
`app/components/Views/confirmations/hooks/send/useCurrencyConversions.ts`
to return `''` when `amount === ''`.
> - **Tests**
> - Update `getNativeValueFn` test in
`app/components/Views/confirmations/hooks/send/useCurrencyConversions.test.ts`
to expect `''` for empty input and rename the test accordingly.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
13d2826. 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**
* UI experience enhancements in createpassword screen
* Open keyboard by default when screen opens and focus on textInput
automatically.
* Create Password button visibility
* Jira: https://consensyssoftware.atlassian.net/browse/SL-299
<!--
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:  UI experience enhancements in createpassword screen
CHANGELOG entry: Open keyboard by default when screen opens and focus on
textInput automatically.
CHANGELOG entry:  Create Password button visibility

## **Related issues**

Fixes:

## **Manual testing steps**

```gherkin
Feature: UI experience enhancements in createpassword screen

  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://github.com/user-attachments/assets/bcc47231-d545-433f-b78e-22c6c8364f51


<!-- [screenshots/recordings] -->

### **After**



https://github.com/user-attachments/assets/10bb584e-6262-41ca-ba55-864ad6186c1c




<!-- [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]
> Adds autofocus to the password field, disables and validates confirm
input with error messaging, replaces CTAs with component-library
Buttons, and tweaks layout/styling.
> 
> - **ChoosePassword UI/UX**:
> - **Password field**: enable `autoFocus`; focused border color updated
to primary (`#4459ff`).
> - **Confirm password**: now disabled until a password is entered; adds
mismatch error state/text; sets `returnKeyType="done"` and dismisses
keyboard on submit; adds accessibility label.
> - **Submit CTA**: replaced `TouchableOpacity` with `Button`; enabled
only when passwords match and meet `MIN_PASSWORD_LENGTH` (and checkbox
selected unless social login).
> - **Checkbox/learn more**: uses `Button` for link-style label; shows
marketing opt-in copy for social login; keeps "Learn more" link.
> - **Styling**: minor layout tweaks (remove some margins, adjust
containers); snapshots updated accordingly.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
00cba62. 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 focuses on adding the quick actions section within trending and
restructure quite a bit of the code for sections to be dynamically
created. Here is a summary of the components that get dynamically
created based on a centralized configuration:
- Quick Action Buttons - 🟢 
- Search Sections - 🟢  (needs hook to be added to useExploreSearch)
- Actual sections - 🟠 

<!--
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: trending quick actions section and dynamic
restructuring (1/2)

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

<img width="434" height="880" alt="image"
src="https://github.com/user-attachments/assets/a1027a9d-49db-45b7-a9c3-3ad01da22b1f"
/>

<!-- [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]
> Introduce centralized `sections.config` powering QuickActions, section
headers, and explore search; refactor related components and tests to
consume it.
> 
> - **Core configuration**
> - Add `config/sections.config.tsx` with `SECTIONS_CONFIG` and
`SECTIONS_ARRAY` to define titles, navigation, rendering, search, and
keys for `tokens`, `perps`, and `predictions`.
>   - Remove legacy `exploreSearchConfig.tsx` and migrate usages.
> - **Explore Search**
> - Update `ExploreSearchResults.tsx` to render sections/items/skeletons
via `SECTIONS_CONFIG` and iterate `SECTIONS_ARRAY`.
> - Refactor `useExploreSearch.ts` to generically process sections from
`SECTIONS_ARRAY`; add debounced data fetching and filtering; update
tests accordingly.
> - **UI components**
> - Add `components/QuickActions/QuickActions.tsx` to auto-generate
action buttons from `SECTIONS_ARRAY` and wire navigation.
> - Refactor `components/SectionHeader/SectionHeader.tsx` to accept
`sectionId` and trigger section-specific navigation; update tests.
> - Update `TrendingTokensSection`, `PredictionSection`, and
`PerpsSection` to use new `SectionHeader`.
>   - Insert `QuickActions` into `TrendingView` feed.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
2292ae1. 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**

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

- Fix issue where subsequent tests are failing due to `Error: Command
failed: "/opt/android-sdk/platform-tools/adb" -s emulator-17452 reverse
tcp:46721 tcp:46721 adb: error: cannot bind listener: Address a...
`

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

- [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
- [ ] 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]
> Cleanly removes stale Android adb reverse bindings for known test
ports before running fixtures to prevent port binding conflicts.
> 
> - **E2E Infrastructure**:
> - Add `cleanupAllAndroidPortForwarding()` in
`e2e/framework/fixtures/FixtureUtils.ts` to remove specific fallback adb
reverse bindings on Android (skips BrowserStack, targets current
device).
> - Invoke cleanup at the start of `withFixtures()` in
`e2e/framework/fixtures/FixtureHelper.ts`; import added.
> - Limits removals to known fallback ports (`fixture`, `command-queue`,
`mock`, `ganache`, `anvil`, `dapp-server` instances) to avoid
interfering with Detox.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
2b5837e. 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**
fix tracking for rehydration

Currently the screen support isComingFromOauthOnboarding and
isSeedlessPasswordOudated

add check for isComingFromOauthOnboarding before tracking to avoid miss
track for isSeedlessPasswordOudated


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

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

- [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]
> <sup>[Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) is
generating a summary for commit
4476b00. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
# Fix Predict Navigation to Cash Out and Single Market

## Overview

This PR fixes navigation issues in the Predict feature that prevented
users from properly navigating to the cash out flow and single market
details screens. This was caused because cash out modal and Single
market details modal are not on the ROOT navigator.

CHANGELOG entry: null

## Problem

Users were unable to navigate correctly to:
- **Cash out flow**: When attempting to sell positions
- **Single market details**: When viewing market information

**Root Cause**: The cash out modal and Single market details modal are
not on the ROOT navigator

## Changes

### Files Modified

1. **`app/components/UI/Predict/routes/index.tsx`**
- Swapped the order of `UNAVAILABLE` and `GTM_MODAL` screen declarations

2.
**`app/components/UI/Predict/components/PredictMarketSingle/PredictMarketSingle.tsx`**
   - Updated navigation calls to work with new modal stack order
   - Restores navigation to single market details screen

3.
**`app/components/UI/Predict/components/PredictPositionDetail/PredictPositionDetail.tsx`**
   - Updated navigation calls to work with new modal stack order
   - Restores navigation to cash out flow
## Testing

### Manual Testing - Cash Out Flow
1. Navigate to Predict feature
2. Open an active position
3. Tap "Cash out" button
4. **Expected**: Cash out screen should display correctly
5. **Previously**: Navigation was blocked or failed

### Manual Testing - Single Market
1. Navigate to Predict feature
2. Tap on any market to view details
3. **Expected**: Single market details screen should display
4. **Previously**: Navigation was blocked or failed

### Verification
- ✅ Cash out flow navigates correctly
- ✅ Single market details navigates correctly
- ✅ No regression in modal functionality (UNAVAILABLE, GTM)
- ✅ All other Predict navigation flows work as expected

## Impact

- **Medium Risk**: Fixes critical navigation blocking issues
- **No API Changes**: Internal navigation structure only
- **User Impact**: Restores cash out and market details functionality
- **No Breaking Changes**: Only fixes existing broken navigation


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Updates Predict navigation to push `MARKET_DETAILS` and `SELL_PREVIEW`
directly (not via `MODALS.ROOT`) and reorders modal stack; adjusts tests
accordingly.
> 
> - **Navigation**:
> - `PredictMarketSingle`: onPress navigates to
`Routes.PREDICT.MARKET_DETAILS` with params (no `MODALS.ROOT`).
> - `PredictPositionDetail`: cash out navigates to
`Routes.PREDICT.MODALS.SELL_PREVIEW` directly (no `MODALS.ROOT`).
> - **Routes**:
> - Reorders modal stack screens: `UNAVAILABLE` declared before
`GTM_MODAL`.
> - **Tests**:
> - Update expectations for navigation calls in
`PredictMarketSingle.test.tsx`, `PredictPositionDetail.test.tsx`, and
`PredictMarketDetails.test.tsx` to match direct navigation and reordered
modals.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
75a984d. 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**
The current ordering of chains in the Receiving Address and Account
Selector screens feels arbitrary, mixing EVM and non-EVM networks
without logical prioritization.
For users managing multiple chains, especially newcomers, this
inconsistency causes cognitive load and confusion when trying to locate
primary networks like Ethereum, Bitcoin, or Solana.

This PR changes the order of networks to: first set of networks being
[Ethereum, Bitcoin, Solana, Tron, Linea] and then the rest.
<!--
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: Updates the order of networks on networks list

## **Related issues**

Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-175

## **Manual testing steps**

```gherkin
Feature: Receiving address

  Scenario: user lists receiving address
    Given user onboarded

    When user clicks copy button at the top of the main page
    Then the networks list have Ethereum, Bitcoin, Solana, Tron, Linea at the beginning of the list
```

## **Screenshots/Recordings**

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

### **Before**
<img width="397" height="839" alt="Screenshot 2025-11-13 at 12 34 03"
src="https://github.com/user-attachments/assets/decdcd81-669f-473f-9d46-42fb02a93c19"
/>

<!-- [screenshots/recordings] -->

### **After**
<img width="399" height="845" alt="Screenshot 2025-11-13 at 12 49 13"
src="https://github.com/user-attachments/assets/2f9d9b52-95da-479b-99bd-9b70487b7e30"
/>

<!-- [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]
> Reorders multichain address sorting to ETH > BTC > SOL > TRX > Linea,
normalizes CAIP IDs, and updates selectors, tests, and snapshots to
match.
> 
> - **Multichain sorting utils (`MultichainAddressRowsList.utils.ts`)**:
> - Implement new priority: `Ethereum (0)`, `Bitcoin (1)`, `Solana (2)`,
`Tron (3)`, `Linea (4)`, then featured, others, testnets last.
> - Normalize EVM CAIP IDs by converting decimal to hex in
`extractHexChainId`.
>   - Add `BtcScope` and `TrxScope` handling; update sorting docstring.
> - **Selectors (`app/selectors/multichainAccounts/accounts.ts`)**:
> - Use `sortNetworkAddressItems` to order account-scope items
consistently across views.
> - **Tests & snapshots**:
> - Update unit tests to assert new ordering in utils, AddressSelector,
and selectors.
> - Refresh AddressSelector snapshot to reflect reordered networks and
labels.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
dae32b6. 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**

### What is the reason for the change?

Market orders in the Perps feature were experiencing a 15-25% failure
rate during volatile market conditions with the error: `"Order could not
immediately match against any resting orders. asset={asset_id}"`. This
IocCancel error occurs when HyperLiquid's IOC (Immediate or Cancel)
order mechanism cannot find matching orders at the specified limit
price.

**Root Cause**: Our implementation used a 1% slippage tolerance for all
order types. HyperLiquid's platform interface defaults (configurable
under "Adjust Max Slippage"):
- **8% for closing positions**
- **10% for TP/SL orders**
- **3% for TWAP orders** (protocol constraint)

The insufficient 1% slippage caused orders to fail when prices moved >1%
between order submission and execution, especially during:
- High volatility periods
- Network latency
- Thin order books
- Flash price movements

### What is the improvement/solution?

**1. Conservative Slippage Increase (Measured Rollout)**
- Replaced single `DEFAULT_SLIPPAGE_BPS: 100` (1%) with
order-type-specific constants:
- `DEFAULT_MARKET_SLIPPAGE_BPS: 300` (3%) - conservative starting point
- `DEFAULT_TPSL_SLIPPAGE_BPS: 1000` (10%) - matches HyperLiquid platform
default
  - `DEFAULT_LIMIT_SLIPPAGE_BPS: 100` (1%) - unchanged

**2. Fixed Critical Stop Loss Slippage Direction Bug**
- **Bug**: Stop loss slippage was inverted - limit prices were set in
the wrong direction
  - Long positions: SL limit was 10% ABOVE trigger (should be BELOW)
  - Short positions: SL limit was 10% BELOW trigger (should be ABOVE)
- **Impact**: Stop losses could fail to execute during adverse price
movements, exposing traders to larger losses
- **Fix**: Corrected slippage direction logic in `buildOrdersArray`
function
- Long positions now set SL limit 10% BELOW trigger (willing to accept
less when selling)
- Short positions now set SL limit 10% ABOVE trigger (willing to pay
more when buying)
- **Testing**: Added 10 comprehensive test cases to validate correct
slippage direction

**3. Implemented Smart Retry for $10 Minimum Order Errors**
- **Issue**: Orders exactly at $10 minimum were rejected due to price
feed differences between UI and HyperLiquid's orderbook
  - UI price feed: $0.003918 (WebSocket live prices)
- HyperLiquid validation: $0.003915 (actual orderbook price at
validation time)
  - Result: $10.00 order calculated as $9.995 by API → rejected
- **Solution**: Automatic retry mechanism with minimal adjustment
  - Attempt order with exact calculation ($10.00)
- If rejected with "$10 minimum" error, retry with 1.5% buffer ($10.15)
  - Limited to 1 retry to prevent infinite loops
- **Benefits**:
  - No upfront buffer - users see exactly what they request
  - Self-correcting - only adds buffer when necessary
  - Minimal impact - adds only $0.15 for edge case $10 orders

**4. Enhanced Error Handling**
- Added `IOC_CANCEL` error code detection
- Implemented user-friendly error message: "Insufficient liquidity to
execute order. Try using a limit order or retry in a moment."
- Pattern-based error matching for HyperLiquid's error responses

**Expected Impact**:
- **Significant reduction** in market order failures (measured rollout
with 3% vs previous 1%)
- Improved user experience during volatile conditions
- Clear actionable error messages when failures do occur
- Room to increase to 8% if 3% proves insufficient

**Files Modified** (12 total):
- `perpsConfig.ts` - Order-type-specific slippage constants
- `orderCalculations.ts` - Market order and TP/SL slippage logic +
**CRITICAL BUG FIX** (stop loss slippage direction)
- `orderCalculations.test.ts` - Added 10 comprehensive tests for stop
loss slippage direction
- `perpsErrorCodes.ts` - Added IOC_CANCEL error code
- `translatePerpsError.ts` - Error message mapping
- `HyperLiquidProvider.ts` - Error detection, slippage constant updates,
+ **$10 minimum retry mechanism**
- `en.json` - User-friendly error message
- `PerpsClosePositionView.tsx` - Slippage constant reference
- `PerpsOrderView.tsx` - Slippage constant reference
- `types/index.ts` - Updated comment for new default
- `PerpsClosePositionView.test.tsx` - Updated test expectations for new
slippage values

## **Changelog**

CHANGELOG entry: Improved perpetuals market order reliability by
aligning slippage tolerance with HyperLiquid platform standards,
reducing order failures by up to 90% during volatile market conditions

## **Related issues**

Fixes: https://consensyssoftware.atlassian.net/browse/TAT-1965
Fixes: https://consensyssoftware.atlassian.net/browse/TAT-2070

## **Manual testing steps**

```gherkin
Feature: Perpetuals Market Order Execution with Improved Slippage Tolerance

  Scenario: user places market order during stable market conditions
    Given user has connected wallet with sufficient USDC balance
    And user is on the Perps order view for BTC market
    And market conditions are stable (low volatility)

    When user enters USD amount of "100"
    And user selects "Market" order type
    And user selects "Buy" direction
    And user confirms the order

    Then order executes successfully without IOC errors
    And position is opened with expected size
    And no error messages are displayed

  Scenario: user places market order during volatile market conditions
    Given user has connected wallet with sufficient USDC balance
    And user is on the Perps order view for BTC market
    And market is experiencing high volatility (price moving >3% per minute)

    When user enters USD amount of "100"
    And user selects "Market" order type
    And user selects "Sell" direction
    And user confirms the order

    Then order executes successfully (vs. previous IOC failures)
    And position is opened with slippage up to 3%
    And no error messages are displayed

  Scenario: user places TP/SL orders with improved slippage
    Given user has an open long position of 0.01 BTC
    And user is on the Perps order view for BTC market
    And current BTC price is $50,000

    When user enters Take Profit price of "$55,000"
    And user enters Stop Loss price of "$45,000"
    And user confirms the order

    Then TP order is created with trigger at $55,000
    And SL order is created with trigger at $45,000 and 10% slippage tolerance
    And orders are visible in open orders list

  Scenario: user receives clear error message for insufficient liquidity
    Given user has connected wallet with sufficient USDC balance
    And user is on the Perps order view for an illiquid alt-coin market
    And order book has extremely thin liquidity

    When user enters USD amount of "10000"
    And user selects "Market" order type
    And user confirms the order

    Then order fails to execute due to insufficient liquidity
    And user sees error message: "Insufficient liquidity to execute order. Try using a limit order or retry in a moment."
    And funds are returned to user's account
    And no technical error codes are shown to user

  Scenario: user places limit order with unchanged slippage
    Given user has connected wallet with sufficient USDC balance
    And user is on the Perps order view for ETH market
    And current ETH price is $3,000

    When user enters USD amount of "100"
    And user selects "Limit" order type
    And user enters limit price of "$2,950"
    And user confirms the order

    Then limit order is created successfully
    And order uses 1% slippage tolerance (unchanged behavior)
    And order is visible in open orders list

  Scenario: user closes position during volatile conditions
    Given user has an open position in BTC market
    And market is experiencing high volatility

    When user navigates to position details
    And user taps "Close Position"
    And user confirms the closure

    Then position closes successfully with market order execution
    And 3% slippage tolerance prevents IOC failures
    And user's balance is updated with realized P&L

  Scenario: stop loss executes correctly for long position during rapid price drop
    Given user has an open long position of 0.1 BTC at entry price $100,000
    And user has set a stop loss at $95,000
    And BTC price rapidly drops from $96,000 to $85,000

    When stop loss is triggered at $95,000
    And price continues dropping rapidly

    Then stop loss order executes successfully (limit price at $85,500, 10% below trigger)
    And position is closed protecting user from further losses
    And user's realized loss is limited to approximately $14,500 (vs. potential $15,000+ without fix)

  Scenario: stop loss executes correctly for short position during rapid price spike
    Given user has an open short position of 0.1 BTC at entry price $90,000
    And user has set a stop loss at $95,000
    And BTC price rapidly spikes from $94,000 to $105,000

    When stop loss is triggered at $95,000
    And price continues spiking rapidly

    Then stop loss order executes successfully (limit price at $104,500, 10% above trigger)
    And position is closed protecting user from further losses
    And user's realized loss is limited to approximately $14,500 (vs. potential unlimited loss without fix)

  Scenario: minimum order value retry handles price feed differences
    Given user has connected wallet with $15 USDC balance
    And user is on the Perps order view for PUMP (low-price asset at $0.003918)
    And there is a slight difference between UI price feed and HyperLiquid orderbook price

    When user enters exactly "$10.00" USD amount
    And user selects "Market" order type with 3x leverage
    And user confirms the order

    Then order is attempted with exact calculation (2553 tokens = $10.00)
    And if HyperLiquid rejects with "$10 minimum" error, order automatically retries
    And retry adjusts to $10.15 (2557 tokens) to account for price difference
    And order executes successfully on retry
    And user is charged the adjusted amount (~$10.15)
    And no error message is shown to user (transparent retry)
```

## **Screenshots/Recordings**

### **Before**

N/A - This PR addresses backend logic for order execution reliability.
The UI remains unchanged; improvements are in order success rates and
error messaging.

### **After**

N/A - This PR addresses backend logic for order execution reliability.
The UI remains unchanged; improvements are in order success rates and
error messaging.

## **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]
> Refactors slippage (3% market, 10% TP/SL, 1% limit), fixes stop-loss
slippage direction, adds a one-time $10-min retry for orders, maps IOC
cancel errors, and updates UI/tests accordingly.
> 
> - **Config & Utils**:
> - Adjust slippage defaults in `constants/perpsConfig.ts`:
`DEFAULT_MARKET_SLIPPAGE_BPS=300`, `DEFAULT_TPSL_SLIPPAGE_BPS=1000`,
`DEFAULT_LIMIT_SLIPPAGE_BPS=100`.
> - Apply new slippage in `orderCalculations.ts` and fix SL limit-price
direction in `buildOrdersArray` (long: below trigger, short: above).
> - **Provider (HyperLiquid)**:
> - `placeOrder`: add one-time retry for "$10 minimum" rejections by
increasing `usdAmount` 1.5%; validate price required; use market
slippage for edits/closes.
> - Map "could not immediately match" to `PERPS_ERROR_CODES.IOC_CANCEL`;
propagate in error handling.
> - **UI**:
> - Use order-type slippage in `PerpsOrderView.tsx` and
`PerpsClosePositionView.tsx` (`maxSlippageBps` per type).
> - **Errors/i18n**:
> - Add `IOC_CANCEL` code in `perpsErrorCodes.ts`; translate to
user-facing messages in `translatePerpsError.ts`/`perpsErrorHandler.ts`;
add locale string in `en.json`.
> - **Types**:
> - Update `slippage` default doc in `controllers/types/index.ts` to 3%
market.
> - **Tests**:
> - Extend `HyperLiquidProvider.test.ts` with $10-min retry and
validations.
>   - Update close position test for 3% market slippage.
> - Add comprehensive SL direction tests in `orderCalculations.test.ts`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
5d21aea. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…22196)

<!--
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 need to update all instances where we were directly using
`createBuyNavigationDetails`, `createSellNavigationDetails` and
`createDepositNavigationDetails` to now use the useRampsNavigation hook.

We also need to create a `withRampsNavigation` HOC for pure components.

<!--
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: Use new Ramps routing

## **Related issues**

Fixes:
https://consensyssoftware.atlassian.net/browse/TRAM-2813?atlOrigin=eyJpIjoiMzY1YTIxZTQ0OTYyNGM5YmE2YTBlNDUwMzMxZDExNzgiLCJwIjoiaiJ9

## **Manual testing steps**

## **Screenshots/Recordings**

### **Unified Buy flag OFF**


https://github.com/user-attachments/assets/09cdb4db-9301-47f9-9aa5-6dc10a8cad40


### **Unified Buy flag ON**


https://github.com/user-attachments/assets/fecec070-0fcd-4133-b3c3-0dabb8364ca7


## **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]
> Replaces direct ramp route navigation with goToRamps across UI, adds
smart routing in useRampNavigation (incl. override), introduces
withRampNavigation HOC, and updates tests accordingly.
> 
> - **Ramps Navigation**:
> - Replace all `createBuy/Sell/DepositNavigationDetails` usages with
`goToRamps` from `useRampNavigation` (e.g., `AssetOverview`,
`FundActionMenu`, `BalanceEmptyState`, Card Add Funds, Orders, Modals,
Swaps, Alerts, Receive/Send/Approve views).
> - Add smart routing in `useRampNavigation` using `rampRoutingDecision`
with support for `overrideUnifiedBuyFlag`.
>   - Consolidate Aggregator routes via `createRampNavigationDetails`.
> - **HOC**:
> - Introduce `withRampNavigation` to inject `goToRamps`, `RampMode`,
and `AggregatorRampType` into class/pure components.
> - **Behavioral tweaks**:
>   - Pass ramp intent (`assetId`) where applicable.
> - Unified Buy/Deposit entry points updated (e.g., Settings/Unsupported
region/state modals, Orders list).
> - **Tests**:
> - Update unit tests to mock `useRampNavigation`/`goToRamps` and new
routing behavior throughout.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
f3fc295. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Pedro Pablo Aste Kompen <wachunei@gmail.com>
## **Description**

Removed dead notification code (e.g. using notifee badges), and improves
test suites

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

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 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]
> Simplifies the notifications list to a single data source, removes
badge updates on item click, and replaces snapshots with data-driven
tests using shared mocks and selectors.
> 
> - **Notifications UI**:
> - Simplifies `Notifications` props to only `allNotifications` and
`loading`; removes `walletNotifications`/`web3Notifications`.
> - Adds `TEST_IDS.loadingContainer` and uses test IDs for list states
and items.
> - Removes badge updates from `useNotificationOnClick`; now only marks
as read, tracks metrics, and conditionally navigates when a modal
exists.
> - **Notifications View**:
> - Consolidates filtering to return `allNotifications` only; updates
rendering accordingly.
>   - Keeps "Mark all as read" flow; still sets badge count to 0.
> - **Tests**:
> - Deletes snapshot file; replaces with state-driven, parameterized
tests for loading/empty/data and item rendering.
> - Mocks `useMarkNotificationAsRead`; verifies metrics and conditional
navigation.
> - Updates notification-state and node-guard tests to use shared
processed mocks (`mockNotificationsWithMetaData`) and controller mocks.
> - **Mocks/Utilities**:
> - Introduces `mockNotificationsWithMetaData` (with `hasModal`) and
switches imports to `notification-services` module mocks.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
fa70630. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…rs cp-7.59.0 (#22719)

## **Description**

It seems that having concurrent calls to `keyring_createAccount` cause
some synchronization issues between Snap's accounts and MetaMask
accounts. We're not sure of the real root cause yet for this, but
preventing concurrent calls seems to mitigate (or even completely
prevent) this kind of issues.

## **Changelog**

CHANGELOG entry: null

## **Related issues**

N/A

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

### **Before**

### **After**

## **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]
> Enforces single-concurrency createAccount and shared timeouts for
Snap-backed BTC/TRX providers and SOL via providerConfigs.
> 
> - **Multichain Account Service**
(`app/core/Engine/controllers/multichain-account-service/multichain-account-service-init.ts`):
> - **New Snap provider config**: `maxConcurrency: 1` plus
discovery/create timeouts.
>   - **Providers**:
> - Pass config to `new BtcAccountProvider(...)` and `new
TrxAccountProvider(...)` via `AccountProviderWrapper`.
>   - **Service config**:
> - Add `providerConfigs` with `[SOL_ACCOUNT_PROVIDER_NAME]` mapped to
the same Snap config.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
8be27eb. 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**

<!--
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]
> Harden grep and related-files handlers, add tool result preview/error
logging in analyzer, and update select-tags prompt guidance.
> 
> - **AI Tools**:
>   - **`ai-tools/handlers/grep-codebase.ts`**:
> - Replace shell escaping with `sanitizeGrepPattern`; validate/reject
dangerous input and escape shell metacharacters while allowing grep
regex.
> - Switch to `grep -Erni`; preserve and report using raw input in
messages; add explicit invalid-pattern handling.
>   - **`ai-tools/handlers/related-files.ts`**:
> - Add `escapeGrepRegex` and build safe `-E` grep pattern for importer
search; improve filename handling and quoting.
> - **Analyzer** (`analysis/analyzer.ts`):
> - Log tool result previews and flag errors; keep finalize flow and
conservative fallback.
> - **Prompt** (`modes/select-tags/prompt.ts`):
> - Import `CLAUDE_CONFIG`; adjust guidance to allow selecting all or no
tags and to respect `maxIterations`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
c060eba. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@pull pull Bot locked and limited conversation to collaborators Nov 14, 2025
@pull pull Bot added the ⤵️ pull label Nov 14, 2025
@pull pull Bot merged commit e700d86 into Reality2byte:main Nov 14, 2025
7 of 41 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.