-
Notifications
You must be signed in to change notification settings - Fork 59
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
Feature: CIP20 helper functions + StringUtils #1427
Conversation
|
d50b4fe
to
87d4e70
Compare
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.
Great work @rhyslbw 👏
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.
Great job @rhyslbw, love the comments ❤️
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.
Great work!
6275d5e
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.
Great work!
8b6ecc7
- `toCIP20Metadata` to convert messages to transaction metadata, supporting both an array of strings or single string that will be chunked if > 64 bytes. - `validateMessage` to ensure the correct type and size compliance, compatible with JS runtime validation - `CIP_20_METADATUM_LABEL` is exported for reference
Context
When fixing input-output-hk/lace#978 I discovered there's more we can be doing in the SDK to help applications produce compliant CIP-20 transaction metadata. I've fixed the immediate issue here input-output-hk/lace#1379, but there were no tests and I would rather put energy into removing the responsibility from Lace altogether.
https://github.com/input-output-hk/lace/blob/e877d4668c02ae647ed39293f05233d0ac513663/packages/cardano/src/wallet/lib/get-auxiliary-data.ts#L1-L74
N.B. This implementation is based on https://cips.cardano.org/cip/CIP-20 which defines a format to support multi-entry messages, whereas Lace currently only has good support for single entry (with a split to handle > 64 bytes). To adopt this solution we will be considering changing to a multi-line input field.
Proposed Solution
See commit messages
Important Changes Introduced
See commits