1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-10-31 07:17:47 +00:00
This commit is contained in:
Jkorf
2026-08-27 15:57:28 +02:00
parent d93d6b7a2e
commit 32e74e9bc4
23 changed files with 874 additions and 60 deletions
@@ -16,7 +16,7 @@ namespace CryptoExchange.Net.SharedApis
/// ctor
/// </summary>
public GetFuturesUserTradeHistoryOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit)
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetFuturesUserTradeHistoryEndpoint.GetFuturesUserTradesAsync))
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetFuturesUserTradeHistoryEndpoint.GetFuturesUserTradeHistoryAsync))
{
}
@@ -0,0 +1,46 @@
using CryptoExchange.Net.Objects;
using System;
using System.Linq;
namespace CryptoExchange.Net.SharedApis
{
/// <summary>
/// Options for subscribing to order book snapshot updates
/// </summary>
public class SubscribeIncrementalOrderBookOptions : CapabilityOptions<SubscribeOrderBookRequest, ISubscribeIncrementalOrderBookOperation>
{
/// <inheritdoc />
public override string Description => "Subscribe to incremental order book updates for a symbol";
/// <summary>
/// Order book depths supported for updates
/// </summary>
public int[] SupportedLimits { get; }
/// <summary>
/// The type of updates the subscription produces
/// </summary>
public SharedOrderBookSubscriptionType UpdateType { get; }
/// <summary>
/// ctor
/// </summary>
public SubscribeIncrementalOrderBookOptions(string exchange, bool needsAuthentication, int[] limits, SharedOrderBookSubscriptionType updateType)
: base(exchange, needsAuthentication, nameof(ISubscribeIncrementalOrderBookOperation.SubscribeToOrderBookUpdatesAsync))
{
SupportedLimits = limits;
UpdateType = updateType;
}
/// <summary>
/// Validate a request
/// </summary>
public override Error? ValidateRequest(SubscribeOrderBookRequest request, ISubscribeIncrementalOrderBookOperation client)
{
if (request.Limit != null && !SupportedLimits.Contains(request.Limit.Value))
return ArgumentError.Invalid(nameof(SubscribeOrderBookRequest.Limit), "Limit not supported");
return base.ValidateRequest(request, client);
}
}
}