Skip to content

Commit c24ed06

Browse files
authored
Update Okex OnPlaceOrderAsync (#688)
Okex does not return order state with the response like most exchange does, so we need to get the order info with separate request.
1 parent 922288b commit c24ed06

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/ExchangeSharp/API/Exchanges/OKGroup/ExchangeOKExAPI.cs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -338,19 +338,10 @@ protected override async Task<ExchangeOrderResult> OnPlaceOrderAsync(ExchangeOrd
338338
payload["px"] = order.Price.ToStringInvariant();
339339
}
340340
order.ExtraParameters.CopyTo(payload);
341-
341+
342342
var token = await MakeJsonRequestAsync<JToken>("/trade/order", BaseUrlV5, payload, "POST");
343-
return new ExchangeOrderResult()
344-
{
345-
MarketSymbol = order.MarketSymbol,
346-
Amount = order.Amount,
347-
Price = order.Price,
348-
OrderDate = DateTime.UtcNow,
349-
OrderId = token[0]["ordId"].Value<string>(),
350-
ClientOrderId = token[0]["clOrdId"].Value<string>(),
351-
Result = ExchangeAPIOrderResult.Open,
352-
IsBuy = order.IsBuy
353-
};
343+
var orderInfo = await GetOrderDetailsAsync(token[0]["ordId"].ToStringInvariant(), order.MarketSymbol);
344+
return orderInfo;
354345
}
355346

356347
protected override async Task ProcessRequestAsync(IHttpWebRequest request, Dictionary<string, object> payload)

0 commit comments

Comments
 (0)