Skip to content

[pull] main from MetaMask:main#313

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

[pull] main from MetaMask:main#313
pull[bot] merged 9 commits into
Reality2byte:mainfrom
MetaMask:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Nov 11, 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 : )

tommasini and others added 9 commits November 11, 2025 00:36
…22436)

<!--
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**
#22323
<!--
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]
> Uses `measureAsyncOnUI` for Android press interactions and wires new
Fabric async measure APIs across JS, native (iOS/Android), and tests;
updates RN to a Yarn patch.
> 
> - **Press interactions**:
> - `Libraries/Pressability/Pressability.js`: Use `measureAsyncOnUI`
only on Android; keep `measure` on other platforms.
> - **Fabric measurement APIs**:
> - JS/TS interfaces: Add `measureAsyncOnUI` to `FabricUIManager`
(`Libraries/ReactNative/FabricUIManager.js`) and expose via
`ReactFabricHostComponent`.
> - JS bridge: Implement `UIManagerBinding.measureAsyncOnUI` to call
back into JS.
> - Scheduler/Delegates: Add async measure pathways (`Scheduler`,
`SchedulerDelegate`, `UIManagerDelegate`).
> - **iOS (Fabric)**:
> - Add `RCTMountingManager.measure` and route via `RCTSurfacePresenter`
to perform measurement on main thread.
> - **Android (Fabric)**:
> - Add `FabricUIManager.measureAsync`, `MountingManager.measure` (with
bounding box computation), and JNI plumbing (`Binding`,
`FabricMountingManager`) to call into Java and invoke callbacks.
> - **Tests and RN DOM shim**:
>   - `jest/setup.js`: Mock `measureAsyncOnUI`.
> - `ReactNativeElement`: Add `measureAsyncOnUI` delegating to
`measure`.
> - **Build config**:
> - `package.json`/`yarn.lock`: Point `react-native@0.76.9` to local
Yarn patch.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
3df2f0f. 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>
## **Description**

This PR updates the Ramps Smart Routing hook to use the actual API
endpoints now that they are available in production and staging
environments.

**What is the reason for the change?**
The smart routing feature was previously using a placeholder endpoint
(`/endpoint-coming-soon`) while waiting for the backend API to be
deployed. The API endpoints are now available and ready to be
integrated.

**What is the improvement/solution?**
- Integrated production and staging API endpoints for ramp eligibility
checks
- Production URL:
`https://on-ramp-content.api.cx.metamask.io/regions/countries/{region-code}`
- Staging URL:
`https://on-ramp-content.uat-api.cx.metamask.io/regions/countries/{region-code}`
- Environment detection uses `process.env.METAMASK_ENVIRONMENT` directly
to determine which endpoint to use
- Production environments: `production`, `beta`, `rc`
- Staging environments: `dev`, `exp`, `test`, `e2e`, and all others
default to staging

## **Changelog**

CHANGELOG entry: null

## **Related issues**

Fixes: https://consensyssoftware.atlassian.net/browse/TRAM-2807

## **Manual testing steps**

```gherkin
Feature: Ramp Smart Routing API Integration

  Scenario: User in supported region sees appropriate ramp option
    Given the app is running in a production environment
    And the user's detected geolocation is "us-ca"
    When the ramp smart routing hook initializes
    Then the app fetches eligibility from "https://on-ramp-content.api.cx.metamask.io/regions/countries/us-ca"
    And the routing decision is set based on the API response

  Scenario: User in supported region in staging environment
    Given the app is running in a dev/staging environment
    And the user's detected geolocation is "us-ca"
    When the ramp smart routing hook initializes
    Then the app fetches eligibility from "https://on-ramp-content.uat-api.cx.metamask.io/regions/countries/us-ca"
    And the routing decision is set based on the API response

  Scenario: User in unsupported region
    Given the app is running in any environment
    And the user's detected geolocation returns global: false from API
    When the ramp smart routing hook initializes
    Then the routing decision is set to UNSUPPORTED
    And the user cannot access ramp features

  Scenario: API fetch fails
    Given the app is running in any environment
    And the API request fails or times out
    When the ramp smart routing hook initializes
    Then the routing decision is set to ERROR
    And appropriate error logging occurs
```

