-
-
Notifications
You must be signed in to change notification settings - Fork 201
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: create initial @metamask/multichain
package
#4812
Conversation
Co-authored-by: Mark Stacey <[email protected]>
…e-caip-multichain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍 Can approve after the base is merged.
109a7bf
to
3c43fce
Compare
…4811) ## Explanation Moves `isEqualCaseInsensitive()` from assets-controllers into controller-utils because it will be used elsewhere downstream ## References Upstream: None. This is the start. Downstream: #4812 ## Changelog <!-- If you're making any consumer-facing changes, list those changes here as if you were updating a changelog, using the template below as a guide. (CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or FIXED. For security-related issues, follow the Security Advisory process.) Please take care to name the exact pieces of the API you've added or changed (e.g. types, interfaces, functions, or methods). If there are any breaking changes, make sure to offer a solution for consumers to follow once they upgrade to the changes. Finally, if you're only making changes to development scripts or tests, you may replace the template below with "None". --> ### `@metamask/controller-utils` - **ADDED**: Export `isEqualCaseInsensitive()` helper which performs case insensitive comparison against two strings and returns true if they are equivalent. ## Checklist - [X] I've updated the test suite for new or updated code as appropriate - [X] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [X] I've highlighted breaking changes using the "BREAKING" category above as appropriate - [X] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes --------- Co-authored-by: Mark Stacey <[email protected]> Co-authored-by: Alex Donesky <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…4784) ## Explanation This PR updates `@metamask/multichain` to provide types, CAIP-25 permission, and helpers/adapters for the new permission, which can be shared across the extension & mobile clients. These tools and utilities will be used in both clients (mobile + extension)'s multichain API implementations. ### File Overview * `packages/multichain/src/adapters/`: Helpers that get and set legacy permission values from and to the new CAIP-25 permission * `packages/multichain/src/caip25Permission.ts`: Constants, types, mutators, and a specification builder for a CAIP-25 permission * `packages/multichain/src/index.ts`: Barrel export * `packages/multichain/src/scope/`: Types for [CAIP-217 ](https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-217.md) and our internal normalized/flattened version of them. Additionally contains helpers for validating shape, normalizing/merging, and checking support (i.e. if the wallet is able to serve the chain with it's requested methods and notifications) ## References Upstream: #4812 Downstream: #4813 Key Multichain API Standards implemented here: - [CAIP-217](https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-217.md) - `scope` defintion Open PR that uses this new package for migrating the legacy permissions to CAIP-25 permission in the extension: MetaMask/metamask-extension#27847 ## Changelog ### `@metamask/multichain` - **ADDED**: TODO ## Checklist - [X] I've updated the test suite for new or updated code as appropriate - [X] 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 - [X] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes --------- Co-authored-by: Alex <[email protected]> Co-authored-by: Mark Stacey <[email protected]> Co-authored-by: Elliot Winkler <[email protected]>
Explanation
Creates the initial (empty)
@metamask/multichain
package to make downstream additions to this package easier to review.References
Upstream: #4811
Downstream: #4784
Changelog
@metamask/multichain
@metamask/multichain
Checklist