MetaMask / core

This monorepo is a collection of packages used across multiple MetaMask clients
MIT License
293 stars 188 forks source link

feat: use crypto compare multi api for currency rate controller #4852

Closed bergeron closed 3 weeks ago

bergeron commented 4 weeks ago

Explanation

Updates the currency rate controller to use the pricemulti endpoint of crypto compare. This allows us to fetch exchange rates for multiple native currencies in a single http request.

References

Changelog

@metamask/assets-controllers

Checklist

legobeat commented 4 weeks ago

Would it be viable to make the public API less tightly coupled to Crypto Compare API?

Would make it less involved to make future changes and make it more flexible and robust at the same time.

Related: https://github.com/MetaMask/core/pull/4852/files#r1817508642

bergeron commented 3 weeks ago

Would it be viable to make the public API less tightly coupled to Crypto Compare API?

Can you explain what you're thinking? The crypto compare stuff is already behind a separate service with generic interfaces for fetchExchangeRate and fetchMultiExchangeRate.

bergeron commented 3 weeks ago

@metamaskbot publish-preview

github-actions[bot] commented 3 weeks ago

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-9e22b9bb", "@metamask-previews/address-book-controller": "6.0.1-preview-9e22b9bb", "@metamask-previews/announcement-controller": "7.0.1-preview-9e22b9bb", "@metamask-previews/approval-controller": "7.1.0-preview-9e22b9bb", "@metamask-previews/assets-controllers": "39.0.0-preview-9e22b9bb", "@metamask-previews/base-controller": "7.0.1-preview-9e22b9bb", "@metamask-previews/build-utils": "3.0.1-preview-9e22b9bb", "@metamask-previews/chain-controller": "0.1.3-preview-9e22b9bb", "@metamask-previews/composable-controller": "9.0.1-preview-9e22b9bb", "@metamask-previews/controller-utils": "11.4.0-preview-9e22b9bb", "@metamask-previews/ens-controller": "14.0.1-preview-9e22b9bb", "@metamask-previews/eth-json-rpc-provider": "4.1.5-preview-9e22b9bb", "@metamask-previews/gas-fee-controller": "21.0.0-preview-9e22b9bb", "@metamask-previews/json-rpc-engine": "10.0.0-preview-9e22b9bb", "@metamask-previews/json-rpc-middleware-stream": "8.0.4-preview-9e22b9bb", "@metamask-previews/keyring-controller": "17.3.0-preview-9e22b9bb", "@metamask-previews/logging-controller": "6.0.1-preview-9e22b9bb", "@metamask-previews/message-manager": "11.0.0-preview-9e22b9bb", "@metamask-previews/multichain": "0.0.0-preview-9e22b9bb", "@metamask-previews/name-controller": "8.0.1-preview-9e22b9bb", "@metamask-previews/network-controller": "22.0.0-preview-9e22b9bb", "@metamask-previews/notification-controller": "7.0.0-preview-9e22b9bb", "@metamask-previews/notification-services-controller": "0.12.0-preview-9e22b9bb", "@metamask-previews/permission-controller": "11.0.2-preview-9e22b9bb", "@metamask-previews/permission-log-controller": "3.0.1-preview-9e22b9bb", "@metamask-previews/phishing-controller": "12.2.0-preview-9e22b9bb", "@metamask-previews/polling-controller": "11.0.0-preview-9e22b9bb", "@metamask-previews/preferences-controller": "13.1.0-preview-9e22b9bb", "@metamask-previews/profile-sync-controller": "0.9.7-preview-9e22b9bb", "@metamask-previews/queued-request-controller": "5.1.0-preview-9e22b9bb", "@metamask-previews/rate-limit-controller": "6.0.1-preview-9e22b9bb", "@metamask-previews/selected-network-controller": "18.0.2-preview-9e22b9bb", "@metamask-previews/signature-controller": "20.1.0-preview-9e22b9bb", "@metamask-previews/transaction-controller": "37.3.0-preview-9e22b9bb", "@metamask-previews/user-operation-controller": "16.0.0-preview-9e22b9bb" } ```