mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2026-02-16 14:13:46 +00:00
37 lines
1.3 KiB
C#
37 lines
1.3 KiB
C#
using CryptoExchange.Net.Objects;
|
|
using System.Text;
|
|
|
|
namespace CryptoExchange.Net.SharedApis
|
|
{
|
|
/// <summary>
|
|
/// Options for requesting position history
|
|
/// </summary>
|
|
public class GetPositionHistoryOptions : PaginatedEndpointOptions<GetPositionHistoryRequest>
|
|
{
|
|
/// <summary>
|
|
/// ctor
|
|
/// </summary>
|
|
public GetPositionHistoryOptions(bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit)
|
|
: base(supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true)
|
|
{
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public override Error? ValidateRequest(string exchange, GetPositionHistoryRequest request, TradingMode? tradingMode, TradingMode[] supportedApiTypes)
|
|
{
|
|
if (!TimePeriodFilterSupport && request.StartTime != null)
|
|
return ArgumentError.Invalid(nameof(GetDepositsRequest.StartTime), $"Time filter is not supported");
|
|
|
|
return base.ValidateRequest(exchange, request, tradingMode, supportedApiTypes);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public override string ToString(string exchange)
|
|
{
|
|
var sb = new StringBuilder(base.ToString(exchange));
|
|
sb.AppendLine($"Time filter supported: {TimePeriodFilterSupport}");
|
|
return sb.ToString();
|
|
}
|
|
}
|
|
}
|