Skip to content
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

Principal - new functions | toSubaccount | toICRC1Text #612

Open
infu opened this issue Jan 28, 2024 · 0 comments
Open

Principal - new functions | toSubaccount | toICRC1Text #612

infu opened this issue Jan 28, 2024 · 0 comments

Comments

@infu
Copy link

infu commented Jan 28, 2024

Since there is now Principal.toLedgerAccount the other most common functions are
toSubaccount
https://github.com/infu/minimal_swap/blob/215217d41d91635a4e4562887ffa37a1e12c339a/swap.mo#L44
https://github.com/dfinity/ic-js/tree/main/packages/ledger-icp#gear-fromprincipal
Used by almost every tokenized canister

toICRC1Text
https://github.com/NatLabs/icrc1/blob/0800c7ac03026a4c5a72eeb357cbbd0aca2f0fb4/src/ICRC1/Account.mo#L83
Will be useful for converting Account to Text Account when validating SNS generic functions and rendering their output.
Useful for the new Identity WG ICRC standards as well (And possibly hardware wallets). https://github.com/dfinity/wg-identity-authentication/blob/main/topics/icrc_21_consent_msg.md

Considering their significance for security, it is essential that they are included in the Motoko Base library.

@infu infu changed the title Principal - new functions Principal - new functions | toSubaccount | toICRC1Text Jan 28, 2024
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

No branches or pull requests

1 participant