mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-04 15:10:54 +00:00
Currency: Add new forex provider exchangerate.host (#682)
* Add new forex provider ExchangeRateHost.io * Fix linter paramTypeComine * Add templates and README files * Convert all times to UTC * Fix cosmetic issue and address nits * Add support for fx exchangerate.host engine override * Address nit plus use remove plural
This commit is contained in:
@@ -313,6 +313,7 @@ func PrintSettings(s *Settings) {
|
||||
gctlog.Debugf(gctlog.Global, "\t Enable currency layer: %v", s.EnableCurrencyLayer)
|
||||
gctlog.Debugf(gctlog.Global, "\t Enable fixer: %v", s.EnableFixer)
|
||||
gctlog.Debugf(gctlog.Global, "\t Enable OpenExchangeRates: %v", s.EnableOpenExchangeRates)
|
||||
gctlog.Debugf(gctlog.Global, "\t Enable ExchangeRateHost: %v", s.EnableExchangeRateHost)
|
||||
gctlog.Debugf(gctlog.Global, "- EXCHANGE SETTINGS:")
|
||||
gctlog.Debugf(gctlog.Global, "\t Enable exchange auto pair updates: %v", s.EnableExchangeAutoPairUpdates)
|
||||
gctlog.Debugf(gctlog.Global, "\t Disable all exchange auto pair updates: %v", s.DisableExchangeAutoPairUpdates)
|
||||
@@ -412,13 +413,15 @@ func (bot *Engine) Start() error {
|
||||
bot.Settings.EnableCurrencyConverter ||
|
||||
bot.Settings.EnableCurrencyLayer ||
|
||||
bot.Settings.EnableFixer ||
|
||||
bot.Settings.EnableOpenExchangeRates {
|
||||
bot.Settings.EnableOpenExchangeRates ||
|
||||
bot.Settings.EnableExchangeRateHost {
|
||||
err = currency.RunStorageUpdater(currency.BotOverrides{
|
||||
Coinmarketcap: bot.Settings.EnableCoinmarketcapAnalysis,
|
||||
FxCurrencyConverter: bot.Settings.EnableCurrencyConverter,
|
||||
FxCurrencyLayer: bot.Settings.EnableCurrencyLayer,
|
||||
FxFixer: bot.Settings.EnableFixer,
|
||||
FxOpenExchangeRates: bot.Settings.EnableOpenExchangeRates,
|
||||
FxExchangeRateHost: bot.Settings.EnableExchangeRateHost,
|
||||
},
|
||||
¤cy.MainConfiguration{
|
||||
ForexProviders: bot.Config.GetForexProviders(),
|
||||
@@ -563,7 +566,8 @@ func (bot *Engine) Stop() {
|
||||
bot.Settings.EnableCurrencyConverter ||
|
||||
bot.Settings.EnableCurrencyLayer ||
|
||||
bot.Settings.EnableFixer ||
|
||||
bot.Settings.EnableOpenExchangeRates {
|
||||
bot.Settings.EnableOpenExchangeRates ||
|
||||
bot.Settings.EnableExchangeRateHost {
|
||||
if err := currency.ShutdownStorageUpdater(); err != nil {
|
||||
gctlog.Errorf(gctlog.Global, "ExchangeSettings storage system. Error: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user