mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-29 15:10:37 +00:00
engine/exchange manager: Add support for custom exchanges (#749)
* engine: Setup exchange manager earlier So it's available for applications before starting. * engine: Add a custom exchange builder interface Allows applications that import GCT as a lib to build new custom exchanges without further modifications.
This commit is contained in:
@@ -105,6 +105,8 @@ func NewFromSettings(settings *Settings, flagSet map[string]bool) (*Engine, erro
|
||||
return nil, fmt.Errorf("failed to create script manager. Err: %s", err)
|
||||
}
|
||||
|
||||
b.ExchangeManager = SetupExchangeManager()
|
||||
|
||||
validateSettings(&b, settings, flagSet)
|
||||
|
||||
return &b, nil
|
||||
@@ -363,7 +365,6 @@ func (bot *Engine) Start() error {
|
||||
bot.Config.PurgeExchangeAPICredentials()
|
||||
}
|
||||
|
||||
bot.ExchangeManager = SetupExchangeManager()
|
||||
gctlog.Debugln(gctlog.Global, "Setting up exchanges..")
|
||||
err = bot.SetupExchanges()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user