diff --git a/dealer/dealer.go b/dealer/dealer.go index 8843162..748c5f9 100644 --- a/dealer/dealer.go +++ b/dealer/dealer.go @@ -270,7 +270,7 @@ func (bot *Dealer) getExchange(x interface{}) exchange.IBotExchange { // +----------------------+ // GetActiveOrders function is a wrapper around the GetActiveOrders function in the exchange package. -func (bot *Dealer) GetActiveOrders(ctx context.Context, exchangeOrName interface{}, request order.GetOrdersRequest) ([]order.Detail, error) { +func (bot *Dealer) GetActiveOrders(ctx context.Context, exchangeOrName interface{}, request order.MultiOrderRequest) ([]order.Detail, error) { e := bot.getExchange(exchangeOrName) timer := time.Now() diff --git a/dealer/exchange_factory.go b/dealer/exchange_factory.go index b784058..d956b83 100644 --- a/dealer/exchange_factory.go +++ b/dealer/exchange_factory.go @@ -1,18 +1,11 @@ package dealer import ( - "errors" - exchange "github.com/thrasher-corp/gocryptotrader/exchanges" ) -var ErrCreatorNotRegistered = errors.New("exchange creator not registered") - -type ( - ExchangeFactory func(name string) (exchange.IBotExchange, error) -) - -// NewExchangeByName implements gocryptotrader/engine.CustomExchangeBuilder. -func (e ExchangeFactory) NewExchangeByName(name string) (exchange.IBotExchange, error) { - return e(name) +// ExchangeFactory defines an interface for creating exchange instances. +// It abstracts the instantiation process, allowing for flexible and dynamic creation of different exchanges based on a given name. +type ExchangeFactory interface { + NewExchangeByName(name string) (exchange.IBotExchange, error) }