Skip to content

feat: currentCurrency added to AssetsController state#7991

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

feat: currentCurrency added to AssetsController state#7991
bergarces wants to merge 12 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 the PriceDataSourceOptions API, which may require consumer updates and could affect price-refresh behavior if miswired.

Overview
Adds a persisted selectedCurrency (ISO 4217, default usd) to AssetsController plus setSelectedCurrency, which updates state and triggers a one-off getAssets refresh for price data.

Refactors PriceDataSource to take a required getSelectedCurrency() callback (replacing the static currency option) so price fetches always use the latest currency, and updates unit tests/changelog accordingly.

Written by Cursor Bugbot for commit 999bdba. 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