From 67bf7d08cb87570c643fb28660f58d00c1e375e4 Mon Sep 17 00:00:00 2001 From: Jkorf Date: Fri, 4 Sep 2026 12:40:54 +0200 Subject: [PATCH] wip --- .../Interfaces/V2/Assets/IGetAllAssetsRest.cs | 18 +++++- .../Interfaces/V2/Assets/IGetAssetRest.cs | 17 +++++- .../V2/Balances/IGetBalancesRest.cs | 18 +++++- .../V2/Deposits/IGetDepositAddressesRest.cs | 18 +++++- .../V2/Deposits/IGetDepositHistoryRest.cs | 20 ++++++- .../Interfaces/V2/Fees/IGetFeesRest.cs | 17 +++++- .../V2/Funding/IGetFundingRateHistoryRest.cs | 19 ++++++- .../Futures/IGetIndexPriceKlinesRest.cs | 19 ++++++- .../Klines/Futures/IGetMarkPriceKlinesRest.cs | 19 ++++++- .../Interfaces/V2/Klines/IGetKlinesRest.cs | 20 ++++++- .../V2/Leverage/IGetLeverageRest.cs | 17 +++++- .../V2/Leverage/ISetLeverageRest.cs | 17 +++++- .../V2/OpenInterest/IGetOpenInterestRest.cs | 17 +++++- .../V2/OrderBooks/IGetBookTickerRest.cs | 18 +++++- .../V2/OrderBooks/IGetOrderBookRest.cs | 18 +++++- .../V2/Orders/Futures/ICancelFuturesOrder.cs | 56 +++++++++++++++++++ .../ICancelFuturesOrderByClientOrderId.cs | 54 ++++++++++++++++++ .../ICancelFuturesOrderByClientOrderIdRest.cs | 28 ---------- .../Orders/Futures/ICancelFuturesOrderRest.cs | 29 ---------- .../Futures/ICancelFuturesOrderSocket.cs | 25 --------- ...dersRest.cs => IGetClosedFuturesOrders.cs} | 21 ++++++- ...uturesOrderRest.cs => IGetFuturesOrder.cs} | 17 +++++- ....cs => IGetFuturesOrderByClientOrderId.cs} | 17 +++++- ...OrdersRest.cs => IGetOpenFuturesOrders.cs} | 17 +++++- ...uresOrderRest.cs => IPlaceFuturesOrder.cs} | 30 +++++++++- .../Futures/IPlaceFuturesOrderSocket.cs | 54 ------------------ .../V2/Orders/Spot/ICancelSpotOrder.cs | 55 ++++++++++++++++++ .../Spot/ICancelSpotOrderByClientOrderId.cs | 54 ++++++++++++++++++ .../ICancelSpotOrderByClientOrderIdRest.cs | 28 ---------- .../V2/Orders/Spot/ICancelSpotOrderRest.cs | 28 ---------- .../V2/Orders/Spot/ICancelSpotOrderSocket.cs | 26 --------- ...tOrdersRest.cs => IGetClosedSpotOrders.cs} | 19 ++++++- ...potOrdersRest.cs => IGetOpenSpotOrders.cs} | 17 +++++- ...{IGetSpotOrderRest.cs => IGetSpotOrder.cs} | 17 +++++- ...est.cs => IGetSpotOrderByClientOrderId.cs} | 18 +++++- .../V2/Orders/Spot/IPlaceSpotOrder.cs | 26 +++++++++ .../V2/Orders/Spot/IPlaceSpotOrderRest.cs | 22 -------- .../V2/Orders/Spot/IPlaceSpotOrderSocket.cs | 19 ------- .../V2/PositionMode/IGetPositionModeRest.cs | 17 +++++- .../V2/PositionMode/ISetPositionModeRest.cs | 17 +++++- .../V2/Positions/IClosePositionRest.cs | 18 +++++- .../V2/Positions/IGetPositionHistoryRest.cs | 19 ++++++- .../V2/Positions/IGetPositionsRest.cs | 17 +++++- .../Symbols/Futures/IGetFuturesSymbolsRest.cs | 17 +++++- .../V2/Symbols/Spot/IGetSpotSymbolsRest.cs | 18 +++++- .../Futures/IGetAllFuturesTickersRest.cs | 17 +++++- .../Tickers/Futures/IGetFuturesTickerRest.cs | 17 +++++- .../V2/Tickers/Spot/IGetAllSpotTickersRest.cs | 17 +++++- .../V2/Tickers/Spot/IGetSpotTickerRest.cs | 17 +++++- .../V2/TpSl/ICancelFuturesTpSlRest.cs | 18 +++++- .../Interfaces/V2/TpSl/ISetFuturesTpSlRest.cs | 18 +++++- .../V2/Trades/IGetRecentTradesRest.cs | 19 ++++++- .../V2/Trades/IGetTradeHistoryRest.cs | 21 ++++++- .../Interfaces/V2/Transfers/ITransferRest.cs | 17 +++++- .../Futures/ICancelFuturesTriggerOrderRest.cs | 17 +++++- .../Futures/IGetFuturesTriggerOrderRest.cs | 17 +++++- .../Futures/IPlaceFuturesTriggerOrderRest.cs | 18 +++++- .../Spot/ICancelSpotTriggerOrderRest.cs | 17 +++++- .../Spot/IGetSpotTriggerOrderRest.cs | 17 +++++- .../Spot/IPlaceSpotTriggerOrderRest.cs | 19 ++++++- .../Futures/IGetFuturesOrderTradesRest.cs | 17 +++++- .../IGetFuturesUserTradeHistoryRest.cs | 19 ++++++- .../Spot/IGetSpotOrderTradesRest.cs | 19 ++++++- .../Spot/IGetSpotUserTradeHistoryRest.cs | 20 ++++++- .../Withdrawals/IGetWithdrawalHistoryRest.cs | 21 ++++++- .../V2/Withdrawals/IWithdrawRest.cs | 19 ++++++- .../Endpoints/CancelFuturesOrderOptions.cs | 4 +- .../Endpoints/CancelSpotOrderOptions.cs | 6 +- .../Endpoints/PlaceFuturesOrderOptions.cs | 6 +- .../CancelFuturesOrderSocketOptions.cs | 4 +- .../CancelSpotOrderSocketOptions.cs | 13 +---- .../PlaceFuturesOrderSocketOptions.cs | 37 +----------- 72 files changed, 1103 insertions(+), 420 deletions(-) create mode 100644 CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/ICancelFuturesOrder.cs create mode 100644 CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/ICancelFuturesOrderByClientOrderId.cs delete mode 100644 CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/ICancelFuturesOrderByClientOrderIdRest.cs delete mode 100644 CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/ICancelFuturesOrderRest.cs delete mode 100644 CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/ICancelFuturesOrderSocket.cs rename CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/{IGetClosedFuturesOrdersRest.cs => IGetClosedFuturesOrders.cs} (52%) rename CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/{IGetFuturesOrderRest.cs => IGetFuturesOrder.cs} (59%) rename CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/{IGetFuturesOrderByClientOrderIdRest.cs => IGetFuturesOrderByClientOrderId.cs} (57%) rename CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/{IGetOpenFuturesOrdersRest.cs => IGetOpenFuturesOrders.cs} (58%) rename CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/{IPlaceFuturesOrderRest.cs => IPlaceFuturesOrder.cs} (59%) delete mode 100644 CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IPlaceFuturesOrderSocket.cs create mode 100644 CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/ICancelSpotOrder.cs create mode 100644 CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/ICancelSpotOrderByClientOrderId.cs delete mode 100644 CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/ICancelSpotOrderByClientOrderIdRest.cs delete mode 100644 CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/ICancelSpotOrderRest.cs delete mode 100644 CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/ICancelSpotOrderSocket.cs rename CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/{IGetClosedSpotOrdersRest.cs => IGetClosedSpotOrders.cs} (54%) rename CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/{IGetOpenSpotOrdersRest.cs => IGetOpenSpotOrders.cs} (58%) rename CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/{IGetSpotOrderRest.cs => IGetSpotOrder.cs} (59%) rename CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/{IGetSpotOrderByClientOrderIdRest.cs => IGetSpotOrderByClientOrderId.cs} (57%) delete mode 100644 CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IPlaceSpotOrderRest.cs delete mode 100644 CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IPlaceSpotOrderSocket.cs diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Assets/IGetAllAssetsRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Assets/IGetAllAssetsRest.cs index 38ccda21..a561323b 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Assets/IGetAllAssetsRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Assets/IGetAllAssetsRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Endpoint definition for retrieving all assets supported on an exchange. /// - public interface IGetAllAssetsRest : ISharedRest + public interface IGetAllAssets : ISharedApiCapability { /// /// Assets request options.
@@ -24,6 +24,20 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> GetAllAssetsAsync(GetAssetsRequest request, CancellationToken ct = default); + Task> GetAllAssetsAsync(GetAssetsRequest request, CancellationToken ct = default); + } + + /// + /// Endpoint definition for retrieving all assets supported on an exchange. + /// + public interface IGetAllAssetsRest : IGetAllAssets, ISharedRest + { + + /// + /// Get info on all assets the exchange supports, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> GetAllAssetsAsync(GetAssetsRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Assets/IGetAssetRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Assets/IGetAssetRest.cs index c1940e93..d60d4bd9 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Assets/IGetAssetRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Assets/IGetAssetRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Endpoint definition for retrieving an asset on an exchange. /// - public interface IGetAssetRest : ISharedRest + public interface IGetAsset : ISharedApiCapability { /// /// Asset request options.
@@ -24,6 +24,19 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> GetAssetAsync(GetAssetRequest request, CancellationToken ct = default); + Task> GetAssetAsync(GetAssetRequest request, CancellationToken ct = default); + } + + /// + /// Endpoint definition for retrieving an asset on an exchange. + /// + public interface IGetAssetRest : IGetAsset, ISharedRest + { + /// + /// Get info on a specific asset, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> GetAssetAsync(GetAssetRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Balances/IGetBalancesRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Balances/IGetBalancesRest.cs index 78bc0ef9..d6f2312d 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Balances/IGetBalancesRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Balances/IGetBalancesRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Endpoint definition for retrieving user asset balances on an exchange. /// - public interface IGetBalancesRest : ISharedRest + public interface IGetBalances : ISharedApiCapability { /// /// Balances request options.
@@ -25,6 +25,20 @@ namespace CryptoExchange.Net.SharedApis /// Request info /// Cancellation token /// - Task> GetBalancesAsync(GetBalancesRequest request, CancellationToken ct = default); + Task> GetBalancesAsync(GetBalancesRequest request, CancellationToken ct = default); + } + + /// + /// Endpoint definition for retrieving user asset balances on an exchange. + /// + public interface IGetBalancesRest : IGetBalances, ISharedRest + { + /// + /// Get balances for the user, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + /// + new Task> GetBalancesAsync(GetBalancesRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Deposits/IGetDepositAddressesRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Deposits/IGetDepositAddressesRest.cs index 24d134d6..7693dcb6 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Deposits/IGetDepositAddressesRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Deposits/IGetDepositAddressesRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Endpoint definition for retrieving user deposit addresses on an exchange. /// - public interface IGetDepositAddressesRest : ISharedRest + public interface IGetDepositAddresses : ISharedApiCapability { /// /// Deposit addresses request options.
@@ -25,6 +25,20 @@ namespace CryptoExchange.Net.SharedApis /// Request info /// Cancellation token /// - Task> GetDepositAddressesAsync(GetDepositAddressesRequest request, CancellationToken ct = default); + Task> GetDepositAddressesAsync(GetDepositAddressesRequest request, CancellationToken ct = default); + } + + /// + /// Endpoint definition for retrieving user deposit addresses on an exchange. + /// + public interface IGetDepositAddressesRest : IGetDepositAddresses, ISharedRest + { + /// + /// Get deposit addresses for an asset, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + /// + new Task> GetDepositAddressesAsync(GetDepositAddressesRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Deposits/IGetDepositHistoryRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Deposits/IGetDepositHistoryRest.cs index 8681dfc0..a4f99981 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Deposits/IGetDepositHistoryRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Deposits/IGetDepositHistoryRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Endpoint definition for retrieving user deposit history on an exchange. /// - public interface IGetDepositHistoryRest : ISharedRest + public interface IGetDepositHistory : ISharedApiCapability { /// /// Deposits request options.
@@ -27,6 +27,22 @@ namespace CryptoExchange.Net.SharedApis /// The pagination request from the previous request result property to continue pagination /// Cancellation token /// - Task> GetDepositHistoryAsync(GetDepositsRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + Task> GetDepositHistoryAsync(GetDepositsRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + } + + /// + /// Endpoint definition for retrieving user deposit history on an exchange. + /// + public interface IGetDepositHistoryRest : IGetDepositHistory, ISharedRest + { + /// + /// 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 property to continue pagination + /// Cancellation token + /// + new Task> GetDepositHistoryAsync(GetDepositsRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Fees/IGetFeesRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Fees/IGetFeesRest.cs index 04e608d8..216642c3 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Fees/IGetFeesRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Fees/IGetFeesRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Endpoint definition for retrieving user trading fees on an exchange. /// - public interface IGetFeesRest : ISharedRest + public interface IGetFees : ISharedApiCapability { /// /// Fee request options.
@@ -24,6 +24,19 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> GetFeesAsync(GetFeeRequest request, CancellationToken ct = default); + Task> GetFeesAsync(GetFeeRequest request, CancellationToken ct = default); + } + + /// + /// Endpoint definition for retrieving user trading fees on an exchange. + /// + public interface IGetFeesRest : IGetFees, ISharedRest + { + /// + /// Get trading fees for a symbol, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> GetFeesAsync(GetFeeRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Funding/IGetFundingRateHistoryRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Funding/IGetFundingRateHistoryRest.cs index 5c008b19..cb14543e 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Funding/IGetFundingRateHistoryRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Funding/IGetFundingRateHistoryRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Endpoint definition for retrieving funding rate history for a symbol on an exchange. /// - public interface IGetFundingRateHistoryRest : ISharedRest + public interface IGetFundingRateHistory : ISharedApiCapability { /// /// Funding rate request options.
@@ -25,6 +25,21 @@ namespace CryptoExchange.Net.SharedApis /// Request info /// The pagination request from the previous request result property to continue pagination /// Cancellation token - Task> GetFundingRateHistoryAsync(GetFundingRateHistoryRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + Task> GetFundingRateHistoryAsync(GetFundingRateHistoryRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + } + + /// + /// Endpoint definition for retrieving funding rate history for a symbol on an exchange. + /// + public interface IGetFundingRateHistoryRest : IGetFundingRateHistory, ISharedRest + { + /// + /// 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 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 + new Task> GetFundingRateHistoryAsync(GetFundingRateHistoryRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Klines/Futures/IGetIndexPriceKlinesRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Klines/Futures/IGetIndexPriceKlinesRest.cs index c26959bd..68b75122 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Klines/Futures/IGetIndexPriceKlinesRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Klines/Futures/IGetIndexPriceKlinesRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Endpoint definition for retrieving index price kline/candlestick data from an exchange /// - public interface IGetIndexPriceKlinesRest : ISharedRest + public interface IGetIndexPriceKlines : ISharedApiCapability { /// /// Index price klines request options.
@@ -25,6 +25,21 @@ namespace CryptoExchange.Net.SharedApis /// Request info /// The pagination request from the previous request result property to continue pagination /// Cancellation token - Task> GetIndexPriceKlinesAsync(GetKlinesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + Task> GetIndexPriceKlinesAsync(GetKlinesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + } + + /// + /// Endpoint definition for retrieving index price kline/candlestick data from an exchange + /// + public interface IGetIndexPriceKlinesRest : IGetIndexPriceKlines, ISharedRest + { + /// + /// 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 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 + new Task> GetIndexPriceKlinesAsync(GetKlinesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Klines/Futures/IGetMarkPriceKlinesRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Klines/Futures/IGetMarkPriceKlinesRest.cs index 709b8dc2..20c91e02 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Klines/Futures/IGetMarkPriceKlinesRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Klines/Futures/IGetMarkPriceKlinesRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Endpoint definition for retrieving mark price kline/candlestick data from an exchange. /// - public interface IGetMarkPriceKlinesRest : ISharedRest + public interface IGetMarkPriceKlines : ISharedApiCapability { /// /// Mark price klines request options.
@@ -25,6 +25,21 @@ namespace CryptoExchange.Net.SharedApis /// Request info /// The pagination request from the previous request result property to continue pagination /// Cancellation token - Task> GetMarkPriceKlinesAsync(GetKlinesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + Task> GetMarkPriceKlinesAsync(GetKlinesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + } + + /// + /// Endpoint definition for retrieving mark price kline/candlestick data from an exchange. + /// + public interface IGetMarkPriceKlinesRest : IGetMarkPriceKlines, ISharedRest + { + /// + /// 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 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 + new Task> GetMarkPriceKlinesAsync(GetKlinesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Klines/IGetKlinesRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Klines/IGetKlinesRest.cs index 06b91fa9..1e7ce93b 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Klines/IGetKlinesRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Klines/IGetKlinesRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for getting kline/candlestick data from an exchange. /// - public interface IGetKlinesRest : ISharedRest + public interface IGetKlines : ISharedApiCapability { /// /// Kline request options.
@@ -27,6 +27,22 @@ namespace CryptoExchange.Net.SharedApis /// The pagination request from the previous request result property to continue pagination /// Cancellation token /// - Task> GetKlinesAsync(GetKlinesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + Task> GetKlinesAsync(GetKlinesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + } + + /// + /// Request definition for getting kline/candlestick data from an exchange. + /// + public interface IGetKlinesRest : IGetKlines, ISharedRest + { + /// + /// 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 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 + /// + new Task> GetKlinesAsync(GetKlinesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Leverage/IGetLeverageRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Leverage/IGetLeverageRest.cs index 2b2750d9..af2d0b48 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Leverage/IGetLeverageRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Leverage/IGetLeverageRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Endpoint definition for retrieving leverage information for a symbol on an exchange. /// - public interface IGetLeverageRest : ISharedRest + public interface IGetLeverage : ISharedApiCapability { /// /// Leverage request options.
@@ -23,6 +23,19 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> GetLeverageAsync(GetLeverageRequest request, CancellationToken ct = default); + Task> GetLeverageAsync(GetLeverageRequest request, CancellationToken ct = default); + } + + /// + /// Endpoint definition for retrieving leverage information for a symbol on an exchange. + /// + public interface IGetLeverageRest : IGetLeverage, ISharedRest + { + /// + /// Get the current leverage setting for a symbol, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> GetLeverageAsync(GetLeverageRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Leverage/ISetLeverageRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Leverage/ISetLeverageRest.cs index b2444da2..b3bb1345 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Leverage/ISetLeverageRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Leverage/ISetLeverageRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Endpoint definition for setting leverage on an exchange. /// - public interface ISetLeverageRest : ISharedRest + public interface ISetLeverage : ISharedApiCapability { /// /// How the leverage setting is configured on the exchange @@ -28,6 +28,19 @@ namespace CryptoExchange.Net.SharedApis /// /// Request info /// Cancellation token - Task> SetLeverageAsync(SetLeverageRequest request, CancellationToken ct = default); + Task> SetLeverageAsync(SetLeverageRequest request, CancellationToken ct = default); + } + + /// + /// Endpoint definition for setting leverage on an exchange. + /// + public interface ISetLeverageRest : ISetLeverage, ISharedRest + { + /// + /// Set the leverage for a symbol, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> SetLeverageAsync(SetLeverageRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/OpenInterest/IGetOpenInterestRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/OpenInterest/IGetOpenInterestRest.cs index f2ef4d0e..992f4204 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/OpenInterest/IGetOpenInterestRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/OpenInterest/IGetOpenInterestRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Endpoint definition for retrieving open interest data from an exchange /// - public interface IGetOpenInterestRest : ISharedRest + public interface IGetOpenInterest : ISharedApiCapability { /// /// Open interest request options.
@@ -23,6 +23,19 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> GetOpenInterestAsync(GetOpenInterestRequest request, CancellationToken ct = default); + Task> GetOpenInterestAsync(GetOpenInterestRequest request, CancellationToken ct = default); + } + + /// + /// Endpoint definition for retrieving open interest data from an exchange + /// + public interface IGetOpenInterestRest : IGetOpenInterest, ISharedRest + { + /// + /// Get the open interest for a symbol, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> GetOpenInterestAsync(GetOpenInterestRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/OrderBooks/IGetBookTickerRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/OrderBooks/IGetBookTickerRest.cs index 364eb655..a488cd79 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/OrderBooks/IGetBookTickerRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/OrderBooks/IGetBookTickerRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for retrieving the best bid/ask prices for a symbol on an exchange. /// - public interface IGetBookTickerRest : ISharedRest + public interface IGetBookTicker : ISharedApiCapability { /// /// Book ticker request options.
@@ -25,6 +25,20 @@ namespace CryptoExchange.Net.SharedApis /// Request info /// Cancellation token /// - Task> GetBookTickerAsync(GetBookTickerRequest request, CancellationToken ct = default); + Task> GetBookTickerAsync(GetBookTickerRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for retrieving the best bid/ask prices for a symbol on an exchange. + /// + public interface IGetBookTickerRest : IGetBookTicker, ISharedRest + { + /// + /// Get the best ask/bid info for a symbol, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + /// + new Task> GetBookTickerAsync(GetBookTickerRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/OrderBooks/IGetOrderBookRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/OrderBooks/IGetOrderBookRest.cs index 639ef14b..3427fc1d 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/OrderBooks/IGetOrderBookRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/OrderBooks/IGetOrderBookRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for retrieving an order book snapshot for a symbol on an exchange. /// - public interface IGetOrderBookRest : ISharedRest + public interface IGetOrderBook : ISharedApiCapability { /// /// Order book request options.
@@ -25,6 +25,20 @@ namespace CryptoExchange.Net.SharedApis /// Request info /// Cancellation token /// - Task> GetOrderBookAsync(GetOrderBookRequest request, CancellationToken ct = default); + Task> GetOrderBookAsync(GetOrderBookRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for retrieving an order book snapshot for a symbol on an exchange. + /// + public interface IGetOrderBookRest : IGetOrderBook, ISharedRest + { + /// + /// Get the order book for a symbol, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + /// + new Task> GetOrderBookAsync(GetOrderBookRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/ICancelFuturesOrder.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/ICancelFuturesOrder.cs new file mode 100644 index 00000000..f064fffe --- /dev/null +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/ICancelFuturesOrder.cs @@ -0,0 +1,56 @@ +using CryptoExchange.Net.Objects; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace CryptoExchange.Net.SharedApis +{ + /// + /// Endpoint definition for canceling a futures order on an exchange. + /// + public interface ICancelFuturesOrder : ISharedApiCapability + { + /// + /// 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); + } + + /// + /// Endpoint definition for canceling a futures order on an exchange. + /// + public interface ICancelFuturesOrderRest : ICancelFuturesOrder, ISharedRest + { + /// + /// Cancel a futures order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> CancelFuturesOrderAsync(CancelOrderRequest request, CancellationToken ct = default); + + } + + /// + /// Endpoint definition for canceling a futures order on an exchange. + /// + public interface ICancelFuturesOrderSocket : ICancelFuturesOrder, ISharedSocket + { + /// + /// Cancel a futures order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> CancelFuturesOrderAsync(CancelOrderRequest request, CancellationToken ct = default); + + } +} diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/ICancelFuturesOrderByClientOrderId.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/ICancelFuturesOrderByClientOrderId.cs new file mode 100644 index 00000000..66f3eb7d --- /dev/null +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/ICancelFuturesOrderByClientOrderId.cs @@ -0,0 +1,54 @@ +using CryptoExchange.Net.Objects; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace CryptoExchange.Net.SharedApis +{ + /// + /// Endpoint definition for canceling a futures order by client order id on an exchange. + /// + public interface ICancelFuturesOrderByClientOrderId : ISharedApiCapability + { + /// + /// 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); + } + + /// + /// Endpoint definition for canceling a futures order by client order id on an exchange. + /// + public interface ICancelFuturesOrderByClientOrderIdRest : ICancelFuturesOrderByClientOrderId, ISharedRest + { + /// + /// Cancel a futures order using client order id, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> CancelFuturesOrderByClientOrderIdAsync(CancelOrderRequest request, CancellationToken ct = default); + } + + /// + /// Endpoint definition for canceling a futures order by client order id on an exchange. + /// + public interface ICancelFuturesOrderByClientOrderIdSocket : ICancelFuturesOrderByClientOrderId, ISharedSocket + { + /// + /// Cancel a futures order using client order id, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> CancelFuturesOrderByClientOrderIdAsync(CancelOrderRequest request, CancellationToken ct = default); + } +} diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/ICancelFuturesOrderByClientOrderIdRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/ICancelFuturesOrderByClientOrderIdRest.cs deleted file mode 100644 index b1c256b8..00000000 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/ICancelFuturesOrderByClientOrderIdRest.cs +++ /dev/null @@ -1,28 +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 -{ - /// - /// Endpoint definition for canceling a futures order by client order id on an exchange. - /// - public interface ICancelFuturesOrderByClientOrderIdRest : ISharedRest - { - /// - /// 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/V2/Orders/Futures/ICancelFuturesOrderRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/ICancelFuturesOrderRest.cs deleted file mode 100644 index 58356160..00000000 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/ICancelFuturesOrderRest.cs +++ /dev/null @@ -1,29 +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 -{ - /// - /// Endpoint definition for canceling a futures order on an exchange. - /// - public interface ICancelFuturesOrderRest : ISharedRest - { - /// - /// 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); - - } -} diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/ICancelFuturesOrderSocket.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/ICancelFuturesOrderSocket.cs deleted file mode 100644 index c56ae168..00000000 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/ICancelFuturesOrderSocket.cs +++ /dev/null @@ -1,25 +0,0 @@ -using CryptoExchange.Net.Objects; -using System.Threading; -using System.Threading.Tasks; - -namespace CryptoExchange.Net.SharedApis -{ - /// - /// Client for placing and managing futures orders - /// - public interface ICancelFuturesOrderSocket : ISharedSocket - { - /// - /// 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. - ///
- CancelFuturesOrderSocketOptions 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); - } -} diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetClosedFuturesOrdersRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetClosedFuturesOrders.cs similarity index 52% rename from CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetClosedFuturesOrdersRest.cs rename to CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetClosedFuturesOrders.cs index e8a03dbf..10e604c4 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetClosedFuturesOrdersRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetClosedFuturesOrders.cs @@ -10,10 +10,10 @@ namespace CryptoExchange.Net.SharedApis /// /// Endpoint definition for retrieving closed futures orders on an exchange. /// - public interface IGetClosedFuturesOrdersRest : ISharedRest + public interface IGetClosedFuturesOrders : ISharedApiCapability { /// - /// Spot get closed orders request options.
+ /// Futures 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. ///
@@ -25,6 +25,21 @@ namespace CryptoExchange.Net.SharedApis /// Request info /// The pagination request from the previous request result property to continue pagination /// Cancellation token - Task> GetClosedFuturesOrdersAsync(GetClosedOrdersRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + Task> GetClosedFuturesOrdersAsync(GetClosedOrdersRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + } + + /// + /// Endpoint definition for retrieving closed futures orders on an exchange. + /// + public interface IGetClosedFuturesOrdersRest : IGetClosedFuturesOrders, ISharedRest + { + /// + /// 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 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 + new Task> GetClosedFuturesOrdersAsync(GetClosedOrdersRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetFuturesOrderRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetFuturesOrder.cs similarity index 59% rename from CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetFuturesOrderRest.cs rename to CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetFuturesOrder.cs index cf82b695..fbcf25e7 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetFuturesOrderRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetFuturesOrder.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Endpoint definition for retrieving a futures order on an exchange. /// - public interface IGetFuturesOrderRest : ISharedRest + public interface IGetFuturesOrder : ISharedApiCapability { /// /// Futures get order request options.
@@ -23,6 +23,19 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> GetFuturesOrderAsync(GetOrderRequest request, CancellationToken ct = default); + Task> GetFuturesOrderAsync(GetOrderRequest request, CancellationToken ct = default); + } + + /// + /// Endpoint definition for retrieving a futures order on an exchange. + /// + public interface IGetFuturesOrderRest : IGetFuturesOrder, ISharedRest + { + /// + /// Get info on a specific futures order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> GetFuturesOrderAsync(GetOrderRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetFuturesOrderByClientOrderIdRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetFuturesOrderByClientOrderId.cs similarity index 57% rename from CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetFuturesOrderByClientOrderIdRest.cs rename to CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetFuturesOrderByClientOrderId.cs index e4f4085c..92b57693 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetFuturesOrderByClientOrderIdRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetFuturesOrderByClientOrderId.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Endpoint definition for retrieving a futures order by client order id on an exchange. /// - public interface IGetFuturesOrderByClientOrderIdRest : ISharedRest + public interface IGetFuturesOrderByClientOrderId : ISharedApiCapability { /// /// Futures get order by client order id request options.
@@ -24,6 +24,19 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> GetFuturesOrderByClientOrderIdAsync(GetOrderRequest request, CancellationToken ct = default); + Task> GetFuturesOrderByClientOrderIdAsync(GetOrderRequest request, CancellationToken ct = default); + } + + /// + /// Endpoint definition for retrieving a futures order by client order id on an exchange. + /// + public interface IGetFuturesOrderByClientOrderIdRest : IGetFuturesOrderByClientOrderId, ISharedRest + { + /// + /// 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 + new Task> GetFuturesOrderByClientOrderIdAsync(GetOrderRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetOpenFuturesOrdersRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetOpenFuturesOrders.cs similarity index 58% rename from CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetOpenFuturesOrdersRest.cs rename to CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetOpenFuturesOrders.cs index f6de4ebd..5ec0f297 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetOpenFuturesOrdersRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IGetOpenFuturesOrders.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Endpoint definition for retrieving open futures orders on an exchange. /// - public interface IGetOpenFuturesOrdersRest : ISharedRest + public interface IGetOpenFuturesOrders : ISharedApiCapability { /// /// Futures get open orders request options.
@@ -23,6 +23,19 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> GetOpenFuturesOrdersAsync(GetOpenOrdersRequest request, CancellationToken ct = default); + Task> GetOpenFuturesOrdersAsync(GetOpenOrdersRequest request, CancellationToken ct = default); + } + + /// + /// Endpoint definition for retrieving open futures orders on an exchange. + /// + public interface IGetOpenFuturesOrdersRest : IGetOpenFuturesOrders, ISharedRest + { + /// + /// Get info on a open futures orders, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> GetOpenFuturesOrdersAsync(GetOpenOrdersRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IPlaceFuturesOrderRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IPlaceFuturesOrder.cs similarity index 59% rename from CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IPlaceFuturesOrderRest.cs rename to CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IPlaceFuturesOrder.cs index b5ff39d7..76086f1d 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IPlaceFuturesOrderRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IPlaceFuturesOrder.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Endpoint definition for placing a futures order on an exchange. /// - public interface IPlaceFuturesOrderRest : ISharedRest + public interface IPlaceFuturesOrder : ISharedApiCapability { /// /// How the trading fee is deducted @@ -51,6 +51,32 @@ namespace CryptoExchange.Net.SharedApis /// /// Request info /// Cancellation token - Task> PlaceFuturesOrderAsync(PlaceFuturesOrderRequest request, CancellationToken ct = default); + Task> PlaceFuturesOrderAsync(PlaceFuturesOrderRequest request, CancellationToken ct = default); + } + + /// + /// Endpoint definition for placing a futures order on an exchange. + /// + public interface IPlaceFuturesOrderRest : IPlaceFuturesOrder, ISharedRest + { + /// + /// Place a new futures order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> PlaceFuturesOrderAsync(PlaceFuturesOrderRequest request, CancellationToken ct = default); + } + + /// + /// Endpoint definition for placing a futures order on an exchange. + /// + public interface IPlaceFuturesOrderSocket : IPlaceFuturesOrder, ISharedSocket + { + /// + /// Place a new futures order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> PlaceFuturesOrderAsync(PlaceFuturesOrderRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IPlaceFuturesOrderSocket.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IPlaceFuturesOrderSocket.cs deleted file mode 100644 index 4848791f..00000000 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Futures/IPlaceFuturesOrderSocket.cs +++ /dev/null @@ -1,54 +0,0 @@ -using CryptoExchange.Net.Objects; -using System.Threading; -using System.Threading.Tasks; - -namespace CryptoExchange.Net.SharedApis -{ - /// - /// Client for placing and managing futures orders - /// - public interface IPlaceFuturesOrderSocket : ISharedSocket - { - /// - /// 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. - ///
- PlaceFuturesOrderSocketOptions 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); - - } -} diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/ICancelSpotOrder.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/ICancelSpotOrder.cs new file mode 100644 index 00000000..99dcb54e --- /dev/null +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/ICancelSpotOrder.cs @@ -0,0 +1,55 @@ +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 canceling a spot order on an exchange. + /// + public interface ICancelSpotOrder : ISharedApiCapability + { + /// + /// 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); + } + + /// + /// Request definition for canceling a spot order on an exchange. + /// + public interface ICancelSpotOrderRest : ICancelSpotOrder, ISharedRest + { + /// + /// Cancel a spot order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> CancelSpotOrderAsync(CancelOrderRequest request, CancellationToken ct = default); + } + + /// + /// Client for placing and managing spot orders + /// + public interface ICancelSpotOrderSocket : ICancelSpotOrder, ISharedSocket + { + /// + /// Cancel a spot order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> CancelSpotOrderAsync(CancelOrderRequest request, CancellationToken ct = default); + + } +} diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/ICancelSpotOrderByClientOrderId.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/ICancelSpotOrderByClientOrderId.cs new file mode 100644 index 00000000..f1f50cbf --- /dev/null +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/ICancelSpotOrderByClientOrderId.cs @@ -0,0 +1,54 @@ +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 canceling a spot order by client order id on an exchange. + /// + public interface ICancelSpotOrderByClientOrderId: ISharedApiCapability + { + /// + /// 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); + } + + /// + /// Request definition for canceling a spot order by client order id on an exchange. + /// + public interface ICancelSpotOrderByClientOrderIdRest : ICancelSpotOrderByClientOrderId, ISharedRest + { + /// + /// Cancel a spot order using client order id, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> CancelSpotOrderByClientOrderIdAsync(CancelOrderRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for canceling a spot order by client order id on an exchange. + /// + public interface ICancelSpotOrderByClientOrderIdSocket : ICancelSpotOrderByClientOrderId, ISharedSocket + { + /// + /// Cancel a spot order using client order id, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> CancelSpotOrderByClientOrderIdAsync(CancelOrderRequest request, CancellationToken ct = default); + } +} diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/ICancelSpotOrderByClientOrderIdRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/ICancelSpotOrderByClientOrderIdRest.cs deleted file mode 100644 index 35c3889d..00000000 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/ICancelSpotOrderByClientOrderIdRest.cs +++ /dev/null @@ -1,28 +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 -{ - /// - /// Request definition for canceling a spot order by client order id on an exchange. - /// - public interface ICancelSpotOrderByClientOrderIdRest : ISharedRest - { - /// - /// 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/V2/Orders/Spot/ICancelSpotOrderRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/ICancelSpotOrderRest.cs deleted file mode 100644 index b7b93bbd..00000000 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/ICancelSpotOrderRest.cs +++ /dev/null @@ -1,28 +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 -{ - /// - /// Request definition for canceling a spot order on an exchange. - /// - public interface ICancelSpotOrderRest : ISharedRest - { - /// - /// 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/V2/Orders/Spot/ICancelSpotOrderSocket.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/ICancelSpotOrderSocket.cs deleted file mode 100644 index 1887f65f..00000000 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/ICancelSpotOrderSocket.cs +++ /dev/null @@ -1,26 +0,0 @@ -using CryptoExchange.Net.Objects; -using System.Threading; -using System.Threading.Tasks; - -namespace CryptoExchange.Net.SharedApis -{ - /// - /// Client for placing and managing spot orders - /// - public interface ICancelSpotOrderSocket : ISharedSocket - { - /// - /// 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. - ///
- CancelSpotOrderSocketOptions 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/V2/Orders/Spot/IGetClosedSpotOrdersRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetClosedSpotOrders.cs similarity index 54% rename from CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetClosedSpotOrdersRest.cs rename to CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetClosedSpotOrders.cs index f78de9df..78718be0 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetClosedSpotOrdersRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetClosedSpotOrders.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for retrieving closed spot orders from an exchange. /// - public interface IGetClosedSpotOrdersRest : ISharedRest + public interface IGetClosedSpotOrders : ISharedApiCapability { /// /// Spot get closed orders request options.
@@ -25,6 +25,21 @@ namespace CryptoExchange.Net.SharedApis /// Request info /// The pagination request from the previous request result property to continue pagination /// Cancellation token - Task> GetClosedSpotOrdersAsync(GetClosedOrdersRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + Task> GetClosedSpotOrdersAsync(GetClosedOrdersRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + } + + /// + /// Request definition for retrieving closed spot orders from an exchange. + /// + public interface IGetClosedSpotOrdersRest : IGetClosedSpotOrders, ISharedRest + { + /// + /// 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 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 + new Task> GetClosedSpotOrdersAsync(GetClosedOrdersRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetOpenSpotOrdersRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetOpenSpotOrders.cs similarity index 58% rename from CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetOpenSpotOrdersRest.cs rename to CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetOpenSpotOrders.cs index d8d35d32..c5edf64d 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetOpenSpotOrdersRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetOpenSpotOrders.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for retrieving open spot order from an exchange. /// - public interface IGetOpenSpotOrdersRest : ISharedRest + public interface IGetOpenSpotOrders : ISharedApiCapability { /// /// Spot get open orders request options.
@@ -23,6 +23,19 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> GetOpenSpotOrdersAsync(GetOpenOrdersRequest request, CancellationToken ct = default); + Task> GetOpenSpotOrdersAsync(GetOpenOrdersRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for retrieving open spot order from an exchange. + /// + public interface IGetOpenSpotOrdersRest : IGetOpenSpotOrders, ISharedRest + { + /// + /// Get info on a open spot orders, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> GetOpenSpotOrdersAsync(GetOpenOrdersRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetSpotOrderRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetSpotOrder.cs similarity index 59% rename from CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetSpotOrderRest.cs rename to CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetSpotOrder.cs index 774e9891..07ed3281 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetSpotOrderRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetSpotOrder.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for retrieving a spot order from an exchange. /// - public interface IGetSpotOrderRest : ISharedRest + public interface IGetSpotOrder : ISharedApiCapability { /// /// Spot get order request options.
@@ -23,6 +23,19 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> GetSpotOrderAsync(GetOrderRequest request, CancellationToken ct = default); + Task> GetSpotOrderAsync(GetOrderRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for retrieving a spot order from an exchange. + /// + public interface IGetSpotOrderRest : IGetSpotOrder, ISharedRest + { + /// + /// Get info on a specific spot order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> GetSpotOrderAsync(GetOrderRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetSpotOrderByClientOrderIdRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetSpotOrderByClientOrderId.cs similarity index 57% rename from CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetSpotOrderByClientOrderIdRest.cs rename to CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetSpotOrderByClientOrderId.cs index e53cf0bd..83163c9c 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetSpotOrderByClientOrderIdRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IGetSpotOrderByClientOrderId.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for retrieving a spot order by client order id from an exchange. /// - public interface IGetSpotOrderByClientOrderIdRest : ISharedRest + public interface IGetSpotOrderByClientOrderId : ISharedApiCapability { /// /// Spot get order by client order id request options.
@@ -24,7 +24,21 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> GetSpotOrderByClientOrderIdAsync(GetOrderRequest request, CancellationToken ct = default); + Task> GetSpotOrderByClientOrderIdAsync(GetOrderRequest request, CancellationToken ct = default); + + } + + /// + /// Request definition for retrieving a spot order by client order id from an exchange. + /// + public interface IGetSpotOrderByClientOrderIdRest : IGetSpotOrderByClientOrderId, ISharedRest + { + /// + /// 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 + new Task> GetSpotOrderByClientOrderIdAsync(GetOrderRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IPlaceSpotOrder.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IPlaceSpotOrder.cs index 0c1aaccd..4dad8aaf 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IPlaceSpotOrder.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IPlaceSpotOrder.cs @@ -47,4 +47,30 @@ namespace CryptoExchange.Net.SharedApis PlaceSpotOrderRequest request, CancellationToken ct = default); } + + /// + /// Request definition for placing a spot order on an exchange. + /// + public interface IPlaceSpotOrderRest : IPlaceSpotOrder, ISharedRest + { + /// + /// Place a new spot order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> PlaceSpotOrderAsync(PlaceSpotOrderRequest request, CancellationToken ct = default); + } + + /// + /// Client for placing and managing spot orders + /// + public interface IPlaceSpotOrderSocket : IPlaceSpotOrder, ISharedSocket + { + /// + /// Place a new spot order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> PlaceSpotOrderAsync(PlaceSpotOrderRequest request, CancellationToken ct = default); + } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IPlaceSpotOrderRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IPlaceSpotOrderRest.cs deleted file mode 100644 index f10f7071..00000000 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IPlaceSpotOrderRest.cs +++ /dev/null @@ -1,22 +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 -{ - /// - /// Request definition for placing a spot order on an exchange. - /// - public interface IPlaceSpotOrderRest : IPlaceSpotOrder, ISharedRest - { - /// - /// Place a new spot order, see for request options and exchange specific required/optional parameters.
- ///
- /// Request info - /// Cancellation token - new Task> PlaceSpotOrderAsync(PlaceSpotOrderRequest request, CancellationToken ct = default); - } -} diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IPlaceSpotOrderSocket.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IPlaceSpotOrderSocket.cs deleted file mode 100644 index b81cd981..00000000 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Orders/Spot/IPlaceSpotOrderSocket.cs +++ /dev/null @@ -1,19 +0,0 @@ -using CryptoExchange.Net.Objects; -using System.Threading; -using System.Threading.Tasks; - -namespace CryptoExchange.Net.SharedApis -{ - /// - /// Client for placing and managing spot orders - /// - public interface IPlaceSpotOrderSocket : IPlaceSpotOrder, ISharedSocket - { - /// - /// Place a new spot order, see for request options and exchange specific required/optional parameters.
- ///
- /// Request info - /// Cancellation token - new Task> PlaceSpotOrderAsync(PlaceSpotOrderRequest request, CancellationToken ct = default); - } -} diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/PositionMode/IGetPositionModeRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/PositionMode/IGetPositionModeRest.cs index 341222db..a6afb6ba 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/PositionMode/IGetPositionModeRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/PositionMode/IGetPositionModeRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request defintion for getting the current user position mode setting on an exchange. /// - public interface IGetPositionModeRest : ISharedRest + public interface IGetPositionMode : ISharedApiCapability { /// /// Position mode request options.
@@ -23,6 +23,19 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> GetPositionModeAsync(GetPositionModeRequest request, CancellationToken ct = default); + Task> GetPositionModeAsync(GetPositionModeRequest request, CancellationToken ct = default); + } + + /// + /// Request defintion for getting the current user position mode setting on an exchange. + /// + public interface IGetPositionModeRest : IGetPositionMode, ISharedRest + { + /// + /// Get the current position mode setting, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> GetPositionModeAsync(GetPositionModeRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/PositionMode/ISetPositionModeRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/PositionMode/ISetPositionModeRest.cs index 3cf536c3..3c3234cb 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/PositionMode/ISetPositionModeRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/PositionMode/ISetPositionModeRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Endpoint definition for setting the user position mode on an exchange. /// - public interface ISetPositionModeRest : ISharedRest + public interface ISetPositionMode : ISharedApiCapability { /// /// How the exchange handles setting the position mode @@ -28,6 +28,19 @@ namespace CryptoExchange.Net.SharedApis /// /// Request info /// Cancellation token - Task> SetPositionModeAsync(SetPositionModeRequest request, CancellationToken ct = default); + Task> SetPositionModeAsync(SetPositionModeRequest request, CancellationToken ct = default); + } + + /// + /// Endpoint definition for setting the user position mode on an exchange. + /// + public interface ISetPositionModeRest : ISetPositionMode, ISharedRest + { + /// + /// Set the position mode to a new value, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> SetPositionModeAsync(SetPositionModeRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Positions/IClosePositionRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Positions/IClosePositionRest.cs index 7c1194bc..c0831c91 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Positions/IClosePositionRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Positions/IClosePositionRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for closing a position on an exchange. /// - public interface IClosePositionRest : ISharedRest + public interface IClosePosition : ISharedApiCapability { /// /// Close position order request options.
@@ -24,6 +24,20 @@ namespace CryptoExchange.Net.SharedApis /// Request info /// Cancellation token /// - Task> ClosePositionAsync(ClosePositionRequest request, CancellationToken ct = default); + Task> ClosePositionAsync(ClosePositionRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for closing a position on an exchange. + /// + public interface IClosePositionRest : IClosePosition, ISharedRest + { + /// + /// Close a currently open position, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + /// + new Task> ClosePositionAsync(ClosePositionRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Positions/IGetPositionHistoryRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Positions/IGetPositionHistoryRest.cs index b57fd356..04221f44 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Positions/IGetPositionHistoryRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Positions/IGetPositionHistoryRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for retrieving position history from an exchange. /// - public interface IGetPositionHistoryRest : ISharedRest + public interface IGetPositionHistory : ISharedApiCapability { /// /// Position history request options.
@@ -25,6 +25,21 @@ namespace CryptoExchange.Net.SharedApis /// Request info /// The pagination request from the previous request result property to continue pagination /// Cancellation token - Task> GetPositionHistoryAsync(GetPositionHistoryRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + Task> GetPositionHistoryAsync(GetPositionHistoryRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + } + + /// + /// Request definition for retrieving position history from an exchange. + /// + public interface IGetPositionHistoryRest : IGetPositionHistory, ISharedRest + { + /// + /// 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 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 + new Task> GetPositionHistoryAsync(GetPositionHistoryRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Positions/IGetPositionsRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Positions/IGetPositionsRest.cs index fdebf9ae..58270b41 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Positions/IGetPositionsRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Positions/IGetPositionsRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for retrieving open positions from an exchange. /// - public interface IGetPositionsRest : ISharedRest + public interface IGetPositions : ISharedApiCapability { /// /// Positions request options.
@@ -23,6 +23,19 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> GetPositionsAsync(GetPositionsRequest request, CancellationToken ct = default); + Task> GetPositionsAsync(GetPositionsRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for retrieving open positions from an exchange. + /// + public interface IGetPositionsRest : IGetPositions, ISharedRest + { + /// + /// Get open position info, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> GetPositionsAsync(GetPositionsRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Symbols/Futures/IGetFuturesSymbolsRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Symbols/Futures/IGetFuturesSymbolsRest.cs index c199a566..9be32a2f 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Symbols/Futures/IGetFuturesSymbolsRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Symbols/Futures/IGetFuturesSymbolsRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for getting futures symbols from an exchange /// - public interface IGetFuturesSymbolsRest : ISharedRest + public interface IGetFuturesSymbols : ISharedApiCapability { /// /// Get the futures symbol catalog. Only available if has been called previously. @@ -47,6 +47,19 @@ namespace CryptoExchange.Net.SharedApis /// /// Request info /// Cancellation token - Task> GetFuturesSymbolsAsync(GetSymbolsRequest request, CancellationToken ct = default); + Task> GetFuturesSymbolsAsync(GetSymbolsRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for getting futures symbols from an exchange + /// + public interface IGetFuturesSymbolsRest : IGetFuturesSymbols, ISharedRest + { + /// + /// Get info on all futures symbols supported on the exchange, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> GetFuturesSymbolsAsync(GetSymbolsRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Symbols/Spot/IGetSpotSymbolsRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Symbols/Spot/IGetSpotSymbolsRest.cs index 0697c17a..c528d590 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Symbols/Spot/IGetSpotSymbolsRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Symbols/Spot/IGetSpotSymbolsRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for retrieving spot symbols from an exchange. /// - public interface IGetSpotSymbolsRest : ISharedRest + public interface IGetSpotSymbols: ISharedApiCapability { /// /// Get the spot symbol catalog. Only available if has been called previously. @@ -47,6 +47,20 @@ namespace CryptoExchange.Net.SharedApis /// /// Request info /// Cancellation token - Task> GetSpotSymbolsAsync(GetSymbolsRequest request, CancellationToken ct = default); + Task> GetSpotSymbolsAsync(GetSymbolsRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for retrieving spot symbols from an exchange. + /// + public interface IGetSpotSymbolsRest : IGetSpotSymbols, ISharedRest + { + + /// + /// Get info on all available spot symbols on the exchange, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> GetSpotSymbolsAsync(GetSymbolsRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Tickers/Futures/IGetAllFuturesTickersRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Tickers/Futures/IGetAllFuturesTickersRest.cs index de446892..00b3070d 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Tickers/Futures/IGetAllFuturesTickersRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Tickers/Futures/IGetAllFuturesTickersRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for retrieving all futures tickers from an exchange. /// - public interface IGetAllFuturesTickersRest : ISharedRest + public interface IGetAllFuturesTickers : ISharedApiCapability { /// /// Futures get tickers request options.
@@ -23,6 +23,19 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> GetAllFuturesTickersAsync(GetTickersRequest request, CancellationToken ct = default); + Task> GetAllFuturesTickersAsync(GetTickersRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for retrieving all futures tickers from an exchange. + /// + public interface IGetAllFuturesTickersRest : IGetAllFuturesTickers + { + /// + /// Get ticker info for all futures symbols, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> GetAllFuturesTickersAsync(GetTickersRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Tickers/Futures/IGetFuturesTickerRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Tickers/Futures/IGetFuturesTickerRest.cs index c4a6f218..d5c5057b 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Tickers/Futures/IGetFuturesTickerRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Tickers/Futures/IGetFuturesTickerRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for retrieving a futures ticker from an exchange. /// - public interface IGetFuturesTickerRest : ISharedRest + public interface IGetFuturesTicker : ISharedApiCapability { /// /// Futures get ticker request options.
@@ -23,6 +23,19 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> GetFuturesTickerAsync(GetTickerRequest request, CancellationToken ct = default); + Task> GetFuturesTickerAsync(GetTickerRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for retrieving a futures ticker from an exchange. + /// + public interface IGetFuturesTickerRest : IGetFuturesTicker, ISharedRest + { + /// + /// Get ticker info for a specific futures symbol, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> GetFuturesTickerAsync(GetTickerRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Tickers/Spot/IGetAllSpotTickersRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Tickers/Spot/IGetAllSpotTickersRest.cs index 403310e6..a020cebe 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Tickers/Spot/IGetAllSpotTickersRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Tickers/Spot/IGetAllSpotTickersRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for retrieving all spot tickers from an exchange. /// - public interface IGetAllSpotTickersRest : ISharedRest + public interface IGetAllSpotTickers : ISharedApiCapability { /// /// Spot tickers request options.
@@ -23,6 +23,19 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> GetAllSpotTickersAsync(GetTickersRequest request, CancellationToken ct = default); + Task> GetAllSpotTickersAsync(GetTickersRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for retrieving all spot tickers from an exchange. + /// + public interface IGetAllSpotTickersRest : IGetAllSpotTickers, ISharedRest + { + /// + /// Get tickers for all spot symbols, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> GetAllSpotTickersAsync(GetTickersRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Tickers/Spot/IGetSpotTickerRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Tickers/Spot/IGetSpotTickerRest.cs index bdc04c71..f01ab517 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Tickers/Spot/IGetSpotTickerRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Tickers/Spot/IGetSpotTickerRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for getting spot ticker info from an exchange. /// - public interface IGetSpotTickerRest : ISharedRest + public interface IGetSpotTicker : ISharedApiCapability { /// /// Spot ticker request options.
@@ -23,6 +23,19 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> GetSpotTickerAsync(GetTickerRequest request, CancellationToken ct = default); + Task> GetSpotTickerAsync(GetTickerRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for getting spot ticker info from an exchange. + /// + public interface IGetSpotTickerRest : IGetSpotTicker, ISharedRest + { + /// + /// Get ticker for a specific spot symbol, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> GetSpotTickerAsync(GetTickerRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/TpSl/ICancelFuturesTpSlRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/TpSl/ICancelFuturesTpSlRest.cs index a8ed6da8..45074d64 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/TpSl/ICancelFuturesTpSlRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/TpSl/ICancelFuturesTpSlRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for canceling a take profit and/or stop loss for an open position on an exchange. /// - public interface ICancelFuturesTpSlRest : ISharedRest + public interface ICancelFuturesTpSl : ISharedApiCapability { /// /// Cancel a take profit and/or stop loss options.
@@ -24,6 +24,20 @@ namespace CryptoExchange.Net.SharedApis /// Request info /// Cancellation token /// - Task> CancelFuturesTpSlAsync(CancelTpSlRequest request, CancellationToken ct = default); + Task> CancelFuturesTpSlAsync(CancelTpSlRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for canceling a take profit and/or stop loss for an open position on an exchange. + /// + public interface ICancelFuturesTpSlRest : ICancelFuturesTpSl, ISharedRest + { + /// + /// 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 + /// + new Task> CancelFuturesTpSlAsync(CancelTpSlRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/TpSl/ISetFuturesTpSlRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/TpSl/ISetFuturesTpSlRest.cs index 76d758fe..ce9bfa8f 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/TpSl/ISetFuturesTpSlRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/TpSl/ISetFuturesTpSlRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for setting take profit and/or stop loss for an open position on an exchange. /// - public interface ISetFuturesTpSlRest : ISharedRest + public interface ISetFuturesTpSl : ISharedApiCapability { /// /// Set take profit and/or stop loss options.
@@ -24,6 +24,20 @@ namespace CryptoExchange.Net.SharedApis /// Request info /// Cancellation token /// - Task> SetFuturesTpSlAsync(SetTpSlRequest request, CancellationToken ct = default); + Task> SetFuturesTpSlAsync(SetTpSlRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for setting take profit and/or stop loss for an open position on an exchange. + /// + public interface ISetFuturesTpSlRest : ISetFuturesTpSl, ISharedRest + { + /// + /// 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 + /// + new Task> SetFuturesTpSlAsync(SetTpSlRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Trades/IGetRecentTradesRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Trades/IGetRecentTradesRest.cs index 19c9b6ec..1108a453 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Trades/IGetRecentTradesRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Trades/IGetRecentTradesRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for retrieving recent trades for a symbol on an exchange. /// - public interface IGetRecentTradesRest : ISharedRest + public interface IGetRecentTrades : ISharedApiCapability { /// /// Recent trades request options.
@@ -25,6 +25,21 @@ namespace CryptoExchange.Net.SharedApis /// Request info /// Cancellation token /// - Task> GetRecentTradesAsync(GetRecentTradesRequest request, CancellationToken ct = default); + Task> GetRecentTradesAsync(GetRecentTradesRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for retrieving recent trades for a symbol on an exchange. + /// + public interface IGetRecentTradesRest : IGetRecentTrades, ISharedRest + { + + /// + /// Get the most recent public trades, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + /// + new Task> GetRecentTradesAsync(GetRecentTradesRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Trades/IGetTradeHistoryRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Trades/IGetTradeHistoryRest.cs index 19ba18a5..a8013b8e 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Trades/IGetTradeHistoryRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Trades/IGetTradeHistoryRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for retrieving trade history from an exchange. /// - public interface IGetTradeHistoryRest : ISharedRest + public interface IGetTradeHistory : ISharedApiCapability { /// /// Trade history request options.
@@ -27,6 +27,23 @@ namespace CryptoExchange.Net.SharedApis /// The pagination request from the previous request result property to continue pagination /// Cancellation token /// - Task> GetTradeHistoryAsync(GetTradeHistoryRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + Task> GetTradeHistoryAsync(GetTradeHistoryRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + } + + /// + /// Request definition for retrieving trade history from an exchange. + /// + public interface IGetTradeHistoryRest : ISharedRest + { + + /// + /// 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 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 + /// + new Task> GetTradeHistoryAsync(GetTradeHistoryRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Transfers/ITransferRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Transfers/ITransferRest.cs index fa0e62a2..08e4ab1f 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Transfers/ITransferRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Transfers/ITransferRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for transferring funds between account types on an exchange. /// - public interface ITransferRest : ISharedRest + public interface ITransfer : ISharedApiCapability { /// /// Transfer request options.
@@ -24,6 +24,19 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> TransferAsync(TransferRequest request, CancellationToken ct = default); + Task> TransferAsync(TransferRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for transferring funds between account types on an exchange. + /// + public interface ITransferRest : ITransfer, ISharedRest + { + /// + /// Transfer funds between account types, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> TransferAsync(TransferRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Futures/ICancelFuturesTriggerOrderRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Futures/ICancelFuturesTriggerOrderRest.cs index a7c5b70e..887bf041 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Futures/ICancelFuturesTriggerOrderRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Futures/ICancelFuturesTriggerOrderRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for canceling a futures trigger order on an exchange. /// - public interface ICancelFuturesTriggerOrderRest : ISharedRest + public interface ICancelFuturesTriggerOrder : ISharedApiCapability { /// /// Cancel trigger order request options.
@@ -23,6 +23,19 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> CancelFuturesTriggerOrderAsync(CancelOrderRequest request, CancellationToken ct = default); + Task> CancelFuturesTriggerOrderAsync(CancelOrderRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for canceling a futures trigger order on an exchange. + /// + public interface ICancelFuturesTriggerOrderRest : ICancelFuturesTriggerOrder, ISharedRest + { + /// + /// Cancel a trigger order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> CancelFuturesTriggerOrderAsync(CancelOrderRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Futures/IGetFuturesTriggerOrderRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Futures/IGetFuturesTriggerOrderRest.cs index 24f2dd93..c3cc734e 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Futures/IGetFuturesTriggerOrderRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Futures/IGetFuturesTriggerOrderRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for getting a specific futures trigger order from the exchange. /// - public interface IGetFuturesTriggerOrderRest : ISharedRest + public interface IGetFuturesTriggerOrder : ISharedApiCapability { /// /// Get trigger order request options.
@@ -23,6 +23,19 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> GetFuturesTriggerOrderAsync(GetOrderRequest request, CancellationToken ct = default); + Task> GetFuturesTriggerOrderAsync(GetOrderRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for getting a specific futures trigger order from the exchange. + /// + public interface IGetFuturesTriggerOrderRest : IGetFuturesTriggerOrder, ISharedRest + { + /// + /// Get info on a specific trigger order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> GetFuturesTriggerOrderAsync(GetOrderRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Futures/IPlaceFuturesTriggerOrderRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Futures/IPlaceFuturesTriggerOrderRest.cs index 740436f5..164d6169 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Futures/IPlaceFuturesTriggerOrderRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Futures/IPlaceFuturesTriggerOrderRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for placing a futures trigger order on an exchange. /// - public interface IPlaceFuturesTriggerOrderRest : ISharedRest + public interface IPlaceFuturesTriggerOrder : ISharedApiCapability { /// /// Place futures trigger order options.
@@ -25,6 +25,20 @@ namespace CryptoExchange.Net.SharedApis /// Request info /// Cancellation token /// - Task> PlaceFuturesTriggerOrderAsync(PlaceFuturesTriggerOrderRequest request, CancellationToken ct = default); + Task> PlaceFuturesTriggerOrderAsync(PlaceFuturesTriggerOrderRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for placing a futures trigger order on an exchange. + /// + public interface IPlaceFuturesTriggerOrderRest : IPlaceFuturesTriggerOrder, ISharedRest + { + /// + /// Place a new trigger order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + /// + new Task> PlaceFuturesTriggerOrderAsync(PlaceFuturesTriggerOrderRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Spot/ICancelSpotTriggerOrderRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Spot/ICancelSpotTriggerOrderRest.cs index 6aa4ec06..4fa79fcd 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Spot/ICancelSpotTriggerOrderRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Spot/ICancelSpotTriggerOrderRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for canceling a spot trigger order on an exchange /// - public interface ICancelSpotTriggerOrderRest : ISharedRest + public interface ICancelSpotTriggerOrder : ISharedApiCapability { /// /// Cancel trigger order request options.
@@ -23,6 +23,19 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> CancelSpotTriggerOrderAsync(CancelOrderRequest request, CancellationToken ct = default); + Task> CancelSpotTriggerOrderAsync(CancelOrderRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for canceling a spot trigger order on an exchange + /// + public interface ICancelSpotTriggerOrderRest : ICancelSpotTriggerOrder, ISharedRest + { + /// + /// Cancel a trigger order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> CancelSpotTriggerOrderAsync(CancelOrderRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Spot/IGetSpotTriggerOrderRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Spot/IGetSpotTriggerOrderRest.cs index 6aef48c0..d4873341 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Spot/IGetSpotTriggerOrderRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Spot/IGetSpotTriggerOrderRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for getting a specific spot trigger order on an exchange /// - public interface IGetSpotTriggerOrderRest : ISharedRest + public interface IGetSpotTriggerOrder : ISharedApiCapability { /// /// Get trigger order request options.
@@ -23,6 +23,19 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> GetSpotTriggerOrderAsync(GetOrderRequest request, CancellationToken ct = default); + Task> GetSpotTriggerOrderAsync(GetOrderRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for getting a specific spot trigger order on an exchange + /// + public interface IGetSpotTriggerOrderRest : IGetSpotTriggerOrder, ISharedRest + { + /// + /// Get info on a specific trigger order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> GetSpotTriggerOrderAsync(GetOrderRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Spot/IPlaceSpotTriggerOrderRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Spot/IPlaceSpotTriggerOrderRest.cs index 1b0e16c5..c3636305 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Spot/IPlaceSpotTriggerOrderRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/TriggerOrders/Spot/IPlaceSpotTriggerOrderRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for placing a spot trigger order on an exchange. /// - public interface IPlaceSpotTriggerOrderRest : ISharedRest + public interface IPlaceSpotTriggerOrder : ISharedApiCapability { /// /// Place spot trigger order options.
@@ -25,7 +25,22 @@ namespace CryptoExchange.Net.SharedApis /// Request info /// Cancellation token /// - Task> PlaceSpotTriggerOrderAsync(PlaceSpotTriggerOrderRequest request, CancellationToken ct = default); + Task> PlaceSpotTriggerOrderAsync(PlaceSpotTriggerOrderRequest request, CancellationToken ct = default); + + } + + /// + /// Request definition for placing a spot trigger order on an exchange. + /// + public interface IPlaceSpotTriggerOrderRest : IPlaceSpotTriggerOrder, ISharedRest + { + /// + /// Place a new trigger order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + /// + new Task> PlaceSpotTriggerOrderAsync(PlaceSpotTriggerOrderRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/UserTrades/Futures/IGetFuturesOrderTradesRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/UserTrades/Futures/IGetFuturesOrderTradesRest.cs index ae0952e4..400f14e9 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/UserTrades/Futures/IGetFuturesOrderTradesRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/UserTrades/Futures/IGetFuturesOrderTradesRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for getting trades for a specific futures order on an exchange. /// - public interface IGetFuturesOrderTradesRest : ISharedRest + public interface IGetFuturesOrderTrades : ISharedApiCapability { /// /// Futures get order trades request options.
@@ -23,6 +23,19 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> GetFuturesOrderTradesAsync(GetOrderTradesRequest request, CancellationToken ct = default); + Task> GetFuturesOrderTradesAsync(GetOrderTradesRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for getting trades for a specific futures order on an exchange. + /// + public interface IGetFuturesOrderTradesRest : IGetFuturesOrderTrades, ISharedRest + { + /// + /// Get trades for a specific futures order, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + new Task> GetFuturesOrderTradesAsync(GetOrderTradesRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/UserTrades/Futures/IGetFuturesUserTradeHistoryRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/UserTrades/Futures/IGetFuturesUserTradeHistoryRest.cs index 0c2ad0d8..5c5abc1a 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/UserTrades/Futures/IGetFuturesUserTradeHistoryRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/UserTrades/Futures/IGetFuturesUserTradeHistoryRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for retrieving futures user trade history from an exchange. /// - public interface IGetFuturesUserTradeHistoryRest : ISharedRest + public interface IGetFuturesUserTradeHistory : ISharedApiCapability { /// /// Futures user trades request options.
@@ -25,6 +25,21 @@ namespace CryptoExchange.Net.SharedApis /// Request info /// The pagination request from the previous request result property to continue pagination /// Cancellation token - Task> GetFuturesUserTradeHistoryAsync(GetUserTradesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + Task> GetFuturesUserTradeHistoryAsync(GetUserTradesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + } + + /// + /// Request definition for retrieving futures user trade history from an exchange. + /// + public interface IGetFuturesUserTradeHistoryRest : IGetFuturesUserTradeHistory, ISharedRest + { + /// + /// 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 + new Task> GetFuturesUserTradeHistoryAsync(GetUserTradesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/UserTrades/Spot/IGetSpotOrderTradesRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/UserTrades/Spot/IGetSpotOrderTradesRest.cs index 653c5efb..c0318007 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/UserTrades/Spot/IGetSpotOrderTradesRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/UserTrades/Spot/IGetSpotOrderTradesRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for getting trades for a specific spot order on an exchange. /// - public interface IGetSpotOrderTradesRest : ISharedRest + public interface IGetSpotOrderTrades : ISharedApiCapability { /// /// Spot get order trades request options.
@@ -24,7 +24,22 @@ namespace CryptoExchange.Net.SharedApis ///
/// Request info /// Cancellation token - Task> GetSpotOrderTradesAsync(GetOrderTradesRequest request, CancellationToken ct = default); + Task> GetSpotOrderTradesAsync(GetOrderTradesRequest request, CancellationToken ct = default); + + } + + /// + /// Request definition for getting trades for a specific spot order on an exchange. + /// + public interface IGetSpotOrderTradesRest : IGetSpotOrderTrades, ISharedRest + { + /// + /// 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 + new Task> GetSpotOrderTradesAsync(GetOrderTradesRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/UserTrades/Spot/IGetSpotUserTradeHistoryRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/UserTrades/Spot/IGetSpotUserTradeHistoryRest.cs index 5e21f6a4..d16aad29 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/UserTrades/Spot/IGetSpotUserTradeHistoryRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/UserTrades/Spot/IGetSpotUserTradeHistoryRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for getting spot user trade history from an exchange /// - public interface IGetSpotUserTradeHistoryRest : ISharedRest + public interface IGetSpotUserTradeHistory : ISharedApiCapability { /// /// Spot user trades request options.
@@ -25,6 +25,22 @@ namespace CryptoExchange.Net.SharedApis /// Request info /// The pagination request from the previous request result property to continue pagination /// Cancellation token - Task> GetSpotUserTradeHistoryAsync(GetUserTradesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + Task> GetSpotUserTradeHistoryAsync(GetUserTradesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + } + + + /// + /// Request definition for getting spot user trade history from an exchange + /// + public interface IGetSpotUserTradeHistoryRest : IGetSpotUserTradeHistory, ISharedRest + { + /// + /// 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 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 + new Task> GetSpotUserTradeHistoryAsync(GetUserTradesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Withdrawals/IGetWithdrawalHistoryRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Withdrawals/IGetWithdrawalHistoryRest.cs index a59edaf8..036f90e7 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Withdrawals/IGetWithdrawalHistoryRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Withdrawals/IGetWithdrawalHistoryRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for retrieving withdrawal history from an exchange /// - public interface IGetWithdrawalHistoryRest : ISharedRest + public interface IGetWithdrawalHistory : ISharedApiCapability { /// /// Withdrawal records request options.
@@ -27,6 +27,23 @@ namespace CryptoExchange.Net.SharedApis /// The pagination request from the previous request result property to continue pagination /// Cancellation token /// - Task> GetWithdrawalHistoryAsync(GetWithdrawalsRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + Task> GetWithdrawalHistoryAsync(GetWithdrawalsRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); + } + + /// + /// Request definition for retrieving withdrawal history from an exchange + /// + public interface IGetWithdrawalHistoryRest : IGetWithdrawalHistory, ISharedRest + { + + /// + /// 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 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 + /// + new Task> GetWithdrawalHistoryAsync(GetWithdrawalsRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Interfaces/V2/Withdrawals/IWithdrawRest.cs b/CryptoExchange.Net/SharedApis/Interfaces/V2/Withdrawals/IWithdrawRest.cs index dd5acc83..f899265b 100644 --- a/CryptoExchange.Net/SharedApis/Interfaces/V2/Withdrawals/IWithdrawRest.cs +++ b/CryptoExchange.Net/SharedApis/Interfaces/V2/Withdrawals/IWithdrawRest.cs @@ -10,7 +10,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Request definition for withdrawing a specific asset from an exchange. /// - public interface IWithdrawRest : ISharedRest + public interface IWithdraw : ISharedApiCapability { /// /// Withdraw request options.
@@ -25,6 +25,21 @@ namespace CryptoExchange.Net.SharedApis /// Request info /// Cancellation token /// - Task> WithdrawAsync(WithdrawRequest request, CancellationToken ct = default); + Task> WithdrawAsync(WithdrawRequest request, CancellationToken ct = default); + } + + /// + /// Request definition for withdrawing a specific asset from an exchange. + /// + public interface IWithdrawRest : IWithdraw, ISharedRest + { + + /// + /// Request a withdrawal, see for request options and exchange specific required/optional parameters.
+ ///
+ /// Request info + /// Cancellation token + /// + new Task> WithdrawAsync(WithdrawRequest request, CancellationToken ct = default); } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelFuturesOrderOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelFuturesOrderOptions.cs index 326d1f2f..4a05a677 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 : CapabilityOptions + public class CancelFuturesOrderOptions : CapabilityOptions { /// 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(ICancelFuturesOrderRest.CancelFuturesOrderAsync)) + public CancelFuturesOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesOrder.CancelFuturesOrderAsync)) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelSpotOrderOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/CancelSpotOrderOptions.cs index e5df6306..3da8d199 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 : CapabilityOptions + public class CancelSpotOrderOptions : CapabilityOptions { /// 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(ICancelSpotOrderRest.CancelSpotOrderAsync)) + public CancelSpotOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelSpotOrder.CancelSpotOrderAsync)) { } /// - public override Error? ValidateRequest(CancelOrderRequest request, ICancelSpotOrderRest client) + public override Error? ValidateRequest(CancelOrderRequest request, ICancelSpotOrder 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/PlaceFuturesOrderOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Endpoints/PlaceFuturesOrderOptions.cs index 2b0553be..1bf5b699 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 : CapabilityOptions + public class PlaceFuturesOrderOptions : CapabilityOptions { /// 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(IPlaceFuturesOrderRest.PlaceFuturesOrderAsync)) + public PlaceFuturesOrderOptions(string exchange, bool supportsTpSl) : base(exchange, true, nameof(IPlaceFuturesOrder.PlaceFuturesOrderAsync)) { SupportsTpSl = supportsTpSl; } @@ -30,7 +30,7 @@ namespace CryptoExchange.Net.SharedApis ///
public override Error? ValidateRequest( PlaceFuturesOrderRequest request, - IPlaceFuturesOrderRest client + IPlaceFuturesOrder client ) { if (!SupportsTpSl && (request.StopLossPrice != null || request.TakeProfitPrice != null)) diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Operations/CancelFuturesOrderSocketOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Operations/CancelFuturesOrderSocketOptions.cs index 39a45a7e..5a28f3d0 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Operations/CancelFuturesOrderSocketOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Operations/CancelFuturesOrderSocketOptions.cs @@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for canceling a futures order /// - public class CancelFuturesOrderSocketOptions : CapabilityOptions + public class CancelFuturesOrderSocketOptions : CancelFuturesOrderOptions { /// public override string Description => "Cancel a futures order over a socket connection"; @@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public CancelFuturesOrderSocketOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesOrderSocket.CancelFuturesOrderAsync)) + public CancelFuturesOrderSocketOptions(string exchange, bool authenticated) : base(exchange, authenticated) { } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Operations/CancelSpotOrderSocketOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Operations/CancelSpotOrderSocketOptions.cs index 2e625528..65a39145 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Operations/CancelSpotOrderSocketOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Operations/CancelSpotOrderSocketOptions.cs @@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for canceling a spot order /// - public class CancelSpotOrderSocketOptions : CapabilityOptions + public class CancelSpotOrderSocketOptions : CancelSpotOrderOptions { /// public override string Description => "Cancel a spot order over a socket connection"; @@ -16,17 +16,8 @@ namespace CryptoExchange.Net.SharedApis /// /// ctor /// - public CancelSpotOrderSocketOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelSpotOrderSocket.CancelSpotOrderAsync)) + public CancelSpotOrderSocketOptions(string exchange, bool authenticated) : base(exchange, authenticated) { } - - /// - public override Error? ValidateRequest(CancelOrderRequest request, ICancelSpotOrderSocket client) - { - if (request.Symbol!.TradingMode != TradingMode.Spot) - return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot"); - - return base.ValidateRequest(request, client); - } } } diff --git a/CryptoExchange.Net/SharedApis/Models/Options/Operations/PlaceFuturesOrderSocketOptions.cs b/CryptoExchange.Net/SharedApis/Models/Options/Operations/PlaceFuturesOrderSocketOptions.cs index 5483112e..d9ae66ed 100644 --- a/CryptoExchange.Net/SharedApis/Models/Options/Operations/PlaceFuturesOrderSocketOptions.cs +++ b/CryptoExchange.Net/SharedApis/Models/Options/Operations/PlaceFuturesOrderSocketOptions.cs @@ -7,49 +7,16 @@ namespace CryptoExchange.Net.SharedApis /// /// Options for placing a new futures order /// - public class PlaceFuturesOrderSocketOptions : CapabilityOptions + public class PlaceFuturesOrderSocketOptions : PlaceFuturesOrderOptions { /// public override string Description => "Place a new futures order over a socket connection"; - /// - /// Whether or not the API supports setting take profit / stop loss with the order - /// - public bool SupportsTpSl { get; set; } - /// /// ctor /// - public PlaceFuturesOrderSocketOptions(string exchange, bool supportsTpSl) : base(exchange, true, nameof(IPlaceFuturesOrderSocket.PlaceFuturesOrderAsync)) + public PlaceFuturesOrderSocketOptions(string exchange, bool supportsTpSl) : base(exchange, supportsTpSl) { - SupportsTpSl = supportsTpSl; - } - - /// - /// Validate a request - /// - public override Error? ValidateRequest( - PlaceFuturesOrderRequest request, - IPlaceFuturesOrderSocket client - ) - { - if (!SupportsTpSl && (request.StopLossPrice != null || request.TakeProfitPrice != null)) - return ArgumentError.Invalid(nameof(PlaceFuturesOrderRequest.StopLossPrice) + " / " + nameof(PlaceFuturesOrderRequest.TakeProfitPrice), "Tp/Sl parameters not supported"); - - if (request.OrderType == SharedOrderType.Other) - throw new ArgumentException("OrderType can't be `Other`", nameof(request.OrderType)); - - if (!client.FuturesSupportedOrderTypes.Contains(request.OrderType)) - return ArgumentError.Invalid(nameof(PlaceFuturesOrderRequest.OrderType), "Order type not supported"); - - if (request.TimeInForce != null && !client.FuturesSupportedTimeInForce.Contains(request.TimeInForce.Value)) - return ArgumentError.Invalid(nameof(PlaceFuturesOrderRequest.TimeInForce), "Order time in force not supported"); - - var quantityError = client.FuturesSupportedOrderQuantity.Validate(request.Side, request.OrderType, request.Quantity); - if (quantityError != null) - return quantityError; - - return base.ValidateRequest(request, client); } }