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: integrate multichain assets rates controller to extension UI #30291

Merged
merged 36 commits into from
Feb 17, 2025

Conversation

salimtb
Copy link
Contributor

@salimtb salimtb commented Feb 13, 2025

Description

This PR aims to integrate the new multichainAssetsRatesControllers into the extension. To achieve this, an upgrade of the assets controller to version 49 is required. As a result, the target branch is set accordingly:
MetaMask PR #30250.

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. open a flask build and add a solana account
  2. check if the polling for the rates is running

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@salimtb salimtb force-pushed the salim/integrate-mutichain-assets-rates-controller branch from 6cd7757 to 48aa482 Compare February 13, 2025 15:52
@salimtb salimtb requested a review from GuillaumeRx February 13, 2025 16:11
@metamaskbot
Copy link
Collaborator

Builds ready [04ae981]
Page Load Metrics (1883 ± 64 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint16422150188112962
domContentLoaded15802114184812862
load16432153188313364
domInteractive25124462813
backgroundConnect1070302010
firstReactRender1675332311
getState659242110
initialActions0452105
loadScripts11361603137010952
setupStore85919178
uiStartup18562333213514168
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.33 KiB (0.02%)
  • ui: 0 Bytes (0.00%)
  • common: 49 Bytes (0.00%)

Copy link
Contributor

@GuillaumeRx GuillaumeRx left a comment

Choose a reason for hiding this comment

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

You need to add the controller name here: https://github.com/MetaMask/metamask-extension/blob/main/app/scripts/controller-init/utils.ts#L39

You might want to wait for https://github.com/MetaMask/metamask-extension/pull/30301to land on main as it will create a merge conflict

sahar-fehri
sahar-fehri previously approved these changes Feb 17, 2025
@sahar-fehri
Copy link
Contributor

Can re-approve once conflicts are resolved after #30301

Copy link
Contributor

@GuillaumeRx GuillaumeRx left a comment

Choose a reason for hiding this comment

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

@salimtb
Copy link
Contributor Author

salimtb commented Feb 17, 2025

You need to add the controller name here: https://github.com/MetaMask/metamask-extension/blob/main/app/scripts/controller-init/utils.ts#L39

You might want to wait for https://github.com/MetaMask/metamask-extension/pull/30301to land on main as it will create a merge conflict

resolved

@salimtb salimtb requested a review from GuillaumeRx February 17, 2025 13:58
@metamaskbot
Copy link
Collaborator

Builds ready [ae46e89]
Page Load Metrics (1513 ± 43 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1346176915148943
domContentLoaded1340175314889043
load1347176715139043
domInteractive22101432411
backgroundConnect95927199
firstReactRender1475292311
getState410721
initialActions00000
loadScripts954129510768441
setupStore55210105
uiStartup14962350174317885
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.35 KiB (0.02%)
  • ui: 0 Bytes (0.00%)
  • common: 49 Bytes (0.00%)

@GuillaumeRx GuillaumeRx added this pull request to the merge queue Feb 17, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 17, 2025
* @param state - Redux state object.
* @returns An object containing non-EVM assets per accounts.
*/
export function getAssetsRates(state: AssetsRatesState) {
Copy link
Contributor

@zone-live zone-live Feb 17, 2025

Choose a reason for hiding this comment

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

Quick question, will this selector replace the existing getMultichainCoinRates
Asking because it's being used in the getMultichainConversionRate
cc @salimtb @ccharly

Copy link
Contributor Author

@salimtb salimtb Feb 17, 2025

Choose a reason for hiding this comment

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

@zone-live The one you mentioned is limited to Native tokens, whereas the one in this PR supports both SPL tokens and Native tokens.
So, the answer is yes—if we need comprehensive data, including SPL tokens, we should use the one in this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you @salimtb 💪🏼

@salimtb salimtb added this pull request to the merge queue Feb 17, 2025
Merged via the queue into main with commit 1f4afda Feb 17, 2025
71 of 73 checks passed
@salimtb salimtb deleted the salim/integrate-mutichain-assets-rates-controller branch February 17, 2025 17:29
@github-actions github-actions bot locked and limited conversation to collaborators Feb 17, 2025
@metamaskbot metamaskbot added the release-12.14.0 Issue or pull request that will be included in release 12.14.0 label Feb 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.14.0 Issue or pull request that will be included in release 12.14.0 team-assets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants