Skip to content

feat: currentCurrency added to AssetsController state#7991

Open
bergarces wants to merge 11 commits intomainfrom
current-currency-state-new-controller
Open

feat: currentCurrency added to AssetsController state#7991
bergarces wants to merge 11 commits intomainfrom
current-currency-state-new-controller

Conversation

@bergarces
Copy link
Contributor

@bergarces bergarces commented Feb 19, 2026

Explanation

The state for currentCurrency is currently saved in CurrencyRateController. Since that controller is being deprecated, and we need that piece of state to be stored somewhere, it's being moved to the controller that will replace it.

This PR also ensures that PriceDataSource gets updated with the existing currency instead of just being set up at constructor level.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • [] I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Introduces new persisted state and changes how currency is supplied to price fetching, which may affect consumers of PriceDataSourceOptions and runtime price-refresh behavior.

Overview
Adds persisted currentCurrency (default usd) to AssetsController state plus setCurrentCurrency(), which updates state and triggers a one-off getAssets(..., { forceUpdate: true, dataTypes: ['price'] }) to refresh displayed prices.

Refactors PriceDataSourceOptions to require getCurrentCurrency() (replacing the previous optional currency value) and updates PriceDataSource/tests to call the getter on each spot-price fetch; changelog and unit tests are updated accordingly.

Written by Cursor Bugbot for commit db459d0. This will update automatically on new commits. Configure here.

@bergarces bergarces requested a review from a team as a code owner February 19, 2026 10:13
@bergarces bergarces changed the title Current-currency-state-new-controller feat: currentCurrency added to AssetsController state Feb 19, 2026
Copy link

@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 2 potential issues.

Copy link
Contributor Author

@bergarces bergarces Feb 19, 2026

Choose a reason for hiding this comment

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

Currency is already included as part of the query key for cache purposes, so no changes needed in the client.

@bergarces bergarces requested a review from a team as a code owner February 19, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments