Skip to content

Commit

Permalink
Binance: GetOrderInfo method issue. Kraken - add Cost param to GetOrd…
Browse files Browse the repository at this point in the history
…erInfo output (thrasher-corp#615)

* add Cost param to Kraken GetOrderInfo output

* fmt

* faulty resp.Time handling in Binance GetOrderInfo method

Co-authored-by: Vazha Bezhanishvili <[email protected]>
  • Loading branch information
vazha and Vazha Bezhanishvili authored Jan 7, 2021
1 parent 7431bf8 commit 29f7fae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 1 addition & 5 deletions exchanges/binance/binance_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -710,10 +710,6 @@ func (b *Binance) GetOrderInfo(orderID string, pair currency.Pair, assetType ass
}

orderSide := order.Side(resp.Side)
orderDate, err := convert.TimeFromUnixTimestampFloat(resp.Time)
if err != nil {
return
}

status, err := order.StringToOrderStatus(resp.Status)
if err != nil {
Expand All @@ -727,7 +723,7 @@ func (b *Binance) GetOrderInfo(orderID string, pair currency.Pair, assetType ass

return order.Detail{
Amount: resp.OrigQty,
Date: orderDate,
Date: resp.Time,
Exchange: b.Name,
ID: strconv.FormatInt(resp.OrderID, 10),
Side: orderSide,
Expand Down
1 change: 1 addition & 0 deletions exchanges/kraken/kraken_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,7 @@ func (k *Kraken) GetOrderInfo(orderID string, pair currency.Pair, assetType asse
RemainingAmount: orderInfo.Volume - orderInfo.VolumeExecuted,
Fee: orderInfo.Fee,
Trades: trades,
Cost: orderInfo.Cost,
}

return orderDetail, nil
Expand Down

0 comments on commit 29f7fae

Please sign in to comment.