[pull] main from MetaMask:main#322
Merged
Merged
Conversation
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
Right now, we're always showing a generic error message for **all**
errors when placing a Sell order.
This fix makes sure we show the user the correct parsed error message.
## **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] -->
<img width="366" height="772" alt="Screenshot 2025-11-12 at 9 34 44 PM"
src="https://github.com/user-attachments/assets/b41c947f-24b2-44c7-9c9d-0808bfe02585"
/>
## **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]
> Show parsed sell order error in `PredictSellPreview` instead of a
generic failure message.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
4a603de. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
#22550) ## **Description** Right now when opting in, we will first attempt to opt in your active account, and then link the first account of your SRP. This PR changes this so that we opt in your first account of your SRP and then link your active account. Reasoning here is that we're heading towards a situation where both on extension and mobile users will be able to opt in for the same SRP. If for some reason on one of their devices their cache is still stale, it will be correctly updated when during op-tin we detect that the first account of their SRP is already tied to a subscription. The active account group will then be tied/linked to this subscription. Instead of creating a new subscription in the old implementation. ## **Changelog** CHANGELOG entry: null ## **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] > Opt-in now prefers side-effect (first wallet) accounts, links the other group afterward, and `RewardsController:optIn` takes explicit accounts with updated tests and metrics. > > - **Rewards opt-in flow (hook)**: > - Prefer `sideEffectAccounts` for `RewardsController:optIn`; otherwise use active group accounts. > - After successful opt-in, link the opposite group (`linkAccountGroup`) based on which accounts were used. > - Track additional metrics/traits on referral usage; throw error if no subscription ID returned. > - **Controller API**: > - Change `RewardsController:optIn` signature to `(accounts: InternalAccount[], referralCode?)` and remove internal account-group lookup. > - Update log message for empty accounts; keep retry/ordering logic via `sortAccounts`. > - Update action type `RewardsControllerOptInAction` to new signature. > - **Tests**: > - Rewrite `useOptIn` tests to cover side-effect vs active group paths, linking behavior, referral traits, and failure cases. > - Update controller tests to pass accounts explicitly and validate new behaviors across edge cases. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 41bcb71. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
… tests
<!--
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?
-->
- Since we added a port manager to allocate random ports we need to
remove the reliance on AnvilPort() in this test
## **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]
> Adds a platform-aware Anvil port helper and updates the Snap network
access test to use the allocated port instead of a hardcoded one.
>
> - **E2E Tests**:
> - Update `e2e/specs/snaps/test-snap-network-access.spec.ts` to use
`getAnvilPortForTest()` for WebSocket URL and remove explicit `port`
option in `localNodeOptions`.
> - **Fixtures/Utils**:
> - Add `getAnvilPortForTest()` in
`e2e/framework/fixtures/FixtureUtils.ts` to return `DEFAULT_ANVIL_PORT`
on Android and the allocated `ANVIL` port on iOS, with JSDoc examples.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
ccb55b4. 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?
-->
- Addresses some flakiness in the send asset test.
- iOS handles element obstruction more gracefully so we dont need the
same checks.
## **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]
> Adds an Android-only delay and consolidated platform check before
tapping the confirm button in e2e `FooterActions` to mitigate element
obstruction.
>
> - **E2E (Browser Confirmations)**
> - In `e2e/pages/Browser/Confirmations/FooterActions.ts`:
> - Add Android-only `TestHelpers.delay(3000)` before `confirm` tap to
avoid bottom toast obstruction.
> - Refactor platform check to `isAndroid` and use it for
`waitForElementToDisappear`.
> - Import `TestHelpers` to support the delay.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
342eb25. 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 a new prediction markets carousel to the Trending tab, allowing users to discover and engage with prediction markets directly from the trending feed. **Reason for change:** - Improve user discoverability of prediction markets - Provide a seamless entry point to predictions from the trending view - Showcase trending prediction markets alongside trending tokens **Implementation:** - Created new `PredictionSection` component with horizontal carousel displaying up to 6 prediction markets - Integrated the prediction section into `TrendingView` above the trending tokens section - Implemented loading states with skeleton loaders - Added pagination dots for carousel navigation - Included "View all" button for future navigation to full predictions list - Fetches trending prediction markets using existing `usePredictMarketData` hook - Fully responsive with proper spacing and design system components ## **Changelog** CHANGELOG entry: Added prediction markets carousel to Trending tab ## **Related issues** Fixes: <!-- Add issue number here --> ## **Manual testing steps** ### **Before** <!-- Trending tab showed only trending tokens section --> ### **After** <!-- Trending tab now shows prediction carousel above trending tokens section with pagination dots --> https://github.com/user-attachments/assets/37365918-d0d1-4db8-b240-365907baee6b ## **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 prediction markets carousel to the Trending view with pagination and loading states, introduces a reusable section header, updates the tokens section, and wires the Predict modal route. > > - **Trending view**: > - Add `PredictionSection` (`PredictionSection.tsx/.styles.ts`) with horizontal carousel (FlashList), pagination dots, and skeleton loading; fetches up to 6 markets via `usePredictMarketData`. > - Integrate `PredictionSection` into `TrendingView.tsx` above tokens. > - Register `Routes.PREDICT.MODALS.ROOT` with `PredictModalStack` in navigator. > - **Shared UI**: > - Create reusable `SectionHeader` (`SectionHeader.tsx`, `index.ts`) and replace inline header in `TrendingTokensSection.tsx`. > - **Tests**: > - Add tests for `PredictionSection` and `SectionHeader` covering loading, empty, header, button press, and hook params. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit ea85dfb. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** Use a dedicated feature flag for predict reward point estimations. ## **Changelog** CHANGELOG entry: null ## **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] > Switches PredictBuyPreview to use dedicated `rewardsEnablePredict` flag via `selectRewardsPredictEnabledFlag` and adds selector + tests; rewards display now gated by this flag. > > - **Predict UI**: > - Update `PredictBuyPreview.tsx` to use `selectRewardsPredictEnabledFlag` (replacing `selectRewardsEnabledFlag`) to gate rewards estimation display. > - Continue calculating `estimatedPoints` from `metamaskFee`; show rewards row only when flag enabled and amount > 0. > - **Feature Flags**: > - Add `REWARDS_PREDICT_ENABLED_FLAG_NAME` (`rewardsEnablePredict`) and new selector `selectRewardsPredictEnabledFlag` in `selectors/featureFlagController/rewards`. > - Extend tests in `selectors/.../rewards/index.test.ts` to cover valid/invalid/version cases for the new flag. > - **Tests**: > - Modify `PredictBuyPreview.test.tsx` to mock `selectRewardsPredictEnabledFlag` and add tests for rewards calculation/display behavior based on the flag. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 31951c1. 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 fixes issue with swaps navigation from token view, when the source token is changed to different network. <!-- 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 with swaps navigation from token view, when the source token is changed to different network. ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-7 ## **Manual testing steps** ```gherkin Feature: Swap Solana Scenario: user swaps solana token Given user onboarded When user goes to Solana token page Then Clicks Swap Then Changes source token to Ethereum EVM Then clicks back button Then the Solana token page should be displayed correctly (before it was stuck at loading screen) ``` ## **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/e58c0455-9600-4161-a126-8f3717cf05f5 <!-- [screenshots/recordings] --> ### **After** https://github.com/user-attachments/assets/310b593e-6708-486c-9dce-eb5ccabe5bc2 <!-- [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] > Ensures the asset view reliably clears the loading state by considering `state.loading` in transaction update conditions for both EVM and non-EVM flows. > > - **Asset view (`app/components/Views/Asset/index.js`)**: > - **Transaction normalization**: > - Include `this.state.loading` in update conditions for non-EVM and EVM paths to force state updates when only loading needs reset. > - Clear loading even when no new transactions by expanding the fallback condition. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 15d58f9. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** Add button to Predict and Perps deposit confirmations to redirect to ramps if account has no token balances. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes:[ #6006](MetaMask/MetaMask-planning#6006) ## **Manual testing steps** ## **Screenshots/Recordings** ### **Before** ### **After** <img width="300" alt="Buy Perps" src="https://github.com/user-attachments/assets/19db49ac-b65a-4d33-8bb6-394b6b16691d" /> <img width="300" alt="Buy Predictions" src="https://github.com/user-attachments/assets/58885d80-0fbb-4d19-add4-4d08297de893" /> ## **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] > Shows a Buy Crypto button on Perps/Predictions deposit confirmations when no eligible pay tokens are available, disables amount/pay UI, and centralizes token availability logic used by the Pay With modal. > > - **Confirmations UI**: > - Add `BuySection` with "Buy crypto" CTA in `CustomAmountInfo` when `useTransactionPayAvailableTokens()` returns none; navigates to Ramp Aggregator with inferred `assetId`. > - Disable `CustomAmount`, `PayTokenAmount`, and `DepositKeyboard` when no tokens; greyed styling and fixed "0 ETH" display. > - Gate "Pay with" row and keyboard behind token availability. > - **Token availability refactor**: > - Introduce `getAvailableTokens` in `utils/transaction-pay` to filter/select tokens (handles required/pay token inclusion, ERC-20/EVM checks, gas availability, disabled messaging). > - New hook `useTransactionPayAvailableTokens` to expose filtered tokens; used in `CustomAmountInfo`. > - Update `PayWithModal` to consume `getAvailableTokens` via `tokenFilter`. > - **Tests**: > - Add unit tests for `useTransactionPayAvailableTokens` and `getAvailableTokens` scenarios. > - Update `custom-amount-info` and `pay-token-amount` tests for new disabled and Buy CTA behaviors; simplify `pay-with-modal` tests. > - **i18n**: > - Add `confirm.custom_amount.buy_button`, `buy_predict`, and `buy_perps` strings. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit fa99fa2. 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** Allows for starting the staking flow for Tron. We added the entry point in the tokens list with the little "earn" button next to the token name, and in the token details page the other entry point that kicks of the staking and unstaking flows. https://github.com/user-attachments/assets/d0364866-7199-4d37-9af0-f2e9e7dc61a8 ## **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] > Enable TRX staking/unstaking behind a feature flag with new UI entry points, token/selector plumbing, and updates to earn views and tests. > > - **TRON staking support (flagged)**: > - Build TRX earn token on-the-fly in `EarnInputView`/`EarnWithdrawInputView` when `selectTrxStakingEnabled` and TRON native asset; show `ResourceToggle`. > - Add TRON staking CTA and buttons in `EarnBalance` via new components `TronStakingButtons` and `TronStakingCta`; determine positions using `earn/utils/tron` helpers. > - Route staking/unstaking for TRX from `StakeButton` and token list CTAs; use `earnSelectors.selectPrimaryEarnExperienceTypeForAsset`. > - Update i18n with TRX-specific CTA copy. > - **Selectors & utils**: > - New `selectIsStakeableToken` (ETH always, TRX when flag on) used in token list items and `EarnBalance`. > - Extend earn selectors to infer pooled staking for TRX when metadata absent and flag enabled. > - Add `createStakedTrxAsset` `ticker` and TRON resource helpers (`hasStakedTrxPositions`, `getStakedTrxTotalFromResources`). > - **Earn views & UX**: > - Generalize withdraw flow to `withdrawalToken`; fix analytics/tracing props. > - `EarnTokenSelector` renders gracefully without APR and supports native/network badges from fallback token. > - `useEarnInput` only estimates gas for native ETH deposits. > - **Tests**: > - Comprehensive unit tests for TRON flows, new selectors, components, and updated views/snapshots. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit ac1df57. 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**
When using the Perps feature on non-EVM networks (Solana or Bitcoin),
clicking the "Start Trading" button in the Perps tab resulted in a
navigation error:
<!--
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 perps flow when solana is selected
## **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**
https://github.com/user-attachments/assets/5ba9dd56-0ca7-4c94-8c7c-7b9d83da44dd
<!-- [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]
> Perps screens are now registered whenever the Perps feature flag is
enabled, regardless of EVM network selection.
>
> - **Navigation (MainNavigator.js)**:
> - `isPerpsEnabled` now depends only on `perpsEnabledFlag` (removes
`isEvmSelected` check), registering Perps routes on non-EVM networks
when the flag is on.
> - Predict feature logic unchanged (still gated by flag + EVM
selection).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
6903391. 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 fixes multiple bugs in transactions list: - Fixes copy for not confirmed transactions. It changes "Sent ETH" to "Send EH" etc. - Fixes "Received" and "Sent" being displayed incorrectly - Fixes Sent icon not being displayed for some transactions - Fixes Solana network not being displayed - Fixes amount and value being displayed incorrectly for some transactions <!-- 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 the way unconfirmed transaction title is displayed ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/TMCU-172 https://consensyssoftware.atlassian.net/browse/TMCU-170 https://consensyssoftware.atlassian.net/browse/TMCU-114 https://consensyssoftware.atlassian.net/browse/TMCU-189 https://consensyssoftware.atlassian.net/browse/TMCU-190 ## **Manual testing steps** ```gherkin Feature: Send ETH Scenario: user sends ETH Given user onboarded and has ETH to spend When user initializes the transaction Then until transaction is finished, its title says "Send ETH" instead of "Sent ETH" ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <img width="389" height="833" alt="before1" src="https://github.com/user-attachments/assets/87b993e0-a65f-49ed-a384-73cac1910f84" /> <img width="396" height="836" alt="before2" src="https://github.com/user-attachments/assets/b2574657-43d8-4d7d-a5ca-086a47b0b743" /> <img width="399" height="837" alt="before3" src="https://github.com/user-attachments/assets/1b61da05-8e56-41ed-beea-f9fb133b9229" /> <!-- [screenshots/recordings] --> ### **After** <img width="387" height="839" alt="after1" src="https://github.com/user-attachments/assets/6e9c5e27-802a-4d1f-a479-ed9c5df71fb5" /> <img width="394" height="835" alt="after2" src="https://github.com/user-attachments/assets/e2db2d4c-3d03-4362-a92c-bf465ec86edb" /> <img width="394" height="835" alt="after3" src="https://github.com/user-attachments/assets/e102f59b-026a-4eef-947a-979c19f72b28" /> <!-- [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] > Updates transaction titles to use Send/Receive for incomplete states, fixes ERC20 decoding and classification, adds network badges to multichain items, and aligns tests/mocks/i18n. > > - **Transactions UX/Copy**: > - Use `transactions.send`/`transactions.receive` for incomplete states and `transactions.sent`/`transactions.received` once confirmed across EVM and multichain (`useMultichainTransactionDisplay`, `utils.js`). > - Action keys now include asset symbol (e.g., `Send UNI`) and respect direction based on `txParams.from`. > - **Parsing/Classification Fixes**: > - Decode actual ERC20 recipient from calldata; fix `renderTo` and transaction type for incoming transfers. > - Normalize comparisons (lowercase), broaden SITE_INTERACTION detection, and handle bridge contracts via first‑party mapping. > - Token transfer decoding prefers payload, falls back to `transferInformation` when data is incomplete. > - **UI**: > - Add network badge overlay to multichain transaction icons; ensure icon type lowercasing. > - Pass `selectedAddress` to `TransactionElement`; use `item.tx.chain` as non‑EVM `chainId`. > - **Tests/Mocks/I18n**: > - Update unit tests to new copy/direction expectations; add tests for `isTransactionIncomplete` and action key behavior. > - Add v1 price exchange‑rates mock for E2E. > - Add/adjust i18n strings (send/receive variants, collectibles, review action key). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6d6e3e8. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** This PR adds a predict ways to earn cta and bottom sheet. Only if the required predict feature flag is turned on. ## **Changelog** CHANGELOG entry: rewards predict ways to earn cta ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/RWDS-787 ## **Screenshots/Recordings** ### **After** <img width="636" height="640" alt="image" src="https://github.com/user-attachments/assets/63cdf2a6-b005-49fe-b18f-7e4d9cdb1769" /> <img width="672" height="521" alt="image" src="https://github.com/user-attachments/assets/69d43c0b-09ee-4d45-acd1-a12a939ec8b4" /> ## **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 a feature-flagged Predict earning option with bottom sheet CTA, navigation to market list, and metrics tracking, plus comprehensive tests and i18n strings. > > - **Rewards Overview — Ways to Earn**: > - **Predict entry (feature-flagged)**: Adds `WayToEarnType.PREDICT`, list item, bottom sheet content, and CTA handling in `WaysToEarn.tsx`. > - **Navigation**: Predict CTA navigates to `Routes.PREDICT.ROOT` → `MARKET_LIST`; list filtering honors `selectPredictEnabledFlag` alongside Card flag. > - **Metrics**: Tracks `REWARDS_PAGE_BUTTON_CLICKED` and `REWARDS_WAYS_TO_EARN_CTA_CLICKED` with `ways_to_earn_type` and `button_type`. > - **Tests** (`WaysToEarn.test.tsx`): > - Covers Predict visibility (flag on/off), modal rendering, CTA navigation, and metrics assertions. > - Extends existing tests (Swap/Perps/Referral/Card) with metrics checks and CTA flows; validates enum values and hook configuration. > - **Localization** (`locales/languages/en.json`): > - Adds Predict strings under `rewards.ways_to_earn.predict` (titles, descriptions, sheet, CTA). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 8bfc213. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )