Skip to content

[pull] main from MetaMask:main#337

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

[pull] main from MetaMask:main#337
pull[bot] merged 7 commits into
Reality2byte:mainfrom
MetaMask:main

Conversation

@pull
Copy link
Copy Markdown

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

GeorgeGkas and others added 7 commits November 19, 2025 07:52
<!--
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 following UI discrepancies were identified by the design team and
were fixed:

- Fix swap button style: The swap icon button currently adds an awkward
square background when pressed. The task is to fix this by either
removing the square background and applying a decrease in opacity,
similar to other touchable elements like the keypad and token input
button, or changing the square to a circle. Additionally, make the
entire button press-able with two states: background/muted and
muted/pressed when pressed.
- Use format “Oct 3 at 12:01 pm” for dates in swap transaction details.
Time is localized to the device.
- make all text color in quote details card alternative except rewards.
- Prevent swap button section from changing position when source balance
is changing.

<!--
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 various ui discrepancies and align with the design
system in swaps page

## **Related issues**

Fixes: https://consensyssoftware.atlassian.net/browse/SWAPS-3443

## **Manual testing steps**

```gherkin
Ensure that the implementation match the screesnhots
```

## **Screenshots/Recordings**

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

### **Before**

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

### **After**

<img width="462" height="917" alt="Screenshot 2025-11-14 at 1 16 02 PM"
src="https://github.com/user-attachments/assets/a74441ee-4773-4ed5-ab3e-485cabfa15ab"
/>


<!-- [screenshots/recordings] -->
<img width="453" height="905" alt="Screenshot 2025-11-14 at 5 05 28 PM"
src="https://github.com/user-attachments/assets/52ce6596-a758-490e-9178-d98d308f584d"
/>


## **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]
> Introduces a new flip/Swap button component, aligns Quote Details text
styling, stabilizes input area layout, and formats transaction dates
consistently.
> 
> - **Bridge UI**:
> - **Flip button**: Replaces inline swap arrow with new
`FLipQuoteButton` (pressed/disabled states, circular background, full
hit area) in `BridgeView`; removes old `arrow*` styles.
> - **Layout**: Removes extra gaps; stabilizes subtitle/Max area using a
hidden/opacity style; keeps destination area spacing consistent.
> - **Components**:
> - **`FlipQuoteButton`**: New component with styles, interactions, and
accessibility; added tests and snapshots.
> - **`TokenInputArea`**: Adds `hidden` style flag, wraps subtitle and
`Max` button, adjusts flex row/column logic, disables `Max` when
subtitle absent.
> - **`QuoteDetailsCard`**: Sets labels/values to
`TextColor.Alternative`; reorders slippage value before edit icon;
preserves error color for warnings.
> - **`QuoteDetailsRecipientKeyValueRow`**: Uses `TextColor.Alternative`
for text and edit icon.
> - **`TransactionDetails`**: Uses `toDateFormat` for submission/ETA
timestamps.
> - **Tests**:
> - Adds `FlipQuoteButton` unit tests and snapshots; updates
`BridgeView` and `QuoteDetailsCard` snapshots to match new UI.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
082fd6c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## **Description**

Fixed inconsistent decimal formatting on the Perps chart Y-axis. The
chart pills (current price, entry, TP/SL, liquidation) were displaying
one extra decimal place compared to the header and other price displays.

**Root Cause:** Chart Y-axis formatter used custom range-span based
logic instead of the universal `PRICE_RANGES_UNIVERSAL` configuration.

**Solution:** Replaced chart price formatter to use the same universal
formatting logic as the header, OHLC data, and TP/SL pills, ensuring
consistent decimal precision across all price displays.

## **Changelog**

CHANGELOG entry: Fixed Perps chart Y-axis showing inconsistent decimal
places compared to header

## **Related issues**

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

## **Manual testing steps**

