Skip to content

Commit

Permalink
Fix for SpotApi.Trading.CancelAllOrdersAsync type parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Mar 5, 2024
1 parent a0f81c1 commit dd0f793
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ public async Task<WebCallResult<KucoinCanceledOrders>> CancelAllOrdersAsync(stri
symbol?.ValidateKucoinSymbol();
var parameters = new Dictionary<string, object>();
parameters.AddOptionalParameter("symbol", symbol);
parameters.AddOptionalParameter("tradeType", type);
parameters.AddOptionalParameter("tradeType", EnumConverter.GetString(type));
return await _baseClient.Execute<KucoinCanceledOrders>(_baseClient.GetUri("orders"), HttpMethod.Delete, ct, parameters, true, weight: 60).ConfigureAwait(false);
}

Expand Down
1 change: 1 addition & 0 deletions Kucoin.Net/Converters/TradeTypeConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public TradeTypeConverter(bool quotes) : base(quotes)

protected override List<KeyValuePair<TradeType, string>> Mapping => new List<KeyValuePair<TradeType, string>>
{
new KeyValuePair<TradeType, string>(TradeType.IsolatedMarginTrade, "ISOLATED_MARGIN_TRADE"),
new KeyValuePair<TradeType, string>(TradeType.MarginTrade, "MARGIN_TRADE"),
new KeyValuePair<TradeType, string>(TradeType.SpotTrade, "TRADE")
};
Expand Down
15 changes: 12 additions & 3 deletions Kucoin.Net/Enums/TradeType.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
namespace Kucoin.Net.Enums
using CryptoExchange.Net.Attributes;

namespace Kucoin.Net.Enums
{
/// <summary>
/// Type of trade
/// </summary>
public enum TradeType
{
/// <summary>
/// Stop trade
/// Spot trade
/// </summary>
[Map("TRADE")]
SpotTrade,
/// <summary>
/// Margin trade
/// </summary>
MarginTrade
[Map("MARGIN_TRADE")]
MarginTrade,
/// <summary>
/// Isolated margin trade
/// </summary>
[Map("MARGIN_ISOLATED_TRADE")]
IsolatedMarginTrade
}
}

0 comments on commit dd0f793

Please sign in to comment.