mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-10-24 12:01:00 +00:00
wip
This commit is contained in:
+2
-2
@@ -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, IFuturesOrderClientIdRestClient>
|
||||
public class CancelFuturesOrderByClientOrderIdOptions : EndpointOptions<CancelOrderRequest, ICancelFuturesOrderByClientOrderIdRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Cancel a futures order by its client order id";
|
||||
@@ -11,7 +11,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public CancelFuturesOrderByClientOrderIdOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IFuturesOrderClientIdRestClient.CancelFuturesOrderByClientOrderIdAsync))
|
||||
public CancelFuturesOrderByClientOrderIdOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesOrderByClientOrderIdRestClient.CancelFuturesOrderByClientOrderIdAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for canceling a futures order
|
||||
/// </summary>
|
||||
public class CancelFuturesOrderOptions : EndpointOptions<CancelOrderRequest, IFuturesOrderRestClient>
|
||||
public class CancelFuturesOrderOptions : EndpointOptions<CancelOrderRequest, ICancelFuturesOrderRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Cancel a futures order";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public CancelFuturesOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IFuturesOrderRestClient.CancelFuturesOrderAsync))
|
||||
public CancelFuturesOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesOrderRestClient.CancelFuturesOrderAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for canceling a TP/SL
|
||||
/// </summary>
|
||||
public class CancelFuturesTpSlOptions : EndpointOptions<CancelTpSlRequest, IFuturesTpSlRestClient>
|
||||
public class CancelFuturesTpSlOptions : EndpointOptions<CancelTpSlRequest, ICancelFuturesTpSlRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Cancel a take profit or stop loss order for a futures position";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public CancelFuturesTpSlOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IFuturesTpSlRestClient.CancelFuturesTpSlAsync))
|
||||
public CancelFuturesTpSlOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesTpSlRestClient.CancelFuturesTpSlAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for canceling spot trigger order
|
||||
/// </summary>
|
||||
public class CancelFuturesTriggerOrderOptions : EndpointOptions<CancelOrderRequest, IFuturesTriggerOrderRestClient>
|
||||
public class CancelFuturesTriggerOrderOptions : EndpointOptions<CancelOrderRequest, ICancelFuturesTriggerOrderRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Cancel a futures trigger order";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public CancelFuturesTriggerOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IFuturesTriggerOrderRestClient.CancelFuturesTriggerOrderAsync))
|
||||
public CancelFuturesTriggerOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesTriggerOrderRestClient.CancelFuturesTriggerOrderAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for canceling a spot order
|
||||
/// </summary>
|
||||
public class CancelSpotOrderByClientOrderIdOptions : EndpointOptions<CancelOrderRequest, ISpotOrderClientIdRestClient>
|
||||
public class CancelSpotOrderByClientOrderIdOptions : EndpointOptions<CancelOrderRequest, ICancelSpotOrderByClientOrderIdRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Cancel a spot order by its client order id";
|
||||
@@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public CancelSpotOrderByClientOrderIdOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ISpotOrderClientIdRestClient.CancelSpotOrderByClientOrderIdAsync))
|
||||
public CancelSpotOrderByClientOrderIdOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelSpotOrderByClientOrderIdRestClient.CancelSpotOrderByClientOrderIdAsync))
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(CancelOrderRequest request, ISpotOrderClientIdRestClient client)
|
||||
public override Error? ValidateRequest(CancelOrderRequest request, ICancelSpotOrderByClientOrderIdRestClient client)
|
||||
{
|
||||
if (request.Symbol!.TradingMode != TradingMode.Spot)
|
||||
return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot");
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for canceling a spot order
|
||||
/// </summary>
|
||||
public class CancelSpotOrderOptions : EndpointOptions<CancelOrderRequest, ISpotOrderRestClient>
|
||||
public class CancelSpotOrderOptions : EndpointOptions<CancelOrderRequest, ICancelSpotOrderRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Cancel a spot order";
|
||||
@@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public CancelSpotOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ISpotOrderRestClient.CancelSpotOrderAsync))
|
||||
public CancelSpotOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelSpotOrderRestClient.CancelSpotOrderAsync))
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(CancelOrderRequest request, ISpotOrderRestClient client)
|
||||
public override Error? ValidateRequest(CancelOrderRequest request, ICancelSpotOrderRestClient client)
|
||||
{
|
||||
if (request.Symbol!.TradingMode != TradingMode.Spot)
|
||||
return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot");
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting spot trigger order
|
||||
/// </summary>
|
||||
public class CancelSpotTriggerOrderOptions : EndpointOptions<CancelOrderRequest, ISpotTriggerOrderRestClient>
|
||||
public class CancelSpotTriggerOrderOptions : EndpointOptions<CancelOrderRequest, ICancelSpotTriggerOrderRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Cancel a spot trigger order";
|
||||
@@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public CancelSpotTriggerOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ISpotTriggerOrderRestClient.CancelSpotTriggerOrderAsync))
|
||||
public CancelSpotTriggerOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelSpotTriggerOrderRestClient.CancelSpotTriggerOrderAsync))
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(CancelOrderRequest request, ISpotTriggerOrderRestClient client)
|
||||
public override Error? ValidateRequest(CancelOrderRequest request, ICancelSpotTriggerOrderRestClient client)
|
||||
{
|
||||
if (request.Symbol!.TradingMode != TradingMode.Spot)
|
||||
return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot");
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for closing position
|
||||
/// </summary>
|
||||
public class ClosePositionOptions : EndpointOptions<ClosePositionRequest, IFuturesOrderRestClient>
|
||||
public class ClosePositionOptions : EndpointOptions<ClosePositionRequest, IClosePositionRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Close an open futures position";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public ClosePositionOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IFuturesOrderRestClient.ClosePositionAsync))
|
||||
public ClosePositionOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IClosePositionRestClient.ClosePositionAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -1,3 +1,4 @@
|
||||
using CryptoExchange.Net.SharedApis.Interfaces.Rest.V2.Spot.Tickers;
|
||||
using System.Text;
|
||||
|
||||
namespace CryptoExchange.Net.SharedApis
|
||||
@@ -5,7 +6,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting tickers
|
||||
/// </summary>
|
||||
public class GetSpotTickersOptions : EndpointOptions<GetTickersRequest, ISpotTickerRestClient>
|
||||
public class GetAllSpotTickersOptions : EndpointOptions<GetTickersRequest, IGetAllSpotTickersRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve price ticker information for all spot symbols";
|
||||
@@ -18,7 +19,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetSpotTickersOptions(string exchange, SharedTickerType? tickerCalcType = null) : base(exchange, false, nameof(ISpotTickerRestClient.GetSpotTickersAsync))
|
||||
public GetAllSpotTickersOptions(string exchange, SharedTickerType? tickerCalcType = null) : base(exchange, false, nameof(IGetAllSpotTickersRestClient.GetAllSpotTickersAsync))
|
||||
{
|
||||
TickerType = tickerCalcType ?? SharedTickerType.Day24H;
|
||||
}
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting asset info
|
||||
/// </summary>
|
||||
public class GetAssetOptions : EndpointOptions<GetAssetRequest, IAssetsRestClient>
|
||||
public class GetAssetOptions : EndpointOptions<GetAssetRequest, IGetAssetRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve basic info for a single asset and networks it supports for withdrawals/deposits";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetAssetOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IAssetsRestClient.GetAssetAsync))
|
||||
public GetAssetOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetAssetRestClient.GetAssetAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting assets info
|
||||
/// </summary>
|
||||
public class GetAssetsOptions : EndpointOptions<GetAssetsRequest, IAssetsRestClient>
|
||||
public class GetAssetsOptions : EndpointOptions<GetAssetsRequest, IGetAllAssetsRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve basic info for all assets and the networks they support for withdrawals/deposits";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetAssetsOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IAssetsRestClient.GetAssetsAsync))
|
||||
public GetAssetsOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetAllAssetsRestClient.GetAssetsAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting a transfer
|
||||
/// </summary>
|
||||
public class GetBalancesOptions : EndpointOptions<GetBalancesRequest, IBalanceRestClient>
|
||||
public class GetBalancesOptions : EndpointOptions<GetBalancesRequest, IGetBalancesRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve account balances";
|
||||
@@ -19,7 +19,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetBalancesOptions(string exchange, params AccountTypeFilter[] accountTypes) : base(exchange, true, nameof(IBalanceRestClient.GetBalancesAsync))
|
||||
public GetBalancesOptions(string exchange, params AccountTypeFilter[] accountTypes) : base(exchange, true, nameof(IGetBalancesRestClient.GetBalancesAsync))
|
||||
{
|
||||
SupportedAccountTypes = accountTypes;
|
||||
}
|
||||
@@ -29,7 +29,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// </summary>
|
||||
public override Error? ValidateRequest(
|
||||
GetBalancesRequest request,
|
||||
IBalanceRestClient client)
|
||||
IGetBalancesRestClient client)
|
||||
{
|
||||
if (request.AccountType != null && !IsValid(request.AccountType.Value))
|
||||
return ArgumentError.Invalid(nameof(request.AccountType), "Invalid AccountType");
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting book ticker
|
||||
/// </summary>
|
||||
public class GetBookTickerOptions : EndpointOptions<GetBookTickerRequest, IBookTickerRestClient>
|
||||
public class GetBookTickerOptions : EndpointOptions<GetBookTickerRequest, IGetBookTickerRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve the best bid and ask price for a symbol";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetBookTickerOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IBookTickerRestClient.GetBookTickerAsync))
|
||||
public GetBookTickerOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetBookTickerRestClient.GetBookTickerAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting deposit address
|
||||
/// </summary>
|
||||
public class GetDepositAddressesOptions : EndpointOptions<GetDepositAddressesRequest, IDepositRestClient>
|
||||
public class GetDepositAddressesOptions : EndpointOptions<GetDepositAddressesRequest, IGetDepositAddressesRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve deposit addresses for an asset";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetDepositAddressesOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IDepositRestClient.GetDepositAddressesAsync))
|
||||
public GetDepositAddressesOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetDepositAddressesRestClient.GetDepositAddressesAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting deposits
|
||||
/// </summary>
|
||||
public class GetDepositsOptions : PaginatedEndpointOptions<GetDepositsRequest, IDepositRestClient>
|
||||
public class GetDepositHistoryOptions : PaginatedEndpointOptions<GetDepositsRequest, IGetDepositHistoryRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve deposit history";
|
||||
@@ -15,13 +15,13 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetDepositsOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit)
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IDepositRestClient.GetDepositsAsync))
|
||||
public GetDepositHistoryOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit)
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetDepositHistoryRestClient.GetDepositHistoryAsync))
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(GetDepositsRequest request, IDepositRestClient client)
|
||||
public override Error? ValidateRequest(GetDepositsRequest request, IGetDepositHistoryRestClient client)
|
||||
{
|
||||
if (!SupportsAscending && request.Direction == DataDirection.Ascending)
|
||||
return ArgumentError.Invalid(nameof(GetWithdrawalsRequest.Direction), $"Ascending direction is not supported");
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting trading fee info
|
||||
/// </summary>
|
||||
public class GetFeeOptions : EndpointOptions<GetFeeRequest, IFeeRestClient>
|
||||
public class GetFeeOptions : EndpointOptions<GetFeeRequest, IGetFeesRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve trading fee information";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetFeeOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IFeeRestClient.GetFeesAsync))
|
||||
public GetFeeOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetFeesRestClient.GetFeesAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting funding rate history
|
||||
/// </summary>
|
||||
public class GetFundingRateHistoryOptions : PaginatedEndpointOptions<GetFundingRateHistoryRequest, IFundingRateRestClient>
|
||||
public class GetFundingRateHistoryOptions : PaginatedEndpointOptions<GetFundingRateHistoryRequest, IGetFundingRateHistoryRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve historical funding rates for a futures symbol";
|
||||
@@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetFundingRateHistoryOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit, bool needsAuthentication)
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IFundingRateRestClient.GetFundingRateHistoryAsync))
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IGetFundingRateHistoryRestClient.GetFundingRateHistoryAsync))
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(GetFundingRateHistoryRequest request, IFundingRateRestClient client)
|
||||
public override Error? ValidateRequest(GetFundingRateHistoryRequest request, IGetFundingRateHistoryRestClient client)
|
||||
{
|
||||
if (!SupportsAscending && request.Direction == DataDirection.Ascending)
|
||||
return ArgumentError.Invalid(nameof(GetWithdrawalsRequest.Direction), $"Ascending direction is not supported");
|
||||
|
||||
+3
-3
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting closed orders
|
||||
/// </summary>
|
||||
public class GetFuturesClosedOrdersOptions : PaginatedEndpointOptions<GetClosedOrdersRequest, IFuturesOrderRestClient>
|
||||
public class GetFuturesClosedOrdersOptions : PaginatedEndpointOptions<GetClosedOrdersRequest, IGetClosedFuturesOrdersRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve closed futures orders";
|
||||
@@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetFuturesClosedOrdersOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit)
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IFuturesOrderRestClient.GetClosedFuturesOrdersAsync))
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetClosedFuturesOrdersRestClient.GetClosedFuturesOrdersAsync))
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(GetClosedOrdersRequest request, IFuturesOrderRestClient client)
|
||||
public override Error? ValidateRequest(GetClosedOrdersRequest request, IGetClosedFuturesOrdersRestClient client)
|
||||
{
|
||||
if (!SupportsAscending && request.Direction == DataDirection.Ascending)
|
||||
return ArgumentError.Invalid(nameof(GetClosedOrdersRequest.Direction), $"Ascending direction is not supported");
|
||||
|
||||
+2
-2
@@ -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, IFuturesOrderClientIdRestClient>
|
||||
public class GetFuturesOrderByClientOrderIdOptions : EndpointOptions<GetOrderRequest, IGetFuturesOrderByClientOrderIdRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve a futures order by its client order id";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetFuturesOrderByClientOrderIdOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IFuturesOrderClientIdRestClient.GetFuturesOrderByClientOrderIdAsync))
|
||||
public GetFuturesOrderByClientOrderIdOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetFuturesOrderByClientOrderIdRestClient.GetFuturesOrderByClientOrderIdAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for getting a futures order by id endpoint
|
||||
/// </summary>
|
||||
public class GetFuturesOrderOptions : EndpointOptions<GetOrderRequest, IFuturesOrderRestClient>
|
||||
public class GetFuturesOrderOptions : EndpointOptions<GetOrderRequest, IGetFuturesOrderRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve a futures order";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetFuturesOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IFuturesOrderRestClient.GetFuturesOrderAsync))
|
||||
public GetFuturesOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetFuturesOrderRestClient.GetFuturesOrderAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for getting a trades for an order
|
||||
/// </summary>
|
||||
public class GetFuturesOrderTradesOptions : EndpointOptions<GetOrderTradesRequest, IFuturesOrderRestClient>
|
||||
public class GetFuturesOrderTradesOptions : EndpointOptions<GetOrderTradesRequest, IGetFuturesOrderTradesRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve trades for a futures order";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetFuturesOrderTradesOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IFuturesOrderRestClient.GetFuturesOrderTradesAsync))
|
||||
public GetFuturesOrderTradesOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetFuturesOrderTradesRestClient.GetFuturesOrderTradesAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting symbol info
|
||||
/// </summary>
|
||||
public class GetFuturesSymbolsOptions : EndpointOptions<GetSymbolsRequest, IFuturesSymbolRestClient>
|
||||
public class GetFuturesSymbolsOptions : EndpointOptions<GetSymbolsRequest, IGetFuturesSymbolsRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve supported futures symbols and their trading rules";
|
||||
@@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetFuturesSymbolsOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IFuturesSymbolRestClient.GetFuturesSymbolsAsync))
|
||||
public GetFuturesSymbolsOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetFuturesSymbolsRestClient.GetFuturesSymbolsAsync))
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(GetSymbolsRequest request, IFuturesSymbolRestClient client)
|
||||
public override Error? ValidateRequest(GetSymbolsRequest request, IGetFuturesSymbolsRestClient client)
|
||||
{
|
||||
if (request.BaseAssetType != null && request.BaseAssetSubType != null)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting ticker
|
||||
/// </summary>
|
||||
public class GetFuturesTickerOptions : EndpointOptions<GetTickerRequest, IFuturesTickerRestClient>
|
||||
public class GetFuturesTickerOptions : EndpointOptions<GetTickerRequest, IGetFuturesTickerRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve price ticker information for a futures symbol";
|
||||
@@ -18,7 +18,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetFuturesTickerOptions(string exchange, SharedTickerType? tickerCalcType = null) : base(exchange, false, nameof(IFuturesTickerRestClient.GetFuturesTickerAsync))
|
||||
public GetFuturesTickerOptions(string exchange, SharedTickerType? tickerCalcType = null) : base(exchange, false, nameof(IGetFuturesTickerRestClient.GetFuturesTickerAsync))
|
||||
{
|
||||
TickerType = tickerCalcType ?? SharedTickerType.Day24H;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting tickers
|
||||
/// </summary>
|
||||
public class GetFuturesTickersOptions : EndpointOptions<GetTickersRequest, IFuturesTickerRestClient>
|
||||
public class GetFuturesTickersOptions : EndpointOptions<GetTickersRequest, IGetAllFuturesTickersRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve price ticker information for all futures symbols";
|
||||
@@ -18,7 +18,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetFuturesTickersOptions(string exchange, SharedTickerType? tickerCalcType = null) : base(exchange, false, nameof(IFuturesTickerRestClient.GetFuturesTickersAsync))
|
||||
public GetFuturesTickersOptions(string exchange, SharedTickerType? tickerCalcType = null) : base(exchange, false, nameof(IGetAllFuturesTickersRestClient.GetFuturesTickersAsync))
|
||||
{
|
||||
TickerType = tickerCalcType ?? SharedTickerType.Day24H;
|
||||
}
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting futures trigger order
|
||||
/// </summary>
|
||||
public class GetFuturesTriggerOrderOptions : EndpointOptions<GetOrderRequest, IFuturesTriggerOrderRestClient>
|
||||
public class GetFuturesTriggerOrderOptions : EndpointOptions<GetOrderRequest, IGetFuturesTriggerOrderRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve a futures trigger order";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetFuturesTriggerOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IFuturesTriggerOrderRestClient.GetFuturesTriggerOrderAsync))
|
||||
public GetFuturesTriggerOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetFuturesTriggerOrderRestClient.GetFuturesTriggerOrderAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting user trades
|
||||
/// </summary>
|
||||
public class GetFuturesUserTradesOptions : PaginatedEndpointOptions<GetUserTradesRequest, IFuturesOrderRestClient>
|
||||
public class GetFuturesUserTradesOptions : PaginatedEndpointOptions<GetUserTradesRequest, IGetFuturesUserTradesRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve futures user trade history";
|
||||
@@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetFuturesUserTradesOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit)
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IFuturesOrderRestClient.GetFuturesUserTradesAsync))
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetFuturesUserTradesRestClient.GetFuturesUserTradesAsync))
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(GetUserTradesRequest request, IFuturesOrderRestClient client)
|
||||
public override Error? ValidateRequest(GetUserTradesRequest request, IGetFuturesUserTradesRestClient client)
|
||||
{
|
||||
if (!SupportsAscending && request.Direction == DataDirection.Ascending)
|
||||
return ArgumentError.Invalid(nameof(GetUserTradesRequest.Direction), $"Ascending direction is not supported");
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting kline/candlestick data
|
||||
/// </summary>
|
||||
public class GetIndexPriceKlinesOptions : PaginatedEndpointOptions<GetKlinesRequest, IIndexPriceKlineRestClient>
|
||||
public class GetIndexPriceKlinesOptions : PaginatedEndpointOptions<GetKlinesRequest, IGetIndexPriceKlinesRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve index price candlestick data";
|
||||
@@ -26,7 +26,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetIndexPriceKlinesOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit, bool needsAuthentication)
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IIndexPriceKlineRestClient.GetIndexPriceKlinesAsync))
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IGetIndexPriceKlinesRestClient.GetIndexPriceKlinesAsync))
|
||||
{
|
||||
SupportIntervals = new[]
|
||||
{
|
||||
@@ -64,7 +64,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
public bool IsSupported(SharedKlineInterval interval) => SupportIntervals.Contains(interval);
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(GetKlinesRequest request, IIndexPriceKlineRestClient client)
|
||||
public override Error? ValidateRequest(GetKlinesRequest request, IGetIndexPriceKlinesRestClient client)
|
||||
{
|
||||
if (!IsSupported(request.Interval))
|
||||
return ArgumentError.Invalid(nameof(GetKlinesRequest.Interval), $"Interval {request.Interval} not supported");
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting kline/candlestick data
|
||||
/// </summary>
|
||||
public class GetKlinesOptions : PaginatedEndpointOptions<GetKlinesRequest, IKlineRestClient>
|
||||
public class GetKlinesOptions : PaginatedEndpointOptions<GetKlinesRequest, IGetKlinesRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve candlestick data for a symbol";
|
||||
@@ -26,7 +26,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetKlinesOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit, bool needsAuthentication)
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IKlineRestClient.GetKlinesAsync))
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IGetKlinesRestClient.GetKlinesAsync))
|
||||
{
|
||||
SupportIntervals = new[]
|
||||
{
|
||||
@@ -51,7 +51,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetKlinesOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit, bool needsAuthentication, params SharedKlineInterval[] intervals)
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IKlineRestClient.GetKlinesAsync))
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IGetKlinesRestClient.GetKlinesAsync))
|
||||
{
|
||||
SupportIntervals = intervals;
|
||||
}
|
||||
@@ -64,7 +64,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
public bool IsSupported(SharedKlineInterval interval) => SupportIntervals.Contains(interval);
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(GetKlinesRequest request, IKlineRestClient client)
|
||||
public override Error? ValidateRequest(GetKlinesRequest request, IGetKlinesRestClient client)
|
||||
{
|
||||
if (!IsSupported(request.Interval))
|
||||
return ArgumentError.Invalid(nameof(GetKlinesRequest.Interval), $"Interval {request.Interval} not supported");
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting asset info
|
||||
/// </summary>
|
||||
public class GetLeverageOptions : EndpointOptions<GetLeverageRequest, ILeverageRestClient>
|
||||
public class GetLeverageOptions : EndpointOptions<GetLeverageRequest, IGetLeverageRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve the current leverage for a futures symbol";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetLeverageOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ILeverageRestClient.GetLeverageAsync))
|
||||
public GetLeverageOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetLeverageRestClient.GetLeverageAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting kline/candlestick data
|
||||
/// </summary>
|
||||
public class GetMarkPriceKlinesOptions : PaginatedEndpointOptions<GetKlinesRequest, IMarkPriceKlineRestClient>
|
||||
public class GetMarkPriceKlinesOptions : PaginatedEndpointOptions<GetKlinesRequest, IGetMarkPriceKlinesRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve mark price candlestick data";
|
||||
@@ -26,7 +26,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetMarkPriceKlinesOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit, bool needsAuthentication)
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IMarkPriceKlineRestClient.GetMarkPriceKlinesAsync))
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IGetMarkPriceKlinesRestClient.GetMarkPriceKlinesAsync))
|
||||
{
|
||||
SupportIntervals = new[]
|
||||
{
|
||||
@@ -51,7 +51,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetMarkPriceKlinesOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit, bool needsAuthentication, params SharedKlineInterval[] intervals)
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IMarkPriceKlineRestClient.GetMarkPriceKlinesAsync))
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IGetMarkPriceKlinesRestClient.GetMarkPriceKlinesAsync))
|
||||
{
|
||||
SupportIntervals = intervals;
|
||||
}
|
||||
@@ -64,7 +64,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
public bool IsSupported(SharedKlineInterval interval) => SupportIntervals.Contains(interval);
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(GetKlinesRequest request, IMarkPriceKlineRestClient client)
|
||||
public override Error? ValidateRequest(GetKlinesRequest request, IGetMarkPriceKlinesRestClient client)
|
||||
{
|
||||
if (!IsSupported(request.Interval))
|
||||
return ArgumentError.Invalid(nameof(GetKlinesRequest.Interval), $"Interval {request.Interval} not supported");
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for getting a futures order by id endpoint
|
||||
/// </summary>
|
||||
public class GetOpenFuturesOrdersOptions : EndpointOptions<GetOpenOrdersRequest, IFuturesOrderRestClient>
|
||||
public class GetOpenFuturesOrdersOptions : EndpointOptions<GetOpenOrdersRequest, IGetOpenFuturesOrdersRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve open futures orders";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetOpenFuturesOrdersOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IFuturesOrderRestClient.GetOpenFuturesOrdersAsync))
|
||||
public GetOpenFuturesOrdersOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetOpenFuturesOrdersRestClient.GetOpenFuturesOrdersAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting open interest
|
||||
/// </summary>
|
||||
public class GetOpenInterestOptions : EndpointOptions<GetOpenInterestRequest, IOpenInterestRestClient>
|
||||
public class GetOpenInterestOptions : EndpointOptions<GetOpenInterestRequest, IGetOpenInterestRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve open interest for a futures symbol";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetOpenInterestOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IOpenInterestRestClient.GetOpenInterestAsync))
|
||||
public GetOpenInterestOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetOpenInterestRestClient.GetOpenInterestAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for getting a spot order by id endpoint
|
||||
/// </summary>
|
||||
public class GetOpenSpotOrdersOptions : EndpointOptions<GetOpenOrdersRequest, ISpotOrderRestClient>
|
||||
public class GetOpenSpotOrdersOptions : EndpointOptions<GetOpenOrdersRequest, IGetOpenSpotOrdersRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve open spot orders";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetOpenSpotOrdersOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ISpotOrderRestClient.GetOpenSpotOrdersAsync))
|
||||
public GetOpenSpotOrdersOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetOpenSpotOrdersRestClient.GetOpenSpotOrdersAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting order book
|
||||
/// </summary>
|
||||
public class GetOrderBookOptions : EndpointOptions<GetOrderBookRequest, IOrderBookRestClient>
|
||||
public class GetOrderBookOptions : EndpointOptions<GetOrderBookRequest, IGetOrderBookRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve the current order book for a symbol";
|
||||
@@ -31,7 +31,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetOrderBookOptions(string exchange, int minLimit, int maxLimit, bool authenticated)
|
||||
: base(exchange, authenticated, nameof(IOrderBookRestClient.GetOrderBookAsync))
|
||||
: base(exchange, authenticated, nameof(IGetOrderBookRestClient.GetOrderBookAsync))
|
||||
{
|
||||
MinLimit = minLimit;
|
||||
MaxLimit = maxLimit;
|
||||
@@ -41,13 +41,13 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetOrderBookOptions(string exchange, int[] supportedLimits, bool authenticated)
|
||||
: base(exchange, authenticated, nameof(IOrderBookRestClient.GetOrderBookAsync))
|
||||
: base(exchange, authenticated, nameof(IGetOrderBookRestClient.GetOrderBookAsync))
|
||||
{
|
||||
SupportedLimits = supportedLimits;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(GetOrderBookRequest request, IOrderBookRestClient client)
|
||||
public override Error? ValidateRequest(GetOrderBookRequest request, IGetOrderBookRestClient client)
|
||||
{
|
||||
if (request.Limit == null)
|
||||
return base.ValidateRequest(request, client);
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting position history
|
||||
/// </summary>
|
||||
public class GetPositionHistoryOptions : PaginatedEndpointOptions<GetPositionHistoryRequest, IPositionHistoryRestClient>
|
||||
public class GetPositionHistoryOptions : PaginatedEndpointOptions<GetPositionHistoryRequest, IGetPositionHistoryRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve historical futures positions";
|
||||
@@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetPositionHistoryOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit)
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IPositionHistoryRestClient.GetPositionHistoryAsync))
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetPositionHistoryRestClient.GetPositionHistoryAsync))
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(GetPositionHistoryRequest request, IPositionHistoryRestClient client)
|
||||
public override Error? ValidateRequest(GetPositionHistoryRequest request, IGetPositionHistoryRestClient client)
|
||||
{
|
||||
if (!SupportsAscending && request.Direction == DataDirection.Ascending)
|
||||
return ArgumentError.Invalid(nameof(GetWithdrawalsRequest.Direction), $"Ascending direction is not supported");
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting current position mode
|
||||
/// </summary>
|
||||
public class GetPositionModeOptions : EndpointOptions<GetPositionModeRequest, IPositionModeRestClient>
|
||||
public class GetPositionModeOptions : EndpointOptions<GetPositionModeRequest, IGetPositionModeRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve the current futures position mode";
|
||||
@@ -11,7 +11,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetPositionModeOptions(string exchange) : base(exchange, true, nameof(IPositionModeRestClient.GetPositionModeAsync))
|
||||
public GetPositionModeOptions(string exchange) : base(exchange, true, nameof(IGetPositionModeRestClient.GetPositionModeAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting open positions
|
||||
/// </summary>
|
||||
public class GetPositionsOptions : EndpointOptions<GetPositionsRequest, IFuturesOrderRestClient>
|
||||
public class GetPositionsOptions : EndpointOptions<GetPositionsRequest, IGetPositionsRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve open futures positions";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetPositionsOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IFuturesOrderRestClient.GetPositionsAsync))
|
||||
public GetPositionsOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetPositionsRestClient.GetPositionsAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting recent trades
|
||||
/// </summary>
|
||||
public class GetRecentTradesOptions : EndpointOptions<GetRecentTradesRequest, IRecentTradeRestClient>
|
||||
public class GetRecentTradesOptions : EndpointOptions<GetRecentTradesRequest, IGetRecentTradesRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve recent public trades for a symbol";
|
||||
@@ -20,13 +20,13 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetRecentTradesOptions(string exchange, int limit, bool authenticated)
|
||||
: base(exchange, authenticated, nameof(IRecentTradeRestClient.GetRecentTradesAsync))
|
||||
: base(exchange, authenticated, nameof(IGetRecentTradesRestClient.GetRecentTradesAsync))
|
||||
{
|
||||
MaxLimit = limit;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(GetRecentTradesRequest request, IRecentTradeRestClient client)
|
||||
public override Error? ValidateRequest(GetRecentTradesRequest request, IGetRecentTradesRestClient client)
|
||||
{
|
||||
var baseError = base.ValidateRequest(request, client);
|
||||
if (baseError != null)
|
||||
|
||||
+3
-3
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting user trades
|
||||
/// </summary>
|
||||
public class GetSpotClosedOrdersOptions : PaginatedEndpointOptions<GetClosedOrdersRequest, ISpotOrderRestClient>
|
||||
public class GetSpotClosedOrdersOptions : PaginatedEndpointOptions<GetClosedOrdersRequest, IGetClosedSpotOrdersRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve closed spot orders";
|
||||
@@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetSpotClosedOrdersOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit)
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(ISpotOrderRestClient.GetClosedSpotOrdersAsync))
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetClosedSpotOrdersRestClient.GetClosedSpotOrdersAsync))
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(GetClosedOrdersRequest request, ISpotOrderRestClient client)
|
||||
public override Error? ValidateRequest(GetClosedOrdersRequest request, IGetClosedSpotOrdersRestClient client)
|
||||
{
|
||||
if (request.Symbol!.TradingMode != TradingMode.Spot)
|
||||
return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot");
|
||||
|
||||
+3
-3
@@ -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, ISpotOrderClientIdRestClient>
|
||||
public class GetSpotOrderByClientOrderIdOptions : EndpointOptions<GetOrderRequest, IGetSpotOrderByClientOrderIdRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve a spot order by its client order id";
|
||||
@@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetSpotOrderByClientOrderIdOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ISpotOrderClientIdRestClient.GetSpotOrderByClientOrderIdAsync))
|
||||
public GetSpotOrderByClientOrderIdOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetSpotOrderByClientOrderIdRestClient.GetSpotOrderByClientOrderIdAsync))
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(GetOrderRequest request, ISpotOrderClientIdRestClient client)
|
||||
public override Error? ValidateRequest(GetOrderRequest request, IGetSpotOrderByClientOrderIdRestClient client)
|
||||
{
|
||||
if (request.Symbol!.TradingMode != TradingMode.Spot)
|
||||
return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot");
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for getting a spot order by id endpoint
|
||||
/// </summary>
|
||||
public class GetSpotOrderOptions : EndpointOptions<GetOrderRequest, ISpotOrderRestClient>
|
||||
public class GetSpotOrderOptions : EndpointOptions<GetOrderRequest, IGetSpotOrderRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve a spot order";
|
||||
@@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetSpotOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ISpotOrderRestClient.GetSpotOrderAsync))
|
||||
public GetSpotOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetSpotOrderRestClient.GetSpotOrderAsync))
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(GetOrderRequest request, ISpotOrderRestClient client)
|
||||
public override Error? ValidateRequest(GetOrderRequest request, IGetSpotOrderRestClient client)
|
||||
{
|
||||
if (request.Symbol!.TradingMode != TradingMode.Spot)
|
||||
return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot");
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for getting trades for a spot order
|
||||
/// </summary>
|
||||
public class GetSpotOrderTradesOptions : EndpointOptions<GetOrderTradesRequest, ISpotOrderRestClient>
|
||||
public class GetSpotOrderTradesOptions : EndpointOptions<GetOrderTradesRequest, IGetSpotOrderTradesRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve trades for a spot order";
|
||||
@@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetSpotOrderTradesOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ISpotOrderRestClient.GetSpotOrderTradesAsync))
|
||||
public GetSpotOrderTradesOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetSpotOrderTradesRestClient.GetSpotOrderTradesAsync))
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(GetOrderTradesRequest request, ISpotOrderRestClient client)
|
||||
public override Error? ValidateRequest(GetOrderTradesRequest request, IGetSpotOrderTradesRestClient client)
|
||||
{
|
||||
if (request.Symbol!.TradingMode != TradingMode.Spot)
|
||||
return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot");
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting symbol info
|
||||
/// </summary>
|
||||
public class GetSpotSymbolsOptions : EndpointOptions<GetSymbolsRequest, ISpotSymbolRestClient>
|
||||
public class GetSpotSymbolsOptions : EndpointOptions<GetSymbolsRequest, IGetSpotSymbolsRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve supported spot symbols and their trading rules";
|
||||
@@ -16,13 +16,13 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetSpotSymbolsOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ISpotSymbolRestClient.GetSpotSymbolsAsync))
|
||||
public GetSpotSymbolsOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetSpotSymbolsRestClient.GetSpotSymbolsAsync))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(GetSymbolsRequest request, ISpotSymbolRestClient client)
|
||||
public override Error? ValidateRequest(GetSymbolsRequest request, IGetSpotSymbolsRestClient client)
|
||||
{
|
||||
if (request.BaseAssetType != null && request.BaseAssetSubType != null)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting ticker
|
||||
/// </summary>
|
||||
public class GetSpotTickerOptions : EndpointOptions<GetTickerRequest, ISpotTickerRestClient>
|
||||
public class GetSpotTickerOptions : EndpointOptions<GetTickerRequest, IGetSpotTickerRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve price ticker information for a spot symbol";
|
||||
@@ -18,7 +18,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetSpotTickerOptions(string exchange, SharedTickerType? tickerCalcType = null) : base(exchange, false, nameof(ISpotTickerRestClient.GetSpotTickerAsync))
|
||||
public GetSpotTickerOptions(string exchange, SharedTickerType? tickerCalcType = null) : base(exchange, false, nameof(IGetSpotTickerRestClient.GetSpotTickerAsync))
|
||||
{
|
||||
TickerType = tickerCalcType ?? SharedTickerType.Day24H;
|
||||
}
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting spot trigger order
|
||||
/// </summary>
|
||||
public class GetSpotTriggerOrderOptions : EndpointOptions<GetOrderRequest, ISpotTriggerOrderRestClient>
|
||||
public class GetSpotTriggerOrderOptions : EndpointOptions<GetOrderRequest, IGetSpotTriggerOrderRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve a spot trigger order";
|
||||
@@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetSpotTriggerOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ISpotTriggerOrderRestClient.GetSpotTriggerOrderAsync))
|
||||
public GetSpotTriggerOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetSpotTriggerOrderRestClient.GetSpotTriggerOrderAsync))
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(GetOrderRequest request, ISpotTriggerOrderRestClient client)
|
||||
public override Error? ValidateRequest(GetOrderRequest request, IGetSpotTriggerOrderRestClient client)
|
||||
{
|
||||
if (request.Symbol!.TradingMode != TradingMode.Spot)
|
||||
return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot");
|
||||
|
||||
+5
-4
@@ -1,4 +1,5 @@
|
||||
using CryptoExchange.Net.Objects;
|
||||
using CryptoExchange.Net.SharedApis.Interfaces.Rest.V2.SpotUserTrades;
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
@@ -7,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting user trades
|
||||
/// </summary>
|
||||
public class GetSpotUserTradesOptions : PaginatedEndpointOptions<GetUserTradesRequest, ISpotOrderRestClient>
|
||||
public class GetSpotUserTradeHistoryOptions : PaginatedEndpointOptions<GetUserTradesRequest, IGetSpotUserTradeHistoryRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve spot user trade history";
|
||||
@@ -15,13 +16,13 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetSpotUserTradesOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit)
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(ISpotOrderRestClient.GetSpotUserTradesAsync))
|
||||
public GetSpotUserTradeHistoryOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit)
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetSpotUserTradeHistoryRestClient.GetSpotUserTradeHistoryAsync))
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(GetUserTradesRequest request, ISpotOrderRestClient client)
|
||||
public override Error? ValidateRequest(GetUserTradesRequest request, IGetSpotUserTradeHistoryRestClient client)
|
||||
{
|
||||
if (request.Symbol!.TradingMode != TradingMode.Spot)
|
||||
return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot");
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting trade history
|
||||
/// </summary>
|
||||
public class GetTradeHistoryOptions : PaginatedEndpointOptions<GetTradeHistoryRequest, ITradeHistoryRestClient>
|
||||
public class GetTradeHistoryOptions : PaginatedEndpointOptions<GetTradeHistoryRequest, IGetTradeHistoryRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve public trade history for a symbol";
|
||||
@@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetTradeHistoryOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit, bool needsAuthentication)
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(ITradeHistoryRestClient.GetTradeHistoryAsync))
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IGetTradeHistoryRestClient.GetTradeHistoryAsync))
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(GetTradeHistoryRequest request, ITradeHistoryRestClient client)
|
||||
public override Error? ValidateRequest(GetTradeHistoryRequest request, IGetTradeHistoryRestClient client)
|
||||
{
|
||||
if (!SupportsAscending && request.Direction == DataDirection.Ascending)
|
||||
return ArgumentError.Invalid(nameof(GetTradeHistoryRequest.Direction), $"Ascending direction is not supported");
|
||||
|
||||
+4
-4
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for requesting withdrawals
|
||||
/// </summary>
|
||||
public class GetWithdrawalsOptions : PaginatedEndpointOptions<GetWithdrawalsRequest, IWithdrawalRestClient>
|
||||
public class GetWithdrawalHistoryOptions : PaginatedEndpointOptions<GetWithdrawalsRequest, IGetWithdrawalHistoryRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Retrieve withdrawal history";
|
||||
@@ -15,13 +15,13 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public GetWithdrawalsOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit)
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IWithdrawalRestClient.GetWithdrawalsAsync))
|
||||
public GetWithdrawalHistoryOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit)
|
||||
: base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetWithdrawalHistoryRestClient.GetWithdrawalHistoryAsync))
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Error? ValidateRequest(GetWithdrawalsRequest request, IWithdrawalRestClient client)
|
||||
public override Error? ValidateRequest(GetWithdrawalsRequest request, IGetWithdrawalHistoryRestClient client)
|
||||
{
|
||||
if (!SupportsAscending && request.Direction == DataDirection.Ascending)
|
||||
return ArgumentError.Invalid(nameof(GetWithdrawalsRequest.Direction), $"Ascending direction is not supported");
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for placing a new futures order
|
||||
/// </summary>
|
||||
public class PlaceFuturesOrderOptions : EndpointOptions<PlaceFuturesOrderRequest, IFuturesOrderRestClient>
|
||||
public class PlaceFuturesOrderOptions : EndpointOptions<PlaceFuturesOrderRequest, IPlaceFuturesOrderRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Place a new futures order";
|
||||
@@ -20,7 +20,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public PlaceFuturesOrderOptions(string exchange, bool supportsTpSl) : base(exchange, true, nameof(IFuturesOrderRestClient.PlaceFuturesOrderAsync))
|
||||
public PlaceFuturesOrderOptions(string exchange, bool supportsTpSl) : base(exchange, true, nameof(IPlaceFuturesOrderRestClient.PlaceFuturesOrderAsync))
|
||||
{
|
||||
SupportsTpSl = supportsTpSl;
|
||||
}
|
||||
@@ -30,7 +30,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// </summary>
|
||||
public override Error? ValidateRequest(
|
||||
PlaceFuturesOrderRequest request,
|
||||
IFuturesOrderRestClient client
|
||||
IPlaceFuturesOrderRestClient client
|
||||
)
|
||||
{
|
||||
if (!SupportsTpSl && (request.StopLossPrice != null || request.TakeProfitPrice != null))
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for placing a new spot trigger order
|
||||
/// </summary>
|
||||
public class PlaceFuturesTriggerOrderOptions : EndpointOptions<PlaceFuturesTriggerOrderRequest, IFuturesTriggerOrderRestClient>
|
||||
public class PlaceFuturesTriggerOrderOptions : EndpointOptions<PlaceFuturesTriggerOrderRequest, IPlaceFuturesTriggerOrderRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Place a new futures trigger order";
|
||||
@@ -18,7 +18,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public PlaceFuturesTriggerOrderOptions(string exchange, bool holdsFunds) : base(exchange, true, nameof(IFuturesTriggerOrderRestClient.PlaceFuturesTriggerOrderAsync))
|
||||
public PlaceFuturesTriggerOrderOptions(string exchange, bool holdsFunds) : base(exchange, true, nameof(IPlaceFuturesTriggerOrderRestClient.PlaceFuturesTriggerOrderAsync))
|
||||
{
|
||||
HoldsFunds = holdsFunds;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for placing a new spot order
|
||||
/// </summary>
|
||||
public class PlaceSpotOrderOptions : EndpointOptions<PlaceSpotOrderRequest, ISpotOrderRestClient>
|
||||
public class PlaceSpotOrderOptions : EndpointOptions<PlaceSpotOrderRequest, IPlaceSpotOrderRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Place a new spot order";
|
||||
@@ -16,7 +16,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public PlaceSpotOrderOptions(string exchange) : base(exchange, true, nameof(ISpotOrderRestClient.PlaceSpotOrderAsync))
|
||||
public PlaceSpotOrderOptions(string exchange) : base(exchange, true, nameof(IPlaceSpotOrderRestClient.PlaceSpotOrderAsync))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// </summary>
|
||||
public override Error? ValidateRequest(
|
||||
PlaceSpotOrderRequest request,
|
||||
ISpotOrderRestClient client)
|
||||
IPlaceSpotOrderRestClient client)
|
||||
{
|
||||
if (request.Symbol!.TradingMode != TradingMode.Spot)
|
||||
return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot");
|
||||
|
||||
+7
-6
@@ -5,7 +5,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for placing a new spot trigger order
|
||||
/// </summary>
|
||||
public class PlaceSpotTriggerOrderOptions : EndpointOptions<PlaceSpotTriggerOrderRequest, ISpotOrderRestClient>
|
||||
public class PlaceSpotTriggerOrderOptions : EndpointOptions<PlaceSpotTriggerOrderRequest, IPlaceSpotTriggerOrderRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Place a new spot trigger order";
|
||||
@@ -18,7 +18,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public PlaceSpotTriggerOrderOptions(string exchange, bool holdsFunds) : base(exchange, true, nameof(ISpotTriggerOrderRestClient.PlaceSpotTriggerOrderAsync))
|
||||
public PlaceSpotTriggerOrderOptions(string exchange, bool holdsFunds) : base(exchange, true, nameof(IPlaceSpotTriggerOrderRestClient.PlaceSpotTriggerOrderAsync))
|
||||
{
|
||||
HoldsFunds = holdsFunds;
|
||||
}
|
||||
@@ -28,14 +28,15 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// </summary>
|
||||
public override Error? ValidateRequest(
|
||||
PlaceSpotTriggerOrderRequest request,
|
||||
ISpotOrderRestClient client)
|
||||
IPlaceSpotTriggerOrderRestClient client)
|
||||
{
|
||||
if (request.Symbol!.TradingMode != TradingMode.Spot)
|
||||
return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot");
|
||||
|
||||
var quantityError = client.SpotSupportedOrderQuantity.Validate(request.OrderSide, request.OrderPrice == null ? SharedOrderType.Market : SharedOrderType.Limit, request.Quantity);
|
||||
if (quantityError != null)
|
||||
return quantityError;
|
||||
#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, IFuturesTpSlRestClient>
|
||||
public class SetFuturesTpSlOptions : EndpointOptions<SetTpSlRequest, ISetFuturesTpSlRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Set take profit or stop loss values for a futures position";
|
||||
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public SetFuturesTpSlOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IFuturesTpSlRestClient.SetFuturesTpSlAsync))
|
||||
public SetFuturesTpSlOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ISetFuturesTpSlRestClient.SetFuturesTpSlAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for setting leverage
|
||||
/// </summary>
|
||||
public class SetLeverageOptions : EndpointOptions<SetLeverageRequest, ILeverageRestClient>
|
||||
public class SetLeverageOptions : EndpointOptions<SetLeverageRequest, ISetLeverageRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Set the leverage for a futures symbol";
|
||||
@@ -11,7 +11,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public SetLeverageOptions(string exchange) : base(exchange, true, nameof(ILeverageRestClient.SetLeverageAsync))
|
||||
public SetLeverageOptions(string exchange) : base(exchange, true, nameof(ISetLeverageRestClient.SetLeverageAsync))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// Options for setting position mode
|
||||
/// </summary>
|
||||
public class SetPositionModeOptions : EndpointOptions<SetPositionModeRequest, IPositionModeRestClient>
|
||||
public class SetPositionModeOptions : EndpointOptions<SetPositionModeRequest, ISetPositionModeRestClient>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Description => "Set the futures position mode";
|
||||
@@ -11,7 +11,7 @@ namespace CryptoExchange.Net.SharedApis
|
||||
/// <summary>
|
||||
/// ctor
|
||||
/// </summary>
|
||||
public SetPositionModeOptions(string exchange) : base(exchange, true, nameof(IPositionModeRestClient.SetPositionModeOptions))
|
||||
public SetPositionModeOptions(string exchange) : base(exchange, true, nameof(ISetPositionModeRestClient.SetPositionModeOptions))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user