File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/ExchangeSharp/API/Exchanges/Coinbase Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ The above copyright notice and this permission notice shall be included in all c
1414using Newtonsoft . Json . Linq ;
1515using System ;
1616using System . Collections . Generic ;
17+ using System . Diagnostics ;
1718using System . Linq ;
1819using System . Threading . Tasks ;
1920
@@ -450,10 +451,13 @@ protected override async Task<ExchangeOrderResult> OnPlaceOrderAsync(ExchangeOrd
450451
451452 try
452453 {
453- JToken result = await MakeJsonRequestAsync < JToken > ( $ "/orders", payload : payload , requestMethod : "POST" ) ;
454- // The Post doesn't return with any status, just a new OrderId. To get the Order Details we have to reQuery.
455- return await OnGetOrderDetailsAsync ( result [ ORDERID ] . ToStringInvariant ( ) ) ;
456- }
454+ JToken jtokenResult = await MakeJsonRequestAsync < JToken > ( $ "/orders", payload : payload , requestMethod : "POST" ) ;
455+ var orderResult = ParseOrder ( jtokenResult [ "success_response" ] ) ;
456+ Debug . Assert ( jtokenResult . Value < bool > ( "success" ) == true ) ;
457+ // the jtokenResult doesn't have the order status inside the "success_response" portion, but rather outside of it, so need to set it manually
458+ orderResult . Result = ExchangeAPIOrderResult . PendingOpen ;
459+ return orderResult ;
460+ }
457461 catch ( Exception ex ) // All fails come back with an exception.
458462 {
459463 Logger . Error ( ex , "Failed to place coinbase error" ) ;
You can’t perform that action at this time.
0 commit comments