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

Update token rates controller for multi evm fetching #4866

Merged
merged 14 commits into from
Nov 1, 2024

Conversation

bergeron
Copy link
Contributor

@bergeron bergeron commented Oct 29, 2024

Explanation

This PR Updates the TokenRatesController to be used in clients across multiple chains.

References

Changelog

@metamask/assets-controllers

  • CHANGED: When the TokensController:stateChange subscription is fired, token prices are now updated across all chain IDs whose tokens changed, instead of just the current chain.

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
Copy link
Contributor Author

@metamaskbot publish-preview

Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/accounts-controller": "18.2.2-preview-1e2accee",
  "@metamask-previews/address-book-controller": "6.0.1-preview-1e2accee",
  "@metamask-previews/announcement-controller": "7.0.1-preview-1e2accee",
  "@metamask-previews/approval-controller": "7.1.0-preview-1e2accee",
  "@metamask-previews/assets-controllers": "39.0.0-preview-1e2accee",
  "@metamask-previews/base-controller": "7.0.1-preview-1e2accee",
  "@metamask-previews/build-utils": "3.0.1-preview-1e2accee",
  "@metamask-previews/chain-controller": "0.1.3-preview-1e2accee",
  "@metamask-previews/composable-controller": "9.0.1-preview-1e2accee",
  "@metamask-previews/controller-utils": "11.4.0-preview-1e2accee",
  "@metamask-previews/ens-controller": "14.0.1-preview-1e2accee",
  "@metamask-previews/eth-json-rpc-provider": "4.1.5-preview-1e2accee",
  "@metamask-previews/gas-fee-controller": "21.0.0-preview-1e2accee",
  "@metamask-previews/json-rpc-engine": "10.0.0-preview-1e2accee",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.4-preview-1e2accee",
  "@metamask-previews/keyring-controller": "17.3.0-preview-1e2accee",
  "@metamask-previews/logging-controller": "6.0.1-preview-1e2accee",
  "@metamask-previews/message-manager": "11.0.0-preview-1e2accee",
  "@metamask-previews/multichain": "0.0.0-preview-1e2accee",
  "@metamask-previews/name-controller": "8.0.1-preview-1e2accee",
  "@metamask-previews/network-controller": "22.0.0-preview-1e2accee",
  "@metamask-previews/notification-controller": "7.0.0-preview-1e2accee",
  "@metamask-previews/notification-services-controller": "0.12.0-preview-1e2accee",
  "@metamask-previews/permission-controller": "11.0.2-preview-1e2accee",
  "@metamask-previews/permission-log-controller": "3.0.1-preview-1e2accee",
  "@metamask-previews/phishing-controller": "12.2.0-preview-1e2accee",
  "@metamask-previews/polling-controller": "11.0.0-preview-1e2accee",
  "@metamask-previews/preferences-controller": "13.1.0-preview-1e2accee",
  "@metamask-previews/profile-sync-controller": "0.9.7-preview-1e2accee",
  "@metamask-previews/queued-request-controller": "5.1.0-preview-1e2accee",
  "@metamask-previews/rate-limit-controller": "6.0.1-preview-1e2accee",
  "@metamask-previews/selected-network-controller": "18.0.2-preview-1e2accee",
  "@metamask-previews/signature-controller": "20.1.0-preview-1e2accee",
  "@metamask-previews/transaction-controller": "37.3.0-preview-1e2accee",
  "@metamask-previews/user-operation-controller": "16.0.0-preview-1e2accee"
}

@bergeron
Copy link
Contributor Author

