Skip to content

feat: create initial @metamask/multichain package - #4812

Merged
adonesky1 merged 8 commits into
mainfrom
initialize-caip-multichain
Oct 21, 2024
Merged

feat: create initial @metamask/multichain package#4812
adonesky1 merged 8 commits into
mainfrom
initialize-caip-multichain

Conversation

@jiexi

@jiexijiexi commented Oct 17, 2024

Copy link
Copy Markdown
Member

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

  • ADDED: Initial skeleton package for @metamask/multichain

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

@GudahttGudahtt left a comment

Copy link
Copy Markdown
Member

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.

@adonesky1
adonesky1force-pushed the controller-utils-isEqualCaseInsensitive branch from 109a7bf to 3c43fceCompareOctober 18, 2024 22:28
@adonesky1
adonesky1 requested a review from a team as a code ownerOctober 18, 2024 22:28
adonesky1 added a commit that referenced this pull request Oct 21, 2024
…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 <markjstacey@gmail.com>
Co-authored-by: Alex Donesky <adonesky@gmail.com>
Base automatically changed from controller-utils-isEqualCaseInsensitive to mainOctober 21, 2024 14:48
adonesky1
adonesky1 previously approved these changes Oct 21, 2024

@adonesky1adonesky1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment threadREADME.md

@GudahttGudahtt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@adonesky1
adonesky1 merged commit 70bd65f into mainOct 21, 2024
@adonesky1
adonesky1 deleted the initialize-caip-multichain branch October 21, 2024 18:57
adonesky1 added a commit that referenced this pull request Nov 13, 2024
…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 <adonesky@gmail.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jiexi@Gudahtt@adonesky1