diff --git a/CryptoExchange.Net/ExtensionMethods.cs b/CryptoExchange.Net/ExtensionMethods.cs index a3aa296d..c415ea84 100644 --- a/CryptoExchange.Net/ExtensionMethods.cs +++ b/CryptoExchange.Net/ExtensionMethods.cs @@ -4,6 +4,7 @@ using CryptoExchange.Net.SharedApis; using Microsoft.Extensions.DependencyInjection; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.IO.Compression; @@ -387,14 +388,14 @@ namespace CryptoExchange.Net services.AddTransient(x => (ITradeHistoryRestClient)client(x)!); if (typeof(IWithdrawalRestClient).IsAssignableFrom(typeof(T))) services.AddTransient(x => (IWithdrawalRestClient)client(x)!); - if (typeof(IWithdrawRestClient).IsAssignableFrom(typeof(T))) - services.AddTransient(x => (IWithdrawRestClient)client(x)!); + if (typeof(IWithdrawEndpoint).IsAssignableFrom(typeof(T))) + services.AddTransient(x => (IWithdrawEndpoint)client(x)!); if (typeof(IFeeRestClient).IsAssignableFrom(typeof(T))) services.AddTransient(x => (IFeeRestClient)client(x)!); if (typeof(IBookTickerRestClient).IsAssignableFrom(typeof(T))) services.AddTransient(x => (IBookTickerRestClient)client(x)!); - if (typeof(ITransferRestClient).IsAssignableFrom(typeof(T))) - services.AddTransient(x => (ITransferRestClient)client(x)!); + if (typeof(ITransferEndpoint).IsAssignableFrom(typeof(T))) + services.AddTransient(x => (ITransferEndpoint)client(x)!); if (typeof(ISpotOrderRestClient).IsAssignableFrom(typeof(T))) services.AddTransient(x => (ISpotOrderRestClient)client(x)!); @@ -474,6 +475,43 @@ namespace CryptoExchange.Net return services; } + /// + /// Register a strict Shared API aggregate and all endpoint capabilities + /// inherited by that aggregate. + /// + public static IServiceCollection RegisterSharedApi< +#if NET5_0_OR_GREATER + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] +#endif + TSharedApi + >( + this IServiceCollection services, + Func factory) + where TSharedApi : class, ISharedClient + { + // Register the exchange-specific aggregate itself. + services.AddTransient( + typeof(TSharedApi), + serviceProvider => factory(serviceProvider)); + + var endpointInterfaces = typeof(TSharedApi) + .GetInterfaces() + .Where(x => + x != typeof(ISharedApiEndpoint) + && typeof(ISharedApiEndpoint).IsAssignableFrom(x)) + .Distinct() + .ToArray(); + + foreach (var endpointInterface in endpointInterfaces) + { + services.AddTransient( + endpointInterface, + serviceProvider => factory(serviceProvider)); + } + + return services; + } + /// /// Convert a hex encoded string to byte array /// diff --git a/CryptoExchange.Net/SharedApis/Interfaces/ISharedClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/ISharedClient.cs index 67bc3c4c..839d86f9 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/ISharedClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/ISharedClient.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; namespace CryptoExchange.Net.SharedApis { @@ -22,6 +23,11 @@ namespace CryptoExchange.Net.SharedApis /// bool Authenticated { get; } + /// + /// Options for the endpoints exposed by this shared API. + /// + IReadOnlyCollection EndpointOptions { get; } + /// /// Get info on the client and supported features /// diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFundingRateRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFundingRateRestClient.cs index dac4fbad..7e28a571 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFundingRateRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFundingRateRestClient.cs @@ -7,7 +7,21 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for request funding rate records /// - public interface IFundingRateRestClient : IGetFundingRateHistoryRestClient + public interface IFundingRateRestClient : ISharedClient { + /// + /// Funding rate request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetFundingRateHistoryOptions GetFundingRateHistoryOptions { get; } + /// + /// Get funding rate records, see for request options and exchange specific required/optional parameters.
+ /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. + ///
+ /// Request info + /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// Cancellation token + Task> GetFundingRateHistoryAsync(GetFundingRateHistoryRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesOrderClientIdRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesOrderClientIdRestClient.cs index f125ae29..80f0531b 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesOrderClientIdRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesOrderClientIdRestClient.cs @@ -7,9 +7,33 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for managing futures orders using a client order id /// - public interface IFuturesOrderClientIdRestClient : - IGetFuturesOrderByClientOrderIdRestClient, - ICancelFuturesOrderByClientOrderIdRestClient - { + public interface IFuturesOrderClientIdRestClient : ISharedClient + { + /// + /// Futures get order by client order id request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetFuturesOrderByClientOrderIdOptions GetFuturesOrderByClientOrderIdOptions { get; } + + /// + /// Get info on a specific futures order using a client order id, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetFuturesOrderByClientOrderIdAsync(GetOrderRequest request, CancellationToken ct = default); + + /// + /// Futures cancel order by client order id request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ CancelFuturesOrderByClientOrderIdOptions CancelFuturesOrderByClientOrderIdOptions { get; } + /// + /// Cancel a futures order using client order id, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> CancelFuturesOrderByClientOrderIdAsync(CancelOrderRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesOrderRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesOrderRestClient.cs index 48ed6821..56d8ab54 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesOrderRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesOrderRestClient.cs @@ -7,16 +7,156 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for placing and managing futures orders /// - public interface IFuturesOrderRestClient : - IPlaceFuturesOrderRestClient, - IGetFuturesOrderRestClient, - IGetOpenFuturesOrdersRestClient, - IGetClosedFuturesOrdersRestClient, - IGetFuturesOrderTradesRestClient, - IGetFuturesUserTradesRestClient, - ICancelFuturesOrderRestClient, - IGetPositionsRestClient, - IClosePositionRestClient + public interface IFuturesOrderRestClient : ISharedClient { + /// + /// How the trading fee is deducted + /// + SharedFeeDeductionType FuturesFeeDeductionType { get; } + /// + /// How the asset is determined in which the trading fee is paid + /// + SharedFeeAssetType FuturesFeeAssetType { get; } + /// + /// Supported order types for futures orders + /// + SharedOrderType[] FuturesSupportedOrderTypes { get; } + /// + /// Supported time in force types for futures orders + /// + SharedTimeInForce[] FuturesSupportedTimeInForce { get; } + /// + /// Supported quantity types for futures orders + /// + SharedQuantitySupport FuturesSupportedOrderQuantity { get; } + + /// + /// Generate a new random client order id + /// + /// + string GenerateClientOrderId(); + + /// + /// Futures place order request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ PlaceFuturesOrderOptions PlaceFuturesOrderOptions { get; } + + /// + /// Place a new futures order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> PlaceFuturesOrderAsync(PlaceFuturesOrderRequest request, CancellationToken ct = default); + + /// + /// Futures get order request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetFuturesOrderOptions GetFuturesOrderOptions { get; } + /// + /// Get info on a specific futures order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetFuturesOrderAsync(GetOrderRequest request, CancellationToken ct = default); + + /// + /// Futures get open orders request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetOpenFuturesOrdersOptions GetOpenFuturesOrdersOptions { get; } + /// + /// Get info on a open futures orders, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetOpenFuturesOrdersAsync(GetOpenOrdersRequest request, CancellationToken ct = default); + + /// + /// Spot get closed orders request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetFuturesClosedOrdersOptions GetClosedFuturesOrdersOptions { get; } + /// + /// Get info on closed futures orders, see for request options and exchange specific required/optional parameters.
+ /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. + ///
+ /// Request info + /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// Cancellation token + Task> GetClosedFuturesOrdersAsync(GetClosedOrdersRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + + /// + /// Futures get order trades request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetFuturesOrderTradesOptions GetFuturesOrderTradesOptions { get; } + /// + /// Get trades for a specific futures order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetFuturesOrderTradesAsync(GetOrderTradesRequest request, CancellationToken ct = default); + + /// + /// Futures user trades request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetFuturesUserTradeHistoryOptions GetFuturesUserTradesOptions { get; } + /// + /// Get futures user trade records, see for request options and exchange specific required/optional parameters.
+ /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. + ///
+ /// Request info + /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// Cancellation token + Task> GetFuturesUserTradesAsync(GetUserTradesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + + /// + /// Futures cancel order request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ CancelFuturesOrderOptions CancelFuturesOrderOptions { get; } + /// + /// Cancel a futures order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> CancelFuturesOrderAsync(CancelOrderRequest request, CancellationToken ct = default); + + /// + /// Positions request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetPositionsOptions GetPositionsOptions { get; } + /// + /// Get open position info, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetPositionsAsync(GetPositionsRequest request, CancellationToken ct = default); + + /// + /// Close position order request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ ClosePositionOptions ClosePositionOptions { get; } + /// + /// Close a currently open position, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + /// + Task> ClosePositionAsync(ClosePositionRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesSymbolRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesSymbolRestClient.cs index 0288658a..7329596d 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesSymbolRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesSymbolRestClient.cs @@ -7,7 +7,43 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for request futures symbol info /// - public interface IFuturesSymbolRestClient : IGetFuturesSymbolsRestClient + public interface IFuturesSymbolRestClient : ISharedClient { + /// + /// Get the futures symbol catalog. Only available if has been called previously. + /// + SharedSymbolCatalog? FuturesSymbolCatalog { get; } + + /// + /// Futures symbol request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetFuturesSymbolsOptions GetFuturesSymbolsOptions { get; } + + /// + /// Get all futures symbols for a specific base asset + /// + /// Asset, for example `ETH` + Task> GetFuturesSymbolsForBaseAssetAsync(string baseAsset); + + /// + /// Gets whether the client supports a futures symbol + /// + /// The symbol + Task> SupportsFuturesSymbolAsync(SharedSymbol symbol); + + /// + /// Gets whether the client supports a futures symbol + /// + /// The symbol name + Task> SupportsFuturesSymbolAsync(string symbolName); + + /// + /// Get info on all futures symbols supported on the exchange, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetFuturesSymbolsAsync(GetSymbolsRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesTickerRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesTickerRestClient.cs index 62828efc..cd1d9f87 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesTickerRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesTickerRestClient.cs @@ -7,9 +7,32 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for requesting ticker info for futures symbols /// - public interface IFuturesTickerRestClient : - IGetFuturesTickerRestClient, - IGetAllFuturesTickersRestClient + public interface IFuturesTickerRestClient : ISharedClient { + /// + /// Futures get ticker request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetFuturesTickerOptions GetFuturesTickerOptions { get; } + /// + /// Get ticker info for a specific futures symbol, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetFuturesTickerAsync(GetTickerRequest request, CancellationToken ct = default); + + /// + /// Futures get tickers request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetAllFuturesTickersOptions GetFuturesTickersOptions { get; } + /// + /// Get ticker info for all futures symbols, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetFuturesTickersAsync(GetTickersRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesTpSlRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesTpSlRestClient.cs index a8265890..2069f80b 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesTpSlRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesTpSlRestClient.cs @@ -7,9 +7,34 @@ namespace CryptoExchange.Net.SharedApis /// /// Take profit / Stop loss client /// - public interface IFuturesTpSlRestClient : - ISetFuturesTpSlRestClient, - ICancelFuturesTpSlRestClient + public interface IFuturesTpSlRestClient : ISharedClient { + /// + /// Set take profit and/or stop loss options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ SetFuturesTpSlOptions SetFuturesTpSlOptions { get; } + /// + /// Set a take profit and/or stop loss for an open position, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + /// + Task> SetFuturesTpSlAsync(SetTpSlRequest request, CancellationToken ct = default); + + /// + /// Cancel a take profit and/or stop loss options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ CancelFuturesTpSlOptions CancelFuturesTpSlOptions { get; } + /// + /// Cancel an active take profit and/or stop loss for an open position, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + /// + Task> CancelFuturesTpSlAsync(CancelTpSlRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesTriggerOrderRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesTriggerOrderRestClient.cs index cb8aa977..67c396cc 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesTriggerOrderRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IFuturesTriggerOrderRestClient.cs @@ -7,10 +7,47 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for placing trigger orders /// - public interface IFuturesTriggerOrderRestClient : - IPlaceFuturesTriggerOrderRestClient, - IGetFuturesTriggerOrderRestClient, - ICancelFuturesTriggerOrderRestClient + public interface IFuturesTriggerOrderRestClient : ISharedClient { + /// + /// Place spot trigger order options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ PlaceFuturesTriggerOrderOptions PlaceFuturesTriggerOrderOptions { get; } + + /// + /// Place a new trigger order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + /// + Task> PlaceFuturesTriggerOrderAsync(PlaceFuturesTriggerOrderRequest request, CancellationToken ct = default); + + /// + /// Get trigger order request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetFuturesTriggerOrderOptions GetFuturesTriggerOrderOptions { get; } + /// + /// Get info on a specific trigger order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetFuturesTriggerOrderAsync(GetOrderRequest request, CancellationToken ct = default); + + /// + /// Cancel trigger order request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ CancelFuturesTriggerOrderOptions CancelFuturesTriggerOrderOptions { get; } + /// + /// Cancel a trigger order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> CancelFuturesTriggerOrderAsync(CancelOrderRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IIndexPriceKlineRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IIndexPriceKlineRestClient.cs index f565db72..bd6c79e2 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IIndexPriceKlineRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IIndexPriceKlineRestClient.cs @@ -7,7 +7,21 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for getting the index price klines for a symbol /// - public interface IIndexPriceKlineRestClient : IGetIndexPriceKlinesRestClient + public interface IIndexPriceKlineRestClient : ISharedClient { + /// + /// Index price klines request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetIndexPriceKlinesOptions GetIndexPriceKlinesOptions { get; } + /// + /// Get index price kline/candlestick data, see for request options and exchange specific required/optional parameters.
+ /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. + ///
+ /// Request info + /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// Cancellation token + Task> GetIndexPriceKlinesAsync(GetKlinesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/ILeverageRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/ILeverageRestClient.cs index 8e4f4642..148ce59c 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/ILeverageRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/ILeverageRestClient.cs @@ -7,9 +7,38 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for managing the leverage of a symbol /// - public interface ILeverageRestClient : - IGetLeverageRestClient, - ISetLeverageRestClient + public interface ILeverageRestClient : ISharedClient { + /// + /// How the leverage setting is configured on the exchange + /// + SharedLeverageSettingMode LeverageSettingType { get; } + + /// + /// Leverage request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetLeverageOptions GetLeverageOptions { get; } + /// + /// Get the current leverage setting for a symbol, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetLeverageAsync(GetLeverageRequest request, CancellationToken ct = default); + + /// + /// Leverage set request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ SetLeverageOptions SetLeverageOptions { get; } + /// + /// Set the leverage for a symbol, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> SetLeverageAsync(SetLeverageRequest request, CancellationToken ct = default); + } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IMarkPriceKlineRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IMarkPriceKlineRestClient.cs index 6487b535..761bb167 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IMarkPriceKlineRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IMarkPriceKlineRestClient.cs @@ -7,7 +7,21 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for getting the mark price klines for a symbol /// - public interface IMarkPriceKlineRestClient : IGetMarkPriceKlinesRestClient + public interface IMarkPriceKlineRestClient : ISharedClient { + /// + /// Mark price klines request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetMarkPriceKlinesOptions GetMarkPriceKlinesOptions { get; } + /// + /// Get mark price kline/candlestick data, see for request options and exchange specific required/optional parameters.
+ /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. + ///
+ /// Request info + /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// Cancellation token + Task> GetMarkPriceKlinesAsync(GetKlinesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IOpenInterestRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IOpenInterestRestClient.cs index 57a797e1..3e9fca24 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IOpenInterestRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IOpenInterestRestClient.cs @@ -7,7 +7,19 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for getting the open interest for a symbol /// - public interface IOpenInterestRestClient : IGetOpenInterestRestClient + public interface IOpenInterestRestClient : ISharedClient { + /// + /// Open interest request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetOpenInterestOptions GetOpenInterestOptions { get; } + /// + /// Get the open interest for a symbol, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetOpenInterestAsync(GetOpenInterestRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IPositionHistoryRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IPositionHistoryRestClient.cs index 603b7cb5..d446ba94 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IPositionHistoryRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IPositionHistoryRestClient.cs @@ -7,7 +7,21 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for getting position history /// - public interface IPositionHistoryRestClient : IGetPositionHistoryRestClient + public interface IPositionHistoryRestClient : ISharedClient { + /// + /// Position history request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetPositionHistoryOptions GetPositionHistoryOptions { get; } + /// + /// Get position history, see for request options and exchange specific required/optional parameters.
+ /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. + ///
+ /// Request info + /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// Cancellation token + Task> GetPositionHistoryAsync(GetPositionHistoryRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IPositionModeRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IPositionModeRestClient.cs index d9585971..2c00cc1e 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IPositionModeRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Futures/IPositionModeRestClient.cs @@ -7,9 +7,37 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for managing the position mode setting /// - public interface IPositionModeRestClient : - IGetPositionModeRestClient, - ISetPositionModeRestClient + public interface IPositionModeRestClient : ISharedClient { + /// + /// How the exchange handles setting the position mode + /// + SharedPositionModeSelection PositionModeSettingType { get; } + + /// + /// Position mode request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetPositionModeOptions GetPositionModeOptions { get; } + /// + /// Get the current position mode setting, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetPositionModeAsync(GetPositionModeRequest request, CancellationToken ct = default); + + /// + /// Position mode set request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ SetPositionModeOptions SetPositionModeOptions { get; } + /// + /// Set the position mode to a new value, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> SetPositionModeAsync(SetPositionModeRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IAssetsRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IAssetsRestClient.cs index 8dcd3f02..78e6b5ad 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IAssetsRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IAssetsRestClient.cs @@ -7,9 +7,34 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for requesting asset info /// - public interface IAssetsRestClient : - IGetAssetRestClient, - IGetAllAssetsRestClient + public interface IAssetsRestClient : ISharedClient { + /// + /// Asset request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetAssetOptions GetAssetOptions { get; } + + /// + /// Get info on a specific asset, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetAssetAsync(GetAssetRequest request, CancellationToken ct = default); + + /// + /// Assets request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetAssetsOptions GetAssetsOptions { get; } + + /// + /// Get info on all assets the exchange supports, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetAssetsAsync(GetAssetsRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IBalanceRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IBalanceRestClient.cs index 94022643..91ca2236 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IBalanceRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IBalanceRestClient.cs @@ -7,7 +7,21 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for requesting user balance info /// - public interface IBalanceRestClient : IGetBalancesRestClient + public interface IBalanceRestClient : ISharedClient { + /// + /// Balances request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetBalancesOptions GetBalancesOptions { get; } + + /// + /// Get balances for the user, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + /// + Task> GetBalancesAsync(GetBalancesRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IBookTickerRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IBookTickerRestClient.cs index 07e69f85..76bcc5cd 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IBookTickerRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IBookTickerRestClient.cs @@ -7,7 +7,21 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for retrieving the current best bid/ask price /// - public interface IBookTickerRestClient : IGetBookTickerRestClient - { + public interface IBookTickerRestClient : ISharedClient + { + /// + /// Book ticker request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetBookTickerOptions GetBookTickerOptions { get; } + + /// + /// Get the best ask/bid info for a symbol, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + /// + Task> GetBookTickerAsync(GetBookTickerRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IDepositRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IDepositRestClient.cs index 5ff49a00..a003130e 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IDepositRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IDepositRestClient.cs @@ -7,9 +7,37 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for requesting deposit addresses and deposit records /// - public interface IDepositRestClient : - IGetDepositAddressesRestClient, - IGetDepositHistoryRestClient + public interface IDepositRestClient : ISharedClient { + /// + /// Deposit addresses request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetDepositAddressesOptions GetDepositAddressesOptions { get; } + + /// + /// Get deposit addresses for an asset, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + /// + Task> GetDepositAddressesAsync(GetDepositAddressesRequest request, CancellationToken ct = default); + + /// + /// Deposits request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetDepositHistoryOptions GetDepositsOptions { get; } + + /// + /// Get deposit records, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// Cancellation token + /// + Task> GetDepositsAsync(GetDepositsRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IFeeRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IFeeRestClient.cs index c2fb48da..2d60ec54 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IFeeRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IFeeRestClient.cs @@ -7,7 +7,20 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for requesting user trading fees /// - public interface IFeeRestClient : IGetFeesRestClient - { + public interface IFeeRestClient : ISharedClient + { + /// + /// Fee request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetFeeOptions GetFeeOptions { get; } + + /// + /// Get trading fees for a symbol, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetFeesAsync(GetFeeRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IKlineRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IKlineRestClient.cs index 24326bc8..5be5c945 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IKlineRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IKlineRestClient.cs @@ -7,7 +7,23 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for requesting kline/candlestick data /// - public interface IKlineRestClient : IGetKlinesRestClient + public interface IKlineRestClient : ISharedClient { + /// + /// Kline request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetKlinesOptions GetKlinesOptions { get; } + + /// + /// Get kline/candlestick data, see for request options and exchange specific required/optional parameters.
+ /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. + ///
+ /// Request info + /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// Cancellation token + /// + Task> GetKlinesAsync(GetKlinesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IOrderBookRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IOrderBookRestClient.cs index 1ee726ee..d4088824 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IOrderBookRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IOrderBookRestClient.cs @@ -7,7 +7,21 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for retrieving the order book for a symbol /// - public interface IOrderBookRestClient : IGetOrderBookRestClient - { + public interface IOrderBookRestClient : ISharedClient + { + /// + /// Order book request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetOrderBookOptions GetOrderBookOptions { get; } + + /// + /// Get the order book for a symbol, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + /// + Task> GetOrderBookAsync(GetOrderBookRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IRecentTradeRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IRecentTradeRestClient.cs index c1b21bc6..85cd9c6b 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IRecentTradeRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IRecentTradeRestClient.cs @@ -7,7 +7,21 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for retrieving the most recent public trades /// - public interface IRecentTradeRestClient : IGetRecentTradesRestClient + public interface IRecentTradeRestClient : ISharedClient { + /// + /// Recent trades request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetRecentTradesOptions GetRecentTradesOptions { get; } + + /// + /// Get the most recent public trades, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + /// + Task> GetRecentTradesAsync(GetRecentTradesRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/ITradeHistoryRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/ITradeHistoryRestClient.cs index 5577af1c..2d5ac119 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/ITradeHistoryRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/ITradeHistoryRestClient.cs @@ -7,7 +7,23 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for retrieving trading history /// - public interface ITradeHistoryRestClient : IGetTradeHistoryRestClient + public interface ITradeHistoryRestClient : ISharedClient { + /// + /// Trade history request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetTradeHistoryOptions GetTradeHistoryOptions { get; } + + /// + /// Get public trade history, see for request options and exchange specific required/optional parameters.
+ /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. + ///
+ /// Request info + /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// Cancellation token + /// + Task> GetTradeHistoryAsync(GetTradeHistoryRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Withdrawals/IWithdrawRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IWithdrawRestClient.cs similarity index 94% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Withdrawals/IWithdrawRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IWithdrawRestClient.cs index 7b376d06..72d07359 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Withdrawals/IWithdrawRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IWithdrawRestClient.cs @@ -7,6 +7,9 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { + /// + /// Client for withdrawing funds + /// public interface IWithdrawRestClient : ISharedClient { /// @@ -24,4 +27,4 @@ namespace CryptoExchange.Net.SharedApis /// Task> WithdrawAsync(WithdrawRequest request, CancellationToken ct = default); } -} +} \ No newline at end of file diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IWithdrawalRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IWithdrawalRestClient.cs index 0b68adb8..812c8a93 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IWithdrawalRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/IWithdrawalRestClient.cs @@ -7,7 +7,23 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for retrieving withdrawal records /// - public interface IWithdrawalRestClient : IGetWithdrawalHistoryRestClient + public interface IWithdrawalRestClient : ISharedClient { + /// + /// Withdrawal records request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetWithdrawalHistoryOptions GetWithdrawalsOptions { get; } + + /// + /// Get withdrawal records, see for request options and exchange specific required/optional parameters.
+ /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. + ///
+ /// Request info + /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// Cancellation token + /// + Task> GetWithdrawalsAsync(GetWithdrawalsRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Spot/ISpotOrderClientIdRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Spot/ISpotOrderClientIdRestClient.cs index da74015d..89e0be33 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Spot/ISpotOrderClientIdRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Spot/ISpotOrderClientIdRestClient.cs @@ -7,9 +7,33 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for managing spot orders using a client order id /// - public interface ISpotOrderClientIdRestClient : - ICancelSpotOrderByClientOrderIdRestClient, - IGetSpotOrderByClientOrderIdRestClient + public interface ISpotOrderClientIdRestClient : ISharedClient { + /// + /// Spot get order by client order id request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetSpotOrderByClientOrderIdOptions GetSpotOrderByClientOrderIdOptions { get; } + + /// + /// Get info on a specific spot order using a client order id, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetSpotOrderByClientOrderIdAsync(GetOrderRequest request, CancellationToken ct = default); + + /// + /// Spot cancel order by client order id request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ CancelSpotOrderByClientOrderIdOptions CancelSpotOrderByClientOrderIdOptions { get; } + /// + /// Cancel a spot order using client order id, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> CancelSpotOrderByClientOrderIdAsync(CancelOrderRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Spot/ISpotOrderRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Spot/ISpotOrderRestClient.cs index 9ba8cd98..371bef1b 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Spot/ISpotOrderRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Spot/ISpotOrderRestClient.cs @@ -7,14 +7,130 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for placing and managing spot orders /// - public interface ISpotOrderRestClient : - IPlaceSpotOrderRestClient, - ICancelSpotOrderRestClient, - IGetSpotOrderRestClient, - IGetOpenSpotOrdersRestClient, - IGetClosedSpotOrdersRestClient, - IGetSpotOrderTradesRestClient, - IGetSpotUserTradeHistoryRestClient + public interface ISpotOrderRestClient : ISharedClient { + /// + /// How the trading fee is deducted + /// + SharedFeeDeductionType SpotFeeDeductionType { get; } + /// + /// How the asset is determined in which the trading fee is paid + /// + SharedFeeAssetType SpotFeeAssetType { get; } + /// + /// Supported order types for spot orders + /// + SharedOrderType[] SpotSupportedOrderTypes { get; } + /// + /// Supported time in force types for placing spot orders + /// + SharedTimeInForce[] SpotSupportedTimeInForce { get; } + /// + /// Supported quantity types for placing spot orders + /// + SharedQuantitySupport SpotSupportedOrderQuantity { get; } + + /// + /// Generate a new random client order id + /// + /// + string GenerateClientOrderId(); + + /// + /// Spot place order request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ PlaceSpotOrderOptions PlaceSpotOrderOptions { get; } + /// + /// Place a new spot order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> PlaceSpotOrderAsync(PlaceSpotOrderRequest request, CancellationToken ct = default); + + /// + /// Spot get order request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetSpotOrderOptions GetSpotOrderOptions { get; } + /// + /// Get info on a specific spot order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetSpotOrderAsync(GetOrderRequest request, CancellationToken ct = default); + + /// + /// Spot get open orders request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetOpenSpotOrdersOptions GetOpenSpotOrdersOptions { get; } + /// + /// Get info on a open spot orders, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetOpenSpotOrdersAsync(GetOpenOrdersRequest request, CancellationToken ct = default); + + /// + /// Spot get closed orders request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetSpotClosedOrdersOptions GetClosedSpotOrdersOptions { get; } + /// + /// Get info on closed spot orders, see for request options and exchange specific required/optional parameters.
+ /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. + ///
+ /// Request info + /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// Cancellation token + Task> GetClosedSpotOrdersAsync(GetClosedOrdersRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + + /// + /// Spot get order trades request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetSpotOrderTradesOptions GetSpotOrderTradesOptions { get; } + /// + /// Get trades for a specific spot order, see for request options and exchange specific required/optional parameters.
+ /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. + ///
+ /// Request info + /// Cancellation token + Task> GetSpotOrderTradesAsync(GetOrderTradesRequest request, CancellationToken ct = default); + + /// + /// Spot user trades request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetSpotUserTradeHistoryOptions GetSpotUserTradesOptions { get; } + /// + /// Get spot user trade records, see for request options and exchange specific required/optional parameters.
+ /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. + ///
+ /// Request info + /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// Cancellation token + Task> GetSpotUserTradesAsync(GetUserTradesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + + /// + /// Spot cancel order request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ CancelSpotOrderOptions CancelSpotOrderOptions { get; } + /// + /// Cancel a spot order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> CancelSpotOrderAsync(CancelOrderRequest request, CancellationToken ct = default); + } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Spot/ISpotSymbolRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Spot/ISpotSymbolRestClient.cs index b199cc79..64e16d02 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Spot/ISpotSymbolRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Spot/ISpotSymbolRestClient.cs @@ -7,7 +7,43 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for requesting spot symbols /// - public interface ISpotSymbolRestClient : IGetSpotSymbolsRestClient + public interface ISpotSymbolRestClient : ISharedClient { + /// + /// Get the spot symbol catalog. Only available if has been called previously. + /// + SharedSymbolCatalog? SpotSymbolCatalog { get; } + + /// + /// Spot symbols request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetSpotSymbolsOptions GetSpotSymbolsOptions { get; } + + /// + /// Get all spot symbols for a specific base asset + /// + /// Asset, for example `ETH` + Task> GetSpotSymbolsForBaseAssetAsync(string baseAsset); + + /// + /// Gets whether the client supports a spot symbol + /// + /// The symbol + Task> SupportsSpotSymbolAsync(SharedSymbol symbol); + + /// + /// Gets whether the client supports a spot symbol + /// + /// The symbol name + Task> SupportsSpotSymbolAsync(string symbolName); + + /// + /// Get info on all available spot symbols on the exchange, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetSpotSymbolsAsync(GetSymbolsRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Spot/ISpotTickerRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Spot/ISpotTickerRestClient.cs index 30693115..35c178ea 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Spot/ISpotTickerRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Spot/ISpotTickerRestClient.cs @@ -7,9 +7,31 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for requesting spot tickers /// - public interface ISpotTickerRestClient : - IGetSpotTickerRestClient, - IGetAllSpotTickersRestClient + public interface ISpotTickerRestClient : ISharedClient { + /// + /// Spot ticker request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetSpotTickerOptions GetSpotTickerOptions { get; } + /// + /// Get ticker for a specific spot symbol, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetSpotTickerAsync(GetTickerRequest request, CancellationToken ct = default); + /// + /// Spot tickers request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetAllSpotTickersOptions GetSpotTickersOptions { get; } + /// + /// Get tickers for all spot symbols, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetSpotTickersAsync(GetTickersRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Spot/ISpotTriggerOrderRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Spot/ISpotTriggerOrderRestClient.cs index 2af983d4..4d37d796 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Spot/ISpotTriggerOrderRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Legacy/Spot/ISpotTriggerOrderRestClient.cs @@ -7,10 +7,47 @@ namespace CryptoExchange.Net.SharedApis /// /// Client for placing trigger orders /// - public interface ISpotTriggerOrderRestClient : - IPlaceSpotTriggerOrderRestClient, - IGetSpotTriggerOrderRestClient, - ICancelSpotTriggerOrderRestClient + public interface ISpotTriggerOrderRestClient : ISharedClient { + /// + /// Place spot trigger order options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ PlaceSpotTriggerOrderOptions PlaceSpotTriggerOrderOptions { get; } + + /// + /// Place a new trigger order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + /// + Task> PlaceSpotTriggerOrderAsync(PlaceSpotTriggerOrderRequest request, CancellationToken ct = default); + + /// + /// Get trigger order request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetSpotTriggerOrderOptions GetSpotTriggerOrderOptions { get; } + /// + /// Get info on a specific trigger order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetSpotTriggerOrderAsync(GetOrderRequest request, CancellationToken ct = default); + + /// + /// Cancel trigger order request options.
+ /// Use and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ CancelSpotTriggerOrderOptions CancelSpotTriggerOrderOptions { get; } + /// + /// Cancel a trigger order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> CancelSpotTriggerOrderAsync(CancelOrderRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Assets/IGetAllAssetsRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Assets/IGetAllAssetsEndpoint.cs similarity index 66% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Assets/IGetAllAssetsRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Assets/IGetAllAssetsEndpoint.cs index 39f90fd2..e5968dd6 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Assets/IGetAllAssetsRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Assets/IGetAllAssetsEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetAllAssetsRestClient : ISharedClient + /// + /// Endpoint definition for retrieving all assets supported on an exchange. + /// + public interface IGetAllAssetsEndpoint : ISharedApiEndpoint { /// /// Assets request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetAssetsOptions GetAssetsOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Assets/IGetAssetRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Assets/IGetAssetEndpoint.cs similarity index 66% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Assets/IGetAssetRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Assets/IGetAssetEndpoint.cs index 98b7eaa1..0831779e 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Assets/IGetAssetRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Assets/IGetAssetEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetAssetRestClient : ISharedClient + /// + /// Endpoint definition for retrieving an asset on an exchange. + /// + public interface IGetAssetEndpoint : ISharedApiEndpoint { /// /// Asset request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetAssetOptions GetAssetOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Balances/IGetBalancesRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Balances/IGetBalancesEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Balances/IGetBalancesRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Balances/IGetBalancesEndpoint.cs index c35645e1..9e247160 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Balances/IGetBalancesRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Balances/IGetBalancesEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetBalancesRestClient : ISharedClient + /// + /// Endpoint definition for retrieving user asset balances on an exchange. + /// + public interface IGetBalancesEndpoint : ISharedApiEndpoint { /// /// Balances request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetBalancesOptions GetBalancesOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Deposits/IGetDepositAddressesRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Deposits/IGetDepositAddressesEndpoint.cs similarity index 68% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Deposits/IGetDepositAddressesRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Deposits/IGetDepositAddressesEndpoint.cs index 544f772b..1d1b9279 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Deposits/IGetDepositAddressesRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Deposits/IGetDepositAddressesEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetDepositAddressesRestClient : ISharedClient + /// + /// Endpoint definition for retrieving user deposit addresses on an exchange. + /// + public interface IGetDepositAddressesEndpoint : ISharedApiEndpoint { /// /// Deposit addresses request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetDepositAddressesOptions GetDepositAddressesOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Deposits/IGetDepositHistoryRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Deposits/IGetDepositHistoryEndpoint.cs similarity index 56% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Deposits/IGetDepositHistoryRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Deposits/IGetDepositHistoryEndpoint.cs index b51f0528..8111607b 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Deposits/IGetDepositHistoryRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Deposits/IGetDepositHistoryEndpoint.cs @@ -7,20 +7,24 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetDepositHistoryRestClient : ISharedClient + /// + /// Endpoint definition for retrieving user deposit history on an exchange. + /// + public interface IGetDepositHistoryEndpoint : ISharedApiEndpoint { /// /// Deposits request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetDepositHistoryOptions GetDepositHistoryOptions { get; } /// /// Get deposit records, see for request options and exchange specific required/optional parameters.
+ /// The result is paginated, if there are more results to be retrieved, the property of the result will contain the pagination request to be used for the next request to continue pagination. ///
/// Request info - /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// The pagination request from the previous request result property to continue pagination /// Cancellation token /// Task> GetDepositHistoryAsync(GetDepositsRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Fees/IGetFeesRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Fees/IGetFeesEndpoint.cs similarity index 66% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Fees/IGetFeesRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Fees/IGetFeesEndpoint.cs index 8a6194ae..83c4694e 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Fees/IGetFeesRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Fees/IGetFeesEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetFeesRestClient : ISharedClient + /// + /// Endpoint definition for retrieving user trading fees on an exchange. + /// + public interface IGetFeesEndpoint : ISharedApiEndpoint { /// /// Fee request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetFeeOptions GetFeeOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Funding/IGetFundingRateHistoryRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Funding/IGetFundingRateHistoryEndpoint.cs similarity index 59% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Funding/IGetFundingRateHistoryRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Funding/IGetFundingRateHistoryEndpoint.cs index a351d3e2..fb40661f 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Funding/IGetFundingRateHistoryRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Funding/IGetFundingRateHistoryEndpoint.cs @@ -7,20 +7,23 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetFundingRateHistoryRestClient : ISharedClient + /// + /// Endpoint definition for retrieving funding rate history for a symbol on an exchange. + /// + public interface IGetFundingRateHistoryEndpoint : ISharedApiEndpoint { /// /// Funding rate request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetFundingRateHistoryOptions GetFundingRateHistoryOptions { get; } /// /// Get funding rate records, see for request options and exchange specific required/optional parameters.
- /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. + /// The result is paginated, if there are more results to be retrieved, the property of the result will contain the pagination request to be used for the next request to continue pagination. ///
/// Request info - /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// The pagination request from the previous request result property to continue pagination /// Cancellation token Task> GetFundingRateHistoryAsync(GetFundingRateHistoryRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/IndexPrices/IGetIndexPriceKlinesRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/IndexPrices/IGetIndexPriceKlinesEndpoint.cs similarity index 59% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/IndexPrices/IGetIndexPriceKlinesRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/IndexPrices/IGetIndexPriceKlinesEndpoint.cs index 9d56c57f..e721de62 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/IndexPrices/IGetIndexPriceKlinesRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/IndexPrices/IGetIndexPriceKlinesEndpoint.cs @@ -7,20 +7,23 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetIndexPriceKlinesRestClient : ISharedClient + /// + /// Endpoint definition for retrieving index price kline/candlestick data from an exchange + /// + public interface IGetIndexPriceKlinesEndpoint : ISharedApiEndpoint { /// /// Index price klines request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetIndexPriceKlinesOptions GetIndexPriceKlinesOptions { get; } /// /// Get index price kline/candlestick data, see for request options and exchange specific required/optional parameters.
- /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. + /// The result is paginated, if there are more results to be retrieved, the property of the result will contain the pagination request to be used for the next request to continue pagination. ///
/// Request info - /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// The pagination request from the previous request result property to continue pagination /// Cancellation token Task> GetIndexPriceKlinesAsync(GetKlinesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Leverage/IGetLeverageRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Leverage/IGetLeverageEndpoint.cs similarity index 66% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Leverage/IGetLeverageRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Leverage/IGetLeverageEndpoint.cs index 044cc86e..047db50c 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Leverage/IGetLeverageRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Leverage/IGetLeverageEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetLeverageRestClient : ISharedClient + /// + /// Endpoint definition for retrieving leverage information for a symbol on an exchange. + /// + public interface IGetLeverageEndpoint : ISharedApiEndpoint { /// /// Leverage request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetLeverageOptions GetLeverageOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Leverage/ISetLeverageRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Leverage/ISetLeverageEndpoint.cs similarity index 71% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Leverage/ISetLeverageRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Leverage/ISetLeverageEndpoint.cs index edb50ef3..d97b81aa 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Leverage/ISetLeverageRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Leverage/ISetLeverageEndpoint.cs @@ -7,7 +7,10 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface ISetLeverageRestClient : ISharedClient + /// + /// Endpoint definition for setting leverage on an exchange. + /// + public interface ISetLeverageEndpoint : ISharedApiEndpoint { /// /// How the leverage setting is configured on the exchange @@ -16,7 +19,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Leverage set request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
SetLeverageOptions SetLeverageOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/MarkPrices/IGetMarkPriceKlinesRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/MarkPrices/IGetMarkPriceKlinesEndpoint.cs similarity index 59% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/MarkPrices/IGetMarkPriceKlinesRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/MarkPrices/IGetMarkPriceKlinesEndpoint.cs index 7a5db2b1..599d400c 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/MarkPrices/IGetMarkPriceKlinesRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/MarkPrices/IGetMarkPriceKlinesEndpoint.cs @@ -7,20 +7,23 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetMarkPriceKlinesRestClient : ISharedClient + /// + /// Endpoint definition for retrieving mark price kline/candlestick data from an exchange. + /// + public interface IGetMarkPriceKlinesEndpoint : ISharedApiEndpoint { /// /// Mark price klines request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetMarkPriceKlinesOptions GetMarkPriceKlinesOptions { get; } /// /// Get mark price kline/candlestick data, see for request options and exchange specific required/optional parameters.
- /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. + /// The result is paginated, if there are more results to be retrieved, the property of the result will contain the pagination request to be used for the next request to continue pagination. ///
/// Request info - /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// The pagination request from the previous request result property to continue pagination /// Cancellation token Task> GetMarkPriceKlinesAsync(GetKlinesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/OpenInterest/IGetOpenInterestRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/OpenInterest/IGetOpenInterestEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/OpenInterest/IGetOpenInterestRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/OpenInterest/IGetOpenInterestEndpoint.cs index 584c1ea2..87339e02 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/OpenInterest/IGetOpenInterestRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/OpenInterest/IGetOpenInterestEndpoint.cs @@ -7,12 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetOpenInterestRestClient : ISharedClient + /// + /// Endpoint definition for retrieving open interest data from an exchange + /// + public interface IGetOpenInterestEndpoint : ISharedApiEndpoint { - /// /// Open interest request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetOpenInterestOptions GetOpenInterestOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Management/ICancelFuturesOrderByClientOrderIdRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Management/ICancelFuturesOrderByClientOrderIdEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Management/ICancelFuturesOrderByClientOrderIdRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Management/ICancelFuturesOrderByClientOrderIdEndpoint.cs index 7b2bbc6c..275b2ddb 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Management/ICancelFuturesOrderByClientOrderIdRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Management/ICancelFuturesOrderByClientOrderIdEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface ICancelFuturesOrderByClientOrderIdRestClient : ISharedClient + /// + /// Endpoint definition for canceling a futures order by client order id on an exchange. + /// + public interface ICancelFuturesOrderByClientOrderIdEndpoint : ISharedApiEndpoint { /// /// Futures cancel order by client order id request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
CancelFuturesOrderByClientOrderIdOptions CancelFuturesOrderByClientOrderIdOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Management/ICancelFuturesOrderRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Management/ICancelFuturesOrderEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Management/ICancelFuturesOrderRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Management/ICancelFuturesOrderEndpoint.cs index 520b3390..3dcef698 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Management/ICancelFuturesOrderRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Management/ICancelFuturesOrderEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface ICancelFuturesOrderRestClient : ISharedClient + /// + /// Endpoint definition for canceling a futures order on an exchange. + /// + public interface ICancelFuturesOrderEndpoint : ISharedApiEndpoint { /// /// Futures cancel order request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
CancelFuturesOrderOptions CancelFuturesOrderOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Management/IPlaceFuturesOrderRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Management/IPlaceFuturesOrderEndpoint.cs similarity index 80% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Management/IPlaceFuturesOrderRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Management/IPlaceFuturesOrderEndpoint.cs index 06907bca..8c5a08ab 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Management/IPlaceFuturesOrderRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Management/IPlaceFuturesOrderEndpoint.cs @@ -7,7 +7,10 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IPlaceFuturesOrderRestClient : ISharedClient + /// + /// Endpoint definition for placing a futures order on an exchange. + /// + public interface IPlaceFuturesOrderEndpoint : ISharedApiEndpoint { /// /// How the trading fee is deducted @@ -38,7 +41,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Futures place order request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
PlaceFuturesOrderOptions PlaceFuturesOrderOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetClosedFuturesOrdersRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetClosedFuturesOrdersEndpoint.cs similarity index 60% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetClosedFuturesOrdersRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetClosedFuturesOrdersEndpoint.cs index 9f18aee7..fd8c350a 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetClosedFuturesOrdersRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetClosedFuturesOrdersEndpoint.cs @@ -7,20 +7,23 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetClosedFuturesOrdersRestClient : ISharedClient + /// + /// Endpoint definition for retrieving closed futures orders on an exchange. + /// + public interface IGetClosedFuturesOrdersEndpoint : ISharedApiEndpoint { /// /// Spot get closed orders request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetFuturesClosedOrdersOptions GetClosedFuturesOrdersOptions { get; } /// /// Get info on closed futures orders, see for request options and exchange specific required/optional parameters.
- /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. + /// The result is paginated, if there are more results to be retrieved, the property of the result will contain the pagination request to be used for the next request to continue pagination. ///
/// Request info - /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// The pagination request from the previous request result property to continue pagination /// Cancellation token Task> GetClosedFuturesOrdersAsync(GetClosedOrdersRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetFuturesOrderByClientOrderIdRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetFuturesOrderByClientOrderIdEndpoint.cs similarity index 68% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetFuturesOrderByClientOrderIdRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetFuturesOrderByClientOrderIdEndpoint.cs index be48d756..95f55353 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetFuturesOrderByClientOrderIdRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetFuturesOrderByClientOrderIdEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetFuturesOrderByClientOrderIdRestClient : ISharedClient + /// + /// Endpoint definition for retrieving a futures order by client order id on an exchange. + /// + public interface IGetFuturesOrderByClientOrderIdEndpoint : ISharedApiEndpoint { /// /// Futures get order by client order id request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetFuturesOrderByClientOrderIdOptions GetFuturesOrderByClientOrderIdOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetFuturesOrderRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetFuturesOrderEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetFuturesOrderRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetFuturesOrderEndpoint.cs index 7a22d235..ea9c31d0 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetFuturesOrderRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetFuturesOrderEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetFuturesOrderRestClient : ISharedClient + /// + /// Endpoint definition for retrieving a futures order on an exchange. + /// + public interface IGetFuturesOrderEndpoint : ISharedApiEndpoint { /// /// Futures get order request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetFuturesOrderOptions GetFuturesOrderOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetOpenFuturesOrdersRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetOpenFuturesOrdersEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetOpenFuturesOrdersRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetOpenFuturesOrdersEndpoint.cs index 61036442..bd39f782 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetOpenFuturesOrdersRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Orders/Retrieval/IGetOpenFuturesOrdersEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetOpenFuturesOrdersRestClient : ISharedClient + /// + /// Endpoint definition for retrieving open futures orders on an exchange. + /// + public interface IGetOpenFuturesOrdersEndpoint : ISharedApiEndpoint { /// /// Futures get open orders request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetOpenFuturesOrdersOptions GetOpenFuturesOrdersOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/PositionMode/IGetPositionModeRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/PositionMode/IGetPositionModeEndpoint.cs similarity index 66% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/PositionMode/IGetPositionModeRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/PositionMode/IGetPositionModeEndpoint.cs index c40cb49f..69e9e3c0 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/PositionMode/IGetPositionModeRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/PositionMode/IGetPositionModeEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetPositionModeRestClient : ISharedClient + /// + /// Request defintion for getting the current user position mode setting on an exchange. + /// + public interface IGetPositionModeEndpoint : ISharedApiEndpoint { /// /// Position mode request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetPositionModeOptions GetPositionModeOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/PositionMode/ISetPositionModeRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/PositionMode/ISetPositionModeEndpoint.cs similarity index 71% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/PositionMode/ISetPositionModeRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/PositionMode/ISetPositionModeEndpoint.cs index 69664b06..4eefca2b 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/PositionMode/ISetPositionModeRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/PositionMode/ISetPositionModeEndpoint.cs @@ -7,7 +7,10 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface ISetPositionModeRestClient : ISharedClient + /// + /// Endpoint definition for setting the user position mode on an exchange. + /// + public interface ISetPositionModeEndpoint : ISharedApiEndpoint { /// /// How the exchange handles setting the position mode @@ -16,7 +19,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Position mode set request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
SetPositionModeOptions SetPositionModeOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Positions/IClosePositionRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Positions/IClosePositionEndpoint.cs similarity index 68% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Positions/IClosePositionRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Positions/IClosePositionEndpoint.cs index 71861d0b..a87aea6b 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Positions/IClosePositionRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Positions/IClosePositionEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IClosePositionRestClient : ISharedClient + /// + /// Request definition for closing a position on an exchange. + /// + public interface IClosePositionEndpoint : ISharedApiEndpoint { /// /// Close position order request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
ClosePositionOptions ClosePositionOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Positions/IGetPositionHistoryRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Positions/IGetPositionHistoryEndpoint.cs similarity index 59% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Positions/IGetPositionHistoryRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Positions/IGetPositionHistoryEndpoint.cs index bbff758c..0ed4157b 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Positions/IGetPositionHistoryRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Positions/IGetPositionHistoryEndpoint.cs @@ -7,20 +7,23 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetPositionHistoryRestClient : ISharedClient + /// + /// Request definition for retrieving position history from an exchange. + /// + public interface IGetPositionHistoryEndpoint : ISharedApiEndpoint { /// /// Position history request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetPositionHistoryOptions GetPositionHistoryOptions { get; } /// /// Get position history, see for request options and exchange specific required/optional parameters.
- /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. + /// The result is paginated, if there are more results to be retrieved, the property of the result will contain the pagination request to be used for the next request to continue pagination. ///
/// Request info - /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// The pagination request from the previous request result property to continue pagination /// Cancellation token Task> GetPositionHistoryAsync(GetPositionHistoryRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Positions/IGetPositionsRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Positions/IGetPositionsEndpoint.cs similarity index 66% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Positions/IGetPositionsRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Positions/IGetPositionsEndpoint.cs index 35796e67..52cc3e19 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Positions/IGetPositionsRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Positions/IGetPositionsEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetPositionsRestClient : ISharedClient + /// + /// Request definition for retrieving open positions from an exchange. + /// + public interface IGetPositionsEndpoint : ISharedApiEndpoint { /// /// Positions request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetPositionsOptions GetPositionsOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Symbols/IGetFuturesSymbolsRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Symbols/IGetFuturesSymbolsEndpoint.cs similarity index 81% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Symbols/IGetFuturesSymbolsRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Symbols/IGetFuturesSymbolsEndpoint.cs index 8332e60f..10ef9dc8 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Symbols/IGetFuturesSymbolsRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Symbols/IGetFuturesSymbolsEndpoint.cs @@ -7,7 +7,10 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetFuturesSymbolsRestClient : ISharedClient + /// + /// Request definition for getting futures symbols from an exchange + /// + public interface IGetFuturesSymbolsEndpoint : ISharedApiEndpoint { /// /// Get the futures symbol catalog. Only available if has been called previously. @@ -16,7 +19,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Futures symbol request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetFuturesSymbolsOptions GetFuturesSymbolsOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Tickers/IGetAllFuturesTickersEndpoint.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Tickers/IGetAllFuturesTickersEndpoint.cs new file mode 100644 index 00000000..d231eb70 --- /dev/null +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Tickers/IGetAllFuturesTickersEndpoint.cs @@ -0,0 +1,28 @@ +using CryptoExchange.Net.Objects; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace CryptoExchange.Net.SharedApis +{ + /// + /// Request definition for retrieving all futures tickers from an exchange. + /// + public interface IGetAllFuturesTickersEndpoint : ISharedApiEndpoint + { + /// + /// Futures get tickers request options.
+ /// Use , and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetAllFuturesTickersOptions GetAllFuturesTickersOptions { get; } + /// + /// Get ticker info for all futures symbols, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + Task> GetAllFuturesTickersAsync(GetTickersRequest request, CancellationToken ct = default); + } +} diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Tickers/IGetAllFuturesTickersRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Tickers/IGetAllFuturesTickersRestClient.cs deleted file mode 100644 index b3d02391..00000000 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Tickers/IGetAllFuturesTickersRestClient.cs +++ /dev/null @@ -1,25 +0,0 @@ -using CryptoExchange.Net.Objects; -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -namespace CryptoExchange.Net.SharedApis -{ - public interface IGetAllFuturesTickersRestClient : ISharedClient - { - /// - /// Futures get tickers request options.
- /// Use and to check for required and optional parameters for the request.
- /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. - ///
- GetFuturesTickersOptions GetFuturesTickersOptions { get; } - /// - /// Get ticker info for all futures symbols, see for request options and exchange specific required/optional parameters.
- ///
- /// Request info - /// Cancellation token - Task> GetFuturesTickersAsync(GetTickersRequest request, CancellationToken ct = default); - } -} diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Tickers/IGetFuturesTickerRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Tickers/IGetFuturesTickerEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Tickers/IGetFuturesTickerRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Tickers/IGetFuturesTickerEndpoint.cs index c237d45b..a981f906 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Tickers/IGetFuturesTickerRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/Tickers/IGetFuturesTickerEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetFuturesTickerRestClient : ISharedClient + /// + /// Request definition for retrieving a futures ticker from an exchange. + /// + public interface IGetFuturesTickerEndpoint : ISharedApiEndpoint { /// /// Futures get ticker request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetFuturesTickerOptions GetFuturesTickerOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TpSl/ICancelFuturesTpSlRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TpSl/ICancelFuturesTpSlEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TpSl/ICancelFuturesTpSlRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TpSl/ICancelFuturesTpSlEndpoint.cs index b1977c1a..95bd9903 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TpSl/ICancelFuturesTpSlRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TpSl/ICancelFuturesTpSlEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface ICancelFuturesTpSlRestClient : ISharedClient + /// + /// Request definition for canceling a take profit and/or stop loss for an open position on an exchange. + /// + public interface ICancelFuturesTpSlEndpoint : ISharedApiEndpoint { /// /// Cancel a take profit and/or stop loss options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
CancelFuturesTpSlOptions CancelFuturesTpSlOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TpSl/ISetFuturesTpSlRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TpSl/ISetFuturesTpSlEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TpSl/ISetFuturesTpSlRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TpSl/ISetFuturesTpSlEndpoint.cs index 17f6727f..3af3294b 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TpSl/ISetFuturesTpSlRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TpSl/ISetFuturesTpSlEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface ISetFuturesTpSlRestClient : ISharedClient + /// + /// Request definition for setting take profit and/or stop loss for an open position on an exchange. + /// + public interface ISetFuturesTpSlEndpoint : ISharedApiEndpoint { /// /// Set take profit and/or stop loss options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
SetFuturesTpSlOptions SetFuturesTpSlOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TriggerOrders/ICancelFuturesTriggerOrderRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TriggerOrders/ICancelFuturesTriggerOrderEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TriggerOrders/ICancelFuturesTriggerOrderRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TriggerOrders/ICancelFuturesTriggerOrderEndpoint.cs index 04a4cd4a..b25da058 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TriggerOrders/ICancelFuturesTriggerOrderRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TriggerOrders/ICancelFuturesTriggerOrderEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface ICancelFuturesTriggerOrderRestClient : ISharedClient + /// + /// Request definition for canceling a futures trigger order on an exchange. + /// + public interface ICancelFuturesTriggerOrderEndpoint : ISharedApiEndpoint { /// /// Cancel trigger order request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
CancelFuturesTriggerOrderOptions CancelFuturesTriggerOrderOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TriggerOrders/IGetFuturesTriggerOrderRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TriggerOrders/IGetFuturesTriggerOrderEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TriggerOrders/IGetFuturesTriggerOrderRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TriggerOrders/IGetFuturesTriggerOrderEndpoint.cs index d518d423..5f1f01b9 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TriggerOrders/IGetFuturesTriggerOrderRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TriggerOrders/IGetFuturesTriggerOrderEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetFuturesTriggerOrderRestClient : ISharedClient + /// + /// Request definition for getting a specific futures trigger order from the exchange. + /// + public interface IGetFuturesTriggerOrderEndpoint : ISharedApiEndpoint { /// /// Get trigger order request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetFuturesTriggerOrderOptions GetFuturesTriggerOrderOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TriggerOrders/IPlaceFuturesTriggerOrderRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TriggerOrders/IPlaceFuturesTriggerOrderEndpoint.cs similarity index 64% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TriggerOrders/IPlaceFuturesTriggerOrderRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TriggerOrders/IPlaceFuturesTriggerOrderEndpoint.cs index 7ed64542..7f72d375 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TriggerOrders/IPlaceFuturesTriggerOrderRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/TriggerOrders/IPlaceFuturesTriggerOrderEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IPlaceFuturesTriggerOrderRestClient : ISharedClient + /// + /// Request definition for placing a futures trigger order on an exchange. + /// + public interface IPlaceFuturesTriggerOrderEndpoint : ISharedApiEndpoint { /// - /// Place spot trigger order options.
- /// Use and to check for required and optional parameters for the request.
+ /// Place futures trigger order options.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
PlaceFuturesTriggerOrderOptions PlaceFuturesTriggerOrderOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/UserTrades/IGetFuturesOrderTradesRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/UserTrades/IGetFuturesOrderTradesEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/UserTrades/IGetFuturesOrderTradesRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/UserTrades/IGetFuturesOrderTradesEndpoint.cs index ff98b601..dea6fd0d 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/UserTrades/IGetFuturesOrderTradesRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/UserTrades/IGetFuturesOrderTradesEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetFuturesOrderTradesRestClient : ISharedClient + /// + /// Request definition for getting trades for a specific futures order on an exchange. + /// + public interface IGetFuturesOrderTradesEndpoint : ISharedApiEndpoint { /// /// Futures get order trades request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetFuturesOrderTradesOptions GetFuturesOrderTradesOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/UserTrades/IGetFuturesUserTradeHistoryEndpoint.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/UserTrades/IGetFuturesUserTradeHistoryEndpoint.cs new file mode 100644 index 00000000..6fcfa4c2 --- /dev/null +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/UserTrades/IGetFuturesUserTradeHistoryEndpoint.cs @@ -0,0 +1,30 @@ +using CryptoExchange.Net.Objects; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace CryptoExchange.Net.SharedApis +{ + /// + /// Request definition for retrieving futures user trade history from an exchange. + /// + public interface IGetFuturesUserTradeHistoryEndpoint : ISharedApiEndpoint + { + /// + /// Futures user trades request options.
+ /// Use , and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ GetFuturesUserTradeHistoryOptions GetFuturesUserTradeHistoryOptions { get; } + /// + /// Get futures user trade records, see for request options and exchange specific required/optional parameters.
+ /// The result is paginated, if there are more results to be retrieved, the property of the result will contain the pagination request to be used for the next request to continue pagination. + ///
+ /// Request info + /// The pagination request from the previous request result property to continue pagination + /// Cancellation token + Task> GetFuturesUserTradesAsync(GetUserTradesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + } +} diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/UserTrades/IGetFuturesUserTradesRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/UserTrades/IGetFuturesUserTradesRestClient.cs deleted file mode 100644 index 111bbe5a..00000000 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Futures/UserTrades/IGetFuturesUserTradesRestClient.cs +++ /dev/null @@ -1,27 +0,0 @@ -using CryptoExchange.Net.Objects; -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -namespace CryptoExchange.Net.SharedApis -{ - public interface IGetFuturesUserTradesRestClient : ISharedClient - { - /// - /// Futures user trades request options.
- /// Use and to check for required and optional parameters for the request.
- /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. - ///
- GetFuturesUserTradesOptions GetFuturesUserTradesOptions { get; } - /// - /// Get futures user trade records, see for request options and exchange specific required/optional parameters.
- /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. - ///
- /// Request info - /// The pagination request from the previous request result `NextPageRequest` property to continue pagination - /// Cancellation token - Task> GetFuturesUserTradesAsync(GetUserTradesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); - } -} diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/ISharedApiEndpoint.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/ISharedApiEndpoint.cs new file mode 100644 index 00000000..e92fc504 --- /dev/null +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/ISharedApiEndpoint.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace CryptoExchange.Net.SharedApis +{ + /// + /// Identifies a fine-grained Shared API endpoint capability. + /// + public interface ISharedApiEndpoint : ISharedClient + { + } +} diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Klines/IGetKlinesRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Klines/IGetKlinesEndpoint.cs similarity index 59% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Klines/IGetKlinesRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Klines/IGetKlinesEndpoint.cs index 804ac3aa..187bb7f8 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Klines/IGetKlinesRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Klines/IGetKlinesEndpoint.cs @@ -7,21 +7,24 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetKlinesRestClient : ISharedClient + /// + /// Request definition for getting kline/candlestick data from an exchange. + /// + public interface IGetKlinesEndpoint : ISharedApiEndpoint { /// /// Kline request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetKlinesOptions GetKlinesOptions { get; } /// /// Get kline/candlestick data, see for request options and exchange specific required/optional parameters.
- /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. + /// The result is paginated, if there are more results to be retrieved, the property of the result will contain the pagination request to be used for the next request to continue pagination. ///
/// Request info - /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// The pagination request from the previous request result property to continue pagination /// Cancellation token /// Task> GetKlinesAsync(GetKlinesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/OrderBooks/IGetBookTickerRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/OrderBooks/IGetBookTickerEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/OrderBooks/IGetBookTickerRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/OrderBooks/IGetBookTickerEndpoint.cs index fd6a3221..86e4cbed 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/OrderBooks/IGetBookTickerRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/OrderBooks/IGetBookTickerEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetBookTickerRestClient : ISharedClient + /// + /// Request definition for retrieving the best bid/ask prices for a symbol on an exchange. + /// + public interface IGetBookTickerEndpoint : ISharedApiEndpoint { /// /// Book ticker request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetBookTickerOptions GetBookTickerOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/OrderBooks/IGetOrderBookRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/OrderBooks/IGetOrderBookEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/OrderBooks/IGetOrderBookRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/OrderBooks/IGetOrderBookEndpoint.cs index 98cba8df..5d392b75 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/OrderBooks/IGetOrderBookRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/OrderBooks/IGetOrderBookEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetOrderBookRestClient : ISharedClient + /// + /// Request definition for retrieving an order book snapshot for a symbol on an exchange. + /// + public interface IGetOrderBookEndpoint : ISharedApiEndpoint { /// /// Order book request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetOrderBookOptions GetOrderBookOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Management/ICancelSpotOrderByClientOrderIdRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Management/ICancelSpotOrderByClientOrderIdEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Management/ICancelSpotOrderByClientOrderIdRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Management/ICancelSpotOrderByClientOrderIdEndpoint.cs index 207a2af1..f5aee5bd 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Management/ICancelSpotOrderByClientOrderIdRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Management/ICancelSpotOrderByClientOrderIdEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface ICancelSpotOrderByClientOrderIdRestClient : ISharedClient + /// + /// Request definition for canceling a spot order by client order id on an exchange. + /// + public interface ICancelSpotOrderByClientOrderIdEndpoint : ISharedApiEndpoint { /// /// Spot cancel order by client order id request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
CancelSpotOrderByClientOrderIdOptions CancelSpotOrderByClientOrderIdOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Management/ICancelSpotOrderRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Management/ICancelSpotOrderEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Management/ICancelSpotOrderRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Management/ICancelSpotOrderEndpoint.cs index 2bcb4648..43771e5d 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Management/ICancelSpotOrderRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Management/ICancelSpotOrderEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface ICancelSpotOrderRestClient : ISharedClient + /// + /// Request definition for canceling a spot order on an exchange. + /// + public interface ICancelSpotOrderEndpoint : ISharedApiEndpoint { /// /// Spot cancel order request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
CancelSpotOrderOptions CancelSpotOrderOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Management/IPlaceSpotOrderRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Management/IPlaceSpotOrderEndpoint.cs similarity index 77% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Management/IPlaceSpotOrderRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Management/IPlaceSpotOrderEndpoint.cs index 6dc799d8..1913efdf 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Management/IPlaceSpotOrderRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Management/IPlaceSpotOrderEndpoint.cs @@ -7,7 +7,10 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IPlaceSpotOrderRestClient : ISharedClient + /// + /// Request definition for placing a spot order on an exchange. + /// + public interface IPlaceSpotOrderEndpoint : ISharedApiEndpoint { /// /// How the trading fee is deducted @@ -31,14 +34,14 @@ namespace CryptoExchange.Net.SharedApis SharedQuantitySupport SpotSupportedOrderQuantity { get; } /// - /// Generate a new random client order id + /// Generate a new random client order id in a format that is accepted by the exchange. /// /// string GenerateClientOrderId(); /// /// Spot place order request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
PlaceSpotOrderOptions PlaceSpotOrderOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetClosedSpotOrdersRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetClosedSpotOrdersEndpoint.cs similarity index 59% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetClosedSpotOrdersRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetClosedSpotOrdersEndpoint.cs index 187d01d8..8e38d229 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetClosedSpotOrdersRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetClosedSpotOrdersEndpoint.cs @@ -7,20 +7,23 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetClosedSpotOrdersRestClient : ISharedClient + /// + /// Request definition for retrieving closed spot orders from an exchange. + /// + public interface IGetClosedSpotOrdersEndpoint : ISharedApiEndpoint { /// /// Spot get closed orders request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetSpotClosedOrdersOptions GetClosedSpotOrdersOptions { get; } /// /// Get info on closed spot orders, see for request options and exchange specific required/optional parameters.
- /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. + /// The result is paginated, if there are more results to be retrieved, the property of the result will contain the pagination request to be used for the next request to continue pagination. ///
/// Request info - /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// The pagination request from the previous request result property to continue pagination /// Cancellation token Task> GetClosedSpotOrdersAsync(GetClosedOrdersRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetOpenSpotOrdersRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetOpenSpotOrdersEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetOpenSpotOrdersRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetOpenSpotOrdersEndpoint.cs index 54e147e1..58cd8c29 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetOpenSpotOrdersRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetOpenSpotOrdersEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetOpenSpotOrdersRestClient : ISharedClient + /// + /// Request definition for retrieving open spot order from an exchange. + /// + public interface IGetOpenSpotOrdersEndpoint : ISharedApiEndpoint { /// /// Spot get open orders request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetOpenSpotOrdersOptions GetOpenSpotOrdersOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetSpotOrderByClientOrderIdRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetSpotOrderByClientOrderIdEndpoint.cs similarity index 68% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetSpotOrderByClientOrderIdRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetSpotOrderByClientOrderIdEndpoint.cs index a951c0a4..1a74af5e 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetSpotOrderByClientOrderIdRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetSpotOrderByClientOrderIdEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetSpotOrderByClientOrderIdRestClient : ISharedClient + /// + /// Request definition for retrieving a spot order by client order id from an exchange. + /// + public interface IGetSpotOrderByClientOrderIdEndpoint : ISharedApiEndpoint { /// /// Spot get order by client order id request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetSpotOrderByClientOrderIdOptions GetSpotOrderByClientOrderIdOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetSpotOrderRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetSpotOrderEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetSpotOrderRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetSpotOrderEndpoint.cs index 2abb139c..b57e5da5 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetSpotOrderRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Orders/Retrieval/IGetSpotOrderEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetSpotOrderRestClient : ISharedClient + /// + /// Request definition for retrieving a spot order from an exchange. + /// + public interface IGetSpotOrderEndpoint : ISharedApiEndpoint { /// /// Spot get order request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetSpotOrderOptions GetSpotOrderOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Symbols/IGetSpotSymbolsRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Symbols/IGetSpotSymbolsEndpoint.cs similarity index 81% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Symbols/IGetSpotSymbolsRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Symbols/IGetSpotSymbolsEndpoint.cs index 7056fc0d..bd470bd0 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Symbols/IGetSpotSymbolsRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Symbols/IGetSpotSymbolsEndpoint.cs @@ -7,9 +7,11 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetSpotSymbolsRestClient : ISharedClient + /// + /// Request definition for retrieving spot symbols from an exchange. + /// + public interface IGetSpotSymbolsEndpoint : ISharedApiEndpoint { - /// /// Get the spot symbol catalog. Only available if has been called previously. /// @@ -35,7 +37,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Spot symbols request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetSpotSymbolsOptions GetSpotSymbolsOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Tickers/IGetAllSpotTickersRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Tickers/IGetAllSpotTickersEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Tickers/IGetAllSpotTickersRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Tickers/IGetAllSpotTickersEndpoint.cs index 48157cbd..8c24c85e 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Tickers/IGetAllSpotTickersRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Tickers/IGetAllSpotTickersEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetAllSpotTickersRestClient : ISharedClient + /// + /// Request definition for retrieving all spot tickers from an exchange. + /// + public interface IGetAllSpotTickersEndpoint : ISharedApiEndpoint { /// /// Spot tickers request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetAllSpotTickersOptions GetAllSpotTickersOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Tickers/IGetSpotTickerRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Tickers/IGetSpotTickerEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Tickers/IGetSpotTickerRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Tickers/IGetSpotTickerEndpoint.cs index abdc6de3..0ac7ab43 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Tickers/IGetSpotTickerRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/Tickers/IGetSpotTickerEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetSpotTickerRestClient : ISharedClient + /// + /// Request definition for getting spot ticker info from an exchange. + /// + public interface IGetSpotTickerEndpoint : ISharedApiEndpoint { /// /// Spot ticker request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetSpotTickerOptions GetSpotTickerOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/TriggerOrders/ICancelSpotTriggerOrderRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/TriggerOrders/ICancelSpotTriggerOrderEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/TriggerOrders/ICancelSpotTriggerOrderRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/TriggerOrders/ICancelSpotTriggerOrderEndpoint.cs index 1c3a5b70..28ae631d 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/TriggerOrders/ICancelSpotTriggerOrderRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/TriggerOrders/ICancelSpotTriggerOrderEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface ICancelSpotTriggerOrderRestClient : ISharedClient + /// + /// Request definition for canceling a spot trigger order on an exchange + /// + public interface ICancelSpotTriggerOrderEndpoint : ISharedApiEndpoint { /// /// Cancel trigger order request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
CancelSpotTriggerOrderOptions CancelSpotTriggerOrderOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/TriggerOrders/IGetSpotTriggerOrderRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/TriggerOrders/IGetSpotTriggerOrderEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/TriggerOrders/IGetSpotTriggerOrderRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/TriggerOrders/IGetSpotTriggerOrderEndpoint.cs index 431e75b6..a808385d 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/TriggerOrders/IGetSpotTriggerOrderRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/TriggerOrders/IGetSpotTriggerOrderEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetSpotTriggerOrderRestClient : ISharedClient + /// + /// Request definition for getting a specific spot trigger order on an exchange + /// + public interface IGetSpotTriggerOrderEndpoint : ISharedApiEndpoint { /// /// Get trigger order request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetSpotTriggerOrderOptions GetSpotTriggerOrderOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/TriggerOrders/IPlaceSpotTriggerOrderRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/TriggerOrders/IPlaceSpotTriggerOrderEndpoint.cs similarity index 68% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/TriggerOrders/IPlaceSpotTriggerOrderRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/TriggerOrders/IPlaceSpotTriggerOrderEndpoint.cs index e8589965..2452bb93 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/TriggerOrders/IPlaceSpotTriggerOrderRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/TriggerOrders/IPlaceSpotTriggerOrderEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IPlaceSpotTriggerOrderRestClient : ISharedClient + /// + /// Request definition for placing a spot trigger order on an exchange. + /// + public interface IPlaceSpotTriggerOrderEndpoint : ISharedApiEndpoint { /// /// Place spot trigger order options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
PlaceSpotTriggerOrderOptions PlaceSpotTriggerOrderOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/UserTrades/IGetSpotOrderTradesRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/UserTrades/IGetSpotOrderTradesEndpoint.cs similarity index 71% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/UserTrades/IGetSpotOrderTradesRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/UserTrades/IGetSpotOrderTradesEndpoint.cs index 79c5333e..64d9ddfd 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/UserTrades/IGetSpotOrderTradesRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/UserTrades/IGetSpotOrderTradesEndpoint.cs @@ -7,12 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetSpotOrderTradesRestClient : ISharedClient + /// + /// Request definition for getting trades for a specific spot order on an exchange. + /// + public interface IGetSpotOrderTradesEndpoint : ISharedApiEndpoint { - /// /// Spot get order trades request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetSpotOrderTradesOptions GetSpotOrderTradesOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/UserTrades/IGetSpotUserTradeHistoryRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/UserTrades/IGetSpotUserTradeHistoryEndpoint.cs similarity index 60% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/UserTrades/IGetSpotUserTradeHistoryRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/UserTrades/IGetSpotUserTradeHistoryEndpoint.cs index f9b9238f..3d39360a 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/UserTrades/IGetSpotUserTradeHistoryRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Spot/UserTrades/IGetSpotUserTradeHistoryEndpoint.cs @@ -7,20 +7,23 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetSpotUserTradeHistoryRestClient : ISharedClient + /// + /// Request definition for getting spot user trade history from an exchange + /// + public interface IGetSpotUserTradeHistoryEndpoint : ISharedApiEndpoint { /// /// Spot user trades request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetSpotUserTradeHistoryOptions GetSpotUserTradeHistoryOptions { get; } /// /// Get spot user trade records, see for request options and exchange specific required/optional parameters.
- /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. + /// The result is paginated, if there are more results to be retrieved, the property of the result will contain the pagination request to be used for the next request to continue pagination. ///
/// Request info - /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// The pagination request from the previous request result property to continue pagination /// Cancellation token Task> GetSpotUserTradeHistoryAsync(GetUserTradesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Trades/IGetRecentTradesRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Trades/IGetRecentTradesEndpoint.cs similarity index 67% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Trades/IGetRecentTradesRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Trades/IGetRecentTradesEndpoint.cs index e8ac48b2..5b95e812 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Trades/IGetRecentTradesRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Trades/IGetRecentTradesEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetRecentTradesRestClient : ISharedClient + /// + /// Request definition for retrieving recent trades for a symbol on an exchange. + /// + public interface IGetRecentTradesEndpoint : ISharedApiEndpoint { /// /// Recent trades request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetRecentTradesOptions GetRecentTradesOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Trades/IGetTradeHistoryRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Trades/IGetTradeHistoryEndpoint.cs similarity index 60% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Trades/IGetTradeHistoryRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Trades/IGetTradeHistoryEndpoint.cs index 3caae5ec..41de496d 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Trades/IGetTradeHistoryRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Trades/IGetTradeHistoryEndpoint.cs @@ -7,21 +7,24 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetTradeHistoryRestClient : ISharedClient + /// + /// Request definition for retrieving trade history from an exchange. + /// + public interface IGetTradeHistoryEndpoint : ISharedApiEndpoint { /// /// Trade history request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetTradeHistoryOptions GetTradeHistoryOptions { get; } /// /// Get public trade history, see for request options and exchange specific required/optional parameters.
- /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. + /// The result is paginated, if there are more results to be retrieved, the property of the result will contain the pagination request to be used for the next request to continue pagination. ///
/// Request info - /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// The pagination request from the previous request result property to continue pagination /// Cancellation token /// Task> GetTradeHistoryAsync(GetTradeHistoryRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Transfers/ITransferRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Transfers/ITransferEndpoint.cs similarity index 66% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Transfers/ITransferRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Transfers/ITransferEndpoint.cs index fead1ce3..845381db 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Transfers/ITransferRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Transfers/ITransferEndpoint.cs @@ -7,11 +7,14 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface ITransferRestClient : ISharedClient + /// + /// Request definition for transferring funds between account types on an exchange. + /// + public interface ITransferEndpoint : ISharedApiEndpoint { /// /// Transfer request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
TransferOptions TransferOptions { get; } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Withdrawals/IGetWithdrawalHistoryRestClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Withdrawals/IGetWithdrawalHistoryEndpoint.cs similarity index 60% rename from CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Withdrawals/IGetWithdrawalHistoryRestClient.cs rename to CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Withdrawals/IGetWithdrawalHistoryEndpoint.cs index 06a5cac5..933d755f 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Withdrawals/IGetWithdrawalHistoryRestClient.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Withdrawals/IGetWithdrawalHistoryEndpoint.cs @@ -7,21 +7,24 @@ using System.Threading.Tasks; namespace CryptoExchange.Net.SharedApis { - public interface IGetWithdrawalHistoryRestClient : ISharedClient + /// + /// Request definition for retrieving withdrawal history from an exchange + /// + public interface IGetWithdrawalHistoryEndpoint : ISharedApiEndpoint { /// /// Withdrawal records request options.
- /// Use and to check for required and optional parameters for the request.
+ /// Use , and to check for required and optional parameters for the request.
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. ///
GetWithdrawalHistoryOptions GetWithdrawalHistoryOptions { get; } /// /// Get withdrawal records, see for request options and exchange specific required/optional parameters.
- /// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination. + /// The result is paginated, if there are more results to be retrieved, the property of the result will contain the pagination request to be used for the next request to continue pagination. ///
/// Request info - /// The pagination request from the previous request result `NextPageRequest` property to continue pagination + /// The pagination request from the previous request result property to continue pagination /// Cancellation token /// Task> GetWithdrawalHistoryAsync(GetWithdrawalsRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Withdrawals/IWithdrawEndpoint.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Withdrawals/IWithdrawEndpoint.cs new file mode 100644 index 00000000..004bfdeb --- /dev/null +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/V2/Withdrawals/IWithdrawEndpoint.cs @@ -0,0 +1,30 @@ +using CryptoExchange.Net.Objects; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace CryptoExchange.Net.SharedApis +{ + /// + /// Request definition for withdrawing a specific asset from an exchange. + /// + public interface IWithdrawEndpoint : ISharedApiEndpoint + { + /// + /// Withdraw request options.
+ /// Use , and to check for required and optional parameters for the request.
+ /// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object. + ///
+ WithdrawOptions WithdrawOptions { get; } + + /// + /// Request a withdrawal, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + /// + Task> WithdrawAsync(WithdrawRequest request, CancellationToken ct = default); + } +} diff --git a/CryptoExchange.Net/SharedApis/Models/ExchangeParameters.cs b/CryptoExchange.Net/SharedApis/Models/ExchangeParameters.cs index 8be680ef..63cb650c 100644 --- a/CryptoExchange.Net/SharedApis/Models/ExchangeParameters.cs +++ b/CryptoExchange.Net/SharedApis/Models/ExchangeParameters.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Data.Common; +using System.Globalization; using System.Linq; namespace CryptoExchange.Net.SharedApis @@ -69,16 +70,7 @@ namespace CryptoExchange.Net.SharedApis if (val == null) return false; - try - { - Type t = Nullable.GetUnderlyingType(type) ?? type; - Convert.ChangeType(val, t); - return true; - } - catch - { - return false; - } + return TryConvertValue(val, type, out _); } /// @@ -99,16 +91,7 @@ namespace CryptoExchange.Net.SharedApis if (val == null) return false; - try - { - Type t = Nullable.GetUnderlyingType(type) ?? type; - Convert.ChangeType(val, t); - return true; - } - catch - { - return false; - } + return TryConvertValue(val, type, out _); } /// @@ -124,18 +107,14 @@ namespace CryptoExchange.Net.SharedApis if (val == null) return default; - if (val is T typeVal) - return typeVal; + if (!TryConvertValue(val, typeof(T), out var convertedValue)) + { + throw new ArgumentException( + $"Incorrect type for parameter, expected {typeof(T).Name}", + name); + } - try - { - Type t = Nullable.GetUnderlyingType(typeof(T)) ?? typeof(T); - return (T)Convert.ChangeType(val, t); - } - catch - { - throw new ArgumentException("Incorrect type for parameter, expected " + typeof(T).Name, name); - } + return (T)convertedValue!; } /// @@ -158,16 +137,52 @@ namespace CryptoExchange.Net.SharedApis if (val == null) return default; + if (!TryConvertValue(val, typeof(T), out var convertedValue)) + { + throw new ArgumentException( + $"Incorrect type for parameter, expected {typeof(T).Name}", + name); + } + + return (T)convertedValue!; + } + + private static bool TryConvertValue( + object value, + Type expectedType, + out object? convertedValue) + { + var targetType = Nullable.GetUnderlyingType(expectedType) ?? expectedType; + + if (targetType.IsInstanceOfType(value)) + { + convertedValue = value; + return true; + } + + if (targetType.IsEnum) + { + convertedValue = null; + return false; + } + try { - var type = typeof(T); - Type t = Nullable.GetUnderlyingType(type) ?? type; - var result = Convert.ChangeType(val, t); - return (T)result; + convertedValue = Convert.ChangeType( + value, + targetType, + CultureInfo.InvariantCulture); + + return true; } - catch + catch (Exception ex) when ( + ex is FormatException || + ex is InvalidCastException || + ex is OverflowException || + ex is ArgumentException) { - throw new ArgumentException("Incorrect type for parameter, expected " + typeof(T).Name, name); + convertedValue = null; + return false; } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelFuturesOrderByClientOrderIdOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelFuturesOrderByClientOrderIdOptions.cs index 95c57556..1327ff23 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelFuturesOrderByClientOrderIdOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelFuturesOrderByClientOrderIdOptions.cs @@ -3,7 +3,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for canceling a futures order by client order id /// - public class CancelFuturesOrderByClientOrderIdOptions : EndpointOptions + public class CancelFuturesOrderByClientOrderIdOptions : EndpointOptions { /// public override string Description => "Cancel a futures order by its client order id"; @@ -11,7 +11,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public CancelFuturesOrderByClientOrderIdOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesOrderByClientOrderIdRestClient.CancelFuturesOrderByClientOrderIdAsync)) + public CancelFuturesOrderByClientOrderIdOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesOrderByClientOrderIdEndpoint.CancelFuturesOrderByClientOrderIdAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelFuturesOrderOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelFuturesOrderOptions.cs index b2ebfe9c..00eb15a9 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelFuturesOrderOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelFuturesOrderOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for canceling a futures order /// - public class CancelFuturesOrderOptions : EndpointOptions + public class CancelFuturesOrderOptions : EndpointOptions { /// public override string Description => "Cancel a futures order"; @@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public CancelFuturesOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesOrderRestClient.CancelFuturesOrderAsync)) + public CancelFuturesOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesOrderEndpoint.CancelFuturesOrderAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelFuturesTpSlOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelFuturesTpSlOptions.cs index 909d735b..8f3d224f 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelFuturesTpSlOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelFuturesTpSlOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for canceling a TP/SL /// - public class CancelFuturesTpSlOptions : EndpointOptions + public class CancelFuturesTpSlOptions : EndpointOptions { /// public override string Description => "Cancel a take profit or stop loss order for a futures position"; @@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public CancelFuturesTpSlOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesTpSlRestClient.CancelFuturesTpSlAsync)) + public CancelFuturesTpSlOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesTpSlEndpoint.CancelFuturesTpSlAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelFuturesTriggerOrderOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelFuturesTriggerOrderOptions.cs index 29cbfb66..b251bc91 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelFuturesTriggerOrderOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelFuturesTriggerOrderOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for canceling spot trigger order /// - public class CancelFuturesTriggerOrderOptions : EndpointOptions + public class CancelFuturesTriggerOrderOptions : EndpointOptions { /// public override string Description => "Cancel a futures trigger order"; @@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public CancelFuturesTriggerOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesTriggerOrderRestClient.CancelFuturesTriggerOrderAsync)) + public CancelFuturesTriggerOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesTriggerOrderEndpoint.CancelFuturesTriggerOrderAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelSpotOrderByClientOrderIdOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelSpotOrderByClientOrderIdOptions.cs index 18c300f8..9a089e19 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelSpotOrderByClientOrderIdOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelSpotOrderByClientOrderIdOptions.cs @@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for canceling a spot order /// - public class CancelSpotOrderByClientOrderIdOptions : EndpointOptions + public class CancelSpotOrderByClientOrderIdOptions : EndpointOptions { /// public override string Description => "Cancel a spot order by its client order id"; @@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public CancelSpotOrderByClientOrderIdOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelSpotOrderByClientOrderIdRestClient.CancelSpotOrderByClientOrderIdAsync)) + public CancelSpotOrderByClientOrderIdOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelSpotOrderByClientOrderIdEndpoint.CancelSpotOrderByClientOrderIdAsync)) { } /// - public override Error? ValidateRequest(CancelOrderRequest request, ICancelSpotOrderByClientOrderIdRestClient client) + public override Error? ValidateRequest(CancelOrderRequest request, ICancelSpotOrderByClientOrderIdEndpoint client) { if (request.Symbol!.TradingMode != TradingMode.Spot) return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelSpotOrderOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelSpotOrderOptions.cs index ef67a51a..cd2c6ddb 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelSpotOrderOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelSpotOrderOptions.cs @@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for canceling a spot order /// - public class CancelSpotOrderOptions : EndpointOptions + public class CancelSpotOrderOptions : EndpointOptions { /// public override string Description => "Cancel a spot order"; @@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public CancelSpotOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelSpotOrderRestClient.CancelSpotOrderAsync)) + public CancelSpotOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelSpotOrderEndpoint.CancelSpotOrderAsync)) { } /// - public override Error? ValidateRequest(CancelOrderRequest request, ICancelSpotOrderRestClient client) + public override Error? ValidateRequest(CancelOrderRequest request, ICancelSpotOrderEndpoint client) { if (request.Symbol!.TradingMode != TradingMode.Spot) return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelSpotTriggerOrderOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelSpotTriggerOrderOptions.cs index d1cbda7a..fb5bed9f 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelSpotTriggerOrderOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelSpotTriggerOrderOptions.cs @@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting spot trigger order /// - public class CancelSpotTriggerOrderOptions : EndpointOptions + public class CancelSpotTriggerOrderOptions : EndpointOptions { /// public override string Description => "Cancel a spot trigger order"; @@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public CancelSpotTriggerOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelSpotTriggerOrderRestClient.CancelSpotTriggerOrderAsync)) + public CancelSpotTriggerOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelSpotTriggerOrderEndpoint.CancelSpotTriggerOrderAsync)) { } /// - public override Error? ValidateRequest(CancelOrderRequest request, ICancelSpotTriggerOrderRestClient client) + public override Error? ValidateRequest(CancelOrderRequest request, ICancelSpotTriggerOrderEndpoint client) { if (request.Symbol!.TradingMode != TradingMode.Spot) return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/ClosePositionOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/ClosePositionOptions.cs index d40b1305..76fea2e5 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/ClosePositionOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/ClosePositionOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for closing position /// - public class ClosePositionOptions : EndpointOptions + public class ClosePositionOptions : EndpointOptions { /// public override string Description => "Close an open futures position"; @@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public ClosePositionOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IClosePositionRestClient.ClosePositionAsync)) + public ClosePositionOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IClosePositionEndpoint.ClosePositionAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/EndpointOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/EndpointOptions.cs index 5bb9ef65..1a129e87 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/EndpointOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/EndpointOptions.cs @@ -123,10 +123,27 @@ namespace CryptoExchange.Net.SharedApis { private static PropertyInfo[] _requestProperties = typeof(TRequest).GetProperties(); + private List _requiredRequestParameters = new(); + /// - /// Required optional parameters in the request. These can be provided via the `exchangeParameters` property of the request object. + /// Request properties that are optional in the shared contract, + /// but required by this exchange implementation. /// - public List RequiredOptionalParameters { get; set; } = new List(); + public List RequiredRequestParameters + { + get => _requiredRequestParameters; + set => _requiredRequestParameters = value; + } + + /// + /// Use RequiredRequestParameters instead. + /// + [Obsolete("Use RequiredRequestParameters instead")] + public List RequiredOptionalParameters + { + get => _requiredRequestParameters; + set => _requiredRequestParameters = value; + } /// /// Whether this accepts multiple symbols (Only applicable to request requiring symbol parameters) @@ -155,7 +172,7 @@ namespace CryptoExchange.Net.SharedApis if (NeedsAuthentication && !client.Authenticated) return new NoApiCredentialsError(); - foreach (var param in RequiredOptionalParameters) + foreach (var param in RequiredRequestParameters) { if (param.Names!.All(x => _requestProperties.Single(p => p.Name == x).GetValue(request, null) == null)) { @@ -199,10 +216,10 @@ namespace CryptoExchange.Net.SharedApis sb.Append(" Notes: "); sb.AppendLine(RequestNotes); } - if (RequiredOptionalParameters.Any()) + if (RequiredRequestParameters.Any()) { - sb.AppendLine($" Required optional parameters:"); - foreach(var param in RequiredOptionalParameters) + sb.AppendLine($" Required request parameters:"); + foreach(var param in RequiredRequestParameters) sb.AppendLine($" {param}"); } if (RequiredExchangeParameters.Any()) diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesTickersOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetAllFuturesTickersOptions.cs similarity index 74% rename from CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesTickersOptions.cs rename to CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetAllFuturesTickersOptions.cs index 9eaf61c0..0303b87b 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesTickersOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetAllFuturesTickersOptions.cs @@ -5,7 +5,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting tickers /// - public class GetFuturesTickersOptions : EndpointOptions + public class GetAllFuturesTickersOptions : EndpointOptions { /// public override string Description => "Retrieve price ticker information for all futures symbols"; @@ -18,7 +18,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetFuturesTickersOptions(string exchange, SharedTickerType? tickerCalcType = null) : base(exchange, false, nameof(IGetAllFuturesTickersRestClient.GetFuturesTickersAsync)) + public GetAllFuturesTickersOptions(string exchange, SharedTickerType? tickerCalcType = null) : base(exchange, false, nameof(IGetAllFuturesTickersEndpoint.GetAllFuturesTickersAsync)) { TickerType = tickerCalcType ?? SharedTickerType.Day24H; } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetAllSpotTickersOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetAllSpotTickersOptions.cs index 9ee0cadc..68e8b067 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetAllSpotTickersOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetAllSpotTickersOptions.cs @@ -5,7 +5,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting tickers /// - public class GetAllSpotTickersOptions : EndpointOptions + public class GetAllSpotTickersOptions : EndpointOptions { /// public override string Description => "Retrieve price ticker information for all spot symbols"; @@ -18,7 +18,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetAllSpotTickersOptions(string exchange, SharedTickerType? tickerCalcType = null) : base(exchange, false, nameof(IGetAllSpotTickersRestClient.GetAllSpotTickersAsync)) + public GetAllSpotTickersOptions(string exchange, SharedTickerType? tickerCalcType = null) : base(exchange, false, nameof(IGetAllSpotTickersEndpoint.GetAllSpotTickersAsync)) { TickerType = tickerCalcType ?? SharedTickerType.Day24H; } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetAssetOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetAssetOptions.cs index 5d663ba7..855b1cb9 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetAssetOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetAssetOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting asset info /// - public class GetAssetOptions : EndpointOptions + public class GetAssetOptions : EndpointOptions { /// 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 /// /// ctor /// - public GetAssetOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetAssetRestClient.GetAssetAsync)) + public GetAssetOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetAssetEndpoint.GetAssetAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetAssetsOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetAssetsOptions.cs index 23549dd0..5da2bcd1 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetAssetsOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetAssetsOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting assets info /// - public class GetAssetsOptions : EndpointOptions + public class GetAssetsOptions : EndpointOptions { /// 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 /// /// ctor /// - public GetAssetsOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetAllAssetsRestClient.GetAssetsAsync)) + public GetAssetsOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetAllAssetsEndpoint.GetAssetsAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetBalancesOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetBalancesOptions.cs index d4f0c9f7..9d46298e 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetBalancesOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetBalancesOptions.cs @@ -6,7 +6,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting a transfer /// - public class GetBalancesOptions : EndpointOptions + public class GetBalancesOptions : EndpointOptions { /// public override string Description => "Retrieve account balances"; @@ -19,7 +19,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetBalancesOptions(string exchange, params AccountTypeFilter[] accountTypes) : base(exchange, true, nameof(IGetBalancesRestClient.GetBalancesAsync)) + public GetBalancesOptions(string exchange, params AccountTypeFilter[] accountTypes) : base(exchange, true, nameof(IGetBalancesEndpoint.GetBalancesAsync)) { SupportedAccountTypes = accountTypes; } @@ -29,7 +29,7 @@ namespace CryptoExchange.Net.SharedApis /// public override Error? ValidateRequest( GetBalancesRequest request, - IGetBalancesRestClient client) + IGetBalancesEndpoint client) { if (request.AccountType != null && !IsValid(request.AccountType.Value)) return ArgumentError.Invalid(nameof(request.AccountType), "Invalid AccountType"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetBookTickerOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetBookTickerOptions.cs index 501a9c1a..6f5e4761 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetBookTickerOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetBookTickerOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting book ticker /// - public class GetBookTickerOptions : EndpointOptions + public class GetBookTickerOptions : EndpointOptions { /// public override string Description => "Retrieve the best bid and ask price for a symbol"; @@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetBookTickerOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetBookTickerRestClient.GetBookTickerAsync)) + public GetBookTickerOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetBookTickerEndpoint.GetBookTickerAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetDepositAddressesOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetDepositAddressesOptions.cs index 5bf0b180..abe484dd 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetDepositAddressesOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetDepositAddressesOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting deposit address /// - public class GetDepositAddressesOptions : EndpointOptions + public class GetDepositAddressesOptions : EndpointOptions { /// public override string Description => "Retrieve deposit addresses for an asset"; @@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetDepositAddressesOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetDepositAddressesRestClient.GetDepositAddressesAsync)) + public GetDepositAddressesOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetDepositAddressesEndpoint.GetDepositAddressesAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetDepositHistoryOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetDepositHistoryOptions.cs index 26c4cab3..4fb3fac1 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetDepositHistoryOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetDepositHistoryOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting deposits /// - public class GetDepositHistoryOptions : PaginatedEndpointOptions + public class GetDepositHistoryOptions : PaginatedEndpointOptions { /// public override string Description => "Retrieve deposit history"; @@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis /// ctor /// public GetDepositHistoryOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit) - : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetDepositHistoryRestClient.GetDepositHistoryAsync)) + : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetDepositHistoryEndpoint.GetDepositHistoryAsync)) { } /// - public override Error? ValidateRequest(GetDepositsRequest request, IGetDepositHistoryRestClient client) + public override Error? ValidateRequest(GetDepositsRequest request, IGetDepositHistoryEndpoint client) { if (!SupportsAscending && request.Direction == DataDirection.Ascending) return ArgumentError.Invalid(nameof(GetWithdrawalsRequest.Direction), $"Ascending direction is not supported"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFeeOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFeeOptions.cs index 4ae1449b..a310eb93 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFeeOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFeeOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting trading fee info /// - public class GetFeeOptions : EndpointOptions + public class GetFeeOptions : EndpointOptions { /// public override string Description => "Retrieve trading fee information"; @@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetFeeOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetFeesRestClient.GetFeesAsync)) + public GetFeeOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetFeesEndpoint.GetFeesAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFundingRateHistoryOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFundingRateHistoryOptions.cs index 4cb91b47..b2f4c2ee 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFundingRateHistoryOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFundingRateHistoryOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting funding rate history /// - public class GetFundingRateHistoryOptions : PaginatedEndpointOptions + public class GetFundingRateHistoryOptions : PaginatedEndpointOptions { /// public override string Description => "Retrieve historical funding rates for a futures symbol"; @@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis /// ctor /// public GetFundingRateHistoryOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit, bool needsAuthentication) - : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IGetFundingRateHistoryRestClient.GetFundingRateHistoryAsync)) + : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IGetFundingRateHistoryEndpoint.GetFundingRateHistoryAsync)) { } /// - public override Error? ValidateRequest(GetFundingRateHistoryRequest request, IGetFundingRateHistoryRestClient client) + public override Error? ValidateRequest(GetFundingRateHistoryRequest request, IGetFundingRateHistoryEndpoint client) { if (!SupportsAscending && request.Direction == DataDirection.Ascending) return ArgumentError.Invalid(nameof(GetWithdrawalsRequest.Direction), $"Ascending direction is not supported"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesClosedOrdersOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesClosedOrdersOptions.cs index fe29512a..854ee4c0 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesClosedOrdersOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesClosedOrdersOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting closed orders /// - public class GetFuturesClosedOrdersOptions : PaginatedEndpointOptions + public class GetFuturesClosedOrdersOptions : PaginatedEndpointOptions { /// public override string Description => "Retrieve closed futures orders"; @@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis /// ctor /// public GetFuturesClosedOrdersOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit) - : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetClosedFuturesOrdersRestClient.GetClosedFuturesOrdersAsync)) + : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetClosedFuturesOrdersEndpoint.GetClosedFuturesOrdersAsync)) { } /// - public override Error? ValidateRequest(GetClosedOrdersRequest request, IGetClosedFuturesOrdersRestClient client) + public override Error? ValidateRequest(GetClosedOrdersRequest request, IGetClosedFuturesOrdersEndpoint client) { if (!SupportsAscending && request.Direction == DataDirection.Ascending) return ArgumentError.Invalid(nameof(GetClosedOrdersRequest.Direction), $"Ascending direction is not supported"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesOrderByClientOrderIdOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesOrderByClientOrderIdOptions.cs index 34cd7b50..d1c5cf24 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesOrderByClientOrderIdOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesOrderByClientOrderIdOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for getting a spot order by client order id /// - public class GetFuturesOrderByClientOrderIdOptions : EndpointOptions + public class GetFuturesOrderByClientOrderIdOptions : EndpointOptions { /// public override string Description => "Retrieve a futures order by its client order id"; @@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetFuturesOrderByClientOrderIdOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetFuturesOrderByClientOrderIdRestClient.GetFuturesOrderByClientOrderIdAsync)) + public GetFuturesOrderByClientOrderIdOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetFuturesOrderByClientOrderIdEndpoint.GetFuturesOrderByClientOrderIdAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesOrderOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesOrderOptions.cs index 81f3e1d1..84c728ad 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesOrderOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesOrderOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for getting a futures order by id endpoint /// - public class GetFuturesOrderOptions : EndpointOptions + public class GetFuturesOrderOptions : EndpointOptions { /// public override string Description => "Retrieve a futures order"; @@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetFuturesOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetFuturesOrderRestClient.GetFuturesOrderAsync)) + public GetFuturesOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetFuturesOrderEndpoint.GetFuturesOrderAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesOrderTradesOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesOrderTradesOptions.cs index 7157bd9f..117c776d 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesOrderTradesOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesOrderTradesOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for getting a trades for an order /// - public class GetFuturesOrderTradesOptions : EndpointOptions + public class GetFuturesOrderTradesOptions : EndpointOptions { /// public override string Description => "Retrieve trades for a futures order"; @@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetFuturesOrderTradesOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetFuturesOrderTradesRestClient.GetFuturesOrderTradesAsync)) + public GetFuturesOrderTradesOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetFuturesOrderTradesEndpoint.GetFuturesOrderTradesAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesSymbolsOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesSymbolsOptions.cs index 9eff8093..3b44d531 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesSymbolsOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesSymbolsOptions.cs @@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting symbol info /// - public class GetFuturesSymbolsOptions : EndpointOptions + public class GetFuturesSymbolsOptions : EndpointOptions { /// public override string Description => "Retrieve supported futures symbols and their trading rules"; @@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetFuturesSymbolsOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetFuturesSymbolsRestClient.GetFuturesSymbolsAsync)) + public GetFuturesSymbolsOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetFuturesSymbolsEndpoint.GetFuturesSymbolsAsync)) { } /// - public override Error? ValidateRequest(GetSymbolsRequest request, IGetFuturesSymbolsRestClient client) + public override Error? ValidateRequest(GetSymbolsRequest request, IGetFuturesSymbolsEndpoint client) { if (request.BaseAssetType != null && request.BaseAssetSubType != null) { diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesTickerOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesTickerOptions.cs index 31753723..f556b9d5 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesTickerOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesTickerOptions.cs @@ -5,7 +5,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting ticker /// - public class GetFuturesTickerOptions : EndpointOptions + public class GetFuturesTickerOptions : EndpointOptions { /// public override string Description => "Retrieve price ticker information for a futures symbol"; @@ -18,7 +18,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetFuturesTickerOptions(string exchange, SharedTickerType? tickerCalcType = null) : base(exchange, false, nameof(IGetFuturesTickerRestClient.GetFuturesTickerAsync)) + public GetFuturesTickerOptions(string exchange, SharedTickerType? tickerCalcType = null) : base(exchange, false, nameof(IGetFuturesTickerEndpoint.GetFuturesTickerAsync)) { TickerType = tickerCalcType ?? SharedTickerType.Day24H; } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesTriggerOrderOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesTriggerOrderOptions.cs index e9ad8332..f9a363c5 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesTriggerOrderOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesTriggerOrderOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting futures trigger order /// - public class GetFuturesTriggerOrderOptions : EndpointOptions + public class GetFuturesTriggerOrderOptions : EndpointOptions { /// public override string Description => "Retrieve a futures trigger order"; @@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetFuturesTriggerOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetFuturesTriggerOrderRestClient.GetFuturesTriggerOrderAsync)) + public GetFuturesTriggerOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetFuturesTriggerOrderEndpoint.GetFuturesTriggerOrderAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesUserTradesOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesUserTradeHistoryOptions.cs similarity index 82% rename from CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesUserTradesOptions.cs rename to CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesUserTradeHistoryOptions.cs index 475b4248..4d7c800b 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesUserTradesOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetFuturesUserTradeHistoryOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting user trades /// - public class GetFuturesUserTradesOptions : PaginatedEndpointOptions + public class GetFuturesUserTradeHistoryOptions : PaginatedEndpointOptions { /// public override string Description => "Retrieve futures user trade history"; @@ -15,13 +15,13 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetFuturesUserTradesOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit) - : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetFuturesUserTradesRestClient.GetFuturesUserTradesAsync)) + public GetFuturesUserTradeHistoryOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit) + : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetFuturesUserTradeHistoryEndpoint.GetFuturesUserTradesAsync)) { } /// - public override Error? ValidateRequest(GetUserTradesRequest request, IGetFuturesUserTradesRestClient client) + public override Error? ValidateRequest(GetUserTradesRequest request, IGetFuturesUserTradeHistoryEndpoint client) { if (!SupportsAscending && request.Direction == DataDirection.Ascending) return ArgumentError.Invalid(nameof(GetUserTradesRequest.Direction), $"Ascending direction is not supported"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetIndexPriceKlinesOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetIndexPriceKlinesOptions.cs index 664b18c2..89c73462 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetIndexPriceKlinesOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetIndexPriceKlinesOptions.cs @@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting kline/candlestick data /// - public class GetIndexPriceKlinesOptions : PaginatedEndpointOptions + public class GetIndexPriceKlinesOptions : PaginatedEndpointOptions { /// public override string Description => "Retrieve index price candlestick data"; @@ -26,7 +26,7 @@ namespace CryptoExchange.Net.SharedApis /// ctor ///
public GetIndexPriceKlinesOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit, bool needsAuthentication) - : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IGetIndexPriceKlinesRestClient.GetIndexPriceKlinesAsync)) + : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IGetIndexPriceKlinesEndpoint.GetIndexPriceKlinesAsync)) { SupportIntervals = new[] { @@ -64,7 +64,7 @@ namespace CryptoExchange.Net.SharedApis public bool IsSupported(SharedKlineInterval interval) => SupportIntervals.Contains(interval); /// - public override Error? ValidateRequest(GetKlinesRequest request, IGetIndexPriceKlinesRestClient client) + public override Error? ValidateRequest(GetKlinesRequest request, IGetIndexPriceKlinesEndpoint client) { if (!IsSupported(request.Interval)) return ArgumentError.Invalid(nameof(GetKlinesRequest.Interval), $"Interval {request.Interval} not supported"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetKlinesOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetKlinesOptions.cs index c071feb8..5e0f63aa 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetKlinesOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetKlinesOptions.cs @@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting kline/candlestick data /// - public class GetKlinesOptions : PaginatedEndpointOptions + public class GetKlinesOptions : PaginatedEndpointOptions { /// public override string Description => "Retrieve candlestick data for a symbol"; @@ -26,7 +26,7 @@ namespace CryptoExchange.Net.SharedApis /// ctor ///
public GetKlinesOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit, bool needsAuthentication) - : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IGetKlinesRestClient.GetKlinesAsync)) + : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IGetKlinesEndpoint.GetKlinesAsync)) { SupportIntervals = new[] { @@ -51,7 +51,7 @@ namespace CryptoExchange.Net.SharedApis /// ctor ///
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(IGetKlinesRestClient.GetKlinesAsync)) + : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IGetKlinesEndpoint.GetKlinesAsync)) { SupportIntervals = intervals; } @@ -64,7 +64,7 @@ namespace CryptoExchange.Net.SharedApis public bool IsSupported(SharedKlineInterval interval) => SupportIntervals.Contains(interval); /// - public override Error? ValidateRequest(GetKlinesRequest request, IGetKlinesRestClient client) + public override Error? ValidateRequest(GetKlinesRequest request, IGetKlinesEndpoint client) { if (!IsSupported(request.Interval)) return ArgumentError.Invalid(nameof(GetKlinesRequest.Interval), $"Interval {request.Interval} not supported"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetLeverageOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetLeverageOptions.cs index fb89d9da..11c464e2 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetLeverageOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetLeverageOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting asset info /// - public class GetLeverageOptions : EndpointOptions + public class GetLeverageOptions : EndpointOptions { /// public override string Description => "Retrieve the current leverage for a futures symbol"; @@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetLeverageOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetLeverageRestClient.GetLeverageAsync)) + public GetLeverageOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetLeverageEndpoint.GetLeverageAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetMarkPriceKlinesOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetMarkPriceKlinesOptions.cs index aafab18d..467561a6 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetMarkPriceKlinesOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetMarkPriceKlinesOptions.cs @@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting kline/candlestick data /// - public class GetMarkPriceKlinesOptions : PaginatedEndpointOptions + public class GetMarkPriceKlinesOptions : PaginatedEndpointOptions { /// public override string Description => "Retrieve mark price candlestick data"; @@ -26,7 +26,7 @@ namespace CryptoExchange.Net.SharedApis /// ctor ///
public GetMarkPriceKlinesOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit, bool needsAuthentication) - : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IGetMarkPriceKlinesRestClient.GetMarkPriceKlinesAsync)) + : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IGetMarkPriceKlinesEndpoint.GetMarkPriceKlinesAsync)) { SupportIntervals = new[] { @@ -51,7 +51,7 @@ namespace CryptoExchange.Net.SharedApis /// ctor ///
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(IGetMarkPriceKlinesRestClient.GetMarkPriceKlinesAsync)) + : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IGetMarkPriceKlinesEndpoint.GetMarkPriceKlinesAsync)) { SupportIntervals = intervals; } @@ -64,7 +64,7 @@ namespace CryptoExchange.Net.SharedApis public bool IsSupported(SharedKlineInterval interval) => SupportIntervals.Contains(interval); /// - public override Error? ValidateRequest(GetKlinesRequest request, IGetMarkPriceKlinesRestClient client) + public override Error? ValidateRequest(GetKlinesRequest request, IGetMarkPriceKlinesEndpoint client) { if (!IsSupported(request.Interval)) return ArgumentError.Invalid(nameof(GetKlinesRequest.Interval), $"Interval {request.Interval} not supported"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetOpenFuturesOrdersOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetOpenFuturesOrdersOptions.cs index 433d2480..3d27f77c 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetOpenFuturesOrdersOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetOpenFuturesOrdersOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for getting a futures order by id endpoint /// - public class GetOpenFuturesOrdersOptions : EndpointOptions + public class GetOpenFuturesOrdersOptions : EndpointOptions { /// public override string Description => "Retrieve open futures orders"; @@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetOpenFuturesOrdersOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetOpenFuturesOrdersRestClient.GetOpenFuturesOrdersAsync)) + public GetOpenFuturesOrdersOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetOpenFuturesOrdersEndpoint.GetOpenFuturesOrdersAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetOpenInterestOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetOpenInterestOptions.cs index 51f5e073..e68ed8e0 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetOpenInterestOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetOpenInterestOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting open interest /// - public class GetOpenInterestOptions : EndpointOptions + public class GetOpenInterestOptions : EndpointOptions { /// public override string Description => "Retrieve open interest for a futures symbol"; @@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetOpenInterestOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetOpenInterestRestClient.GetOpenInterestAsync)) + public GetOpenInterestOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetOpenInterestEndpoint.GetOpenInterestAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetOpenSpotOrdersOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetOpenSpotOrdersOptions.cs index a47f5434..3897d850 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetOpenSpotOrdersOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetOpenSpotOrdersOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for getting a spot order by id endpoint /// - public class GetOpenSpotOrdersOptions : EndpointOptions + public class GetOpenSpotOrdersOptions : EndpointOptions { /// public override string Description => "Retrieve open spot orders"; @@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetOpenSpotOrdersOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetOpenSpotOrdersRestClient.GetOpenSpotOrdersAsync)) + public GetOpenSpotOrdersOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetOpenSpotOrdersEndpoint.GetOpenSpotOrdersAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetOrderBookOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetOrderBookOptions.cs index d05e33ec..b612d708 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetOrderBookOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetOrderBookOptions.cs @@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting order book /// - public class GetOrderBookOptions : EndpointOptions + public class GetOrderBookOptions : EndpointOptions { /// public override string Description => "Retrieve the current order book for a symbol"; @@ -31,7 +31,7 @@ namespace CryptoExchange.Net.SharedApis /// ctor ///
public GetOrderBookOptions(string exchange, int minLimit, int maxLimit, bool authenticated) - : base(exchange, authenticated, nameof(IGetOrderBookRestClient.GetOrderBookAsync)) + : base(exchange, authenticated, nameof(IGetOrderBookEndpoint.GetOrderBookAsync)) { MinLimit = minLimit; MaxLimit = maxLimit; @@ -41,13 +41,13 @@ namespace CryptoExchange.Net.SharedApis /// ctor /// public GetOrderBookOptions(string exchange, int[] supportedLimits, bool authenticated) - : base(exchange, authenticated, nameof(IGetOrderBookRestClient.GetOrderBookAsync)) + : base(exchange, authenticated, nameof(IGetOrderBookEndpoint.GetOrderBookAsync)) { SupportedLimits = supportedLimits; } /// - public override Error? ValidateRequest(GetOrderBookRequest request, IGetOrderBookRestClient client) + public override Error? ValidateRequest(GetOrderBookRequest request, IGetOrderBookEndpoint client) { if (request.Limit == null) return base.ValidateRequest(request, client); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetPositionHistoryOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetPositionHistoryOptions.cs index 7d990b3f..9193071a 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetPositionHistoryOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetPositionHistoryOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting position history /// - public class GetPositionHistoryOptions : PaginatedEndpointOptions + public class GetPositionHistoryOptions : PaginatedEndpointOptions { /// public override string Description => "Retrieve historical futures positions"; @@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis /// ctor /// public GetPositionHistoryOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit) - : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetPositionHistoryRestClient.GetPositionHistoryAsync)) + : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetPositionHistoryEndpoint.GetPositionHistoryAsync)) { } /// - public override Error? ValidateRequest(GetPositionHistoryRequest request, IGetPositionHistoryRestClient client) + public override Error? ValidateRequest(GetPositionHistoryRequest request, IGetPositionHistoryEndpoint client) { if (!SupportsAscending && request.Direction == DataDirection.Ascending) return ArgumentError.Invalid(nameof(GetWithdrawalsRequest.Direction), $"Ascending direction is not supported"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetPositionModeOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetPositionModeOptions.cs index 663e1f2b..74b2cb0a 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetPositionModeOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetPositionModeOptions.cs @@ -3,7 +3,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting current position mode /// - public class GetPositionModeOptions : EndpointOptions + public class GetPositionModeOptions : EndpointOptions { /// public override string Description => "Retrieve the current futures position mode"; @@ -11,7 +11,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetPositionModeOptions(string exchange) : base(exchange, true, nameof(IGetPositionModeRestClient.GetPositionModeAsync)) + public GetPositionModeOptions(string exchange) : base(exchange, true, nameof(IGetPositionModeEndpoint.GetPositionModeAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetPositionsOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetPositionsOptions.cs index 00537a96..333428b3 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetPositionsOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetPositionsOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting open positions /// - public class GetPositionsOptions : EndpointOptions + public class GetPositionsOptions : EndpointOptions { /// public override string Description => "Retrieve open futures positions"; @@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetPositionsOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetPositionsRestClient.GetPositionsAsync)) + public GetPositionsOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetPositionsEndpoint.GetPositionsAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetRecentTradesOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetRecentTradesOptions.cs index 6c6ac1da..961154e9 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetRecentTradesOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetRecentTradesOptions.cs @@ -6,7 +6,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting recent trades /// - public class GetRecentTradesOptions : EndpointOptions + public class GetRecentTradesOptions : EndpointOptions { /// public override string Description => "Retrieve recent public trades for a symbol"; @@ -20,13 +20,13 @@ namespace CryptoExchange.Net.SharedApis /// ctor /// public GetRecentTradesOptions(string exchange, int limit, bool authenticated) - : base(exchange, authenticated, nameof(IGetRecentTradesRestClient.GetRecentTradesAsync)) + : base(exchange, authenticated, nameof(IGetRecentTradesEndpoint.GetRecentTradesAsync)) { MaxLimit = limit; } /// - public override Error? ValidateRequest(GetRecentTradesRequest request, IGetRecentTradesRestClient client) + public override Error? ValidateRequest(GetRecentTradesRequest request, IGetRecentTradesEndpoint client) { var baseError = base.ValidateRequest(request, client); if (baseError != null) diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotClosedOrdersOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotClosedOrdersOptions.cs index 58396588..641735a7 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotClosedOrdersOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotClosedOrdersOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting user trades /// - public class GetSpotClosedOrdersOptions : PaginatedEndpointOptions + public class GetSpotClosedOrdersOptions : PaginatedEndpointOptions { /// public override string Description => "Retrieve closed spot orders"; @@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis /// ctor /// public GetSpotClosedOrdersOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit) - : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetClosedSpotOrdersRestClient.GetClosedSpotOrdersAsync)) + : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetClosedSpotOrdersEndpoint.GetClosedSpotOrdersAsync)) { } /// - public override Error? ValidateRequest(GetClosedOrdersRequest request, IGetClosedSpotOrdersRestClient client) + public override Error? ValidateRequest(GetClosedOrdersRequest request, IGetClosedSpotOrdersEndpoint client) { if (request.Symbol!.TradingMode != TradingMode.Spot) return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotOrderByClientOrderIdOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotOrderByClientOrderIdOptions.cs index 973e6b44..d94c5456 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotOrderByClientOrderIdOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotOrderByClientOrderIdOptions.cs @@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for getting a spot order by client order id endpoint /// - public class GetSpotOrderByClientOrderIdOptions : EndpointOptions + public class GetSpotOrderByClientOrderIdOptions : EndpointOptions { /// public override string Description => "Retrieve a spot order by its client order id"; @@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetSpotOrderByClientOrderIdOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetSpotOrderByClientOrderIdRestClient.GetSpotOrderByClientOrderIdAsync)) + public GetSpotOrderByClientOrderIdOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetSpotOrderByClientOrderIdEndpoint.GetSpotOrderByClientOrderIdAsync)) { } /// - public override Error? ValidateRequest(GetOrderRequest request, IGetSpotOrderByClientOrderIdRestClient client) + public override Error? ValidateRequest(GetOrderRequest request, IGetSpotOrderByClientOrderIdEndpoint client) { if (request.Symbol!.TradingMode != TradingMode.Spot) return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotOrderOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotOrderOptions.cs index 672b9162..5c94b448 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotOrderOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotOrderOptions.cs @@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for getting a spot order by id endpoint /// - public class GetSpotOrderOptions : EndpointOptions + public class GetSpotOrderOptions : EndpointOptions { /// public override string Description => "Retrieve a spot order"; @@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetSpotOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetSpotOrderRestClient.GetSpotOrderAsync)) + public GetSpotOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetSpotOrderEndpoint.GetSpotOrderAsync)) { } /// - public override Error? ValidateRequest(GetOrderRequest request, IGetSpotOrderRestClient client) + public override Error? ValidateRequest(GetOrderRequest request, IGetSpotOrderEndpoint client) { if (request.Symbol!.TradingMode != TradingMode.Spot) return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotOrderTradesOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotOrderTradesOptions.cs index 8f2048d9..53d7f99a 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotOrderTradesOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotOrderTradesOptions.cs @@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for getting trades for a spot order /// - public class GetSpotOrderTradesOptions : EndpointOptions + public class GetSpotOrderTradesOptions : EndpointOptions { /// public override string Description => "Retrieve trades for a spot order"; @@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetSpotOrderTradesOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetSpotOrderTradesRestClient.GetSpotOrderTradesAsync)) + public GetSpotOrderTradesOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetSpotOrderTradesEndpoint.GetSpotOrderTradesAsync)) { } /// - public override Error? ValidateRequest(GetOrderTradesRequest request, IGetSpotOrderTradesRestClient client) + public override Error? ValidateRequest(GetOrderTradesRequest request, IGetSpotOrderTradesEndpoint client) { if (request.Symbol!.TradingMode != TradingMode.Spot) return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotSymbolsOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotSymbolsOptions.cs index 05629dd8..0c64c1e7 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotSymbolsOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotSymbolsOptions.cs @@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting symbol info /// - public class GetSpotSymbolsOptions : EndpointOptions + public class GetSpotSymbolsOptions : EndpointOptions { /// public override string Description => "Retrieve supported spot symbols and their trading rules"; @@ -16,13 +16,13 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetSpotSymbolsOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetSpotSymbolsRestClient.GetSpotSymbolsAsync)) + public GetSpotSymbolsOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetSpotSymbolsEndpoint.GetSpotSymbolsAsync)) { } /// - public override Error? ValidateRequest(GetSymbolsRequest request, IGetSpotSymbolsRestClient client) + public override Error? ValidateRequest(GetSymbolsRequest request, IGetSpotSymbolsEndpoint client) { if (request.BaseAssetType != null && request.BaseAssetSubType != null) { diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotTickerOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotTickerOptions.cs index 2b0843da..ea7e20e5 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotTickerOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotTickerOptions.cs @@ -5,7 +5,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting ticker /// - public class GetSpotTickerOptions : EndpointOptions + public class GetSpotTickerOptions : EndpointOptions { /// public override string Description => "Retrieve price ticker information for a spot symbol"; @@ -18,7 +18,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetSpotTickerOptions(string exchange, SharedTickerType? tickerCalcType = null) : base(exchange, false, nameof(IGetSpotTickerRestClient.GetSpotTickerAsync)) + public GetSpotTickerOptions(string exchange, SharedTickerType? tickerCalcType = null) : base(exchange, false, nameof(IGetSpotTickerEndpoint.GetSpotTickerAsync)) { TickerType = tickerCalcType ?? SharedTickerType.Day24H; } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotTriggerOrderOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotTriggerOrderOptions.cs index 02f2dd03..749ba4bf 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotTriggerOrderOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotTriggerOrderOptions.cs @@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting spot trigger order /// - public class GetSpotTriggerOrderOptions : EndpointOptions + public class GetSpotTriggerOrderOptions : EndpointOptions { /// public override string Description => "Retrieve a spot trigger order"; @@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public GetSpotTriggerOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetSpotTriggerOrderRestClient.GetSpotTriggerOrderAsync)) + public GetSpotTriggerOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IGetSpotTriggerOrderEndpoint.GetSpotTriggerOrderAsync)) { } /// - public override Error? ValidateRequest(GetOrderRequest request, IGetSpotTriggerOrderRestClient client) + public override Error? ValidateRequest(GetOrderRequest request, IGetSpotTriggerOrderEndpoint client) { if (request.Symbol!.TradingMode != TradingMode.Spot) return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotUserTradeHistoryOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotUserTradeHistoryOptions.cs index f35a344a..530614ed 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotUserTradeHistoryOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetSpotUserTradeHistoryOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting user trades /// - public class GetSpotUserTradeHistoryOptions : PaginatedEndpointOptions + public class GetSpotUserTradeHistoryOptions : PaginatedEndpointOptions { /// public override string Description => "Retrieve spot user trade history"; @@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis /// ctor /// public GetSpotUserTradeHistoryOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit) - : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetSpotUserTradeHistoryRestClient.GetSpotUserTradeHistoryAsync)) + : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetSpotUserTradeHistoryEndpoint.GetSpotUserTradeHistoryAsync)) { } /// - public override Error? ValidateRequest(GetUserTradesRequest request, IGetSpotUserTradeHistoryRestClient client) + public override Error? ValidateRequest(GetUserTradesRequest request, IGetSpotUserTradeHistoryEndpoint client) { if (request.Symbol!.TradingMode != TradingMode.Spot) return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetTradeHistoryOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetTradeHistoryOptions.cs index 43c5c9a7..99af0c8e 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetTradeHistoryOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetTradeHistoryOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting trade history /// - public class GetTradeHistoryOptions : PaginatedEndpointOptions + public class GetTradeHistoryOptions : PaginatedEndpointOptions { /// public override string Description => "Retrieve public trade history for a symbol"; @@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis /// ctor /// public GetTradeHistoryOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit, bool needsAuthentication) - : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IGetTradeHistoryRestClient.GetTradeHistoryAsync)) + : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, needsAuthentication, nameof(IGetTradeHistoryEndpoint.GetTradeHistoryAsync)) { } /// - public override Error? ValidateRequest(GetTradeHistoryRequest request, IGetTradeHistoryRestClient client) + public override Error? ValidateRequest(GetTradeHistoryRequest request, IGetTradeHistoryEndpoint client) { if (!SupportsAscending && request.Direction == DataDirection.Ascending) return ArgumentError.Invalid(nameof(GetTradeHistoryRequest.Direction), $"Ascending direction is not supported"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetWithdrawalHistoryOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetWithdrawalHistoryOptions.cs index 1bbcef37..78c39406 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetWithdrawalHistoryOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/GetWithdrawalHistoryOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting withdrawals /// - public class GetWithdrawalHistoryOptions : PaginatedEndpointOptions + public class GetWithdrawalHistoryOptions : PaginatedEndpointOptions { /// public override string Description => "Retrieve withdrawal history"; @@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis /// ctor /// public GetWithdrawalHistoryOptions(string exchange, bool supportsAscending, bool supportsDescending, bool timeFilterSupported, int maxLimit) - : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetWithdrawalHistoryRestClient.GetWithdrawalHistoryAsync)) + : base(exchange, supportsAscending, supportsDescending, timeFilterSupported, maxLimit, true, nameof(IGetWithdrawalHistoryEndpoint.GetWithdrawalHistoryAsync)) { } /// - public override Error? ValidateRequest(GetWithdrawalsRequest request, IGetWithdrawalHistoryRestClient client) + public override Error? ValidateRequest(GetWithdrawalsRequest request, IGetWithdrawalHistoryEndpoint client) { if (!SupportsAscending && request.Direction == DataDirection.Ascending) return ArgumentError.Invalid(nameof(GetWithdrawalsRequest.Direction), $"Ascending direction is not supported"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/PlaceFuturesOrderOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/PlaceFuturesOrderOptions.cs index ec2e6f3e..deaad69c 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/PlaceFuturesOrderOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/PlaceFuturesOrderOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for placing a new futures order /// - public class PlaceFuturesOrderOptions : EndpointOptions + public class PlaceFuturesOrderOptions : EndpointOptions { /// public override string Description => "Place a new futures order"; @@ -20,7 +20,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public PlaceFuturesOrderOptions(string exchange, bool supportsTpSl) : base(exchange, true, nameof(IPlaceFuturesOrderRestClient.PlaceFuturesOrderAsync)) + public PlaceFuturesOrderOptions(string exchange, bool supportsTpSl) : base(exchange, true, nameof(IPlaceFuturesOrderEndpoint.PlaceFuturesOrderAsync)) { SupportsTpSl = supportsTpSl; } @@ -30,7 +30,7 @@ namespace CryptoExchange.Net.SharedApis /// public override Error? ValidateRequest( PlaceFuturesOrderRequest request, - IPlaceFuturesOrderRestClient client + IPlaceFuturesOrderEndpoint client ) { if (!SupportsTpSl && (request.StopLossPrice != null || request.TakeProfitPrice != null)) diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/PlaceFuturesTriggerOrderOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/PlaceFuturesTriggerOrderOptions.cs index bb8f9abc..41e7cc84 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/PlaceFuturesTriggerOrderOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/PlaceFuturesTriggerOrderOptions.cs @@ -5,7 +5,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for placing a new spot trigger order /// - public class PlaceFuturesTriggerOrderOptions : EndpointOptions + public class PlaceFuturesTriggerOrderOptions : EndpointOptions { /// public override string Description => "Place a new futures trigger order"; @@ -18,7 +18,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public PlaceFuturesTriggerOrderOptions(string exchange, bool holdsFunds) : base(exchange, true, nameof(IPlaceFuturesTriggerOrderRestClient.PlaceFuturesTriggerOrderAsync)) + public PlaceFuturesTriggerOrderOptions(string exchange, bool holdsFunds) : base(exchange, true, nameof(IPlaceFuturesTriggerOrderEndpoint.PlaceFuturesTriggerOrderAsync)) { HoldsFunds = holdsFunds; } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/PlaceSpotOrderOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/PlaceSpotOrderOptions.cs index 9275b605..08ab19fc 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/PlaceSpotOrderOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/PlaceSpotOrderOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for placing a new spot order /// - public class PlaceSpotOrderOptions : EndpointOptions + public class PlaceSpotOrderOptions : EndpointOptions { /// public override string Description => "Place a new spot order"; @@ -16,7 +16,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public PlaceSpotOrderOptions(string exchange) : base(exchange, true, nameof(IPlaceSpotOrderRestClient.PlaceSpotOrderAsync)) + public PlaceSpotOrderOptions(string exchange) : base(exchange, true, nameof(IPlaceSpotOrderEndpoint.PlaceSpotOrderAsync)) { } @@ -25,7 +25,7 @@ namespace CryptoExchange.Net.SharedApis /// public override Error? ValidateRequest( PlaceSpotOrderRequest request, - IPlaceSpotOrderRestClient client) + IPlaceSpotOrderEndpoint client) { if (request.Symbol!.TradingMode != TradingMode.Spot) return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/PlaceSpotTriggerOrderOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/PlaceSpotTriggerOrderOptions.cs index ec2ac587..97e104a8 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/PlaceSpotTriggerOrderOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/PlaceSpotTriggerOrderOptions.cs @@ -5,7 +5,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for placing a new spot trigger order /// - public class PlaceSpotTriggerOrderOptions : EndpointOptions + public class PlaceSpotTriggerOrderOptions : EndpointOptions { /// public override string Description => "Place a new spot trigger order"; @@ -18,7 +18,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public PlaceSpotTriggerOrderOptions(string exchange, bool holdsFunds) : base(exchange, true, nameof(IPlaceSpotTriggerOrderRestClient.PlaceSpotTriggerOrderAsync)) + public PlaceSpotTriggerOrderOptions(string exchange, bool holdsFunds) : base(exchange, true, nameof(IPlaceSpotTriggerOrderEndpoint.PlaceSpotTriggerOrderAsync)) { HoldsFunds = holdsFunds; } @@ -28,7 +28,7 @@ namespace CryptoExchange.Net.SharedApis /// public override Error? ValidateRequest( PlaceSpotTriggerOrderRequest request, - IPlaceSpotTriggerOrderRestClient client) + IPlaceSpotTriggerOrderEndpoint client) { if (request.Symbol!.TradingMode != TradingMode.Spot) return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/SetFuturesTpSlOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/SetFuturesTpSlOptions.cs index 359ea205..8ba5a5f9 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/SetFuturesTpSlOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/SetFuturesTpSlOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for setting a TP/SL /// - public class SetFuturesTpSlOptions : EndpointOptions + public class SetFuturesTpSlOptions : EndpointOptions { /// public override string Description => "Set take profit or stop loss values for a futures position"; @@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public SetFuturesTpSlOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ISetFuturesTpSlRestClient.SetFuturesTpSlAsync)) + public SetFuturesTpSlOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ISetFuturesTpSlEndpoint.SetFuturesTpSlAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/SetLeverageOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/SetLeverageOptions.cs index eea04d82..48774f42 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/SetLeverageOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/SetLeverageOptions.cs @@ -3,7 +3,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for setting leverage /// - public class SetLeverageOptions : EndpointOptions + public class SetLeverageOptions : EndpointOptions { /// public override string Description => "Set the leverage for a futures symbol"; @@ -11,7 +11,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public SetLeverageOptions(string exchange) : base(exchange, true, nameof(ISetLeverageRestClient.SetLeverageAsync)) + public SetLeverageOptions(string exchange) : base(exchange, true, nameof(ISetLeverageEndpoint.SetLeverageAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/SetPositionModeOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/SetPositionModeOptions.cs index c99a7a94..d7f058ad 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/SetPositionModeOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/SetPositionModeOptions.cs @@ -3,7 +3,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for setting position mode /// - public class SetPositionModeOptions : EndpointOptions + public class SetPositionModeOptions : EndpointOptions { /// public override string Description => "Set the futures position mode"; @@ -11,7 +11,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public SetPositionModeOptions(string exchange) : base(exchange, true, nameof(ISetPositionModeRestClient.SetPositionModeOptions)) + public SetPositionModeOptions(string exchange) : base(exchange, true, nameof(ISetPositionModeEndpoint.SetPositionModeOptions)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/TransferOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/TransferOptions.cs index bd5f6b07..c19ffa8c 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/TransferOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/TransferOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting a transfer /// - public class TransferOptions : EndpointOptions + public class TransferOptions : EndpointOptions { /// public override string Description => "Transfer funds between account types"; @@ -20,7 +20,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public TransferOptions(string exchange, SharedAccountType[] accountTypes) : base(exchange, true, nameof(ITransferRestClient.TransferAsync)) + public TransferOptions(string exchange, SharedAccountType[] accountTypes) : base(exchange, true, nameof(ITransferEndpoint.TransferAsync)) { SupportedAccountTypes = accountTypes; } @@ -30,7 +30,7 @@ namespace CryptoExchange.Net.SharedApis /// public override Error? ValidateRequest( TransferRequest request, - ITransferRestClient client) + ITransferEndpoint client) { if (!SupportedAccountTypes.Contains(request.FromAccountType)) return ArgumentError.Invalid(nameof(request.FromAccountType), "Invalid FromAccountType"); diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/WithdrawOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/WithdrawOptions.cs index c8a3f403..b7bdd836 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/WithdrawOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/WithdrawOptions.cs @@ -3,7 +3,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for requesting a withdrawal /// - public class WithdrawOptions : EndpointOptions + public class WithdrawOptions : EndpointOptions { /// public override string Description => "Withdraw an asset"; @@ -11,7 +11,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public WithdrawOptions(string exchange) : base(exchange, true, nameof(IWithdrawRestClient.WithdrawAsync)) + public WithdrawOptions(string exchange) : base(exchange, true, nameof(IWithdrawEndpoint.WithdrawAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/RequestParameter.cs b/CryptoExchange.Net/SharedApis/Models/RequestParameter.cs new file mode 100644 index 00000000..ef0a11b1 --- /dev/null +++ b/CryptoExchange.Net/SharedApis/Models/RequestParameter.cs @@ -0,0 +1,90 @@ +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Reflection; +using System.Text; + +namespace CryptoExchange.Net.SharedApis +{ + /// + /// Creates descriptions for properties on a shared request. + /// + public static class RequestParameter + where TRequest : SharedRequest + { + /// + /// Describe a request property which is required by an implementation. + /// + public static ParameterDescription Required( + Expression> selector, + string description, + TValue exampleValue) + { + Expression body = selector.Body; + + if (body is UnaryExpression unary + && unary.NodeType == ExpressionType.Convert) + { + body = unary.Operand; + } + + if (body is not MemberExpression member + || member.Member is not PropertyInfo property + || member.Expression != selector.Parameters[0]) + { + throw new ArgumentException( + "Selector must select a direct request property", + nameof(selector)); + } + + return new ParameterDescription( + property.Name, + property.PropertyType, + description, + exampleValue!); + } + } + + /// + /// Creates descriptions for exchange-specific parameters. + /// + public static class ExchangeParameterDescription + { + /// + /// Describe a required exchange-specific parameter. + /// + public static ParameterDescription Required( + string name, + string description, + TValue exampleValue, + params string[] aliases) + => Create(name, description, exampleValue, aliases); + + /// + /// Describe an optional exchange-specific parameter. + /// + public static ParameterDescription Optional( + string name, + string description, + TValue exampleValue, + params string[] aliases) + => Create(name, description, exampleValue, aliases); + + private static ParameterDescription Create( + string name, + string description, + TValue exampleValue, + string[] aliases) + { + var names = new string[aliases.Length + 1]; + names[0] = name; + Array.Copy(aliases, 0, names, 1, aliases.Length); + + return new ParameterDescription( + names, + typeof(TValue), + description, + exampleValue!); + } + } +} diff --git a/CryptoExchange.Net/SharedApis/SharedApiBase.cs b/CryptoExchange.Net/SharedApis/SharedApiBase.cs new file mode 100644 index 00000000..086eeab1 --- /dev/null +++ b/CryptoExchange.Net/SharedApis/SharedApiBase.cs @@ -0,0 +1,62 @@ +using CryptoExchange.Net.Clients; +using System; +using System.Collections.Generic; +using System.Text; + +namespace CryptoExchange.Net.SharedApis +{ + /// + /// Shared API base client + /// + public abstract class SharedApiBase : ISharedClient + { + private readonly Func _symbolFormatter; + private readonly Func _authDelegate; + + private IReadOnlyCollection _endpointOptions = Array.Empty(); + IReadOnlyCollection ISharedClient.EndpointOptions => _endpointOptions; + + /// + public string Exchange { get; } + + /// + public TradingMode[] SupportedTradingModes { get; } + + /// + public bool Authenticated => _authDelegate(); + + /// + /// Shared API base client + /// + public SharedApiBase( + string exchange, + TradingMode[] supportedTradingModes, + Func authenticated, + Func formatSymbol) + { + Exchange = exchange; + SupportedTradingModes = supportedTradingModes; + _authDelegate = authenticated; + _symbolFormatter = formatSymbol; + } + + /// + protected void SetEndpointOptions(params EndpointOptions[] endpointOptions) + { + _endpointOptions = Array.AsReadOnly(endpointOptions); + } + + /// + public string FormatSymbol(string baseAsset, string quoteAsset, TradingMode tradingMode, DateTime? deliverDate = null) + => _symbolFormatter(baseAsset, quoteAsset, tradingMode, deliverDate); + + /// + public void SetDefaultExchangeParameter(string name, object value) => ExchangeParameters.SetStaticParameter(Exchange, name, value); + + /// + public void ResetDefaultExchangeParameters() => ExchangeParameters.ResetStaticExchangeParameters(Exchange); + + /// + public abstract SharedClientInfo Discover(); + } +} diff --git a/CryptoExchange.Net/SharedApis/SharedUtils.cs b/CryptoExchange.Net/SharedApis/SharedUtils.cs index c477eb4c..0a1f7c7e 100644 --- a/CryptoExchange.Net/SharedApis/SharedUtils.cs +++ b/CryptoExchange.Net/SharedApis/SharedUtils.cs @@ -21,175 +21,10 @@ namespace CryptoExchange.Net.SharedApis SupportedEnvironments = platformInfo.SupportedEnvironments, SupportedTradingModes = client.SupportedTradingModes, CentralizationType = platformInfo.CentralizationType, - Features = GetAllEndpointOptions(client) + Features = client.EndpointOptions.Where(x => x.Supported).ToArray() }; } - /// - /// Get all supported endpoints for a client - /// - /// - /// - public static EndpointOptions[] GetAllEndpointOptions(ISharedClient client) - { -#warning TODO - return []; - //var clientType = client.GetType(); - //var result = new List(); - //if (client is IAssetsRestClient assetClient) - //{ - // result.Add(assetClient.GetAssetOptions); - // result.Add(assetClient.GetAssetsOptions); - //} - //if (client is IBalanceRestClient balanceClient) - // result.Add(balanceClient.GetBalancesOptions); - //if (client is IDepositRestClient depositClient) - //{ - // result.Add(depositClient.GetDepositAddressesOptions); - // result.Add(depositClient.GetDepositsOptions); - //} - //if (client is IKlineRestClient klineClient) - // result.Add(klineClient.GetKlinesOptions); - //if (client is IOrderBookRestClient orderBookClient) - // result.Add(orderBookClient.GetOrderBookOptions); - //if (client is IRecentTradeRestClient recentTradeClient) - // result.Add(recentTradeClient.GetRecentTradesOptions); - //if (client is ITradeHistoryRestClient tradeHistoryClient) - // result.Add(tradeHistoryClient.GetTradeHistoryOptions); - //if (client is IWithdrawalRestClient withdrawalClient) - // result.Add(withdrawalClient.GetWithdrawalHistoryOptions); - //if (client is IWithdrawRestClient withdrawClient) - // result.Add(withdrawClient.WithdrawOptions); - //if (client is IFeeRestClient feeClient) - // result.Add(feeClient.GetFeeOptions); - //if (client is IBookTickerRestClient bookTickerClient) - // result.Add(bookTickerClient.GetBookTickerOptions); - //if (client is ITransferRestClient transferClient) - // result.Add(transferClient.TransferOptions); - - //if (client is ISpotOrderRestClient spotOrderClient) - //{ - // result.Add(spotOrderClient.PlaceSpotOrderOptions); - // result.Add(spotOrderClient.CancelSpotOrderOptions); - // result.Add(spotOrderClient.GetClosedSpotOrdersOptions); - // result.Add(spotOrderClient.GetOpenSpotOrdersOptions); - // result.Add(spotOrderClient.GetSpotOrderOptions); - // result.Add(spotOrderClient.GetSpotOrderTradesOptions); - // result.Add(spotOrderClient.GetSpotUserTradesOptions); - //} - //if (client is ISpotSymbolRestClient spotSymbolClient) - // result.Add(spotSymbolClient.GetSpotSymbolsOptions); - //if (client is ISpotTickerRestClient spotTickerClient) - //{ - // result.Add(spotTickerClient.GetSpotTickerOptions); - // result.Add(spotTickerClient.GetSpotTickersOptions); - //} - //if (client is ISpotTriggerOrderRestClient spotTriggerOrderClient) - //{ - // result.Add(spotTriggerOrderClient.CancelSpotTriggerOrderOptions); - // result.Add(spotTriggerOrderClient.GetSpotTriggerOrderOptions); - // result.Add(spotTriggerOrderClient.PlaceSpotTriggerOrderOptions); - //} - //if (client is ISpotOrderClientIdRestClient spotOrderClientIdClient) - //{ - // result.Add(spotOrderClientIdClient.CancelSpotOrderByClientOrderIdOptions); - // result.Add(spotOrderClientIdClient.GetSpotOrderByClientOrderIdOptions); - //} - - //if (client is IFundingRateRestClient fundingRateClient) - // result.Add(fundingRateClient.GetFundingRateHistoryOptions); - //if (client is IFuturesOrderRestClient futuresOrderClient) - //{ - // result.Add(futuresOrderClient.CancelFuturesOrderOptions); - // result.Add(futuresOrderClient.ClosePositionOptions); - // result.Add(futuresOrderClient.GetClosedFuturesOrdersOptions); - // result.Add(futuresOrderClient.GetFuturesOrderOptions); - // result.Add(futuresOrderClient.GetFuturesOrderTradesOptions); - // result.Add(futuresOrderClient.GetFuturesUserTradesOptions); - // result.Add(futuresOrderClient.GetOpenFuturesOrdersOptions); - // result.Add(futuresOrderClient.GetPositionsOptions); - // result.Add(futuresOrderClient.PlaceFuturesOrderOptions); - //} - //if (client is IFuturesSymbolRestClient futuresSymbolClient) - // result.Add(futuresSymbolClient.GetFuturesSymbolsOptions); - //if (client is IFuturesTickerRestClient futuresTickerClient) - //{ - // result.Add(futuresTickerClient.GetFuturesTickerOptions); - // result.Add(futuresTickerClient.GetFuturesTickersOptions); - //} - //if (client is IIndexPriceKlineRestClient indexPriceKlineClient) - // result.Add(indexPriceKlineClient.GetIndexPriceKlinesOptions); - //if (client is ILeverageRestClient leverageClient) - //{ - // result.Add(leverageClient.GetLeverageOptions); - // result.Add(leverageClient.SetLeverageOptions); - //} - //if (client is IMarkPriceKlineRestClient markPriceKlineClient) - // result.Add(markPriceKlineClient.GetMarkPriceKlinesOptions); - //if (client is IOpenInterestRestClient openInterestClient) - // result.Add(openInterestClient.GetOpenInterestOptions); - //if (client is IPositionHistoryRestClient positionHistoryClient) - // result.Add(positionHistoryClient.GetPositionHistoryOptions); - //if (client is IPositionModeRestClient positionModeClient) - //{ - // result.Add(positionModeClient.SetPositionModeOptions); - // result.Add(positionModeClient.GetPositionModeOptions); - //} - //if (client is IFuturesTpSlRestClient futuresTpSlClient) - //{ - // result.Add(futuresTpSlClient.SetFuturesTpSlOptions); - // result.Add(futuresTpSlClient.CancelFuturesTpSlOptions); - //} - //if (client is IFuturesTriggerOrderRestClient futuresTriggerOrderClient) - //{ - // result.Add(futuresTriggerOrderClient.CancelFuturesTriggerOrderOptions); - // result.Add(futuresTriggerOrderClient.GetFuturesTriggerOrderOptions); - // result.Add(futuresTriggerOrderClient.PlaceFuturesTriggerOrderOptions); - //} - //if (client is IFuturesOrderClientIdRestClient futuresOrderClientIdClient) - //{ - // result.Add(futuresOrderClientIdClient.GetFuturesOrderByClientOrderIdOptions); - // result.Add(futuresOrderClientIdClient.CancelFuturesOrderByClientOrderIdOptions); - //} - - //if (client is IBalanceSocketClient balanceSocketClient) - // result.Add(balanceSocketClient.SubscribeBalanceOptions); - //if (client is IBookTickerSocketClient bookTickerSocketClient) - // result.Add(bookTickerSocketClient.SubscribeBookTickerOptions); - //if (client is IKlineSocketClient klineSocketClient) - // result.Add(klineSocketClient.SubscribeKlineOptions); - //if (client is IOrderBookSocketClient orderBookSocketClient) - // result.Add(orderBookSocketClient.SubscribeOrderBookOptions); - //if (client is ITickerSocketClient tickerSocketClient) - // result.Add(tickerSocketClient.SubscribeTickerOptions); - //if (client is ITickersSocketClient tickersSocketClient) - // result.Add(tickersSocketClient.SubscribeAllTickersOptions); - //if (client is ITradeSocketClient tradeSocketClient) - // result.Add(tradeSocketClient.SubscribeTradeOptions); - //if (client is IUserTradeSocketClient userTradeSocketClient) - // result.Add(userTradeSocketClient.SubscribeUserTradeOptions); - - //if (client is ISpotOrderSocketClient spotOrderSocketClient) - // result.Add(spotOrderSocketClient.SubscribeSpotOrderOptions); - //if (client is ISpotOrderManagementSocketClient spotOrderManagementSocketClient) - //{ - // result.Add(spotOrderManagementSocketClient.PlaceSpotOrderOptions); - // result.Add(spotOrderManagementSocketClient.CancelSpotOrderOptions); - //} - - //if (client is IFuturesOrderSocketClient futuresOrderSocketClient) - // result.Add(futuresOrderSocketClient.SubscribeFuturesOrderOptions); - //if (client is IPositionSocketClient positionSocketClient) - // result.Add(positionSocketClient.SubscribePositionOptions); - //if (client is IFuturesOrderManagementSocketClient futuresOrderManagementSocketClient) - //{ - // result.Add(futuresOrderManagementSocketClient.PlaceFuturesOrderOptions); - // result.Add(futuresOrderManagementSocketClient.CancelFuturesOrderOptions); - //} - - //return result.Where(x => x.Supported).ToArray(); - } - /// /// Apply symbols request filter for asset type and trading mode /// diff --git a/CryptoExchange.Net/Trackers/UserData/ItemTrackers/SpotUserTradeTracker.cs b/CryptoExchange.Net/Trackers/UserData/ItemTrackers/SpotUserTradeTracker.cs index 11db0267..f1ba4396 100644 --- a/CryptoExchange.Net/Trackers/UserData/ItemTrackers/SpotUserTradeTracker.cs +++ b/CryptoExchange.Net/Trackers/UserData/ItemTrackers/SpotUserTradeTracker.cs @@ -15,7 +15,7 @@ namespace CryptoExchange.Net.Trackers.UserData.ItemTrackers /// public class SpotUserTradeTracker : UserDataItemTracker { - private readonly IGetSpotUserTradeHistoryRestClient _restClient; + private readonly IGetSpotUserTradeHistoryEndpoint _restClient; private readonly IUserTradeSocketClient? _socketClient; private readonly ExchangeParameters? _exchangeParameters; private readonly TimeSpan _pollOverlapPeriod = TimeSpan.FromSeconds(3); @@ -28,7 +28,7 @@ namespace CryptoExchange.Net.Trackers.UserData.ItemTrackers public SpotUserTradeTracker( ILogger logger, UserDataSymbolTracker symbolTracker, - ISpotOrderRestClient restClient, + IGetSpotUserTradeHistoryEndpoint restClient, IUserTradeSocketClient? socketClient, TrackerItemConfig config, IEnumerable symbols, diff --git a/CryptoExchange.Net/Trackers/UserData/UserSpotDataTracker.cs b/CryptoExchange.Net/Trackers/UserData/UserSpotDataTracker.cs index 8180c990..39821332 100644 --- a/CryptoExchange.Net/Trackers/UserData/UserSpotDataTracker.cs +++ b/CryptoExchange.Net/Trackers/UserData/UserSpotDataTracker.cs @@ -38,12 +38,15 @@ namespace CryptoExchange.Net.Trackers.UserData IBalanceRestClient balanceRestClient, IBalanceSocketClient? balanceSocketClient, ISpotOrderRestClient spotOrderRestClient, + IGetSpotUserTradeHistoryEndpoint getSpotUserTradeHistoryRestClient, ISpotOrderSocketClient? spotOrderSocketClient, IUserTradeSocketClient? userTradeSocketClient, string? userIdentifier, SpotUserDataTrackerConfig config, ExchangeParameters? exchangeParameters = null) : base(logger, symbolRestClient.Exchange, config, userIdentifier) { +#warning TODO specific interfaces + // create trackers _symbolClient = symbolRestClient; _exchangeParameters = exchangeParameters; @@ -60,7 +63,7 @@ namespace CryptoExchange.Net.Trackers.UserData if (config.TrackTrades) { - var tradeTracker = new SpotUserTradeTracker(logger, SymbolTracker, spotOrderRestClient, userTradeSocketClient, config.UserTradesConfig, config.TrackedSymbols, config.OnlyTrackProvidedSymbols, exchangeParameters); + var tradeTracker = new SpotUserTradeTracker(logger, SymbolTracker, getSpotUserTradeHistoryRestClient, userTradeSocketClient, config.UserTradesConfig, config.TrackedSymbols, config.OnlyTrackProvidedSymbols, exchangeParameters); Trades = tradeTracker; trackers.Add(tradeTracker);