mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-10-22 11:00:58 +00:00
wip
This commit is contained in:
+123
-139
@@ -9,120 +9,10 @@ using System.Text;
|
||||
namespace CryptoExchange.Net.SharedApis
|
||||
{
|
||||
/// <summary>
|
||||
/// Options for an exchange endpoint
|
||||
/// Options and description of a Shared API capability.
|
||||
/// </summary>
|
||||
public abstract class EndpointOptions
|
||||
public abstract class CapabilityOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Required exchange-specific parameters. These can be provided via the `exchangeParameters` property of the request object.
|
||||
/// </summary>
|
||||
public List<ParameterDescription> RequiredExchangeParameters { get; set; } = new List<ParameterDescription>();
|
||||
/// <summary>
|
||||
/// Optional exchange-specific parameters. These can be provided via the `exchangeParameters` property of the request object.
|
||||
/// </summary>
|
||||
public List<ParameterDescription> OptionalExchangeParameters { get; set; } = new List<ParameterDescription>();
|
||||
/// <summary>
|
||||
/// Exchange
|
||||
/// </summary>
|
||||
public string Exchange { get; set; }
|
||||
/// <summary>
|
||||
/// Endpoint name
|
||||
/// </summary>
|
||||
public string EndpointName { get; set; }
|
||||
/// <summary>
|
||||
/// Exchange specific additional info
|
||||
/// </summary>
|
||||
public string? RequestNotes { get; set; }
|
||||
/// <summary>
|
||||
/// Whether the call requires authentication
|
||||
/// </summary>
|
||||
public bool NeedsAuthentication { get; set; }
|
||||
/// <summary>
|
||||
/// Whether the call is supported. If false the exchange API does not support this operation.
|
||||
/// </summary>
|
||||
public bool Supported { get; set; } = true;
|
||||
/// <summary>
|
||||
/// Description of the endpoint
|
||||
/// </summary>
|
||||
public abstract string Description { get; }
|
||||
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public EndpointOptions(string exchange, string endpointName, bool needAuthentication)
|
||||
{
|
||||
Exchange = exchange;
|
||||
EndpointName = endpointName;
|
||||
NeedsAuthentication = needAuthentication;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validate a request
|
||||
/// </summary>
|
||||
/// <param name="exchangeParameters">Provided exchange parameters</param>
|
||||
/// <param name="tradingMode">Request trading mode</param>
|
||||
/// <param name="supportedTradingModes">Supported trading modes</param>
|
||||
/// <returns></returns>
|
||||
public virtual Error? ValidateRequest(ExchangeParameters? exchangeParameters, TradingMode? tradingMode, TradingMode[] supportedTradingModes)
|
||||
{
|
||||
if (!Supported)
|
||||
return ArgumentError.Invalid("Endpoint", $"Endpoint {Exchange} {EndpointName} is not supported by the API");
|
||||
|
||||
if (tradingMode != null && !supportedTradingModes.Contains(tradingMode.Value))
|
||||
return ArgumentError.Invalid("TradingMode", $"TradingMode.{tradingMode} is not supported, supported types: {string.Join(", ", supportedTradingModes)}");
|
||||
|
||||
foreach (var param in RequiredExchangeParameters)
|
||||
{
|
||||
if (param.Names!.All(x => ExchangeParameters.HasValue(exchangeParameters, Exchange, x, param.ValueType) != true))
|
||||
{
|
||||
if (param.Names.Length == 1)
|
||||
return ArgumentError.Invalid(string.Join("/", param.Names!), $"Exchange parameter `{param.Names[0]}` for exchange `{Exchange}` should be provided. Example: {param.ExampleValue}");
|
||||
else
|
||||
return ArgumentError.Invalid(string.Join("/", param.Names!), $"One of exchange parameters `{string.Join(", ", param.Names!)}` for exchange `{Exchange}` should be provided. Example: {param.ExampleValue}");
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Options for an exchange endpoint
|
||||
/// </summary>
|
||||
/// <typeparam name="TRequest">Type of data</typeparam>
|
||||
#if NET5_0_OR_GREATER
|
||||
public abstract class EndpointOptions<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] TRequest> : EndpointOptions
|
||||
where TRequest : SharedRequest
|
||||
#else
|
||||
public abstract class EndpointOptions<TRequest> : EndpointOptions
|
||||
where TRequest : SharedRequest
|
||||
#endif
|
||||
{
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public EndpointOptions(string exchange, bool needsAuthentication, string requestName) : base(exchange, requestName, needsAuthentication)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Options for an exchange endpoint
|
||||
/// </summary>
|
||||
/// <typeparam name="TRequest">Type of data</typeparam>
|
||||
/// <typeparam name="TClient">Type of the client</typeparam>
|
||||
#if NET5_0_OR_GREATER
|
||||
public abstract class EndpointOptions<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] TRequest, TClient> : EndpointOptions <TRequest>
|
||||
where TRequest : SharedRequest
|
||||
where TClient : ISharedClient
|
||||
#else
|
||||
public abstract class EndpointOptions<TRequest, TClient> : EndpointOptions<TRequest>
|
||||
where TRequest : SharedRequest
|
||||
where TClient : ISharedClient
|
||||
#endif
|
||||
{
|
||||
private static PropertyInfo[] _requestProperties = typeof(TRequest).GetProperties();
|
||||
|
||||
private List<ParameterDescription> _requiredRequestParameters = new();
|
||||
|
||||
/// <summary>
|
||||
@@ -154,56 +44,87 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// </summary>
|
||||
public int? MaxSymbolCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Required exchange-specific parameters. These can be provided via the `exchangeParameters` property of the request object.
|
||||
/// </summary>
|
||||
public List<ParameterDescription> RequiredExchangeParameters { get; set; } = new List<ParameterDescription>();
|
||||
/// <summary>
|
||||
/// Optional exchange-specific parameters. These can be provided via the `exchangeParameters` property of the request object.
|
||||
/// </summary>
|
||||
public List<ParameterDescription> OptionalExchangeParameters { get; set; } = new List<ParameterDescription>();
|
||||
/// <summary>
|
||||
/// Exchange
|
||||
/// </summary>
|
||||
public string Exchange { get; set; }
|
||||
/// <summary>
|
||||
/// Operation name
|
||||
/// </summary>
|
||||
public string OperationName { get; set; }
|
||||
/// <summary>
|
||||
/// Exchange specific additional info
|
||||
/// </summary>
|
||||
public string? RequestNotes { get; set; }
|
||||
/// <summary>
|
||||
/// Whether the call requires authentication
|
||||
/// </summary>
|
||||
public bool NeedsAuthentication { get; set; }
|
||||
/// <summary>
|
||||
/// Whether the call is supported. If false the exchange API does not support this operation.
|
||||
/// </summary>
|
||||
public bool Supported { get; set; } = true;
|
||||
/// <summary>
|
||||
/// Description of the endpoint
|
||||
/// </summary>
|
||||
public abstract string Description { get; }
|
||||
/// <summary>
|
||||
/// The type of the capability
|
||||
/// </summary>
|
||||
public abstract Type CapabilityType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public EndpointOptions(string exchange, bool needsAuthentication, string requestName) : base(exchange, needsAuthentication, requestName)
|
||||
public CapabilityOptions(string exchange, string operationName, bool needAuthentication)
|
||||
{
|
||||
Exchange = exchange;
|
||||
OperationName = operationName;
|
||||
NeedsAuthentication = needAuthentication;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validate a request
|
||||
/// </summary>
|
||||
/// <param name="request">The request</param>
|
||||
/// <param name="client">Containing client</param>
|
||||
/// <param name="exchangeParameters">Provided exchange parameters</param>
|
||||
/// <param name="tradingMode">Request trading mode</param>
|
||||
/// <param name="supportedTradingModes">Supported trading modes</param>
|
||||
/// <returns></returns>
|
||||
public virtual Error? ValidateRequest(TRequest request, TClient client)
|
||||
public virtual Error? ValidateRequest(ExchangeParameters? exchangeParameters, TradingMode? tradingMode, TradingMode[] supportedTradingModes)
|
||||
{
|
||||
if (NeedsAuthentication && !client.Authenticated)
|
||||
return new NoApiCredentialsError();
|
||||
if (!Supported)
|
||||
return ArgumentError.Invalid("Operation", $"Operation {Exchange} {OperationName} is not supported by the API");
|
||||
|
||||
foreach (var param in RequiredRequestParameters)
|
||||
if (tradingMode != null && !supportedTradingModes.Contains(tradingMode.Value))
|
||||
return ArgumentError.Invalid("TradingMode", $"TradingMode.{tradingMode} is not supported, supported types: {string.Join(", ", supportedTradingModes)}");
|
||||
|
||||
foreach (var param in RequiredExchangeParameters)
|
||||
{
|
||||
if (param.Names!.All(x => _requestProperties.Single(p => p.Name == x).GetValue(request, null) == null))
|
||||
if (param.Names!.All(x => ExchangeParameters.HasValue(exchangeParameters, Exchange, x, param.ValueType) != true))
|
||||
{
|
||||
if (param.Names.Length == 1)
|
||||
return ArgumentError.Invalid(string.Join("/", param.Names!), $"Optional parameter `{param.Names[0]}` for exchange `{Exchange}` should be provided. Example: {param.ExampleValue}");
|
||||
return ArgumentError.Invalid(string.Join("/", param.Names!), $"Exchange parameter `{param.Names[0]}` for exchange `{Exchange}` should be provided. Example: {param.ExampleValue}");
|
||||
else
|
||||
return ArgumentError.Invalid(string.Join("/", param.Names!), $"One of optional parameters `{string.Join(", ", param.Names!)}` for exchange `{Exchange}` should be provided. Example: {param.ExampleValue}");
|
||||
return ArgumentError.Invalid(string.Join("/", param.Names!), $"One of exchange parameters `{string.Join(", ", param.Names!)}` for exchange `{Exchange}` should be provided. Example: {param.ExampleValue}");
|
||||
}
|
||||
}
|
||||
|
||||
if (request is SharedSymbolRequest symbolsRequest)
|
||||
{
|
||||
if (symbolsRequest.Symbols != null)
|
||||
{
|
||||
if (!SupportsMultipleSymbols)
|
||||
return ArgumentError.Invalid(nameof(SharedSymbolRequest.Symbols), $"Only a single symbol parameter is allowed, multiple symbols are not supported");
|
||||
|
||||
if (symbolsRequest.Symbols.Length > MaxSymbolCount)
|
||||
return ArgumentError.Invalid(nameof(SharedSymbolRequest.Symbols), $"Max number of symbols is {MaxSymbolCount} but {symbolsRequest.Symbols.Length} were passed");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return ValidateRequest(request.ExchangeParameters, request.TradingMode, client.SupportedTradingModes);
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine($"{EndpointName}");
|
||||
sb.AppendLine($"{OperationName}");
|
||||
if (!Supported)
|
||||
{
|
||||
sb.AppendLine(" NOT SUPPORTED");
|
||||
@@ -211,7 +132,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
}
|
||||
|
||||
sb.AppendLine($"{Description}");
|
||||
if (!string.IsNullOrEmpty(RequestNotes))
|
||||
if (!string.IsNullOrEmpty(RequestNotes))
|
||||
{
|
||||
sb.Append(" Notes: ");
|
||||
sb.AppendLine(RequestNotes);
|
||||
@@ -219,7 +140,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
if (RequiredRequestParameters.Any())
|
||||
{
|
||||
sb.AppendLine($" Required request parameters:");
|
||||
foreach(var param in RequiredRequestParameters)
|
||||
foreach (var param in RequiredRequestParameters)
|
||||
sb.AppendLine($" {param}");
|
||||
}
|
||||
if (RequiredExchangeParameters.Any())
|
||||
@@ -240,4 +161,67 @@ namespace CryptoExchange.Net.SharedApis
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Options and description of a Shared API capability.
|
||||
/// </summary>
|
||||
public abstract class CapabilityOptions<
|
||||
#if NET5_0_OR_GREATER
|
||||
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)]
|
||||
#endif
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
TRequest, TCapability> : EndpointOptions // Derives from endpoint options for compatibility, but can derive from CapabilityOptions in a later release
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
where TRequest : SharedRequest
|
||||
where TCapability : ISharedApiCapability
|
||||
{
|
||||
private static PropertyInfo[] _requestProperties = typeof(TRequest).GetProperties();
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Type CapabilityType => typeof(TCapability);
|
||||
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public CapabilityOptions(string exchange, bool needsAuthentication, string requestName) : base(exchange, requestName, needsAuthentication)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validate a request
|
||||
/// </summary>
|
||||
/// <param name="request">The request</param>
|
||||
/// <param name="client">Containing client</param>
|
||||
/// <returns></returns>
|
||||
public virtual Error? ValidateRequest(TRequest request, TCapability client)
|
||||
{
|
||||
if (NeedsAuthentication && !client.Authenticated)
|
||||
return new NoApiCredentialsError();
|
||||
|
||||
foreach (var param in RequiredRequestParameters)
|
||||
{
|
||||
if (param.Names!.All(x => _requestProperties.Single(p => p.Name == x).GetValue(request, null) == null))
|
||||
{
|
||||
if (param.Names.Length == 1)
|
||||
return ArgumentError.Invalid(string.Join("/", param.Names!), $"Optional parameter `{param.Names[0]}` for exchange `{Exchange}` should be provided. Example: {param.ExampleValue}");
|
||||
else
|
||||
return ArgumentError.Invalid(string.Join("/", param.Names!), $"One of optional parameters `{string.Join(", ", param.Names!)}` for exchange `{Exchange}` should be provided. Example: {param.ExampleValue}");
|
||||
}
|
||||
}
|
||||
|
||||
if (request is SharedSymbolRequest symbolsRequest)
|
||||
{
|
||||
if (symbolsRequest.Symbols != null)
|
||||
{
|
||||
if (!SupportsMultipleSymbols)
|
||||
return ArgumentError.Invalid(nameof(SharedSymbolRequest.Symbols), $"Only a single symbol parameter is allowed, multiple symbols are not supported");
|
||||
|
||||
if (symbolsRequest.Symbols.Length > MaxSymbolCount)
|
||||
return ArgumentError.Invalid(nameof(SharedSymbolRequest.Symbols), $"Max number of symbols is {MaxSymbolCount} but {symbolsRequest.Symbols.Length} were passed");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return ValidateRequest(request.ExchangeParameters, request.TradingMode, client.SupportedTradingModes);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using CryptoExchange.Net.Objects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace CryptoExchange.Net.SharedApis
|
||||
{
|
||||
/// <summary>
|
||||
/// Endpoint options
|
||||
/// </summary>
|
||||
[Obsolete("Use CapabilityOptions instead")]
|
||||
public abstract class EndpointOptions : CapabilityOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Endpoint name
|
||||
/// </summary>
|
||||
[Obsolete("Use OperationName instead")]
|
||||
public string EndpointName
|
||||
{
|
||||
get => OperationName;
|
||||
set => OperationName = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
protected EndpointOptions(
|
||||
string exchange,
|
||||
string operationName,
|
||||
bool needsAuthentication)
|
||||
: base(exchange, operationName, needsAuthentication)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -3,7 +3,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for canceling a futures order by client order id
|
||||
/// </summary>
|
||||
public class CancelFuturesOrderByClientOrderIdOptions : EndpointOptions<CancelOrderRequest, ICancelFuturesOrderByClientOrderIdEndpoint>
|
||||
public class CancelFuturesOrderByClientOrderIdOptions : CapabilityOptions<CancelOrderRequest, ICancelFuturesOrderByClientOrderIdEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Cancel a futures order by its client order id";
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for canceling a futures order
|
||||
/// </summary>
|
||||
public class CancelFuturesOrderOptions : EndpointOptions<CancelOrderRequest, ICancelFuturesOrderEndpoint>
|
||||
public class CancelFuturesOrderOptions : CapabilityOptions<CancelOrderRequest, ICancelFuturesOrderEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Cancel a futures order";
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for canceling a TP/SL
|
||||
/// </summary>
|
||||
public class CancelFuturesTpSlOptions : EndpointOptions<CancelTpSlRequest, ICancelFuturesTpSlEndpoint>
|
||||
public class CancelFuturesTpSlOptions : CapabilityOptions<CancelTpSlRequest, ICancelFuturesTpSlEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Cancel a take profit or stop loss order for a futures position";
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for canceling spot trigger order
|
||||
/// </summary>
|
||||
public class CancelFuturesTriggerOrderOptions : EndpointOptions<CancelOrderRequest, ICancelFuturesTriggerOrderEndpoint>
|
||||
public class CancelFuturesTriggerOrderOptions : CapabilityOptions<CancelOrderRequest, ICancelFuturesTriggerOrderEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Cancel a futures trigger order";
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for canceling a spot order
|
||||
/// </summary>
|
||||
public class CancelSpotOrderByClientOrderIdOptions : EndpointOptions<CancelOrderRequest, ICancelSpotOrderByClientOrderIdEndpoint>
|
||||
public class CancelSpotOrderByClientOrderIdOptions : CapabilityOptions<CancelOrderRequest, ICancelSpotOrderByClientOrderIdEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Cancel a spot order by its client order id";
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for canceling a spot order
|
||||
/// </summary>
|
||||
public class CancelSpotOrderOptions : EndpointOptions<CancelOrderRequest, ICancelSpotOrderEndpoint>
|
||||
public class CancelSpotOrderOptions : CapabilityOptions<CancelOrderRequest, ICancelSpotOrderEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Cancel a spot order";
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting spot trigger order
|
||||
/// </summary>
|
||||
public class CancelSpotTriggerOrderOptions : EndpointOptions<CancelOrderRequest, ICancelSpotTriggerOrderEndpoint>
|
||||
public class CancelSpotTriggerOrderOptions : CapabilityOptions<CancelOrderRequest, ICancelSpotTriggerOrderEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Cancel a spot trigger order";
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for closing position
|
||||
/// </summary>
|
||||
public class ClosePositionOptions : EndpointOptions<ClosePositionRequest, IClosePositionEndpoint>
|
||||
public class ClosePositionOptions : CapabilityOptions<ClosePositionRequest, IClosePositionEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Close an open futures position";
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting tickers
|
||||
/// </summary>
|
||||
public class GetAllFuturesTickersOptions : EndpointOptions<GetTickersRequest, IGetAllFuturesTickersEndpoint>
|
||||
public class GetAllFuturesTickersOptions : CapabilityOptions<GetTickersRequest, IGetAllFuturesTickersEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve price ticker information for all futures symbols";
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting tickers
|
||||
/// </summary>
|
||||
public class GetAllSpotTickersOptions : EndpointOptions<GetTickersRequest, IGetAllSpotTickersEndpoint>
|
||||
public class GetAllSpotTickersOptions : CapabilityOptions<GetTickersRequest, IGetAllSpotTickersEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve price ticker information for all spot symbols";
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting asset info
|
||||
/// </summary>
|
||||
public class GetAssetOptions : EndpointOptions<GetAssetRequest, IGetAssetEndpoint>
|
||||
public class GetAssetOptions : CapabilityOptions<GetAssetRequest, IGetAssetEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve basic info for a single asset and networks it supports for withdrawals/deposits";
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting assets info
|
||||
/// </summary>
|
||||
public class GetAssetsOptions : EndpointOptions<GetAssetsRequest, IGetAllAssetsEndpoint>
|
||||
public class GetAssetsOptions : CapabilityOptions<GetAssetsRequest, IGetAllAssetsEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve basic info for all assets and the networks they support for withdrawals/deposits";
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting a transfer
|
||||
/// </summary>
|
||||
public class GetBalancesOptions : EndpointOptions<GetBalancesRequest, IGetBalancesEndpoint>
|
||||
public class GetBalancesOptions : CapabilityOptions<GetBalancesRequest, IGetBalancesEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve account balances";
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting book ticker
|
||||
/// </summary>
|
||||
public class GetBookTickerOptions : EndpointOptions<GetBookTickerRequest, IGetBookTickerEndpoint>
|
||||
public class GetBookTickerOptions : CapabilityOptions<GetBookTickerRequest, IGetBookTickerEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve the best bid and ask price for a symbol";
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting deposit address
|
||||
/// </summary>
|
||||
public class GetDepositAddressesOptions : EndpointOptions<GetDepositAddressesRequest, IGetDepositAddressesEndpoint>
|
||||
public class GetDepositAddressesOptions : CapabilityOptions<GetDepositAddressesRequest, IGetDepositAddressesEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve deposit addresses for an asset";
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting deposits
|
||||
/// </summary>
|
||||
public class GetDepositHistoryOptions : PaginatedEndpointOptions<GetDepositsRequest, IGetDepositHistoryEndpoint>
|
||||
public class GetDepositHistoryOptions : PaginatedCapabilityOptions<GetDepositsRequest, IGetDepositHistoryEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve deposit history";
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting trading fee info
|
||||
/// </summary>
|
||||
public class GetFeeOptions : EndpointOptions<GetFeeRequest, IGetFeesEndpoint>
|
||||
public class GetFeeOptions : CapabilityOptions<GetFeeRequest, IGetFeesEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve trading fee information";
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting funding rate history
|
||||
/// </summary>
|
||||
public class GetFundingRateHistoryOptions : PaginatedEndpointOptions<GetFundingRateHistoryRequest, IGetFundingRateHistoryEndpoint>
|
||||
public class GetFundingRateHistoryOptions : PaginatedCapabilityOptions<GetFundingRateHistoryRequest, IGetFundingRateHistoryEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve historical funding rates for a futures symbol";
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting closed orders
|
||||
/// </summary>
|
||||
public class GetFuturesClosedOrdersOptions : PaginatedEndpointOptions<GetClosedOrdersRequest, IGetClosedFuturesOrdersEndpoint>
|
||||
public class GetFuturesClosedOrdersOptions : PaginatedCapabilityOptions<GetClosedOrdersRequest, IGetClosedFuturesOrdersEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve closed futures orders";
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for getting a spot order by client order id
|
||||
/// </summary>
|
||||
public class GetFuturesOrderByClientOrderIdOptions : EndpointOptions<GetOrderRequest, IGetFuturesOrderByClientOrderIdEndpoint>
|
||||
public class GetFuturesOrderByClientOrderIdOptions : CapabilityOptions<GetOrderRequest, IGetFuturesOrderByClientOrderIdEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve a futures order by its client order id";
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for getting a futures order by id endpoint
|
||||
/// </summary>
|
||||
public class GetFuturesOrderOptions : EndpointOptions<GetOrderRequest, IGetFuturesOrderEndpoint>
|
||||
public class GetFuturesOrderOptions : CapabilityOptions<GetOrderRequest, IGetFuturesOrderEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve a futures order";
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for getting a trades for an order
|
||||
/// </summary>
|
||||
public class GetFuturesOrderTradesOptions : EndpointOptions<GetOrderTradesRequest, IGetFuturesOrderTradesEndpoint>
|
||||
public class GetFuturesOrderTradesOptions : CapabilityOptions<GetOrderTradesRequest, IGetFuturesOrderTradesEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve trades for a futures order";
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting symbol info
|
||||
/// </summary>
|
||||
public class GetFuturesSymbolsOptions : EndpointOptions<GetSymbolsRequest, IGetFuturesSymbolsEndpoint>
|
||||
public class GetFuturesSymbolsOptions : CapabilityOptions<GetSymbolsRequest, IGetFuturesSymbolsEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve supported futures symbols and their trading rules";
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting ticker
|
||||
/// </summary>
|
||||
public class GetFuturesTickerOptions : EndpointOptions<GetTickerRequest, IGetFuturesTickerEndpoint>
|
||||
public class GetFuturesTickerOptions : CapabilityOptions<GetTickerRequest, IGetFuturesTickerEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve price ticker information for a futures symbol";
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting futures trigger order
|
||||
/// </summary>
|
||||
public class GetFuturesTriggerOrderOptions : EndpointOptions<GetOrderRequest, IGetFuturesTriggerOrderEndpoint>
|
||||
public class GetFuturesTriggerOrderOptions : CapabilityOptions<GetOrderRequest, IGetFuturesTriggerOrderEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve a futures trigger order";
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting user trades
|
||||
/// </summary>
|
||||
public class GetFuturesUserTradeHistoryOptions : PaginatedEndpointOptions<GetUserTradesRequest, IGetFuturesUserTradeHistoryEndpoint>
|
||||
public class GetFuturesUserTradeHistoryOptions : PaginatedCapabilityOptions<GetUserTradesRequest, IGetFuturesUserTradeHistoryEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve futures user trade history";
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting kline/candlestick data
|
||||
/// </summary>
|
||||
public class GetIndexPriceKlinesOptions : PaginatedEndpointOptions<GetKlinesRequest, IGetIndexPriceKlinesEndpoint>
|
||||
public class GetIndexPriceKlinesOptions : PaginatedCapabilityOptions<GetKlinesRequest, IGetIndexPriceKlinesEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve index price candlestick data";
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting kline/candlestick data
|
||||
/// </summary>
|
||||
public class GetKlinesOptions : PaginatedEndpointOptions<GetKlinesRequest, IGetKlinesEndpoint>
|
||||
public class GetKlinesOptions : PaginatedCapabilityOptions<GetKlinesRequest, IGetKlinesEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve candlestick data for a symbol";
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting asset info
|
||||
/// </summary>
|
||||
public class GetLeverageOptions : EndpointOptions<GetLeverageRequest, IGetLeverageEndpoint>
|
||||
public class GetLeverageOptions : CapabilityOptions<GetLeverageRequest, IGetLeverageEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve the current leverage for a futures symbol";
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting kline/candlestick data
|
||||
/// </summary>
|
||||
public class GetMarkPriceKlinesOptions : PaginatedEndpointOptions<GetKlinesRequest, IGetMarkPriceKlinesEndpoint>
|
||||
public class GetMarkPriceKlinesOptions : PaginatedCapabilityOptions<GetKlinesRequest, IGetMarkPriceKlinesEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve mark price candlestick data";
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for getting a futures order by id endpoint
|
||||
/// </summary>
|
||||
public class GetOpenFuturesOrdersOptions : EndpointOptions<GetOpenOrdersRequest, IGetOpenFuturesOrdersEndpoint>
|
||||
public class GetOpenFuturesOrdersOptions : CapabilityOptions<GetOpenOrdersRequest, IGetOpenFuturesOrdersEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve open futures orders";
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting open interest
|
||||
/// </summary>
|
||||
public class GetOpenInterestOptions : EndpointOptions<GetOpenInterestRequest, IGetOpenInterestEndpoint>
|
||||
public class GetOpenInterestOptions : CapabilityOptions<GetOpenInterestRequest, IGetOpenInterestEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve open interest for a futures symbol";
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for getting a spot order by id endpoint
|
||||
/// </summary>
|
||||
public class GetOpenSpotOrdersOptions : EndpointOptions<GetOpenOrdersRequest, IGetOpenSpotOrdersEndpoint>
|
||||
public class GetOpenSpotOrdersOptions : CapabilityOptions<GetOpenOrdersRequest, IGetOpenSpotOrdersEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve open spot orders";
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting order book
|
||||
/// </summary>
|
||||
public class GetOrderBookOptions : EndpointOptions<GetOrderBookRequest, IGetOrderBookEndpoint>
|
||||
public class GetOrderBookOptions : CapabilityOptions<GetOrderBookRequest, IGetOrderBookEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve the current order book for a symbol";
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting position history
|
||||
/// </summary>
|
||||
public class GetPositionHistoryOptions : PaginatedEndpointOptions<GetPositionHistoryRequest, IGetPositionHistoryEndpoint>
|
||||
public class GetPositionHistoryOptions : PaginatedCapabilityOptions<GetPositionHistoryRequest, IGetPositionHistoryEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve historical futures positions";
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting current position mode
|
||||
/// </summary>
|
||||
public class GetPositionModeOptions : EndpointOptions<GetPositionModeRequest, IGetPositionModeEndpoint>
|
||||
public class GetPositionModeOptions : CapabilityOptions<GetPositionModeRequest, IGetPositionModeEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve the current futures position mode";
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting open positions
|
||||
/// </summary>
|
||||
public class GetPositionsOptions : EndpointOptions<GetPositionsRequest, IGetPositionsEndpoint>
|
||||
public class GetPositionsOptions : CapabilityOptions<GetPositionsRequest, IGetPositionsEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve open futures positions";
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting recent trades
|
||||
/// </summary>
|
||||
public class GetRecentTradesOptions : EndpointOptions<GetRecentTradesRequest, IGetRecentTradesEndpoint>
|
||||
public class GetRecentTradesOptions : CapabilityOptions<GetRecentTradesRequest, IGetRecentTradesEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve recent public trades for a symbol";
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting user trades
|
||||
/// </summary>
|
||||
public class GetSpotClosedOrdersOptions : PaginatedEndpointOptions<GetClosedOrdersRequest, IGetClosedSpotOrdersEndpoint>
|
||||
public class GetSpotClosedOrdersOptions : PaginatedCapabilityOptions<GetClosedOrdersRequest, IGetClosedSpotOrdersEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve closed spot orders";
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for getting a spot order by client order id endpoint
|
||||
/// </summary>
|
||||
public class GetSpotOrderByClientOrderIdOptions : EndpointOptions<GetOrderRequest, IGetSpotOrderByClientOrderIdEndpoint>
|
||||
public class GetSpotOrderByClientOrderIdOptions : CapabilityOptions<GetOrderRequest, IGetSpotOrderByClientOrderIdEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve a spot order by its client order id";
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for getting a spot order by id endpoint
|
||||
/// </summary>
|
||||
public class GetSpotOrderOptions : EndpointOptions<GetOrderRequest, IGetSpotOrderEndpoint>
|
||||
public class GetSpotOrderOptions : CapabilityOptions<GetOrderRequest, IGetSpotOrderEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve a spot order";
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for getting trades for a spot order
|
||||
/// </summary>
|
||||
public class GetSpotOrderTradesOptions : EndpointOptions<GetOrderTradesRequest, IGetSpotOrderTradesEndpoint>
|
||||
public class GetSpotOrderTradesOptions : CapabilityOptions<GetOrderTradesRequest, IGetSpotOrderTradesEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve trades for a spot order";
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting symbol info
|
||||
/// </summary>
|
||||
public class GetSpotSymbolsOptions : EndpointOptions<GetSymbolsRequest, IGetSpotSymbolsEndpoint>
|
||||
public class GetSpotSymbolsOptions : CapabilityOptions<GetSymbolsRequest, IGetSpotSymbolsEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve supported spot symbols and their trading rules";
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting ticker
|
||||
/// </summary>
|
||||
public class GetSpotTickerOptions : EndpointOptions<GetTickerRequest, IGetSpotTickerEndpoint>
|
||||
public class GetSpotTickerOptions : CapabilityOptions<GetTickerRequest, IGetSpotTickerEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve price ticker information for a spot symbol";
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting spot trigger order
|
||||
/// </summary>
|
||||
public class GetSpotTriggerOrderOptions : EndpointOptions<GetOrderRequest, IGetSpotTriggerOrderEndpoint>
|
||||
public class GetSpotTriggerOrderOptions : CapabilityOptions<GetOrderRequest, IGetSpotTriggerOrderEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve a spot trigger order";
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting user trades
|
||||
/// </summary>
|
||||
public class GetSpotUserTradeHistoryOptions : PaginatedEndpointOptions<GetUserTradesRequest, IGetSpotUserTradeHistoryEndpoint>
|
||||
public class GetSpotUserTradeHistoryOptions : PaginatedCapabilityOptions<GetUserTradesRequest, IGetSpotUserTradeHistoryEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve spot user trade history";
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting trade history
|
||||
/// </summary>
|
||||
public class GetTradeHistoryOptions : PaginatedEndpointOptions<GetTradeHistoryRequest, IGetTradeHistoryEndpoint>
|
||||
public class GetTradeHistoryOptions : PaginatedCapabilityOptions<GetTradeHistoryRequest, IGetTradeHistoryEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve public trade history for a symbol";
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting withdrawals
|
||||
/// </summary>
|
||||
public class GetWithdrawalHistoryOptions : PaginatedEndpointOptions<GetWithdrawalsRequest, IGetWithdrawalHistoryEndpoint>
|
||||
public class GetWithdrawalHistoryOptions : PaginatedCapabilityOptions<GetWithdrawalsRequest, IGetWithdrawalHistoryEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve withdrawal history";
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for placing a new futures order
|
||||
/// </summary>
|
||||
public class PlaceFuturesOrderOptions : EndpointOptions<PlaceFuturesOrderRequest, IPlaceFuturesOrderEndpoint>
|
||||
public class PlaceFuturesOrderOptions : CapabilityOptions<PlaceFuturesOrderRequest, IPlaceFuturesOrderEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Place a new futures order";
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for placing a new spot trigger order
|
||||
/// </summary>
|
||||
public class PlaceFuturesTriggerOrderOptions : EndpointOptions<PlaceFuturesTriggerOrderRequest, IPlaceFuturesTriggerOrderEndpoint>
|
||||
public class PlaceFuturesTriggerOrderOptions : CapabilityOptions<PlaceFuturesTriggerOrderRequest, IPlaceFuturesTriggerOrderEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Place a new futures trigger order";
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for placing a new spot order
|
||||
/// </summary>
|
||||
public class PlaceSpotOrderOptions : EndpointOptions<PlaceSpotOrderRequest, IPlaceSpotOrderEndpoint>
|
||||
public class PlaceSpotOrderOptions : CapabilityOptions<PlaceSpotOrderRequest, IPlaceSpotOrderEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Place a new spot order";
|
||||
|
||||
+1
-6
@@ -5,7 +5,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for placing a new spot trigger order
|
||||
/// </summary>
|
||||
public class PlaceSpotTriggerOrderOptions : EndpointOptions<PlaceSpotTriggerOrderRequest, IPlaceSpotTriggerOrderEndpoint>
|
||||
public class PlaceSpotTriggerOrderOptions : CapabilityOptions<PlaceSpotTriggerOrderRequest, IPlaceSpotTriggerOrderEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Place a new spot trigger order";
|
||||
@@ -33,11 +33,6 @@ namespace CryptoExchange.Net.SharedApis
|
||||
if (request.Symbol!.TradingMode != TradingMode.Spot)
|
||||
return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot");
|
||||
|
||||
#warning TODO
|
||||
//var quantityError = client.SpotSupportedOrderQuantity.Validate(request.OrderSide, request.OrderPrice == null ? SharedOrderType.Market : SharedOrderType.Limit, request.Quantity);
|
||||
//if (quantityError != null)
|
||||
// return quantityError;
|
||||
|
||||
return base.ValidateRequest(request, client);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for setting a TP/SL
|
||||
/// </summary>
|
||||
public class SetFuturesTpSlOptions : EndpointOptions<SetTpSlRequest, ISetFuturesTpSlEndpoint>
|
||||
public class SetFuturesTpSlOptions : CapabilityOptions<SetTpSlRequest, ISetFuturesTpSlEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Set take profit or stop loss values for a futures position";
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for setting leverage
|
||||
/// </summary>
|
||||
public class SetLeverageOptions : EndpointOptions<SetLeverageRequest, ISetLeverageEndpoint>
|
||||
public class SetLeverageOptions : CapabilityOptions<SetLeverageRequest, ISetLeverageEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Set the leverage for a futures symbol";
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for setting position mode
|
||||
/// </summary>
|
||||
public class SetPositionModeOptions : EndpointOptions<SetPositionModeRequest, ISetPositionModeEndpoint>
|
||||
public class SetPositionModeOptions : CapabilityOptions<SetPositionModeRequest, ISetPositionModeEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Set the futures position mode";
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting a transfer
|
||||
/// </summary>
|
||||
public class TransferOptions : EndpointOptions<TransferRequest, ITransferEndpoint>
|
||||
public class TransferOptions : CapabilityOptions<TransferRequest, ITransferEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Transfer funds between account types";
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting a withdrawal
|
||||
/// </summary>
|
||||
public class WithdrawOptions : EndpointOptions<WithdrawRequest, IWithdrawEndpoint>
|
||||
public class WithdrawOptions : CapabilityOptions<WithdrawRequest, IWithdrawEndpoint>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Withdraw an asset";
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for canceling a futures order
|
||||
/// </summary>
|
||||
public class CancelFuturesOrderSocketOptions : EndpointOptions<CancelOrderRequest, IFuturesOrderManagementSocketClient>
|
||||
public class CancelFuturesOrderSocketOptions : CapabilityOptions<CancelOrderRequest, ICancelFuturesOrderOperation>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Cancel a futures order over a socket connection";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public CancelFuturesOrderSocketOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IFuturesOrderManagementSocketClient.CancelFuturesOrderAsync))
|
||||
public CancelFuturesOrderSocketOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesOrderOperation.CancelFuturesOrderAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for canceling a spot order
|
||||
/// </summary>
|
||||
public class CancelSpotOrderSocketOptions : EndpointOptions<CancelOrderRequest, ISpotOrderManagementSocketClient>
|
||||
public class CancelSpotOrderSocketOptions : CapabilityOptions<CancelOrderRequest, ICancelSpotOrderOperation>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Cancel a spot order over a socket connection";
|
||||
@@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public CancelSpotOrderSocketOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ISpotOrderManagementSocketClient.CancelSpotOrderAsync))
|
||||
public CancelSpotOrderSocketOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelSpotOrderOperation.CancelSpotOrderAsync))
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(CancelOrderRequest request, ISpotOrderManagementSocketClient client)
|
||||
public override Error? ValidateRequest(CancelOrderRequest request, ICancelSpotOrderOperation client)
|
||||
{
|
||||
if (request.Symbol!.TradingMode != TradingMode.Spot)
|
||||
return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot");
|
||||
+3
-3
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for placing a new futures order
|
||||
/// </summary>
|
||||
public class PlaceFuturesOrderSocketOptions : EndpointOptions<PlaceFuturesOrderRequest, IFuturesOrderManagementSocketClient>
|
||||
public class PlaceFuturesOrderSocketOptions : CapabilityOptions<PlaceFuturesOrderRequest, IPlaceFuturesOrderOperation>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Place a new futures order over a socket connection";
|
||||
@@ -20,7 +20,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public PlaceFuturesOrderSocketOptions(string exchange, bool supportsTpSl) : base(exchange, true, nameof(IFuturesOrderManagementSocketClient.PlaceFuturesOrderAsync))
|
||||
public PlaceFuturesOrderSocketOptions(string exchange, bool supportsTpSl) : base(exchange, true, nameof(IPlaceFuturesOrderOperation.PlaceFuturesOrderAsync))
|
||||
{
|
||||
SupportsTpSl = supportsTpSl;
|
||||
}
|
||||
@@ -30,7 +30,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// </summary>
|
||||
public override Error? ValidateRequest(
|
||||
PlaceFuturesOrderRequest request,
|
||||
IFuturesOrderManagementSocketClient client
|
||||
IPlaceFuturesOrderOperation client
|
||||
)
|
||||
{
|
||||
if (!SupportsTpSl && (request.StopLossPrice != null || request.TakeProfitPrice != null))
|
||||
+3
-3
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for placing a new spot order
|
||||
/// </summary>
|
||||
public class PlaceSpotOrderSocketOptions : EndpointOptions<PlaceSpotOrderRequest, ISpotOrderManagementSocketClient>
|
||||
public class PlaceSpotOrderSocketOptions : CapabilityOptions<PlaceSpotOrderRequest, IPlaceSpotOrderOperation>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Place a new spot order over a socket connection";
|
||||
@@ -16,7 +16,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public PlaceSpotOrderSocketOptions(string exchange) : base(exchange, true, nameof(ISpotOrderManagementSocketClient.PlaceSpotOrderAsync))
|
||||
public PlaceSpotOrderSocketOptions(string exchange) : base(exchange, true, nameof(IPlaceSpotOrderOperation.PlaceSpotOrderAsync))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// </summary>
|
||||
public override Error? ValidateRequest(
|
||||
PlaceSpotOrderRequest request,
|
||||
ISpotOrderManagementSocketClient client)
|
||||
IPlaceSpotOrderOperation client)
|
||||
{
|
||||
if (request.Symbol!.TradingMode != TradingMode.Spot)
|
||||
return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot");
|
||||
+2
-2
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for subscribing to balance updates
|
||||
/// </summary>
|
||||
public class SubscribeBalanceOptions : EndpointOptions<SubscribeBalancesRequest, IBalanceSocketClient>
|
||||
public class SubscribeBalanceOptions : CapabilityOptions<SubscribeBalancesRequest, ISubscribeBalancesOperation>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Subscribe to balance updates";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public SubscribeBalanceOptions(string exchange, bool needsAuthentication) : base(exchange, needsAuthentication, nameof(IBalanceSocketClient.SubscribeToBalanceUpdatesAsync))
|
||||
public SubscribeBalanceOptions(string exchange, bool needsAuthentication) : base(exchange, needsAuthentication, nameof(ISubscribeBalancesOperation.SubscribeToBalanceUpdatesAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for subscribing to book ticker updates
|
||||
/// </summary>
|
||||
public class SubscribeBookTickerOptions : EndpointOptions<SubscribeBookTickerRequest, IBookTickerSocketClient>
|
||||
public class SubscribeBookTickerOptions : CapabilityOptions<SubscribeBookTickerRequest, ISubscribeBookTickerOperation>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Subscribe to best bid and ask price updates";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public SubscribeBookTickerOptions(string exchange, bool needsAuthentication) : base(exchange, needsAuthentication, nameof(IBookTickerSocketClient.SubscribeToBookTickerUpdatesAsync))
|
||||
public SubscribeBookTickerOptions(string exchange, bool needsAuthentication) : base(exchange, needsAuthentication, nameof(ISubscribeBookTickerOperation.SubscribeToBookTickerUpdatesAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for subscribing to order updates
|
||||
/// </summary>
|
||||
public class SubscribeFuturesOrderOptions : EndpointOptions<SubscribeFuturesOrderRequest, IFuturesOrderSocketClient>
|
||||
public class SubscribeFuturesOrderOptions : CapabilityOptions<SubscribeFuturesOrderRequest, ISubscribeFuturesOrdersOperation>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Subscribe to futures order updates";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public SubscribeFuturesOrderOptions(string exchange, bool needsAuthentication) : base(exchange, needsAuthentication, nameof(IFuturesOrderSocketClient.SubscribeToFuturesOrderUpdatesAsync))
|
||||
public SubscribeFuturesOrderOptions(string exchange, bool needsAuthentication) : base(exchange, needsAuthentication, nameof(ISubscribeFuturesOrdersOperation.SubscribeToFuturesOrderUpdatesAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for subscribing to kline/candlestick updates
|
||||
/// </summary>
|
||||
public class SubscribeKlineOptions : EndpointOptions<SubscribeKlineRequest, IKlineSocketClient>
|
||||
public class SubscribeKlineOptions : CapabilityOptions<SubscribeKlineRequest, ISubscribeKlinesOperation>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Subscribe to candlestick updates for a symbol";
|
||||
@@ -20,7 +20,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public SubscribeKlineOptions(string exchange, bool needsAuthentication) : base(exchange, needsAuthentication, nameof(IKlineSocketClient.SubscribeToKlineUpdatesAsync))
|
||||
public SubscribeKlineOptions(string exchange, bool needsAuthentication) : base(exchange, needsAuthentication, nameof(ISubscribeKlinesOperation.SubscribeToKlineUpdatesAsync))
|
||||
{
|
||||
SupportIntervals = new[]
|
||||
{
|
||||
@@ -45,7 +45,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public SubscribeKlineOptions(string exchange, bool needsAuthentication, params SharedKlineInterval[] intervals)
|
||||
: base(exchange, needsAuthentication, nameof(IKlineSocketClient.SubscribeToKlineUpdatesAsync))
|
||||
: base(exchange, needsAuthentication, nameof(ISubscribeKlinesOperation.SubscribeToKlineUpdatesAsync))
|
||||
{
|
||||
SupportIntervals = intervals;
|
||||
}
|
||||
@@ -60,7 +60,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Validate a request
|
||||
/// </summary>
|
||||
public override Error? ValidateRequest(SubscribeKlineRequest request, IKlineSocketClient client)
|
||||
public override Error? ValidateRequest(SubscribeKlineRequest request, ISubscribeKlinesOperation client)
|
||||
{
|
||||
if (!IsSupported(request.Interval))
|
||||
return ArgumentError.Invalid(nameof(SubscribeKlineRequest.Interval), "Interval not supported");
|
||||
+3
-3
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for subscribing to order book snapshot updates
|
||||
/// </summary>
|
||||
public class SubscribeOrderBookOptions : EndpointOptions<SubscribeOrderBookRequest, IOrderBookSocketClient>
|
||||
public class SubscribeOrderBookOptions : CapabilityOptions<SubscribeOrderBookRequest, ISubscribeOrderBookOperation>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Subscribe to order book updates for a symbol";
|
||||
@@ -20,7 +20,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public SubscribeOrderBookOptions(string exchange, bool needsAuthentication, int[] limits) : base(exchange, needsAuthentication, nameof(IOrderBookSocketClient.SubscribeToOrderBookUpdatesAsync))
|
||||
public SubscribeOrderBookOptions(string exchange, bool needsAuthentication, int[] limits) : base(exchange, needsAuthentication, nameof(ISubscribeOrderBookOperation.SubscribeToOrderBookUpdatesAsync))
|
||||
{
|
||||
SupportedLimits = limits;
|
||||
}
|
||||
@@ -28,7 +28,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Validate a request
|
||||
/// </summary>
|
||||
public override Error? ValidateRequest(SubscribeOrderBookRequest request, IOrderBookSocketClient client)
|
||||
public override Error? ValidateRequest(SubscribeOrderBookRequest request, ISubscribeOrderBookOperation client)
|
||||
{
|
||||
if (request.Limit != null && !SupportedLimits.Contains(request.Limit.Value))
|
||||
return ArgumentError.Invalid(nameof(SubscribeOrderBookRequest.Limit), "Limit not supported");
|
||||
+2
-2
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for subscribing to position updates
|
||||
/// </summary>
|
||||
public class SubscribePositionOptions : EndpointOptions<SubscribePositionRequest, IPositionSocketClient>
|
||||
public class SubscribePositionOptions : CapabilityOptions<SubscribePositionRequest, ISubscribePositionsOperation>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Subscribe to futures position updates";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public SubscribePositionOptions(string exchange, bool needsAuthentication) : base(exchange, needsAuthentication, nameof(IPositionSocketClient.SubscribeToPositionUpdatesAsync))
|
||||
public SubscribePositionOptions(string exchange, bool needsAuthentication) : base(exchange, needsAuthentication, nameof(ISubscribePositionsOperation.SubscribeToPositionUpdatesAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for subscribing to order updates
|
||||
/// </summary>
|
||||
public class SubscribeSpotOrderOptions : EndpointOptions<SubscribeSpotOrderRequest, ISpotOrderSocketClient>
|
||||
public class SubscribeSpotOrderOptions : CapabilityOptions<SubscribeSpotOrderRequest, ISubscribeSpotOrdersOperation>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Subscribe to spot order updates";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public SubscribeSpotOrderOptions(string exchange, bool needsAuthentication) : base(exchange, needsAuthentication, nameof(ISpotOrderSocketClient.SubscribeToSpotOrderUpdatesAsync))
|
||||
public SubscribeSpotOrderOptions(string exchange, bool needsAuthentication) : base(exchange, needsAuthentication, nameof(ISubscribeSpotOrdersOperation.SubscribeToSpotOrderUpdatesAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -3,7 +3,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for subscribing to ticker updates
|
||||
/// </summary>
|
||||
public class SubscribeTickerOptions : EndpointOptions<SubscribeTickerRequest, ITickerSocketClient>
|
||||
public class SubscribeTickerOptions : CapabilityOptions<SubscribeTickerRequest, ISubscribeTickerOperation>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Subscribe to price ticker updates for a symbol";
|
||||
@@ -16,7 +16,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public SubscribeTickerOptions(string exchange, SharedTickerType? tickerCalcType = null) : base(exchange, false, nameof(ITickerSocketClient.SubscribeToTickerUpdatesAsync))
|
||||
public SubscribeTickerOptions(string exchange, SharedTickerType? tickerCalcType = null) : base(exchange, false, nameof(ISubscribeTickerOperation.SubscribeToTickerUpdatesAsync))
|
||||
{
|
||||
TickerType = tickerCalcType ?? SharedTickerType.Day24H;
|
||||
}
|
||||
+2
-2
@@ -3,7 +3,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for subscribing to ticker updates
|
||||
/// </summary>
|
||||
public class SubscribeTickersOptions : EndpointOptions<SubscribeAllTickersRequest, ITickersSocketClient>
|
||||
public class SubscribeTickersOptions : CapabilityOptions<SubscribeAllTickersRequest, ISubscribeAllTickersOperation>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Subscribe to price ticker updates for all symbols";
|
||||
@@ -16,7 +16,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public SubscribeTickersOptions(string exchange, SharedTickerType? tickerCalcType = null) : base(exchange, false, nameof(ITickersSocketClient.SubscribeToAllTickersUpdatesAsync))
|
||||
public SubscribeTickersOptions(string exchange, SharedTickerType? tickerCalcType = null) : base(exchange, false, nameof(ISubscribeAllTickersOperation.SubscribeToAllTickersUpdatesAsync))
|
||||
{
|
||||
TickerType = tickerCalcType ?? SharedTickerType.Day24H;
|
||||
}
|
||||
+2
-2
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for subscribing to trade updates
|
||||
/// </summary>
|
||||
public class SubscribeTradeOptions : EndpointOptions<SubscribeTradeRequest, ITradeSocketClient>
|
||||
public class SubscribeTradeOptions : CapabilityOptions<SubscribeTradeRequest, ISubscribeTradesOperation>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Subscribe to public trade updates for a symbol";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public SubscribeTradeOptions(string exchange, bool needsAuthentication) : base(exchange, needsAuthentication, nameof(ITradeSocketClient.SubscribeToTradeUpdatesAsync))
|
||||
public SubscribeTradeOptions(string exchange, bool needsAuthentication) : base(exchange, needsAuthentication, nameof(ISubscribeTradesOperation.SubscribeToTradeUpdatesAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for subscribing to user trade updates
|
||||
/// </summary>
|
||||
public class SubscribeUserTradeOptions : EndpointOptions<SubscribeUserTradeRequest, IUserTradeSocketClient>
|
||||
public class SubscribeUserTradeOptions : CapabilityOptions<SubscribeUserTradeRequest, ISubscribeUserTradesOperation>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Subscribe to user trade updates";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public SubscribeUserTradeOptions(string exchange, bool needsAuthentication) : base(exchange, needsAuthentication, nameof(IUserTradeSocketClient.SubscribeToUserTradeUpdatesAsync))
|
||||
public SubscribeUserTradeOptions(string exchange, bool needsAuthentication) : base(exchange, needsAuthentication, nameof(ISubscribeUserTradesOperation.SubscribeToUserTradeUpdatesAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
+8
-10
@@ -5,24 +5,22 @@ using System.Text;
|
||||
namespace CryptoExchange.Net.SharedApis
|
||||
{
|
||||
/// <summary>
|
||||
/// Options for paginated endpoints
|
||||
/// Options and description of a Shared API capability which returns paginated data.
|
||||
/// </summary>
|
||||
public abstract class PaginatedCapabilityOptions<
|
||||
#if NET5_0_OR_GREATER
|
||||
public abstract class PaginatedEndpointOptions<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] TRequest, TClient> : EndpointOptions<TRequest, TClient>
|
||||
where TRequest : SharedRequest
|
||||
where TClient : ISharedClient
|
||||
#else
|
||||
public abstract class PaginatedEndpointOptions<TRequest, TClient> : EndpointOptions<TRequest, TClient>
|
||||
where TRequest : SharedRequest
|
||||
where TClient : ISharedClient
|
||||
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)]
|
||||
#endif
|
||||
TRequest, TCapability> : CapabilityOptions<TRequest, TCapability>
|
||||
where TRequest : SharedRequest
|
||||
where TCapability : ISharedApiCapability
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether ascending data retrieval and pagination is available
|
||||
/// </summary>
|
||||
public bool SupportsAscending { get; set; }
|
||||
/// <summary>
|
||||
/// Whether ascending data retrieval and pagination is available
|
||||
/// Whether descending data retrieval and pagination is available
|
||||
/// </summary>
|
||||
public bool SupportsDescending { get; set; }
|
||||
|
||||
@@ -44,7 +42,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public PaginatedEndpointOptions(
|
||||
public PaginatedCapabilityOptions(
|
||||
string exchange,
|
||||
bool supportsAscending,
|
||||
bool supportsDescending,
|
||||
Reference in New Issue
Block a user