Skip to content

Commit

Permalink
feat: add label getters
Browse files Browse the repository at this point in the history
  • Loading branch information
heueristik committed Jul 4, 2024
1 parent ce95fd8 commit 00dd867
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Token/Label.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Anoma open;
type Label :=
mkLabel {
name : Nat;
-- TODO This should become a ;String; once `natToString` is implemented.
symbol : String;
decimals : Nat
};
Expand All @@ -21,3 +22,11 @@ Label-Eq : Eq Label :=

getLabel (r : Resource) : Label :=
anomaDecode (Resource.label r);

getName (r : Resource) : Nat := Label.name (getLabel r);

getSymbol (r : Resource) : String :=
Label.symbol (getLabel r);

getDecimals (r : Resource) : Nat :=
Label.decimals (getLabel r);

0 comments on commit 00dd867

Please sign in to comment.