From 5306c6b3d3c27fd0cb98f37f6ef6b2c81374af4d Mon Sep 17 00:00:00 2001 From: Manuel Kreutz Date: Sun, 9 Apr 2017 16:16:54 -0400 Subject: [PATCH] support currency pair notation without - (used by AllActiveExchangesAndCurrencies) --- exchanges/gdax/gdax_wrapper.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exchanges/gdax/gdax_wrapper.go b/exchanges/gdax/gdax_wrapper.go index 56631a3b..831ee06d 100644 --- a/exchanges/gdax/gdax_wrapper.go +++ b/exchanges/gdax/gdax_wrapper.go @@ -1,6 +1,7 @@ package gdax import ( + "fmt" "log" "time" @@ -80,6 +81,9 @@ func (e *GDAX) GetExchangeAccountInfo() (exchange.ExchangeAccountInfo, error) { } func (g *GDAX) GetTickerPrice(currency string) (ticker.TickerPrice, error) { + if len(currency) == 6 { + currency = fmt.Sprintf("%s-%s", currency[0:3], currency[3:]) + } tickerNew, err := ticker.GetTicker(g.GetName(), currency[0:3], currency[4:]) if err == nil { return tickerNew, nil