## **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
- [ ] 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]
> Hook now fetches ramp eligibility from environment-specific endpoints
with error handling; tests expanded and Babel config updated to preserve
env vars.
> 
> - **Ramps Smart Routing
(`app/components/UI/Ramp/hooks/useRampsSmartRouting.ts`)**
> - Use real eligibility API with env-based base URLs via
`process.env.METAMASK_ENVIRONMENT` (`PRODUCTION` vs `STAGING`).
> - Build fetch URL `'/regions/countries/{region}'`; validate
`response.ok` and throw on errors; log and route to `ERROR` on failure.
> - **Tests (`useRampsSmartRouting.test.ts`)**
> - Add cases verifying production/staging URLs across envs
(`production`, `beta`, `rc`, `dev`, `exp`, `test`, `e2e`).
> - Add error-path tests for failed fetch and non-OK responses (404,
500); persist/restore env; update geolocation to `us-ca`.
> - **Build/Config (`babel.config.tests.js`)**
> - Exclude `useRampsSmartRouting.ts` and its tests from inline env var
transform to allow runtime env-based behavior.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
77d4425. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…22293)

## **Description**

This PR implements a feature to prevent users from trading when they
have open cross-margin positions in MetaMask Perps. Since MetaMask only
supports isolated margin trading, users with cross-margin positions are
now shown a blocking warning modal that explains the limitation and
instructs them to close their cross-margin positions before trading.

**What is the reason for the change?**
MetaMask Perps only supports isolated margin trading. If users have
cross-margin positions and attempt to trade, this could lead to
unexpected behavior or errors since the system is designed exclusively
for isolated margin.

**What is the improvement/solution?**
- Added detection logic in the order placement flow to check if the user
has an open cross-margin position for the asset they're trying to trade
- Created a new bottom sheet modal
(`PerpsCrossMarginWarningBottomSheet`) that displays a clear warning
message
- Integrated the check into `PerpsOrderView.handlePlaceOrder()` before
order execution
- Added proper navigation routing through the Perps modal stack
- Included error tracking metrics for monitoring

## **Changelog**

CHANGELOG entry: Added cross-margin position detection to prevent
trading when users have unsupported margin types

## **Related issues**

Fixes: https://consensyssoftware.atlassian.net/browse/TAT-1564

## **Manual testing steps**

```gherkin
Feature: Cross-margin position trading prevention

  Scenario: user attempts to place order with cross-margin position
    Given user has an open cross-margin position for BTC
    And user is on the Perps Order view for BTC

    When user taps Long or Short button
    Then a bottom sheet modal appears with title "Cross Margin Not Supported"
    And the modal displays message "MetaMask Perps only support trading with isolated margin. You need to first close your cross margin position before you can trade on MetaMask."
    And user can dismiss the modal with "Got it" button
    And no order is placed

  Scenario: user attempts to place order with isolated margin position
    Given user has an open isolated margin position for BTC
    And user is on the Perps Order view for BTC

    When user taps Long or Short button
    Then the order placement proceeds normally
    And no warning modal is shown

  Scenario: user attempts to place order without existing position
    Given user has no open positions for BTC
    And user is on the Perps Order view for BTC

    When user taps Long or Short button
    Then the order placement proceeds normally
    And no warning modal is shown
```

## **Screenshots/Recordings**

### **Before**
Users with cross-margin positions could attempt to place orders,
potentially causing errors or unexpected behavior.

### **After**
Users with cross-margin positions are blocked with a clear warning modal
explaining the limitation.
<!-- Screenshot of the warning bottom sheet should be added here -->


https://github.com/user-attachments/assets/e90cd4d0-d25e-49f4-9d87-ee7c3e68f144


