From 45870512bfbeb21300e241c9d8345ede72fc1824 Mon Sep 17 00:00:00 2001 From: miiu Date: Thu, 30 May 2024 14:12:58 +0300 Subject: [PATCH] string method --- core/constants.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/core/constants.go b/core/constants.go index e022eea3..e1861bee 100644 --- a/core/constants.go +++ b/core/constants.go @@ -214,6 +214,30 @@ const ( DynamicMeta ) +// String will convert number type in string +func (t ESDTType) String() string { + switch t { + case Fungible: + return FungibleESDT + case NonFungible: + return NonFungibleESDT + case NonFungibleV2: + return NonFungibleESDTv2 + case SemiFungible: + return SemiFungibleESDT + case MetaFungible: + return MetaESDT + case DynamicNFT: + return DynamicNFTESDT + case DynamicSFT: + return DynamicSFTESDT + case DynamicMeta: + return DynamicMetaESDT + default: + return "Unknown" + } +} + // FungibleESDT defines the string for the token type of fungible ESDT const FungibleESDT = "FungibleESDT"