```gherkin
Feature: Consistent decimal formatting on Perps chart

  Scenario: user views BTC chart
    Given user is on BTC Perps trading screen
    Given BTC price is around $100,000

    When user views the chart Y-axis labels
    Then all Y-axis labels should show 0 decimals (e.g., 97000, 98000, 99000)
    And current price pill should show 0 decimals matching the header
    And TP/SL/Entry/Liquidation pills should show 0 decimals

  Scenario: user views ETH chart
    Given user is on ETH Perps trading screen
    Given ETH price is around $3,000

    When user views the chart Y-axis labels
    Then all Y-axis labels should show max 1 decimal with consistent trailing zeros
    And current price pill should match header decimal precision

  Scenario: user views SOL chart
    Given user is on SOL Perps trading screen
    Given SOL price is around $100-200

    When user views the chart Y-axis labels
    Then all Y-axis labels should show max 2 decimals with consistent trailing zeros
    And current price pill should match header decimal precision
```

## **Screenshots/Recordings**

### **Before**

- BTC: Chart showed 1 decimal instead of 0
- ETH: Chart showed 2 decimals instead of 1
- SOL: Chart showed 3 decimals instead of 2
- Y-axis labels had inconsistent trailing zeros (1.256, 1.25, 1.245)

### **After**

- All assets now follow `PRICE_RANGES_UNIVERSAL` rules from
docs/perps/perps-rules-decimals.md
- Y-axis labels maintain consistent decimal places with trailing zeros
- Chart decimals match header decimals exactly


https://github.com/user-attachments/assets/723dd7b9-e4ac-48d1-94a4-c780e2cf7d67


## **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 custom Y-axis price formatting with universal
significant-digit ranges, caches number formatters, adjusts decimals by
zoom, and unifies time formatting.
> 
> - **Perps TradingView chart**:
> - **Price formatting**: Replace custom Y-axis `priceFormatter` with
hybrid universal formatting using `PRICE_RANGES` + significant digits;
adjusts decimals based on visible range; caches `Intl.NumberFormat`
instances.
> - **Helpers added**: `PRICE_THRESHOLD`, `PRICE_RANGES`,
`getCachedFormatter`, `formatPriceWithSignificantDigits`,
`formatPriceUniversal`.
> - **Time formatting**: Add `formatTimestamp` and use it for
`timeFormatter`/`tickMarkFormatter` (local timezone).
> - **Minor**: Small current price line config tweaks; general
cleanup/perf comments.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
392f5ab. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: George Gkasdrogkas <georgegkas@gmail.com>
Co-authored-by: huggingbot <83656073+huggingbot@users.noreply.github.com>
Co-authored-by: Patryk Łucka <5708018+PatrykLucka@users.noreply.github.com>
Co-authored-by: OGPoyraz <omergoktugpoyraz@gmail.com>
Co-authored-by: Juanmi <95381763+juanmigdr@users.noreply.github.com>
Co-authored-by: ieow <4881057+ieow@users.noreply.github.com>
Co-authored-by: VGR <VanGulckRik@gmail.com>
Co-authored-by: Priya Narayanaswamy <priya.narayanaswamy@consensys.net>
Co-authored-by: Pavel Dvorkin <pavel.dvorkin@consensys.net>
Co-authored-by: jvbriones <1674192+jvbriones@users.noreply.github.com>
Co-authored-by: Michal Szorad <michal.szorad@consensys.net>
Co-authored-by: Matthew Walsh <matthew.walsh@consensys.net>
Co-authored-by: Alejandro Garcia Anglada <aganglada@gmail.com>
Co-authored-by: Fred <frederic.heng@consensys.net>
Co-authored-by: Pedro Pablo Aste Kompen <wachunei@gmail.com>
Co-authored-by: AxelGes <axelges9@gmail.com>
Co-authored-by: Prithpal Sooriya <prithpal.sooriya@consensys.net>
Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
Co-authored-by: AxelGes <34173844+AxelGes@users.noreply.github.com>
Co-authored-by: sophieqgu <37032128+sophieqgu@users.noreply.github.com>
Co-authored-by: Salim TOUBAL <salim.toubal@outlook.com>
Co-authored-by: Christian Tran <christian.trn@gmail.com>
## **Description**