@metamaskbot publish-preview

Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/accounts-controller": "18.2.2-preview-c6d939c9",
  "@metamask-previews/address-book-controller": "6.0.1-preview-c6d939c9",
  "@metamask-previews/announcement-controller": "7.0.1-preview-c6d939c9",
  "@metamask-previews/approval-controller": "7.1.1-preview-c6d939c9",
  "@metamask-previews/assets-controllers": "40.0.0-preview-c6d939c9",
  "@metamask-previews/base-controller": "7.0.2-preview-c6d939c9",
  "@metamask-previews/build-utils": "3.0.1-preview-c6d939c9",
  "@metamask-previews/chain-controller": "0.1.3-preview-c6d939c9",
  "@metamask-previews/composable-controller": "9.0.1-preview-c6d939c9",
  "@metamask-previews/controller-utils": "11.4.1-preview-c6d939c9",
  "@metamask-previews/ens-controller": "15.0.0-preview-c6d939c9",
  "@metamask-previews/eth-json-rpc-provider": "4.1.6-preview-c6d939c9",
  "@metamask-previews/gas-fee-controller": "22.0.0-preview-c6d939c9",
  "@metamask-previews/json-rpc-engine": "10.0.1-preview-c6d939c9",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.5-preview-c6d939c9",
  "@metamask-previews/keyring-controller": "17.3.0-preview-c6d939c9",
  "@metamask-previews/logging-controller": "6.0.1-preview-c6d939c9",
  "@metamask-previews/message-manager": "11.0.0-preview-c6d939c9",
  "@metamask-previews/multichain": "0.0.0-preview-c6d939c9",
  "@metamask-previews/name-controller": "8.0.1-preview-c6d939c9",
  "@metamask-previews/network-controller": "22.0.0-preview-c6d939c9",
  "@metamask-previews/notification-controller": "7.0.0-preview-c6d939c9",
  "@metamask-previews/notification-services-controller": "0.12.0-preview-c6d939c9",
  "@metamask-previews/permission-controller": "11.0.3-preview-c6d939c9",
  "@metamask-previews/permission-log-controller": "3.0.1-preview-c6d939c9",
  "@metamask-previews/phishing-controller": "12.3.0-preview-c6d939c9",
  "@metamask-previews/polling-controller": "12.0.0-preview-c6d939c9",
  "@metamask-previews/preferences-controller": "13.1.0-preview-c6d939c9",
  "@metamask-previews/profile-sync-controller": "0.9.7-preview-c6d939c9",
  "@metamask-previews/queued-request-controller": "6.0.0-preview-c6d939c9",
  "@metamask-previews/rate-limit-controller": "6.0.1-preview-c6d939c9",
  "@metamask-previews/selected-network-controller": "19.0.0-preview-c6d939c9",
  "@metamask-previews/signature-controller": "21.0.0-preview-c6d939c9",
  "@metamask-previews/transaction-controller": "38.1.0-preview-c6d939c9",
  "@metamask-previews/user-operation-controller": "17.0.0-preview-c6d939c9"
}

@bergeron
Copy link
Contributor Author

@metamaskbot publish-preview

Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/accounts-controller": "18.2.2-preview-fa7d96bb",
  "@metamask-previews/address-book-controller": "6.0.1-preview-fa7d96bb",
  "@metamask-previews/announcement-controller": "7.0.1-preview-fa7d96bb",
  "@metamask-previews/approval-controller": "7.1.1-preview-fa7d96bb",
  "@metamask-previews/assets-controllers": "40.0.0-preview-fa7d96bb",
  "@metamask-previews/base-controller": "7.0.2-preview-fa7d96bb",
  "@metamask-previews/build-utils": "3.0.1-preview-fa7d96bb",
  "@metamask-previews/chain-controller": "0.1.3-preview-fa7d96bb",
  "@metamask-previews/composable-controller": "9.0.1-preview-fa7d96bb",
  "@metamask-previews/controller-utils": "11.4.1-preview-fa7d96bb",
  "@metamask-previews/ens-controller": "15.0.0-preview-fa7d96bb",
  "@metamask-previews/eth-json-rpc-provider": "4.1.6-preview-fa7d96bb",
  "@metamask-previews/gas-fee-controller": "22.0.0-preview-fa7d96bb",
  "@metamask-previews/json-rpc-engine": "10.0.1-preview-fa7d96bb",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.5-preview-fa7d96bb",
  "@metamask-previews/keyring-controller": "17.3.0-preview-fa7d96bb",
  "@metamask-previews/logging-controller": "6.0.1-preview-fa7d96bb",
  "@metamask-previews/message-manager": "11.0.0-preview-fa7d96bb",
  "@metamask-previews/multichain": "0.0.0-preview-fa7d96bb",
  "@metamask-previews/name-controller": "8.0.1-preview-fa7d96bb",
  "@metamask-previews/network-controller": "22.0.0-preview-fa7d96bb",
  "@metamask-previews/notification-controller": "7.0.0-preview-fa7d96bb",
  "@metamask-previews/notification-services-controller": "0.12.0-preview-fa7d96bb",
  "@metamask-previews/permission-controller": "11.0.3-preview-fa7d96bb",
  "@metamask-previews/permission-log-controller": "3.0.1-preview-fa7d96bb",
  "@metamask-previews/phishing-controller": "12.3.0-preview-fa7d96bb",
  "@metamask-previews/polling-controller": "12.0.0-preview-fa7d96bb",
  "@metamask-previews/preferences-controller": "13.1.0-preview-fa7d96bb",
  "@metamask-previews/profile-sync-controller": "0.9.7-preview-fa7d96bb",
  "@metamask-previews/queued-request-controller": "6.0.0-preview-fa7d96bb",
  "@metamask-previews/rate-limit-controller": "6.0.1-preview-fa7d96bb",
  "@metamask-previews/selected-network-controller": "19.0.0-preview-fa7d96bb",
  "@metamask-previews/signature-controller": "21.0.0-preview-fa7d96bb",
  "@metamask-previews/transaction-controller": "38.1.0-preview-fa7d96bb",
  "@metamask-previews/user-operation-controller": "17.0.0-preview-fa7d96bb"
}

