diff --git a/README.md b/README.md index fbc425c..616e78f 100644 --- a/README.md +++ b/README.md @@ -819,7 +819,7 @@ Frequently asked questions: - Q: Which currencies can I convert to? - - A: The supported fiat currencies for conversion are `AUD`, `BRL`, `CAD`, `CFH`, `CLP`, `CNY`, `CZK`, `DKK`, `EUR`, `GBP`, `HKD`, `HUF`, `IDR`, `ILS`, `INR`, `JPY`, `KRW`, `MXN`, `MYR`, `NOK`, `NZD`, `PLN`, `PHP`, `PKR`, `RUB`, `SEK`, `SGD`, `THB`, `TRY`, `TWD`, `USD`, `ZAR` and `VND`. + - A: The supported fiat currencies for conversion are `AUD`, `BRL`, `CAD`, `CFH`, `CLP`, `CNY`, `CZK`, `DKK`, `EUR`, `GBP`, `HKD`, `HUF`, `IDR`, `ILS`, `INR`, `JPY`, `KRW`, `MXN`, `MYR`, `NOK`, `NZD`, `PLN`, `PHP`, `PKR`, `RUB`, `SEK`, `SGD`, `THB`, `TRY`, `TWD`, `USD`, `VND`, and `ZAR`. The supported crypto currencies for conversion are `BTC` and `ETH`. diff --git a/cointop/common/api/impl/coingecko/coingecko.go b/cointop/common/api/impl/coingecko/coingecko.go index 38e0832..cf03e91 100644 --- a/cointop/common/api/impl/coingecko/coingecko.go +++ b/cointop/common/api/impl/coingecko/coingecko.go @@ -252,25 +252,26 @@ func (s *Service) CoinLink(name string) string { // SupportedCurrencies returns a list of supported currencies func (s *Service) SupportedCurrencies() []string { + + // keep these in alphabetical order return []string{ - "BTC", - "ETH", - "BNB", - "EOS", - "USD", "AED", "ARS", "AUD", "BDT", "BHD", "BMD", + "BNB", "BRL", + "BTC", "CAD", "CHF", "CLP", "CNY", "CZK", "DKK", + "EOS", + "ETH", "EUR", "GBP", "HKD", @@ -297,11 +298,11 @@ func (s *Service) SupportedCurrencies() []string { "THB", "TRY", "TWD", + "USD", "VEF", "VND", - "ZAR", - "XDR", "XAG", - "VND", + "XDR", + "ZAR", } } diff --git a/cointop/common/api/impl/coinmarketcap/coinmarketcap.go b/cointop/common/api/impl/coinmarketcap/coinmarketcap.go index 69222b3..6cd0646 100644 --- a/cointop/common/api/impl/coinmarketcap/coinmarketcap.go +++ b/cointop/common/api/impl/coinmarketcap/coinmarketcap.go @@ -192,17 +192,19 @@ func (s *Service) CoinLink(name string) string { // SupportedCurrencies returns a list of supported currencies func (s *Service) SupportedCurrencies() []string { + + // keep these in alphabetical order return []string{ - "BTC", - "ETH", "AUD", "BRL", + "BTC", "CAD", "CFH", "CLP", "CNY", "CZK", "DKK", + "ETH", "EUR", "GBP", "HKD", @@ -216,9 +218,9 @@ func (s *Service) SupportedCurrencies() []string { "MYR", "NOK", "NZD", - "PLN", "PHP", "PKR", + "PLN", "RUB", "SEK", "SGD", @@ -226,7 +228,7 @@ func (s *Service) SupportedCurrencies() []string { "TRY", "TWD", "USD", - "ZAR", "VND", + "ZAR", } } diff --git a/cointop/conversion.go b/cointop/conversion.go index 694d808..a125b93 100644 --- a/cointop/conversion.go +++ b/cointop/conversion.go @@ -9,6 +9,7 @@ import ( "github.com/miguelmota/cointop/cointop/common/pad" ) +// keep these in alphabetical order var fiatCurrencyNames = map[string]string{ "AUD": "Australian Dollar", "BRL": "Brazilian Real", @@ -41,8 +42,8 @@ var fiatCurrencyNames = map[string]string{ "TRY": "Turkish lira", "TWD": "New Taiwan Dollar", "USD": "US Dollar", + "VND": "Vietnamese Dong", "ZAR": "South African Rand", - "VND": "Vietnamese đồng", } var cryptocurrencyNames = map[string]string{ @@ -50,6 +51,7 @@ var cryptocurrencyNames = map[string]string{ "ETH": "Ethereum", } +// keep these in alphabetical order var currencySymbolMap = map[string]string{ "AUD": "$", "BRL": "R$", @@ -84,8 +86,8 @@ var currencySymbolMap = map[string]string{ "TRY": "₺", "TWD": "NT$", "USD": "$", - "ZAR": "R", "VND": "₫", + "ZAR": "R", } var alphanumericcharacters = []rune{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}