mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
Added IsFiatCurrency function.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user