Skip to content

Conversation

@erwolff
Copy link
Contributor

@erwolff erwolff commented Dec 12, 2024

Added full support for CAIP-19 Asset IDs 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

@erwolff erwolff force-pushed the feat/add-additional-caip-types branch from 78ea315 to 8b22bb4 Compare December 12, 2024 21:40
@erwolff erwolff merged commit 48267f8 into main Dec 13, 2024
17 checks passed
@erwolff erwolff deleted the feat/add-additional-caip-types branch December 13, 2024 16:36
Sign up for free to 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