(Exchange Interface) Convert Fetch & Update orderbook/ticker methods to return pointers (#398)

* moved order and ticker fetching to return a pointer

* return nil instead of empty struct

* fixed incorrect nil

* general cleanup
This commit is contained in:
Andrew
2019-12-17 15:54:09 +11:00
committed by Adrian Gallagher
parent 44aa1e306c
commit 75ac5ee791
42 changed files with 320 additions and 348 deletions

View File

@@ -22,10 +22,10 @@ type IBotExchange interface {
GetName() string
IsEnabled() bool
SetEnabled(bool)
FetchTicker(currency currency.Pair, assetType asset.Item) (ticker.Price, error)
UpdateTicker(currency currency.Pair, assetType asset.Item) (ticker.Price, error)
FetchOrderbook(currency currency.Pair, assetType asset.Item) (orderbook.Base, error)
UpdateOrderbook(currency currency.Pair, assetType asset.Item) (orderbook.Base, error)
FetchTicker(currency currency.Pair, assetType asset.Item) (*ticker.Price, error)
UpdateTicker(currency currency.Pair, assetType asset.Item) (*ticker.Price, error)
FetchOrderbook(currency currency.Pair, assetType asset.Item) (*orderbook.Base, error)
UpdateOrderbook(currency currency.Pair, assetType asset.Item) (*orderbook.Base, error)
FetchTradablePairs(assetType asset.Item) ([]string, error)
UpdateTradablePairs(forceUpdate bool) error
GetEnabledPairs(assetType asset.Item) currency.Pairs