support currency pair notation without - (used by AllActiveExchangesAndCurrencies)

This commit is contained in:
Manuel Kreutz
2017-04-09 16:16:54 -04:00
parent 4b6c1f8b6c
commit 5306c6b3d3

View File

@@ -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