Skip to content

Commit

Permalink
new tokens (#118)
Browse files Browse the repository at this point in the history
* new coins

* new coins

* new coins

* new coins
  • Loading branch information
defisaur authored Aug 14, 2023
1 parent 18c13ba commit 51f19a6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions coin/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions types/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 6 additions & 2 deletions types/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -102,6 +102,7 @@ const (
AXELAR TokenType = "AXL"
JUNO TokenType = "JUNO"
SEI TokenType = "SEI"
CARDANO TokenType = "CARDANO"
)

const (
Expand Down Expand Up @@ -192,6 +193,7 @@ func GetTokenTypes() []TokenType {
AXELAR,
JUNO,
SEI,
CARDANO,
}
}

Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 51f19a6

Please sign in to comment.