## **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 (5/7 tests passing - 2 tests
have mock configuration issues but component functions correctly)
- [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.

---

## **Technical Implementation Details**

### Files Created:
1. `PerpsCrossMarginWarningBottomSheet.tsx` - Main warning modal
component
2. `PerpsCrossMarginWarningBottomSheet.styles.ts` - Component styles
3. `PerpsCrossMarginWarningBottomSheet.test.tsx` - Unit tests
4. `index.ts` - Barrel export

### Files Modified:
1. `app/constants/navigation/Routes.ts` - Added `CROSS_MARGIN_WARNING`
route
2. `app/components/UI/Perps/routes/index.tsx` - Registered modal route
in navigation stack
3. `app/components/UI/Perps/Views/PerpsOrderView/PerpsOrderView.tsx` -
Added cross-margin detection logic in `handlePlaceOrder()`
4. `locales/languages/en.json` - Added i18n strings for warning messages

### Key Features:
- **Same-asset detection**: Only blocks trading when user has
cross-margin position for the exact asset they're trying to trade (not
all positions)
- **Navigation routing**: Uses proper modal navigation stack for
consistency with other Perps modals
- **Error tracking**: Tracks cross-margin detection events in
MetaMetrics for monitoring
- **User-friendly**: Clear warning message with single "Got it" dismiss
action
- **Early validation**: Check happens before order execution to prevent
wasted API calls

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Blocks order placement when a cross-margin position is detected and
shows a new Perps cross‑margin warning bottom sheet.
> 
> - **Perps Order Flow**:
> - Add cross‑margin detection in `PerpsOrderView.handlePlaceOrder` to
prevent execution and navigate to warning modal.
> - Track validation error via `MetaMetricsEvents.PERPS_ERROR` when
cross‑margin detected.
> - **UI/Modal**:
> - New `PerpsCrossMarginWarningBottomSheet` component with styles and
tests; dismiss navigates back or triggers `onClose`.
> - **Navigation**:
> - Register `Routes.PERPS.MODALS.CROSS_MARGIN_WARNING` in `Routes.ts`
and modal stack (`app/components/UI/Perps/routes/index.tsx`).
> - **i18n**:
>   - Add `perps.crossMargin` strings in `locales/languages/en.json`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
fd11621. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Nicholas Smith <nick.smith@consensys.net>
<!--
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**

Enable Gasless crosschain swaps (bridge) using eth_sendBundle

## **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: Added Gasless bridging for users with STX ON on
networks supporting eth_sendBundle

Relates to https://consensyssoftware.atlassian.net/browse/STX-250
 
## **Manual testing steps**

```gherkin
Feature: Gasless crosschain swaps (bridge) using eth_sendBundle

  Scenario: user perform a gasless cross chain swap from MUSD (Ethereum-mainnet) to ETH (Base-mainnet)
    Given the user enabled Smart transactions
    AND the use does not have ETH on Ethereum-mainnet

    When user swap MUSD (Ethereum-mainnet) to ETH (Base-mainnet)
    Then the swap has gas included
```

## **Screenshots/Recordings**

TO DO

### **Before**

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

### **After**

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

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Introduces gasIncluded flow for Bridge/Swap by detecting
eth_sendBundle support and STX enablement, wiring it into Redux and
quote requests, and refining STX publish fallback behavior, with
comprehensive tests.
> 
> - **Bridge UI/Hooks**:
> - Add `useGasIncluded` to compute and dispatch `gasIncluded` based on
`selectShouldUseSmartTransaction` and `useIsSendBundleSupported`
(EVM-only).
>   - Add `useIsSendBundleSupported` (async sentinel check).
> - Call `useGasIncluded(sourceToken?.chainId)` in `BridgeView` to
update state on source chain changes.
> - **Redux (bridge slice)**:
> - Add `bridge.gasIncluded` to state, selectors, and `setGasIncluded`
action; update initial state and tests.
> - **Quote Request**:
> - Include `gasIncluded` and `gasIncluded7702: false` in
`GenericQuoteRequest` via `useBridgeQuoteRequest`; remove reliance on
smart-transaction selector here.
> - **Smart Transactions publish hook**:
> - Simplify fallback: drop special cases for bridge/bridgeApproval
types; keep legacy and non-STX fallbacks.
> - **Tests**:
>   - New tests for `useGasIncluded` and `useIsSendBundleSupported`.
> - Update `BridgeView` and `useBridgeQuoteRequest` tests to cover
`gasIncluded` propagation and chain changes.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
590356d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: dan437 <80175477+dan437@users.noreply.github.com>
…tion cp-7.59.0 (#22457)

<!--
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 aligns the Swaps points equation to be anchored more similarly to
the perps amount, fixes the perps description to be more consistent and
convey how fee discounts affect perps points, and better clarifies how
the loyalty bonus works.

## **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: Updated Rewards "ways to earn" descriptions to be more
accurate.

## **Related issues**

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

<!-- 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]
> Updates Rewards “Ways to earn” text: swaps to 8 points per $10, adds
perps fee-discount note, changes referrals to 10 points per 50, and
clarifies loyalty bonus description.
> 
> - **Rewards > `ways_to_earn` (i18n copy updates)**:
>   - **`swap`**:
> - `description`/`sheet.points`: `80 points per $100` → `8 points per
$10`.
>   - **`perps`**:
> - `sheet.description`: add note that fee discounts also discount
points.
>   - **`referrals`**:
>     - `sheet.points`: `20 points per 100` → `10 points per 50`.
>   - **`loyalty`**:
> - `sheet.description`: clarify wording to “past MetaMask in-wallet
swaps or bridges.”
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
c97f27e. 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**

