Use new utility method from chain-agnostic-permission package: generateCaip25Caveat#31253
Closed
adonesky1 wants to merge 17 commits intodd/permission-connect-multichain-2from
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. |
|
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
adonesky1
commented
Mar 24, 2025
app/scripts/lib/rpc-method-middleware/handlers/wallet-createSession/handler.ts
Outdated
Show resolved
Hide resolved
4 tasks
Collaborator
|
❌ API Spec Test Failed. View the report here. |
Collaborator
|
❌ API Spec Test Failed. View the report here. |
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
6cd601b to
63409de
Compare
Collaborator
|
❌ API Spec Test Failed. View the report here. |
Contributor
Author
|
Closed 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.
See this core PR where I've adapted some of the helpers to be more chain-agnostic: MetaMask/core#5536
Before:
Screen.Recording.2025-03-24.at.4.19.09.PM.mov
After:
Screen.Recording.2025-03-24.at.4.01.00.PM.mov