From f7505596d7d5091becec875ec2b0863d976aa908 Mon Sep 17 00:00:00 2001 From: BZ-CO <30245815+BZ-CO@users.noreply.github.com> Date: Sun, 14 Nov 2021 00:43:22 +0200 Subject: [PATCH] Update Okex OnPlaceOrderAsync Okex does not return order state with the response like most exchange does, so we need to get the order info with separate request. --- .../API/Exchanges/OKGroup/ExchangeOKExAPI.cs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/ExchangeSharp/API/Exchanges/OKGroup/ExchangeOKExAPI.cs b/src/ExchangeSharp/API/Exchanges/OKGroup/ExchangeOKExAPI.cs index b08e4d1d..8fc11ff3 100644 --- a/src/ExchangeSharp/API/Exchanges/OKGroup/ExchangeOKExAPI.cs +++ b/src/ExchangeSharp/API/Exchanges/OKGroup/ExchangeOKExAPI.cs @@ -338,19 +338,10 @@ protected override async Task OnPlaceOrderAsync(ExchangeOrd payload["px"] = order.Price.ToStringInvariant(); } order.ExtraParameters.CopyTo(payload); - + var token = await MakeJsonRequestAsync("/trade/order", BaseUrlV5, payload, "POST"); - return new ExchangeOrderResult() - { - MarketSymbol = order.MarketSymbol, - Amount = order.Amount, - Price = order.Price, - OrderDate = DateTime.UtcNow, - OrderId = token[0]["ordId"].Value(), - ClientOrderId = token[0]["clOrdId"].Value(), - Result = ExchangeAPIOrderResult.Open, - IsBuy = order.IsBuy - }; + var orderInfo = await GetOrderDetailsAsync(token[0]["ordId"].ToStringInvariant(), order.MarketSymbol); + return orderInfo; } protected override async Task ProcessRequestAsync(IHttpWebRequest request, Dictionary payload)