- Adds minimum transfer after claim

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

- [ ] 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]
> Adds a balance check and optionally appends a USDC transfer to claim
transactions when signer collateral is below a minimum threshold;
updates claim transaction shape and tests.
> 
> - **Polymarket Provider**
> - `prepareClaim`: checks signer collateral via `getBalance` and sets
`includeTransferTransaction` when balance <
`MIN_COLLATERAL_BALANCE_FOR_CLAIM`.
>   - Returns claim `transactions` as an array (not a single object).
> - **Safe Utils**
> - `createClaimSafeTransaction`: optionally appends an ERC20 transfer
(USDC) to the signer and aggregates via multisend.
> - `getClaimTransaction`: accepts `includeTransferTransaction`, using
signer address when true.
> - **Constants**
> - Introduces `MIN_COLLATERAL_BALANCE_FOR_CLAIM = 0.5` and uses
collateral/decimals in transfer encoding.
> - **Tests**
> - Update provider and safe utils tests to expect array-based claim
transactions and to cover transfer-inclusion cases across balance
thresholds.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
8abd446. 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**

feat: Remove stocks/commodities dropdown and fix FlashList gaps

Changes:
- Remove conditional stocks/commodities dropdown in market list view
  - Set showStocksCommoditiesDropdown to false (always hidden)
- Add tests to verify dropdown is not shown regardless of market type
filter

- Fix FlashList layout gaps in market lists
- Add drawDistance={200} and removeClippedSubviews props to
PerpsMarketList
  - Create marketListConfig.ts for FlashList configuration constants
  - Prevents blank space gaps when searching or scrolling

- Fix pre-existing test failure
  - Refactor "handles search with whitespace" test to use proper mocking
  - Rename to "filters markets with whitespace-only query" for clarity
<!--
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/TAT-2041
Fixes: #22440

## **Manual testing steps**

```gherkin
feat: Remove stocks/commodities dropdown and fix FlashList gaps

Feature: Market List View Filtering
  Scenario: Hide secondary dropdown in stocks tab
    Given the market list view is displayed
    When the user is on any market type tab
    Then the stocks/commodities dropdown should not be visible
    And the filter bar should only show the sort dropdown

Feature: FlashList Rendering
  Scenario: Prevent layout gaps in market list
    Given the market list uses FlashList for rendering
    When markets are displayed in search or tab views
    Then there should be no blank space gaps
    And items should render 200px ahead of viewport
    And clipped subviews should be removed for optimal layout
```

## **Screenshots/Recordings**

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

### **Before**

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

### **After**

<img width="399" alt="Simulator Screenshot - iPhone 17 Pro - 2025-11-10
at 18 23 47"
src="https://github.com/user-attachments/assets/18233ad3-992f-4a5e-bd14-9809ba23043c"
/>

<!-- [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]
> Hides the stocks/commodities dropdown in the market list and
configures FlashList (drawDistance, removeClippedSubviews) via new
constants to prevent layout gaps, with tests updated accordingly.
> 
> - **UI**:
> - Force-hide stocks/commodities dropdown by setting
`showStocksCommoditiesDropdown={false}` in `PerpsMarketListView`.
> - **Performance/Rendering**:
> - Add `drawDistance={200}` and `removeClippedSubviews` to
`PerpsMarketList`’s `FlashList`.
> - Centralize list config in `constants/marketListConfig.ts`
(`PERPS_MARKET_LIST_CONSTANTS`).
> - **Tests**:
> - Add assertions that `stocks/commodities` dropdown is not rendered
(regardless of market filter).
> - Refactor whitespace-only search test using hook-based mocking and
rename for clarity.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
0eccafa. 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**

- Removes the mandatory terms of service modal

