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: multichain token detection #28380

Closed
wants to merge 3 commits into from

Conversation

salimtb
Copy link
Contributor

@salimtb salimtb commented Nov 8, 2024

Description

TokenDetectionController is responsible for detecting and keeping an updated list of all tokens across supported chains. This dataset is stored in the detectedTokens state variable within Metamask’s state. After completing this task, token detection will be enhanced by implementing periodic polling across all networks linked to the wallet, resulting in a more comprehensive dataset available to users.

For each network added to the wallet, the polling loop will receive the network as a parameter and execute token autodetection for it. Once results are available, they will be stored in detectedTokensAllChains, organized by chainId. This approach enables us to retrieve a comprehensive list of detected tokens across all networks.

This should now be working to test locally. Here's some steps to run this locally with core PR:

  1. Ensure you build this corresponding core PR using yarn build
  2. Link resolution of assets-controllers in package.json: "@metamask/assets-controllers": "../core/packages/assets-controllers",

Open in GitHub Codespaces

Related issues

Fixes: #3431

Manual testing steps

  1. Attach the mentioned core PR to this one on the package json ( follow the instruction here )
  2. install dependencies using yarn
  3. start the project using PORTFOLIO_VIEW=1 yarn start
  4. add other networks where you have tokens
  5. the autodetection should be multichain

Screenshots/Recordings

Before

After

Screen.Recording.2024-11-08.at.14.27.23.mov

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

github-actions bot commented Nov 8, 2024

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 changed the title Salim/multichain token detection final feat: multichain token detection Nov 8, 2024
@salimtb salimtb force-pushed the salim/multichain-token-detection-final branch from 4583bad to 1b8fe67 Compare November 8, 2024 13:34
@salimtb salimtb marked this pull request as ready for review November 8, 2024 13:53
@salimtb salimtb requested review from a team as code owners November 8, 2024 13:53
@salimtb salimtb force-pushed the salim/multichain-token-detection-final branch from 1b8fe67 to fde2ca2 Compare November 8, 2024 14:01
@metamaskbot
Copy link
Collaborator

Builds ready [fde2ca2]
Page Load Metrics (2038 ± 79 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint44023261955384184
domContentLoaded16852313200116981
load17392328203816579
domInteractive24109512110
backgroundConnect797352813
firstReactRender603041275326
getState457242110
initialActions01000
loadScripts12021711146913766
setupStore68412178
uiStartup189629382314248119
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 126 Bytes (0.00%)
  • ui: 2.28 KiB (0.03%)
  • common: 620 Bytes (0.01%)

@metamaskbot
Copy link
Collaborator

Builds ready [e899713]
Page Load Metrics (1965 ± 125 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint171128091969255122
domContentLoaded165227371932241116
load166128111965259125
domInteractive21106472211
backgroundConnect7127343617
firstReactRender512631194320
getState45516168
initialActions01000
loadScripts113922081411232111
setupStore558202010
uiStartup184930172208273131
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 126 Bytes (0.00%)
  • ui: 2.28 KiB (0.03%)
  • common: 620 Bytes (0.01%)

@salimtb
Copy link
Contributor Author

salimtb commented Nov 13, 2024

closing this PR because the changes has been moved to #28444

@salimtb salimtb closed this Nov 13, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants