Fix Binance/Bithumb ticker/orderbook

This commit is contained in:
Adrian Gallagher
2018-02-02 09:28:33 +11:00
parent e3b4d55af6
commit b109c18e5e
3 changed files with 3 additions and 10 deletions

View File

@@ -437,12 +437,6 @@ func (b *Binance) SendAuthHTTPRequest(method, path string, params url.Values, re
hmacSignedStr := common.HexEncodeToString(hmacSigned)
params.Set("signature", hmacSignedStr)
if b.Nonce.Get() == 0 {
b.Nonce.Set(time.Now().UnixNano() / int64(time.Millisecond))
} else {
b.Nonce.Inc()
}
headers := make(map[string]string)
headers["X-MBX-APIKEY"] = b.APIKey
headers["Content-Type"] = "application/x-www-form-urlencoded"

View File

@@ -40,7 +40,7 @@ func (b *Binance) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Pr
tickerPrice.High = tick.HighPrice
tickerPrice.Last = tick.LastPrice
tickerPrice.Low = tick.LowPrice
tickerPrice.Volume = tick.LastQty
tickerPrice.Volume = tick.Volume
ticker.ProcessTicker(b.GetName(), p, tickerPrice, assetType)
@@ -68,9 +68,7 @@ func (b *Binance) GetOrderbookEx(currency pair.CurrencyPair, assetType string) (
// UpdateOrderbook updates and returns the orderbook for a currency pair
func (b *Binance) UpdateOrderbook(p pair.CurrencyPair, assetType string) (orderbook.Base, error) {
var orderBook orderbook.Base
currency := p.GetFirstCurrency().String()
orderbookNew, err := b.GetOrderBook(currency, 1000)
orderbookNew, err := b.GetOrderBook(p.Pair().String(), 1000)
if err != nil {
return orderBook, err
}

View File

@@ -62,6 +62,7 @@ func (b *Bithumb) SetDefaults() {
b.RequestCurrencyPairFormat.Uppercase = true
b.ConfigCurrencyPairFormat.Delimiter = ""
b.ConfigCurrencyPairFormat.Uppercase = true
b.ConfigCurrencyPairFormat.Index = "KRW"
b.AssetTypes = []string{ticker.Spot}
}