You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Feature: my feature nameScenario: user [verb for user action]Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
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.
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.
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
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.
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
vsCurrencyparameter to thegetTrendingTokensAPI call, dynamically set to the user's selected currency from Redux storeTrendingTokenRowItemto format prices using the user's selected currency instead of defaulting to USDChangelog
CHANGELOG entry: Fetches trending tokens prices in user's selected currency
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-3159
Manual testing steps
Screenshots/Recordings
Before
After
Screen.Recording.2026-05-07.at.11.55.58.mov
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
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(fromselectCurrentCurrency) to thegetTrendingTokenscall and updates callsites to use the newsort/TrendingTokensQueryParamsshape.UI rendering in
TrendingTokenRowItemnow 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-controllersto makegetTrendingTokensaccept a passthrough query-param bag (TrendingTokensQueryParams) so new endpoint params likevsCurrencycan 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.