Skip to content

Commit

Permalink
Add some helper methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreibancioiu committed Jun 24, 2022
1 parent ef381f5 commit 3c1ff02
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/smartcontracts/typesystem/tokenIdentifier.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { PrimitiveType, PrimitiveValue } from "./types";

const EGLDTokenIdentifier = "EGLD";

export class TokenIdentifierType extends PrimitiveType {
static ClassName = "TokenIdentifierType";

Expand All @@ -21,6 +23,14 @@ export class TokenIdentifierValue extends PrimitiveValue {
this.value = value;
}

static egld(): TokenIdentifierValue {
return new TokenIdentifierValue(EGLDTokenIdentifier)
}

static esdtTokenIdentifier(identifier: string): TokenIdentifierValue {
return new TokenIdentifierValue(identifier);
}

getClassName(): string {
return TokenIdentifierValue.ClassName;
}
Expand Down

0 comments on commit 3c1ff02

Please sign in to comment.