feat: Add multichain connection capabilities#31203
Closed
Conversation
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. |
c1bb79d to
962fcfe
Compare
4 tasks
adonesky1
reviewed
Mar 25, 2025
Contributor
There was a problem hiding this comment.
Going to move versions of these helpers into the @metamask/chain-agnostic-permission package in a subsequent PR
adonesky1
added a commit
to MetaMask/core
that referenced
this pull request
Mar 25, 2025
…aip25 permission (#5536) ## Explanation Currently the utility/helper functions we expose to interface with and help construct a valid caip25 permission caveat are very eth/evm centric (i.e. `setPermittedAccounts`, `addPermittedEthChainId`, `getPermittedEthChainIds` etc) This PR adds some new helpers that are actually chain agnostic ## References see @david0xd 's PR [here](MetaMask/metamask-extension#31203) and my extension PR ontop of it that uses these changes: MetaMask/metamask-extension#31253 ### `@metamask/chain-agnostic-permission` - **CHANGED**: Renamed `caip-permission-adapter-eth-accounts.ts` to `caip-permission-adapter-accounts.ts` to better reflect its more generalized functionality. - **ADDED**: New `setPermittedAccounts` function that allows setting accounts for any CAIP namespace, not just EVM scopes. - **ADDED**: New `addPermittedChainId` and `setPermittedChainIds` functions for managing permitted chains across any CAIP namespace. - **ADDED**: New `generateCaip25Caveat` function to simplify modification of CAIP-25 permissions after UI confirmation. - **ADDED**: New `isWalletScope` utility function to detect wallet-related scopes. ## 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
d7a7d15 to
18cfedb
Compare
Contributor
|
Closing in favor of #31326 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds support for multichain dapp connections.
Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/3660
Manual testing steps
Screenshots/Recordings
Before
For previous version look at description of this PR: #30164
After
Connecting to Solana (CAIP)
Screen.Recording.2025-03-21.at.17.46.30.mov
Connecting to Solana and EVM (CAIP)
Screen.Recording.2025-03-21.at.18.43.28.mov
Connecting to EVM (CAIP)
Screen.Recording.2025-03-21.at.17.51.50.mov
Old (legacy) connection flow
Screen.Recording.2025-03-21.at.17.55.15.mov
Pre-merge author checklist
Pre-merge reviewer checklist