Ensure the insufficient balance alert is displayed for Predict
confirmations when the token is Polygon USDC.e.

## **Changelog**

CHANGELOG entry: null

## **Related issues**

Fixes: #22713 

## **Manual testing steps**

## **Screenshots/Recordings**

### **Before**

### **After**

## **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]
> Refines insufficient balance alert logic to consider pay token vs
required tokens and updates result readiness to check required token
source amounts; adds corresponding tests.
> 
> - **Alerts (useInsufficientBalanceAlert)**:
> - Consider `payToken` and `useTransactionPayRequiredTokens()`; compute
primary required token and show alert only when relevant.
> - Early-exit when a `payToken` is set for a different token; only
ignore `TransactionType.predictWithdraw`.
>   - Update memo deps accordingly.
> - **Custom Amount UI**:
> - `useIsResultReady` now checks for source amounts matching
non-skippable required tokens instead of `sourceAmounts` length.
> - **Tests**:
> - Add/adjust unit tests for pay-token/required-token scenarios and
ignored types.
>   - Update mocks, types (`Hex`), and defaults for new hooks.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
6fe6488. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## **Description**

Fix total calculation when using alternate currencies.

## **Changelog**

CHANGELOG entry: null

## **Related issues**

Fixes: #22714 

## **Manual testing steps**

## **Screenshots/Recordings**

### **Before**

### **After**

