mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-20 15:10:10 +00:00
Poloniex: Implementation of GetOrderInfo method (#607)
* GetClosedOrder implemented for Kraken and Binance, fixed Binance MARKET order creaton, added rate, fee and cost fileds on SubmitOrder responce * return Trades on Binance SubmitOrder, new validation methods on Binance and kraken GetClosedOrderInfo * removed the Binance extra method GetClosedOrder * func description corrected * removed price, fee and cost from SimulateOrder response, as we get all necessary info in response to calculate them on client side * GetClosedOrder implementation moved to GetOrderInfo * changed GetOrderInfo params * removed Canceled order.Type used for Kraken * update QueryOrder in gctscript * add missed params to QueryOrder validator (gctscript) * fixed testing issues * GetClosedOrder implemented for Kraken and Binance, fixed Binance MARKET order creaton, added rate, fee and cost fileds on SubmitOrder responce * return Trades on Binance SubmitOrder, new validation methods on Binance and kraken GetClosedOrderInfo * removed the Binance extra method GetClosedOrder * func description corrected * removed price, fee and cost from SimulateOrder response, as we get all necessary info in response to calculate them on client side * GetClosedOrder implementation moved to GetOrderInfo * changed GetOrderInfo params * removed Canceled order.Type used for Kraken * update QueryOrder in gctscript * add missed params to QueryOrder validator (gctscript) * fixed testing issues * pull previous changes * linter issues fix * updated query_order exmple in gctscript, fixed params check * removed orderPair unnecessary conversion * added wsCancelAllOrders, fixed bugs * fixed Kraken wsAddOrder method * cleanup * CancelBatchOrders implementation * changed CancelBatchOrders signature * fixed tests and wrappers * btcmarkets_test fix * cleanup * cleanup * changed CancelBatchOrders signature * fmt * Update configtest.json * Update configtest.json * rollback configtest * refactored Kraken wsHandleData to allow tests * removed unnecessary error test in TestWsAddOrderJSON * dependencies updates * fixed issue with PortfolioSleepDelay set on startup * add GetWithdrawalsHistory method to exchanges interface * param name changes * add extra params for Binance WithdrawStatus method * add Binance TestWithdrawHistory * add GetOrderInfo on Poloniex * linter errors fix * switch interface type to avoid panic * Poloniex has no para errror in OrderbookResponse - removed, added seq param (incrementing sequence) for future use * linter issues fix * linter issues fix * dependencies update * add tests * refactored unmarshalling of GetAuthenticatedOrderStatus response * test fix * linter issues fix * unmarshaling logic moved to GetAuthenticatedOrderStatus * forced Status setting on GetAuthenticatedOrderStatus error * comment edited Co-authored-by: Vazha Bezhanishvili <vazha.bezhanishvili@elegro.eu>
This commit is contained in:
@@ -851,8 +851,18 @@ func (s *RPCServer) GetOrder(_ context.Context, r *gctrpc.GetOrderRequest) (*gct
|
||||
AssetType: result.Trades[i].Type.String(),
|
||||
OrderSide: result.Trades[i].Side.String(),
|
||||
Fee: result.Trades[i].Fee,
|
||||
Total: result.Trades[i].Total,
|
||||
})
|
||||
}
|
||||
|
||||
var creationTime, updateTime int64
|
||||
if result.Date.Unix() > 0 {
|
||||
creationTime = result.Date.Unix()
|
||||
}
|
||||
if result.CloseTime.Unix() > 0 {
|
||||
updateTime = result.CloseTime.Unix()
|
||||
}
|
||||
|
||||
return &gctrpc.OrderDetails{
|
||||
Exchange: result.Exchange,
|
||||
Id: result.ID,
|
||||
@@ -861,7 +871,7 @@ func (s *RPCServer) GetOrder(_ context.Context, r *gctrpc.GetOrderRequest) (*gct
|
||||
AssetType: result.AssetType.String(),
|
||||
OrderSide: result.Side.String(),
|
||||
OrderType: result.Type.String(),
|
||||
CreationTime: result.Date.Unix(),
|
||||
CreationTime: creationTime,
|
||||
Status: result.Status.String(),
|
||||
Price: result.Price,
|
||||
Amount: result.Amount,
|
||||
@@ -869,7 +879,7 @@ func (s *RPCServer) GetOrder(_ context.Context, r *gctrpc.GetOrderRequest) (*gct
|
||||
Fee: result.Fee,
|
||||
Trades: trades,
|
||||
Cost: result.Cost,
|
||||
UpdateTime: result.CloseTime.Unix(),
|
||||
UpdateTime: updateTime,
|
||||
}, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user