Skip to content

fix: add vsCurrency to trending request#29852

Open
sahar-fehri wants to merge 11 commits into
mainfrom
fix/add-vs-currency-trending-list
Open

fix: add vsCurrency to trending request#29852
sahar-fehri wants to merge 11 commits into
mainfrom
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
Changes trending-token fetching and display to use the user’s selected fiat currency (adds vsCurrency and updates formatting), plus bumps @metamask/assets-controllers to 107.0.0, which could affect API/query behavior.

Overview
Trending tokens now fetch market data in the user’s selected currency by passing vsCurrency (from selectCurrentCurrency) through useTrendingRequest into getTrendingTokens.

The UI updates to render prices and market stats with the same currency, adding currency-aware helpers (formatCompactCurrency, formatMarketStats(..., currency)) and wiring currency into TrendingTokenRowItem. Call sites were updated for the assets-controller API rename (sortBysort). Tests were expanded to cover multi-currency formatting.

Reviewed by Cursor Bugbot for commit 6ccc939. 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
@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
@github-actions github-actions Bot added size-S and removed size-M labels May 15, 2026
@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 15, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​metamask/​assets-controllers@​107.0.0721009198100

View full report

@sahar-fehri sahar-fehri requested a review from a team as a code owner May 15, 2026 13:49
infiniteflower
infiniteflower previously approved these changes May 15, 2026
@github-actions github-actions Bot added size-M and removed size-S labels May 15, 2026
Comment thread app/components/UI/Trending/components/TrendingTokenRowItem/utils.ts
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b4c1391. Configure here.

Comment thread app/components/UI/Trending/components/TrendingTokenRowItem/utils.ts
@github-actions
Copy link
Copy Markdown
Contributor

🔍 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/assets-controllers. Running all tests.

Performance Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/assets-controllers. Running all tests.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@sahar-fehri sahar-fehri enabled auto-merge May 15, 2026 16:06
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.

4 participants