<!--
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:
[PRED-297](https://consensyssoftware.atlassian.net/browse/PRED-297)

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


[PRED-297]:
https://consensyssoftware.atlassian.net/browse/PRED-297?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Removes the Predict ToS consent modal and agreement tracking,
simplifying buy/sell flows and pruning related controller APIs, types,
selectors, and tests.
> 
> - **UI (Predict)**:
> - Remove `PredictConsentSheet` component and all references from
`PredictBuyPreview` and `PredictSellPreview`; orders now proceed
directly.
>   - Keep inline disclaimer with "Learn more" link; no modal gating.
> - **Controller**:
> - Delete `acceptAgreement` API from `PredictController` and all
usages.
> - **Hooks**:
>   - Remove `usePredictAgreement` hook and its tests.
> - **Types/Selectors**:
> - Simplify `PredictAccountMeta` to `{ isOnboarded: boolean }`; drop
`acceptedToS` and `AcceptAgreementParams`.
>   - Update selectors/tests to reflect removal of `acceptedToS`.
> - **Tests**:
> - Remove consent-related tests and mocks across buy/sell previews and
consent sheet; adjust flows to assert direct order placement.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
8c727d0. 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**

Added support for proper display of hip3 and other DEX assets by
stripping prefixes from asset symbols throughout the Perps UI.

- Added `getPerpsDisplaySymbol()` in `marketUtils.ts`
- Strips DEX prefixes (e.g., `hip3:`, `xyz:`) from asset symbols
- Returns clean symbol for display (e.g., `hip3:BTC` → `BTC`)

**Utils:**
- `transactionTransforms.ts` - Strip prefixes in transaction subtitles
(fills, orders, funding)

**Hooks:**
- `usePerpsToasts.tsx` - Clean asset names in toast notifications

**Components:**
- `PerpsAmountDisplay.tsx` - Display token symbols without prefixes
- `PerpsOrderHeader.tsx` - Show clean asset names in order titles
- `PerpsOpenOrderCard.tsx` - Format symbols in order cards
- `PerpsRecentActivityList.tsx` - Display clean symbols in activity list

- Hip3 assets now display as `BTC` instead of `hip3:BTC`
- Stock/commodity assets show as `TSLA` instead of `xyz:TSLA`
- Consistent, clean asset naming across entire Perps UI
- Regular assets (BTC, ETH, SOL) remain unchanged
<!--
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/TAT-2043
Fixes: #22439

## **Manual testing steps**

```gherkin
Feature: Hip3 Asset Name Display

  Background:
    Given the system uses getPerpsDisplaySymbol() to format asset names

  Scenario: Strip DEX prefix from hip3 assets
    Given a hip3 asset with symbol "hip3:BTC"
    When displaying the asset name
    Then show "BTC"

  Scenario: Keep regular asset names unchanged
    Given a regular asset with symbol "BTC"
    When displaying the asset name
    Then show "BTC"
```

## **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/c6c73f1c-2640-4dac-9311-eaae8393e235

<!-- [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]
> Standardizes Perps asset symbols by stripping DEX prefixes (e.g.,
hip3:, xyz:) via getPerpsDisplaySymbol across UI, toasts, and
transaction transforms, with comprehensive tests.
> 
> - **Utils**:
> - Add `getPerpsDisplaySymbol` in `marketUtils` to strip DEX prefixes
from symbols for display.
> - Apply in `transactionTransforms` to clean `subtitle` for fills,
orders, and funding items.
> - **Hooks**:
> - Update `usePerpsToasts` to use cleaned symbols in all toast
subtitles and errors.
> - **Components**:
> - `PerpsOrderHeader`, `PerpsAmountDisplay`, `PerpsOpenOrderCard`,
`PerpsRecentActivityList`, `PerpsClosePositionView`, `PerpsOrderView`:
replace raw symbols with `getPerpsDisplaySymbol` in titles, labels, and
amounts.
> - **Tests**:
> - Add/expand coverage to assert prefix stripping (HIP-3/DEX) and
unchanged regular symbols across the updated components, hooks, and
utils.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
f7c4f2d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Nicholas Gambino <nicholas.gambino@consensys.net>
Co-authored-by: Nick Gambino <35090461+gambinish@users.noreply.github.com>
Co-authored-by: abretonc7s <107169956+abretonc7s@users.noreply.github.com>
Co-authored-by: Arthur Breton <arthur.breton@consensys.net>
Co-authored-by: dylanbutler1 <99672693+dylanbutler1@users.noreply.github.com>
@pull pull Bot locked and limited conversation to collaborators Nov 11, 2025
@pull pull Bot added the ⤵️ pull label Nov 11, 2025
@pull pull Bot merged commit 09ce116 into Reality2byte:main Nov 11, 2025
3 of 11 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.

8 participants