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: Add Solana account (Flask only) #13160

Merged
merged 12 commits into from
Jan 24, 2025
Merged

Conversation

owencraston
Copy link
Contributor

@owencraston owencraston commented Jan 23, 2025

Description

  • pre installed the Solana Wallet Snap on mobile
  • include it in the list of pre installed snaps
  • add method to trigger the Solana snap
  • added copy for adding a solana account
  • added the account actions to add a solana account
  • added selectors/functions to determine if the user has solana enabled (default to true on flask) and if they have already created a solana account
  • allow user to add a solana account under the following conditions
    • the client is in flask mode
    • solana is enabled (default to true on flask)
    • the user has not already created a solana account
  • When the current selected account is Solana, we render the network as Solana and make it non selectable (same as we did for Bitcoin until we deal with the MultichainNetworks).

This PR does not...

  • render balances properly
  • disable token list on non evm chains
  • disable dapp connections on non evm chains

Extension references:

Screenshot 2025-01-23 at 1 36 26 PM Screenshot 2025-01-23 at 2 33 51 PM

Related issues

Similar to the Bitcoin work done in this PR

Fixes: https://github.com/MetaMask/accounts-planning/issues/807

Manual testing steps

  • checkout this branch
  • open .js.env
  • set export METAMASK_BUILD_TYPE="flask" // flask
  • source .js.env
  • yarn setup
  • yarn start:ios
  • create/import a wallet
  • open the account menu actions
  • you should see that you can add a solana account along with a BTC and BTC testnet account
  • click Add a new Solana account (Beta)
  • a popup with a suggested name should appear
  • click confirm
  • the newly selected account should be your Solana account and the network picker should show the Solana logo
  • the network should not be clickable
  • open up the account actions again and notice that you can add another Sol account. This is different from Bitcoin which can only support one account.
  • repeat these steps with bitcoin

Testing Production

  • reset your wallet
  • reset your .js.env to have METAMASK_BUILD_TYPE = 'main'
  • rebuild the app
  • create/import wallet
  • open the account actions
  • there should be no mention of Bitcoin or Solana
  • there should be no snaps section in the settings

Screenshots/Recordings

After

Screen.Recording.2025-01-23.at.3.47.35.PM.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

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.

Copy link

socket-security bot commented Jan 23, 2025

Copy link

socket-security bot commented Jan 23, 2025

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: npm/@metamask/[email protected], npm/@metamask/[email protected]

View full report↗︎

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

@owencraston owencraston marked this pull request as ready for review January 23, 2025 23:44
@owencraston owencraston requested review from a team as code owners January 23, 2025 23:44
@owencraston owencraston added the Run Smoke E2E Triggers smoke e2e on Bitrise label Jan 23, 2025
Copy link
Contributor

https://bitrise.io/ Bitrise

🔄🔄🔄 pr_smoke_e2e_pipeline started on Bitrise...🔄🔄🔄

Commit hash: c219b29
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/988d67d3-7d8b-4b6f-b058-ccd4f9582959

Note

  • This comment will auto-update when build completes
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

tommasini
tommasini previously approved these changes Jan 23, 2025
Copy link
Contributor

@tommasini tommasini left a comment

Choose a reason for hiding this comment

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

LGTM

app/components/UI/Navbar/index.js Show resolved Hide resolved
@owencraston
Copy link
Contributor Author

@SocketSecurity ignore npm/@metamask/[email protected]
@SocketSecurity ignore npm/@metamask/[email protected]

These are both internal metamask packages.

.nvmrc Show resolved Hide resolved
@owencraston owencraston added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Jan 24, 2025
Copy link
Contributor

github-actions bot commented Jan 24, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 5939524
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/f16c1fbd-eb2c-4188-aa80-ae222d0e3f1d

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

tommasini
tommasini previously approved these changes Jan 24, 2025
@owencraston owencraston enabled auto-merge January 24, 2025 00:31
@owencraston owencraston added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Jan 24, 2025
Copy link
Contributor

github-actions bot commented Jan 24, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: d42794d
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/c58b68b5-cc82-485e-aa15-dd3cfd22ac23

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

tommasini
tommasini previously approved these changes Jan 24, 2025
@owencraston owencraston added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Jan 24, 2025
aganglada
aganglada previously approved these changes Jan 24, 2025
Copy link

@aganglada aganglada left a comment

Choose a reason for hiding this comment

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

GREAT work! 🎉
QQ, how is the flask build code fence called, how come we are using keyring-snaps

.nvmrc Show resolved Hide resolved
app/core/Multichain/test/utils.test.ts Outdated Show resolved Hide resolved
app/core/Multichain/test/utils.test.ts Outdated Show resolved Hide resolved
app/core/Multichain/test/utils.test.ts Outdated Show resolved Hide resolved
app/selectors/accountsController.ts Outdated Show resolved Hide resolved
locales/languages/en.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@owencraston owencraston added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Jan 24, 2025
Copy link
Contributor

https://bitrise.io/ Bitrise

🔄🔄🔄 pr_smoke_e2e_pipeline started on Bitrise...🔄🔄🔄

Commit hash: d80e63d
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/6ba896f3-3612-451c-8da7-d1bb45a4a120

Note

  • This comment will auto-update when build completes
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@owencraston owencraston added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Jan 24, 2025
Copy link
Contributor

https://bitrise.io/ Bitrise

🔄🔄🔄 pr_smoke_e2e_pipeline started on Bitrise...🔄🔄🔄

Commit hash: 2a3ae96
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/8e935e92-6bf5-4617-9c74-7df43c528209

Note

  • This comment will auto-update when build completes
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@owencraston
Copy link
Contributor Author

@aganglada It works by using this shared custom library inside the metro.transform file. In that file we define the flags that are supported on flask vs main.

@owencraston owencraston added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Jan 24, 2025
Copy link
Contributor

https://bitrise.io/ Bitrise

🔄🔄🔄 pr_smoke_e2e_pipeline started on Bitrise...🔄🔄🔄

Commit hash: 28a35f6
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/e6595176-041f-4335-9752-0f7c5d3d1869

Note

  • This comment will auto-update when build completes
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@owencraston
Copy link
Contributor Author

Screen.Recording.2025-01-24.at.11.25.18.AM.mov

@owencraston owencraston added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Jan 24, 2025
Copy link
Contributor

github-actions bot commented Jan 24, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 867e639
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/113e0d60-c7ce-4038-9ff6-92b6c90d775d

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@owencraston owencraston added this pull request to the merge queue Jan 24, 2025
Merged via the queue into main with commit 6e2d9cf Jan 24, 2025
42 of 43 checks passed
@owencraston owencraston deleted the feat/add-solana-accounts branch January 24, 2025 20:37
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2025
@metamaskbot metamaskbot added the release-7.40.0 Issue or pull request that will be included in release 7.40.0 label Jan 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.40.0 Issue or pull request that will be included in release 7.40.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-accounts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants