generated from MetaMask/metamask-module-template
-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add additional CAIP-19 types and parsing functions to align wit…
…h proposal (#227) Added full support for [CAIP-19 Asset IDs](https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-19.md) including the necessary regex, structs, and parsing functions. A few notes: - While the regex of a chain namespace is technically the same as an asset namespace, the official proposal makes a clear distinction between the two, and so it's within the spirit of the spec to break these out into separate properties. The same cannot be said for a chain reference vs asset reference: these require different regex for validation. - Previously, `CaipAssetId` required a tokenId (`/${string}`) to be present. This has been changed to allow for tokenId to be optional (as dictated by the official proposal) in both the type and its corresponding regex string - For completeness, `toCaipAccountId` and `parseCaipAssetId` functions were added
- Loading branch information
Showing
6 changed files
with
864 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.