Skip to content

Commit 5e4984a

Browse files
committed
fix
1 parent b6969c4 commit 5e4984a

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/ExchangeSharp/API/Exchanges/BTSE/ExchangeBTSEAPI.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected override async Task OnCancelOrderAsync(string orderId, string? marketS
7979
{"orderID", orderId}
8080
});
8181

82-
await MakeJsonRequestAsync<JToken>(url.ToStringInvariant().Replace(BaseUrl, ""),
82+
await MakeJsonRequestAsync<JToken>($"/api/v3.1/order{url.Query}",
8383
requestMethod: "DELETE", payload: payload);
8484
}
8585

@@ -116,8 +116,7 @@ protected override async Task<IEnumerable<ExchangeOrderResult>> OnGetOpenOrderDe
116116
{"symbol", marketSymbol}
117117
});
118118

119-
120-
var result = await MakeJsonRequestAsync<JToken>(url.ToStringInvariant().Replace(BaseUrl, ""),
119+
var result = await MakeJsonRequestAsync<JToken>("/api/v3.1/user/open_orders"+url.Query,
121120
requestMethod: "GET", payload: payload);
122121

123122
return Extract2(result, token => new ExchangeOrderResult()
@@ -146,21 +145,21 @@ protected override async Task<ExchangeOrderResult> OnPlaceOrderAsync(ExchangeOrd
146145

147146
dict.Add("size", request.Amount);
148147
dict.Add("side", request.IsBuy ? "BUY" : "SELL");
149-
dict.Add("price", request.Price);
150148
dict.Add("symbol", request.MarketSymbol);
151149

152150
switch (request.OrderType )
153151
{
154152
case OrderType.Limit:
155153
dict.Add("txType", "LIMIT");
156154
dict.Add("type", "LIMIT");
155+
dict.Add("price", request.Price);
157156
break;
158157
case OrderType.Market:
159-
160158
dict.Add("type", "MARKET");
161159
break;
162160
case OrderType.Stop:
163161
dict.Add("stopPrice", request.StopPrice);
162+
dict.Add("price", request.Price);
164163
dict.Add("txType", "STOP");
165164
break;
166165
}
@@ -246,7 +245,6 @@ protected override async Task ProcessRequestAsync(IHttpWebRequest request, Dicti
246245
var nonce = payload["nonce"].ToString();
247246
payload.Remove("nonce");
248247

249-
250248
var json = JsonConvert.SerializeObject(body ?? payload);
251249
if (json == "{}")
252250
{

0 commit comments

Comments
 (0)