Base automatically changed from brian/multichain-currency-rates to main October 30, 2024 00:00
@MetaMask MetaMask deleted a comment from alphachart Oct 30, 2024
@bergeron
Copy link
Contributor Author

@metamaskbot publish-preview

Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/accounts-controller": "18.2.3-preview-699c6b6a",
  "@metamask-previews/address-book-controller": "6.0.1-preview-699c6b6a",
  "@metamask-previews/announcement-controller": "7.0.1-preview-699c6b6a",
  "@metamask-previews/approval-controller": "7.1.1-preview-699c6b6a",
  "@metamask-previews/assets-controllers": "41.0.0-preview-699c6b6a",
  "@metamask-previews/base-controller": "7.0.2-preview-699c6b6a",
  "@metamask-previews/build-utils": "3.0.1-preview-699c6b6a",
  "@metamask-previews/chain-controller": "0.1.3-preview-699c6b6a",
  "@metamask-previews/composable-controller": "9.0.1-preview-699c6b6a",
  "@metamask-previews/controller-utils": "11.4.2-preview-699c6b6a",
  "@metamask-previews/ens-controller": "15.0.0-preview-699c6b6a",
  "@metamask-previews/eth-json-rpc-provider": "4.1.6-preview-699c6b6a",
  "@metamask-previews/gas-fee-controller": "22.0.0-preview-699c6b6a",
  "@metamask-previews/json-rpc-engine": "10.0.1-preview-699c6b6a",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.5-preview-699c6b6a",
  "@metamask-previews/keyring-controller": "17.3.1-preview-699c6b6a",
  "@metamask-previews/logging-controller": "6.0.1-preview-699c6b6a",
  "@metamask-previews/message-manager": "11.0.1-preview-699c6b6a",
  "@metamask-previews/multichain": "0.0.0-preview-699c6b6a",
  "@metamask-previews/name-controller": "8.0.1-preview-699c6b6a",
  "@metamask-previews/network-controller": "22.0.1-preview-699c6b6a",
  "@metamask-previews/notification-controller": "7.0.0-preview-699c6b6a",
  "@metamask-previews/notification-services-controller": "0.12.0-preview-699c6b6a",
  "@metamask-previews/permission-controller": "11.0.3-preview-699c6b6a",
  "@metamask-previews/permission-log-controller": "3.0.1-preview-699c6b6a",
  "@metamask-previews/phishing-controller": "12.3.0-preview-699c6b6a",
  "@metamask-previews/polling-controller": "12.0.1-preview-699c6b6a",
  "@metamask-previews/preferences-controller": "13.2.0-preview-699c6b6a",
  "@metamask-previews/profile-sync-controller": "0.9.7-preview-699c6b6a",
  "@metamask-previews/queued-request-controller": "7.0.0-preview-699c6b6a",
  "@metamask-previews/rate-limit-controller": "6.0.1-preview-699c6b6a",
  "@metamask-previews/selected-network-controller": "19.0.0-preview-699c6b6a",
  "@metamask-previews/signature-controller": "21.0.0-preview-699c6b6a",
  "@metamask-previews/transaction-controller": "38.1.0-preview-699c6b6a",
  "@metamask-previews/user-operation-controller": "17.0.0-preview-699c6b6a"
}

@bergeron bergeron marked this pull request as ready for review November 1, 2024 00:03
@bergeron bergeron requested a review from a team as a code owner November 1, 2024 00:03
@bergeron
Copy link
Contributor Author

bergeron commented Nov 1, 2024

Gonna tweak the changelog. Since fetchAndMapExchangeRatesForUnsupportedNativeCurrency is a private function that is not exported or used elsewhere, I don't think it needs to be in the changelog since it won't affect consumers

@bergeron bergeron enabled auto-merge (squash) November 1, 2024 00:17
@bergeron bergeron merged commit bab1445 into main Nov 1, 2024
119 checks passed
@bergeron bergeron deleted the brian/multichain-token-rates branch November 1, 2024 08:21
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.

2 participants