## **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]
> Switches to a unified USD fiat formatter across confirmation views,
fixes total/fee/balance USD calculations, and updates custom amount
logic and tests.
> 
> - **Confirmations UI (fiat display)**:
> - Replace `useTransactionPayFiat` with `useFiatFormatter({ currency:
'usd' })` in `predict-claim-footer`, `bridge-fee-row`, `pay-with-row`,
and `total-row`.
> - Format amounts via `BigNumber` and use USD fields (`.usd`,
`balanceUsd`) for totals/fees/balances.
> - **Bridge fees**:
> - Recalculate fee totals and tooltip breakdown using USD values
(provider + sourceNetwork + targetNetwork) and format with USD
formatter.
> - **Pay With row**:
> - Display USD balance using `payToken.balanceUsd` instead of
fiat-converted balance.
> - **Predict claim footer**:
>   - Format single-win amount in USD via formatter.
> - **Custom amount logic** (`useTransactionCustomAmount`):
> - Use token USD rate and direct USD balances; compute percentage
amounts from USD balances; update `useTokenBalance` to return USD
values.
>   - Adjust related test expectations (e.g., 43% -> `530.86`).
> - **Cleanup**:
>   - Remove `useTransactionPayFiat` hook and its test.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
e213a26. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…nent cp-7.60.0 (#22870)

<!--
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 fixes non-evm address transformation on asset page, used for
generating blockexplorer link.
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: Fixed a bug that was causing redirect to incorrect url
when viewing all transactions on blockexplorer from asset page

## **Related issues**

Fixes: #22858

## **Manual testing steps**

```gherkin
Feature: View full history on Solscan

  Scenario: user views full history on Solscan
    Given user has transacted with some solana assets

    When user opens individual solana asset page and clicks "View full history on Solscan"
    Then correct solscan link is opened
```

## **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/ccf486ec-3bf9-44c6-bbca-3ed4d8582aaa


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

### **After**


https://github.com/user-attachments/assets/14882761-c8ae-4bd5-8b3e-4fb4eea65472


<!-- [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]
> Only checksum EVM (hex) addresses in Asset view, leaving non-EVM
addresses intact to produce correct block explorer links.
> 
> - **Asset View (`app/components/Views/Asset/index.js`)**:
> - Validate address with `isHexAddress` and only apply
`safeToChecksumAddress` to EVM addresses; leave non-EVM addresses
unchanged for downstream usage (e.g., block explorer links).
> - Update imports: add `isHexAddress`; remove `toChecksumHexAddress`
usage.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
3d1b03f. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## **Description**

Show an alert if doing a Perps or Predict deposit and there is an
existing submitted transaction on the same chain and account.

## **Changelog**

CHANGELOG entry: null

## **Related issues**

Fixes: #22762 

## **Manual testing steps**

## **Screenshots/Recordings**

### **Before**

### **After**

## **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]
> Alerts now trigger for Perps/Predict deposits when an existing
transaction is in submitted status on the same chain/account; tests
updated/added.
> 
> - **Alerts**:
> - Update `useSignedOrSubmittedAlert` to include
`TransactionStatus.submitted` as a blocking status when the current
transaction is a Pay type (`perpsDeposit`, `predictDeposit`).
> - **Tests**:
> - Add cases verifying alerts show when an existing transaction is
`submitted` and current type is any in `PAY_TYPES`.
> - Ensure existing behavior for signed/approved, chain/account checks,
and Pay-type messaging remains validated.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
968d285. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## **Description**

Switches the reward point calculation for predict from a hard coded
approach to using the rewards API. It also uses the same approach
recently introduced in the swaps flow, to allow add their account if
it's not correctly tied to their rewards subscription.

## **Changelog**

CHANGELOG entry: Estimate reward points in predict flow

## **Related issues**

Fixes: https://consensyssoftware.atlassian.net/browse/RWDS-801

## **Screenshots/Recordings**

### **After**

<img width="732" height="1041" alt="Screenshot-88"
src="https://github.com/user-attachments/assets/9e4e27c6-2fab-4382-8d0f-69d861f4780b"
/>

---

<img width="701" height="823" alt="Screenshot-2025-11-18-10:30:28"
src="https://github.com/user-attachments/assets/b8fd489e-610a-422c-8d23-67ae24daa4d3"
/>

---

<img width="500" height="600" alt="Screenshot-2025-11-18-10:31:15"
src="https://github.com/user-attachments/assets/64bbfc9e-4bd2-48e7-9574-479f6299a2f5"
/>

---

<img width="774" height="307" alt="Screenshot-2025-11-18-10:32:21"
src="https://github.com/user-attachments/assets/996f3b03-dfc2-4897-8c65-2d81b8e584a2"
/>

## **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]
> Switch Predict to API-based points estimation with opt-in handling,
update UI to show points/add-account, and extend rewards types/tests.
> 
> - **Predict flow**:
> - Update `PredictBuyPreview` to use `usePredictRewards(totalFee)` and
drive rewards UI; compute `shouldShowRewardsRow` and pass
`accountOptedIn`, `estimatedPoints`, loading/error to
`PredictFeeSummary`.
> - `PredictFeeSummary` props renamed `shouldShowRewards` →
`shouldShowRewardsRow`; add `accountOptedIn`, error tooltip; render
`AddRewardsAccount` when not opted in; wire `RewardPointsAnimation`
states.
> - **Hook: `usePredictRewards`**:
> - New signature accepts `totalFeeAmountUsd`; selects multichain
account by `POLYGON_MAINNET_CAIP_CHAIN_ID` and formats CAIP-10 without
bridge-controller.
> - Checks feature flag and subscription, opt-in status/support;
estimates points via `RewardsController:estimatePoints` using
`POLYGON_USDC_CAIP_ASSET_ID` and `parseUnits` with 6 decimals.
> - Subscribes to `RewardsController:accountLinked`; returns
`{enabled,isLoading,accountOptedIn,shouldShowRewardsRow,estimatedPoints,hasError}`.
> - **Rewards UI**:
> - `RewardPointsAnimation`: make `infoOnPress` optional; hide info icon
unless provided; support `hideValue` from hook.
> - **Types/Constants**:
> - Extend rewards types with `EstimatePredictContextDto`, add `PREDICT`
to `PointsEventEarnType`.
>   - Add `POLYGON_USDC_CAIP_ASSET_ID` constant.
> - **Tests**:
> - Comprehensive updates for new props/flows, loading/error states,
subscription/opt-in paths, and animation behavior.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
dadabd0. 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 19, 2025
@pull pull Bot added the ⤵️ pull label Nov 19, 2025
@pull pull Bot merged commit af6ba34 into Reality2byte:main Nov 19, 2025
0 of 7 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.

5 participants