Skip to content

fix: add vsCurrency to trending request#29852

Open
sahar-fehri wants to merge 3 commits intomainfrom
fix/add-vs-currency-trending-list
Open

fix: add vsCurrency to trending request#29852
sahar-fehri wants to merge 3 commits intomainfrom
fix/add-vs-currency-trending-list

Conversation

@sahar-fehri
Copy link
Copy Markdown
Contributor

@sahar-fehri sahar-fehri commented May 7, 2026

Description

Make sure this is merged only after MetaMask/core#8729

Fixes trending tokens to fetch and display prices in the user's selected currency instead of always defaulting to USD.

Problem

The trending tokens list was always fetching data in USD and displaying prices with USD formatting, regardless of the user's selected currency preference.

Solution

  • Added vsCurrency parameter to the getTrendingTokens API call, dynamically set to the user's selected currency from Redux store
  • Updated TrendingTokenRowItem to format prices using the user's selected currency instead of defaulting to USD
  • Used selectCurrentCurrency selector to retrieve the user's currency preference (defaults to 'usd' if not set)

Changelog

CHANGELOG entry: Fetches trending tokens prices in user's selected currency

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-3159

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Screen.Recording.2026-05-07.at.11.55.58.mov

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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.

Note

Medium Risk
Medium risk because it changes the query parameters sent to the trending tokens API (via a patched @metamask/assets-controllers) and alters currency formatting in the Trending UI, which could affect pricing correctness across locales/currencies.

Overview
Trending token prices are now fetched and displayed in the user’s selected fiat currency. The trending request hook adds vsCurrency (from selectCurrentCurrency) to the getTrendingTokens call and updates callsites to use the new sort/TrendingTokensQueryParams shape.

UI rendering in TrendingTokenRowItem now formats the token price using the selected currency instead of assuming USD, and tests were updated to mock the currency selector.

This PR also introduces a Yarn patch for @metamask/assets-controllers to make getTrendingTokens accept a passthrough query-param bag (TrendingTokensQueryParams) so new endpoint params like vsCurrency can be forwarded without additional library changes.

Reviewed by Cursor Bugbot for commit 0b4c0a0. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@github-actions github-actions Bot added size-M and removed size-S labels May 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeConfirmations, SmokeIdentity, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeSwap, SmokeStake, SmokeWalletPlatform, SmokeMoney, SmokePerps, SmokeMultiChainAPI, SmokePredictions, SmokeSeedlessOnboarding, SmokeBrowser, SmokeSnaps
  • Selected Performance tags: @PerformanceAccountList, @PerformanceOnboarding, @PerformanceLogin, @PerformanceSwaps, @PerformanceLaunch, @PerformanceAssetLoading, @PerformancePredict, @PerformancePreps
  • Risk Level: high
  • AI Confidence: 100%
click to see 🤖 AI reasoning details

E2E Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/bridge-status-controller@npm:^71.0.0, @metamask/assets-controllers@npm:^105.1.0, @metamask/assets-controllers@npm:^105.0.0, @metamask/assets-controllers. Running all tests.

Performance Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/bridge-status-controller@npm:^71.0.0, @metamask/assets-controllers@npm:^105.1.0, @metamask/assets-controllers@npm:^105.0.0, @metamask/assets-controllers. Running all tests.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 7, 2026

@sahar-fehri sahar-fehri marked this pull request as ready for review May 7, 2026 12:43
@sahar-fehri sahar-fehri requested a review from a team as a code owner May 7, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant