mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-31 15:10:42 +00:00
Fix Binance/Bithumb ticker/orderbook
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user