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
14
14
using Newtonsoft . Json . Linq ;
15
15
using System ;
16
16
using System . Collections . Generic ;
17
+ using System . Diagnostics ;
17
18
using System . Linq ;
18
19
using System . Threading . Tasks ;
19
20
@@ -450,10 +451,13 @@ protected override async Task<ExchangeOrderResult> OnPlaceOrderAsync(ExchangeOrd
450
451
451
452
try
452
453
{
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
+ }
457
461
catch ( Exception ex ) // All fails come back with an exception.
458
462
{
459
463
Logger . Error ( ex , "Failed to place coinbase error" ) ;
You can’t perform that action at this time.
0 commit comments