From 51f19a60e18f7ad7a4dae1ecf4333ae6377d62db Mon Sep 17 00:00:00 2001 From: Denis <136321897+defisaur@users.noreply.github.com> Date: Mon, 14 Aug 2023 19:03:41 +0400 Subject: [PATCH] new tokens (#118) * new coins * new coins * new coins * new coins --- coin/models.go | 2 ++ types/chain.go | 2 ++ types/token.go | 8 ++++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/coin/models.go b/coin/models.go index 4651a12..cf49920 100644 --- a/coin/models.go +++ b/coin/models.go @@ -153,6 +153,8 @@ func GetCoinExploreURL(c Coin, tokenID, tokenType string) (string, error) { return fmt.Sprintf("https://blockscout.acala.network/token/%s", tokenID), nil case BASE: return fmt.Sprintf("https://basescan.org/token/%s", tokenID), nil + case CARDANO: + return fmt.Sprintf("https://cexplorer.io/asset/%s", tokenID), nil } return "", errors.New("no explorer for coin: " + c.Handle) diff --git a/types/chain.go b/types/chain.go index 7620101..4ac5731 100644 --- a/types/chain.go +++ b/types/chain.go @@ -137,6 +137,8 @@ func GetChainFromAssetType(assetType string) (coin.Coin, error) { return coin.Juno(), nil case SEI: return coin.Sei(), nil + case CARDANO: + return coin.Cardano(), nil } return coin.Coin{}, errors.New("unknown asset type: " + assetType) diff --git a/types/token.go b/types/token.go index 4cdfb22..9d46a76 100644 --- a/types/token.go +++ b/types/token.go @@ -75,7 +75,7 @@ const ( STELLAR TokenType = "STELLAR" KRC20 TokenType = "KRC20" AURORA TokenType = "AURORA" - ALGORAND TokenType = "ALGORAND" + ALGORAND TokenType = "ASA" KAVAERC20 TokenType = "KAVAERC20" METER TokenType = "METER" EVMOS_ERC20 TokenType = "EVMOS_ERC20" @@ -102,6 +102,7 @@ const ( AXELAR TokenType = "AXL" JUNO TokenType = "JUNO" SEI TokenType = "SEI" + CARDANO TokenType = "CARDANO" ) const ( @@ -192,6 +193,7 @@ func GetTokenTypes() []TokenType { AXELAR, JUNO, SEI, + CARDANO, } } @@ -279,6 +281,8 @@ func GetTokenType(c uint, tokenID string) (string, bool) { return string(JUNO), true case coin.SEI: return string(SEI), true + case coin.CARDANO: + return string(CARDANO), true default: return "", false } @@ -331,7 +335,7 @@ func GetTokenVersion(tokenType string) (TokenVersion, error) { return TokenVersionV13, nil case BRC20, ERC721, ERC1155, EOS, NEP5, VET, ONTOLOGY, THETA, TOMO, POA, OASIS, ALGORAND, KAVAERC20, METER, EVMOS_ERC20, KIP20, MOONBEAM, KLAYTN, METIS, MOONRIVER, BOBA, STRIDE, NEUTRON, FA2, CFXEVM, - ACA: + ACA, CARDANO: return TokenVersionUndefined, nil default: // This should not happen, as it is guarded by TestGetTokenVersionImplementEverySupportedTokenTypes