Huobi/HuobiHadax/Binance: Fix GetActiveOrders orders date (#304)

* fix balance responce

* Fixed OrderHistory unmarshalling on the GateIo

* fix int convertation in the GetOrderHistory function

* fix issue on order submit : Binance exchange raw response: {"code":-1102,"msg":"Mandatory parameter 'timeInForce' was not sent, was empty/null, or malformed."}

* Okgroup: fix issue on empty notional GetSpotOrderResponse

* Okgroup: fix issue with empty order status. order start is required for orderHistory request

* HUOBU: fix order currency mapping in GetActiveOrders method

* OKGroup: fix currency name on GetAccountInfo

* ZB: fixed wrong error code on order send method

* OKGroup: add missing fields to GetActiveOrders mapping

* huobi: add missing fields to GetActiveOrders/GetOrderHistory response mapping

* gateio: add order status field to GetActiveOrders response

* gateio: fix orderId on SubmitOrder response

* - poloniex: fix 422 on private API call
- poloniex: fix empty order history

* - poloniex: fix 422 on private API call (revert)

* GateIo: Fix unmarshalling issue

* Huobi: removing redundant breaks

* Huobi: fix rangeValCopy in GetActiveOrders/GetOrderHistory methods

* - poloniex: fix 422 on private API call

* Revert "- poloniex: fix 422 on private API call"

This reverts commit 4748227a

Took 39 minutes

* Replace nonce increment with mutex to atomic incrementation

Took 20 minutes

* Fix ZB order unmarshaling

Took 6 minutes

* Fix CancelSpotOrderResponse unmarshaling on OKGroup

Took 2 minutes

* fix OrderDate on huobi

Took 3 minutes

* fix OrderDate on binance

Took 1 minute

* fix OrderDate on huobihadax

Took 24 minutes
This commit is contained in:
Vadim Zhuk
2019-05-22 01:23:51 +03:00
committed by Adrian Gallagher
parent 0c6cd7fedf
commit c08222699c
3 changed files with 6 additions and 6 deletions

View File

@@ -347,7 +347,7 @@ func (b *Binance) GetActiveOrders(getOrdersRequest *exchange.GetOrdersRequest) (
for i := range resp {
orderSide := exchange.OrderSide(strings.ToUpper(resp[i].Side))
orderType := exchange.OrderType(strings.ToUpper(resp[i].Type))
orderDate := time.Unix(int64(resp[i].Time), 0)
orderDate := time.Unix(0, int64(resp[i].Time)*int64(time.Millisecond))
orders = append(orders, exchange.OrderDetail{
Amount: resp[i].OrigQty,
@@ -387,7 +387,7 @@ func (b *Binance) GetOrderHistory(getOrdersRequest *exchange.GetOrdersRequest) (
for i := range resp {
orderSide := exchange.OrderSide(strings.ToUpper(resp[i].Side))
orderType := exchange.OrderType(strings.ToUpper(resp[i].Type))
orderDate := time.Unix(int64(resp[i].Time), 0)
orderDate := time.Unix(0, int64(resp[i].Time)*int64(time.Millisecond))
// New orders are covered in GetOpenOrders
if resp[i].Status == "NEW" {
continue

View File

@@ -429,7 +429,7 @@ func (h *HUOBI) GetActiveOrders(getOrdersRequest *exchange.GetOrdersRequest) ([]
CurrencyPair: c,
Exchange: h.Name,
ExecutedAmount: resp[i].FilledAmount,
OrderDate: time.Unix(resp[i].CreatedAt, 0),
OrderDate: time.Unix(0, resp[i].CreatedAt*int64(time.Millisecond)),
Status: resp[i].State,
AccountID: strconv.FormatFloat(resp[i].AccountID, 'f', -1, 64),
Fee: resp[i].FilledFees,
@@ -477,7 +477,7 @@ func (h *HUOBI) GetOrderHistory(getOrdersRequest *exchange.GetOrdersRequest) ([]
CurrencyPair: c,
Exchange: h.Name,
ExecutedAmount: resp[i].FilledAmount,
OrderDate: time.Unix(resp[i].CreatedAt, 0),
OrderDate: time.Unix(0, resp[i].CreatedAt*int64(time.Millisecond)),
Status: resp[i].State,
AccountID: strconv.FormatFloat(resp[i].AccountID, 'f', -1, 64),
Fee: resp[i].FilledFees,

View File

@@ -385,7 +385,7 @@ func (h *HUOBIHADAX) GetActiveOrders(getOrdersRequest *exchange.GetOrdersRequest
for i := range allOrders {
symbol := currency.NewPairDelimiter(allOrders[i].Symbol,
h.ConfigCurrencyPairFormat.Delimiter)
orderDate := time.Unix(allOrders[i].CreatedAt, 0)
orderDate := time.Unix(0, allOrders[i].CreatedAt*int64(time.Millisecond))
orders = append(orders, exchange.OrderDetail{
ID: fmt.Sprintf("%v", allOrders[i].ID),
@@ -433,7 +433,7 @@ func (h *HUOBIHADAX) GetOrderHistory(getOrdersRequest *exchange.GetOrdersRequest
for i := range allOrders {
symbol := currency.NewPairDelimiter(allOrders[i].Symbol,
h.ConfigCurrencyPairFormat.Delimiter)
orderDate := time.Unix(allOrders[i].CreatedAt, 0)
orderDate := time.Unix(0, allOrders[i].CreatedAt*int64(time.Millisecond))
orders = append(orders, exchange.OrderDetail{
ID: fmt.Sprintf("%v", allOrders[i].ID),