Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update currency rate controller polling input #4839

Merged
merged 4 commits into from
Oct 23, 2024

Conversation

bergeron
Copy link
Contributor

@bergeron bergeron commented Oct 23, 2024

Explanation

Prepares the currency rate controller to be polled across chains. We want a unique polling loop for each unique native currency (e.g. ETH, BNB). Rather than for each network client id. So this PR updates the polling input to {nativeCurrency: string}

References

Changelog

@metamask/assets-controllers

  • BREAKING: The CurrencyRateController polling input is now {nativeCurrency: string} instead of a network client id.

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 highlighted breaking changes using the "BREAKING" category above as appropriate
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@bergeron bergeron requested a review from a team as a code owner October 23, 2024 00:04
@@ -155,7 +155,7 @@ describe('CurrencyRateController', () => {
messenger,
});

controller.startPolling({ networkClientId: 'mainnet' });
controller.startPolling({ nativeCurrency: 'ETH' });
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering why we are using the symbol here rather than an address of some sort?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the currency rate controller handles prices for the native gas token of each chain. They're identified by symbol.

@bergeron bergeron merged commit 81546f1 into main Oct 23, 2024
119 checks passed
@bergeron bergeron deleted the brian/currencyratepollinginput branch October 23, 2024 18:35
@bergeron
Copy link
Contributor Author

@metamaskbot publish-preview

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.

4 participants