Added IsFiatCurrency function.

This commit is contained in:
Adrian Gallagher
2015-05-15 15:31:53 +10:00
parent b0b119d790
commit 13379ed0fe

View File

@@ -42,11 +42,19 @@ const (
var (
CurrencyStore YahooJSONResponse
BaseCurrencies string
ErrCurrencyDataNotFetched = errors.New("Yahoo currency data has not been fetched yet.")
ErrCurrencyNotFound = errors.New("Unable to find specified currency.")
ErrQueryingYahoo = errors.New("Unable to query Yahoo currency values.")
)
func IsFiatCurrency(currency string) bool {
if StringContains(BaseCurrencies, StringToUpper(currency)) {
return true
}
return false
}
func RetrieveConfigCurrencyPairs(config Config) error {
currencyPairs := ""
for _, exchange := range config.Exchanges {
@@ -69,6 +77,7 @@ func RetrieveConfigCurrencyPairs(config Config) error {
}
}
currencyPairs = currencyPairs[0 : len(currencyPairs)-1]
BaseCurrencies = currencyPairs
err := QueryYahooCurrencyValues(currencyPairs)
if err != nil {