diff --git a/.nuget/Nuget.config b/.nuget/Nuget.config
new file mode 100644
index 00000000..49430d5e
--- /dev/null
+++ b/.nuget/Nuget.config
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ExchangeSharp/API/Exchanges/Bitstamp/ExchangeBitstampAPI.cs b/ExchangeSharp/API/Exchanges/Bitstamp/ExchangeBitstampAPI.cs
index cf00d5b1..802d01b7 100644
--- a/ExchangeSharp/API/Exchanges/Bitstamp/ExchangeBitstampAPI.cs
+++ b/ExchangeSharp/API/Exchanges/Bitstamp/ExchangeBitstampAPI.cs
@@ -151,36 +151,45 @@ protected override async Task> OnGetAmountsAsync()
{
string url = "/balance/";
var payload = await OnGetNoncePayloadAsync();
- JObject responseObject = await MakeJsonRequestAsync(url, null, payload, "POST");
- Dictionary balances = new Dictionary();
- foreach (var property in responseObject)
- {
- if (property.Key.Contains("_balance"))
- {
- decimal balance = property.Value.ConvertInvariant();
- if (balance == 0) { continue; }
- balances.Add(property.Key.Replace("_balance", "").Trim(), balance);
- }
- }
- return balances;
+ var responseObject = await MakeJsonRequestAsync(url, null, payload, "POST");
+ return ExtractDictionary(responseObject, "balance");
+ }
+
+
+ protected override async Task> OnGetFeesAsync()
+ {
+ string url = "/balance/";
+ var payload = await OnGetNoncePayloadAsync();
+ var responseObject = await MakeJsonRequestAsync(url, null, payload, "POST");
+ return ExtractDictionary(responseObject, "fee");
}
protected override async Task> OnGetAmountsAvailableToTradeAsync()
{
string url = "/balance/";
var payload = await OnGetNoncePayloadAsync();
- JObject responseObject = await MakeJsonRequestAsync(url, null, payload, "POST");
- Dictionary balances = new Dictionary();
+ var responseObject = await MakeJsonRequestAsync(url, null, payload, "POST");
+ return ExtractDictionary(responseObject, "available");
+ }
+
+ private static Dictionary ExtractDictionary(JObject responseObject, string key)
+ {
+ var result = new Dictionary();
+ var suffix = $"_{key}";
foreach (var property in responseObject)
{
- if (property.Key.Contains("_available"))
+ if (property.Key.Contains(suffix))
{
- decimal balance = property.Value.ConvertInvariant();
- if (balance == 0) { continue; }
- balances.Add(property.Key.Replace("_available", "").Trim(), balance);
+ decimal value = property.Value.ConvertInvariant();
+ if (value == 0)
+ {
+ continue;
+ }
+
+ result.Add(property.Key.Replace(suffix, "").Trim(), value);
}
}
- return balances;
+ return result;
}
protected override async Task OnPlaceOrderAsync(ExchangeOrderRequest order)
@@ -197,6 +206,12 @@ protected override async Task OnPlaceOrderAsync(ExchangeOrd
payload["price"] = order.Price.ToStringInvariant();
}
+ payload["amount"] = order.Amount.ToStringInvariant();
+ foreach (var kv in order.ExtraParameters)
+ {
+ payload["price"] = order.Price.ToStringInvariant();
+ }
+
payload["amount"] = order.RoundAmount().ToStringInvariant();
order.ExtraParameters.CopyTo(payload);
diff --git a/ExchangeSharp/API/Exchanges/_Base/ExchangeAPI.cs b/ExchangeSharp/API/Exchanges/_Base/ExchangeAPI.cs
index 5c5b7067..3bd2a4a6 100644
--- a/ExchangeSharp/API/Exchanges/_Base/ExchangeAPI.cs
+++ b/ExchangeSharp/API/Exchanges/_Base/ExchangeAPI.cs
@@ -118,6 +118,7 @@ await GetHistoricalTradesAsync((e) =>
protected virtual Task> OnGetDepositHistoryAsync(string symbol) => throw new NotImplementedException();
protected virtual Task> OnGetCandlesAsync(string symbol, int periodSeconds, DateTime? startDate = null, DateTime? endDate = null, int? limit = null) => throw new NotImplementedException();
protected virtual Task> OnGetAmountsAsync() => throw new NotImplementedException();
+ protected virtual Task> OnGetFeesAsync() => throw new NotImplementedException();
protected virtual Task> OnGetAmountsAvailableToTradeAsync() => throw new NotImplementedException();
protected virtual Task OnPlaceOrderAsync(ExchangeOrderRequest order) => throw new NotImplementedException();
protected virtual Task OnGetOrderDetailsAsync(string orderId, string symbol = null) => throw new NotImplementedException();
@@ -846,6 +847,24 @@ public async Task> GetAmountsAsync()
return await OnGetAmountsAsync();
}
+
+ ///
+ /// Get fees
+ ///
+ /// The customer trading fees
+ public Dictionary GetFees() => GetFeesAync().GetAwaiter().GetResult();
+
+ ///
+ /// ASYNC - Get fees
+ ///
+ /// The customer trading fees
+ public async Task> GetFeesAync()
+ {
+ await new SynchronizationContextRemover();
+ return await OnGetFeesAsync();
+ }
+
+
///
/// Get amounts available to trade, symbol / amount dictionary
///
diff --git a/ExchangeSharp/API/Exchanges/_Base/IExchangeAPI.cs b/ExchangeSharp/API/Exchanges/_Base/IExchangeAPI.cs
index f2942407..60d51346 100644
--- a/ExchangeSharp/API/Exchanges/_Base/IExchangeAPI.cs
+++ b/ExchangeSharp/API/Exchanges/_Base/IExchangeAPI.cs
@@ -438,6 +438,18 @@ public interface IExchangeAPI : IDisposable
/// Symbol
/// Close margin position result
Task CloseMarginPositionAsync(string symbol);
+
+ ///
+ /// Get fees
+ ///
+ /// The customer trading fees
+ Dictionary GetFees();
+
+ ///
+ /// ASYNC - Get fees
+ ///
+ /// The customer trading fees
+ Task> GetFeesAync();
#endregion REST