1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-10-13 22:51:39 +00:00
This commit is contained in:
Jkorf
2026-08-25 16:09:15 +02:00
parent 407509e9cd
commit d0ce2563de
155 changed files with 1714 additions and 621 deletions
+42 -4
View File
@@ -4,6 +4,7 @@ using CryptoExchange.Net.SharedApis;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.IO.Compression;
@@ -387,14 +388,14 @@ namespace CryptoExchange.Net
services.AddTransient(x => (ITradeHistoryRestClient)client(x)!);
if (typeof(IWithdrawalRestClient).IsAssignableFrom(typeof(T)))
services.AddTransient(x => (IWithdrawalRestClient)client(x)!);
if (typeof(IWithdrawRestClient).IsAssignableFrom(typeof(T)))
services.AddTransient(x => (IWithdrawRestClient)client(x)!);
if (typeof(IWithdrawEndpoint).IsAssignableFrom(typeof(T)))
services.AddTransient(x => (IWithdrawEndpoint)client(x)!);
if (typeof(IFeeRestClient).IsAssignableFrom(typeof(T)))
services.AddTransient(x => (IFeeRestClient)client(x)!);
if (typeof(IBookTickerRestClient).IsAssignableFrom(typeof(T)))
services.AddTransient(x => (IBookTickerRestClient)client(x)!);
if (typeof(ITransferRestClient).IsAssignableFrom(typeof(T)))
services.AddTransient(x => (ITransferRestClient)client(x)!);
if (typeof(ITransferEndpoint).IsAssignableFrom(typeof(T)))
services.AddTransient(x => (ITransferEndpoint)client(x)!);
if (typeof(ISpotOrderRestClient).IsAssignableFrom(typeof(T)))
services.AddTransient(x => (ISpotOrderRestClient)client(x)!);
@@ -474,6 +475,43 @@ namespace CryptoExchange.Net
return services;
}
/// <summary>
/// Register a strict Shared API aggregate and all endpoint capabilities
/// inherited by that aggregate.
/// </summary>
public static IServiceCollection RegisterSharedApi<
#if NET5_0_OR_GREATER
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)]
#endif
TSharedApi
>(
this IServiceCollection services,
Func<IServiceProvider, TSharedApi> factory)
where TSharedApi : class, ISharedClient
{
// Register the exchange-specific aggregate itself.
services.AddTransient(
typeof(TSharedApi),
serviceProvider => factory(serviceProvider));
var endpointInterfaces = typeof(TSharedApi)
.GetInterfaces()
.Where(x =>
x != typeof(ISharedApiEndpoint)
&& typeof(ISharedApiEndpoint).IsAssignableFrom(x))
.Distinct()
.ToArray();
foreach (var endpointInterface in endpointInterfaces)
{
services.AddTransient(
endpointInterface,
serviceProvider => factory(serviceProvider));
}
return services;
}
/// <summary>
/// Convert a hex encoded string to byte array
/// </summary>
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
namespace CryptoExchange.Net.SharedApis
{
@@ -22,6 +23,11 @@ namespace CryptoExchange.Net.SharedApis
/// </summary>
bool Authenticated { get; }
/// <summary>
/// Options for the endpoints exposed by this shared API.
/// </summary>
IReadOnlyCollection<EndpointOptions> EndpointOptions { get; }
/// <summary>
/// Get info on the client and supported features
/// </summary>
@@ -7,7 +7,21 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for request funding rate records
/// </summary>
public interface IFundingRateRestClient : IGetFundingRateHistoryRestClient
public interface IFundingRateRestClient : ISharedClient
{
/// <summary>
/// Funding rate request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetFundingRateHistoryOptions GetFundingRateHistoryOptions { get; }
/// <summary>
/// Get funding rate records, see <see cref="GetFundingRateHistoryOptions"/> for request options and exchange specific required/optional parameters. <br />
/// 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.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedFundingRate[]>> GetFundingRateHistoryAsync(GetFundingRateHistoryRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
}
}
@@ -7,9 +7,33 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for managing futures orders using a client order id
/// </summary>
public interface IFuturesOrderClientIdRestClient :
IGetFuturesOrderByClientOrderIdRestClient,
ICancelFuturesOrderByClientOrderIdRestClient
{
public interface IFuturesOrderClientIdRestClient : ISharedClient
{
/// <summary>
/// Futures get order by client order id request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetFuturesOrderByClientOrderIdOptions GetFuturesOrderByClientOrderIdOptions { get; }
/// <summary>
/// Get info on a specific futures order using a client order id, see <see cref="GetFuturesOrderByClientOrderIdOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedFuturesOrder>> GetFuturesOrderByClientOrderIdAsync(GetOrderRequest request, CancellationToken ct = default);
/// <summary>
/// Futures cancel order by client order id request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
CancelFuturesOrderByClientOrderIdOptions CancelFuturesOrderByClientOrderIdOptions { get; }
/// <summary>
/// Cancel a futures order using client order id, see <see cref="CancelFuturesOrderByClientOrderIdOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedId>> CancelFuturesOrderByClientOrderIdAsync(CancelOrderRequest request, CancellationToken ct = default);
}
}
@@ -7,16 +7,156 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for placing and managing futures orders
/// </summary>
public interface IFuturesOrderRestClient :
IPlaceFuturesOrderRestClient,
IGetFuturesOrderRestClient,
IGetOpenFuturesOrdersRestClient,
IGetClosedFuturesOrdersRestClient,
IGetFuturesOrderTradesRestClient,
IGetFuturesUserTradesRestClient,
ICancelFuturesOrderRestClient,
IGetPositionsRestClient,
IClosePositionRestClient
public interface IFuturesOrderRestClient : ISharedClient
{
/// <summary>
/// How the trading fee is deducted
/// </summary>
SharedFeeDeductionType FuturesFeeDeductionType { get; }
/// <summary>
/// How the asset is determined in which the trading fee is paid
/// </summary>
SharedFeeAssetType FuturesFeeAssetType { get; }
/// <summary>
/// Supported order types for futures orders
/// </summary>
SharedOrderType[] FuturesSupportedOrderTypes { get; }
/// <summary>
/// Supported time in force types for futures orders
/// </summary>
SharedTimeInForce[] FuturesSupportedTimeInForce { get; }
/// <summary>
/// Supported quantity types for futures orders
/// </summary>
SharedQuantitySupport FuturesSupportedOrderQuantity { get; }
/// <summary>
/// Generate a new random client order id
/// </summary>
/// <returns></returns>
string GenerateClientOrderId();
/// <summary>
/// Futures place order request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
PlaceFuturesOrderOptions PlaceFuturesOrderOptions { get; }
/// <summary>
/// Place a new futures order, see <see cref="PlaceFuturesOrderOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedId>> PlaceFuturesOrderAsync(PlaceFuturesOrderRequest request, CancellationToken ct = default);
/// <summary>
/// Futures get order request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetFuturesOrderOptions GetFuturesOrderOptions { get; }
/// <summary>
/// Get info on a specific futures order, see <see cref="GetFuturesOrderOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedFuturesOrder>> GetFuturesOrderAsync(GetOrderRequest request, CancellationToken ct = default);
/// <summary>
/// Futures get open orders request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetOpenFuturesOrdersOptions GetOpenFuturesOrdersOptions { get; }
/// <summary>
/// Get info on a open futures orders, see <see cref="GetOpenFuturesOrdersOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedFuturesOrder[]>> GetOpenFuturesOrdersAsync(GetOpenOrdersRequest request, CancellationToken ct = default);
/// <summary>
/// Spot get closed orders request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetFuturesClosedOrdersOptions GetClosedFuturesOrdersOptions { get; }
/// <summary>
/// Get info on closed futures orders, see <see cref="GetClosedFuturesOrdersOptions"/> for request options and exchange specific required/optional parameters. <br />
/// 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.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedFuturesOrder[]>> GetClosedFuturesOrdersAsync(GetClosedOrdersRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
/// <summary>
/// Futures get order trades request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetFuturesOrderTradesOptions GetFuturesOrderTradesOptions { get; }
/// <summary>
/// Get trades for a specific futures order, see <see cref="GetFuturesOrderTradesOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedUserTrade[]>> GetFuturesOrderTradesAsync(GetOrderTradesRequest request, CancellationToken ct = default);
/// <summary>
/// Futures user trades request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetFuturesUserTradeHistoryOptions GetFuturesUserTradesOptions { get; }
/// <summary>
/// Get futures user trade records, see <see cref="GetFuturesUserTradesOptions"/> for request options and exchange specific required/optional parameters. <br />
/// 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.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedUserTrade[]>> GetFuturesUserTradesAsync(GetUserTradesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
/// <summary>
/// Futures cancel order request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
CancelFuturesOrderOptions CancelFuturesOrderOptions { get; }
/// <summary>
/// Cancel a futures order, see <see cref="CancelFuturesOrderOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedId>> CancelFuturesOrderAsync(CancelOrderRequest request, CancellationToken ct = default);
/// <summary>
/// Positions request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetPositionsOptions GetPositionsOptions { get; }
/// <summary>
/// Get open position info, see <see cref="GetPositionsOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedPosition[]>> GetPositionsAsync(GetPositionsRequest request, CancellationToken ct = default);
/// <summary>
/// Close position order request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
ClosePositionOptions ClosePositionOptions { get; }
/// <summary>
/// Close a currently open position, see <see cref="ClosePositionOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<HttpResult<SharedId>> ClosePositionAsync(ClosePositionRequest request, CancellationToken ct = default);
}
}
@@ -7,7 +7,43 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for request futures symbol info
/// </summary>
public interface IFuturesSymbolRestClient : IGetFuturesSymbolsRestClient
public interface IFuturesSymbolRestClient : ISharedClient
{
/// <summary>
/// Get the futures symbol catalog. Only available if <see cref="GetFuturesSymbolsAsync(GetSymbolsRequest, CancellationToken)"/> has been called previously.
/// </summary>
SharedSymbolCatalog? FuturesSymbolCatalog { get; }
/// <summary>
/// Futures symbol request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetFuturesSymbolsOptions GetFuturesSymbolsOptions { get; }
/// <summary>
/// Get all futures symbols for a specific base asset
/// </summary>
/// <param name="baseAsset">Asset, for example `ETH`</param>
Task<ExchangeCallResult<SharedSymbol[]>> GetFuturesSymbolsForBaseAssetAsync(string baseAsset);
/// <summary>
/// Gets whether the client supports a futures symbol
/// </summary>
/// <param name="symbol">The symbol</param>
Task<ExchangeCallResult<bool>> SupportsFuturesSymbolAsync(SharedSymbol symbol);
/// <summary>
/// Gets whether the client supports a futures symbol
/// </summary>
/// <param name="symbolName">The symbol name</param>
Task<ExchangeCallResult<bool>> SupportsFuturesSymbolAsync(string symbolName);
/// <summary>
/// Get info on all futures symbols supported on the exchange, see <see cref="GetFuturesSymbolsOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedFuturesSymbol[]>> GetFuturesSymbolsAsync(GetSymbolsRequest request, CancellationToken ct = default);
}
}
@@ -7,9 +7,32 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for requesting ticker info for futures symbols
/// </summary>
public interface IFuturesTickerRestClient :
IGetFuturesTickerRestClient,
IGetAllFuturesTickersRestClient
public interface IFuturesTickerRestClient : ISharedClient
{
/// <summary>
/// Futures get ticker request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetFuturesTickerOptions GetFuturesTickerOptions { get; }
/// <summary>
/// Get ticker info for a specific futures symbol, see <see cref="GetFuturesTickerOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedFuturesTicker>> GetFuturesTickerAsync(GetTickerRequest request, CancellationToken ct = default);
/// <summary>
/// Futures get tickers request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetAllFuturesTickersOptions GetFuturesTickersOptions { get; }
/// <summary>
/// Get ticker info for all futures symbols, see <see cref="GetFuturesTickersOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedFuturesTicker[]>> GetFuturesTickersAsync(GetTickersRequest request, CancellationToken ct = default);
}
}
@@ -7,9 +7,34 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Take profit / Stop loss client
/// </summary>
public interface IFuturesTpSlRestClient :
ISetFuturesTpSlRestClient,
ICancelFuturesTpSlRestClient
public interface IFuturesTpSlRestClient : ISharedClient
{
/// <summary>
/// Set take profit and/or stop loss options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
SetFuturesTpSlOptions SetFuturesTpSlOptions { get; }
/// <summary>
/// Set a take profit and/or stop loss for an open position, see <see cref="SetFuturesTpSlOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<HttpResult<SharedId>> SetFuturesTpSlAsync(SetTpSlRequest request, CancellationToken ct = default);
/// <summary>
/// Cancel a take profit and/or stop loss options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
CancelFuturesTpSlOptions CancelFuturesTpSlOptions { get; }
/// <summary>
/// Cancel an active take profit and/or stop loss for an open position, see <see cref="CancelFuturesTpSlOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<HttpResult<bool>> CancelFuturesTpSlAsync(CancelTpSlRequest request, CancellationToken ct = default);
}
}
@@ -7,10 +7,47 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for placing trigger orders
/// </summary>
public interface IFuturesTriggerOrderRestClient :
IPlaceFuturesTriggerOrderRestClient,
IGetFuturesTriggerOrderRestClient,
ICancelFuturesTriggerOrderRestClient
public interface IFuturesTriggerOrderRestClient : ISharedClient
{
/// <summary>
/// Place spot trigger order options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
PlaceFuturesTriggerOrderOptions PlaceFuturesTriggerOrderOptions { get; }
/// <summary>
/// Place a new trigger order, see <see cref="PlaceFuturesTriggerOrderOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<HttpResult<SharedId>> PlaceFuturesTriggerOrderAsync(PlaceFuturesTriggerOrderRequest request, CancellationToken ct = default);
/// <summary>
/// Get trigger order request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetFuturesTriggerOrderOptions GetFuturesTriggerOrderOptions { get; }
/// <summary>
/// Get info on a specific trigger order, see <see cref="GetFuturesTriggerOrderOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedFuturesTriggerOrder>> GetFuturesTriggerOrderAsync(GetOrderRequest request, CancellationToken ct = default);
/// <summary>
/// Cancel trigger order request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
CancelFuturesTriggerOrderOptions CancelFuturesTriggerOrderOptions { get; }
/// <summary>
/// Cancel a trigger order, see <see cref="CancelFuturesTriggerOrderOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedId>> CancelFuturesTriggerOrderAsync(CancelOrderRequest request, CancellationToken ct = default);
}
}
@@ -7,7 +7,21 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for getting the index price klines for a symbol
/// </summary>
public interface IIndexPriceKlineRestClient : IGetIndexPriceKlinesRestClient
public interface IIndexPriceKlineRestClient : ISharedClient
{
/// <summary>
/// Index price klines request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetIndexPriceKlinesOptions GetIndexPriceKlinesOptions { get; }
/// <summary>
/// Get index price kline/candlestick data, see <see cref="GetIndexPriceKlinesOptions"/> for request options and exchange specific required/optional parameters. <br />
/// 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.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedFuturesKline[]>> GetIndexPriceKlinesAsync(GetKlinesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
}
}
@@ -7,9 +7,38 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for managing the leverage of a symbol
/// </summary>
public interface ILeverageRestClient :
IGetLeverageRestClient,
ISetLeverageRestClient
public interface ILeverageRestClient : ISharedClient
{
/// <summary>
/// How the leverage setting is configured on the exchange
/// </summary>
SharedLeverageSettingMode LeverageSettingType { get; }
/// <summary>
/// Leverage request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetLeverageOptions GetLeverageOptions { get; }
/// <summary>
/// Get the current leverage setting for a symbol, see <see cref="GetLeverageOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedLeverage>> GetLeverageAsync(GetLeverageRequest request, CancellationToken ct = default);
/// <summary>
/// Leverage set request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
SetLeverageOptions SetLeverageOptions { get; }
/// <summary>
/// Set the leverage for a symbol, see <see cref="SetLeverageOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedLeverage>> SetLeverageAsync(SetLeverageRequest request, CancellationToken ct = default);
}
}
@@ -7,7 +7,21 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for getting the mark price klines for a symbol
/// </summary>
public interface IMarkPriceKlineRestClient : IGetMarkPriceKlinesRestClient
public interface IMarkPriceKlineRestClient : ISharedClient
{
/// <summary>
/// Mark price klines request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetMarkPriceKlinesOptions GetMarkPriceKlinesOptions { get; }
/// <summary>
/// Get mark price kline/candlestick data, see <see cref="GetMarkPriceKlinesOptions"/> for request options and exchange specific required/optional parameters. <br />
/// 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.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedFuturesKline[]>> GetMarkPriceKlinesAsync(GetKlinesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
}
}
@@ -7,7 +7,19 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for getting the open interest for a symbol
/// </summary>
public interface IOpenInterestRestClient : IGetOpenInterestRestClient
public interface IOpenInterestRestClient : ISharedClient
{
/// <summary>
/// Open interest request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetOpenInterestOptions GetOpenInterestOptions { get; }
/// <summary>
/// Get the open interest for a symbol, see <see cref="GetOpenInterestOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedOpenInterest>> GetOpenInterestAsync(GetOpenInterestRequest request, CancellationToken ct = default);
}
}
@@ -7,7 +7,21 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for getting position history
/// </summary>
public interface IPositionHistoryRestClient : IGetPositionHistoryRestClient
public interface IPositionHistoryRestClient : ISharedClient
{
/// <summary>
/// Position history request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetPositionHistoryOptions GetPositionHistoryOptions { get; }
/// <summary>
/// Get position history, see <see cref="GetPositionHistoryOptions"/> for request options and exchange specific required/optional parameters. <br />
/// 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.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedPositionHistory[]>> GetPositionHistoryAsync(GetPositionHistoryRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
}
}
@@ -7,9 +7,37 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for managing the position mode setting
/// </summary>
public interface IPositionModeRestClient :
IGetPositionModeRestClient,
ISetPositionModeRestClient
public interface IPositionModeRestClient : ISharedClient
{
/// <summary>
/// How the exchange handles setting the position mode
/// </summary>
SharedPositionModeSelection PositionModeSettingType { get; }
/// <summary>
/// Position mode request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetPositionModeOptions GetPositionModeOptions { get; }
/// <summary>
/// Get the current position mode setting, see <see cref="GetPositionModeOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedPositionModeResult>> GetPositionModeAsync(GetPositionModeRequest request, CancellationToken ct = default);
/// <summary>
/// Position mode set request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
SetPositionModeOptions SetPositionModeOptions { get; }
/// <summary>
/// Set the position mode to a new value, see <see cref="SetPositionModeOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedPositionModeResult>> SetPositionModeAsync(SetPositionModeRequest request, CancellationToken ct = default);
}
}
@@ -7,9 +7,34 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for requesting asset info
/// </summary>
public interface IAssetsRestClient :
IGetAssetRestClient,
IGetAllAssetsRestClient
public interface IAssetsRestClient : ISharedClient
{
/// <summary>
/// Asset request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetAssetOptions GetAssetOptions { get; }
/// <summary>
/// Get info on a specific asset, see <see cref="GetAssetOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedAsset>> GetAssetAsync(GetAssetRequest request, CancellationToken ct = default);
/// <summary>
/// Assets request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetAssetsOptions GetAssetsOptions { get; }
/// <summary>
/// Get info on all assets the exchange supports, see <see cref="GetAssetsOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedAsset[]>> GetAssetsAsync(GetAssetsRequest request, CancellationToken ct = default);
}
}
@@ -7,7 +7,21 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for requesting user balance info
/// </summary>
public interface IBalanceRestClient : IGetBalancesRestClient
public interface IBalanceRestClient : ISharedClient
{
/// <summary>
/// Balances request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetBalancesOptions GetBalancesOptions { get; }
/// <summary>
/// Get balances for the user, see <see cref="GetBalancesOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<HttpResult<SharedBalance[]>> GetBalancesAsync(GetBalancesRequest request, CancellationToken ct = default);
}
}
@@ -7,7 +7,21 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for retrieving the current best bid/ask price
/// </summary>
public interface IBookTickerRestClient : IGetBookTickerRestClient
{
public interface IBookTickerRestClient : ISharedClient
{
/// <summary>
/// Book ticker request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetBookTickerOptions GetBookTickerOptions { get; }
/// <summary>
/// Get the best ask/bid info for a symbol, see <see cref="GetBookTickerOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<HttpResult<SharedBookTicker>> GetBookTickerAsync(GetBookTickerRequest request, CancellationToken ct = default);
}
}
@@ -7,9 +7,37 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for requesting deposit addresses and deposit records
/// </summary>
public interface IDepositRestClient :
IGetDepositAddressesRestClient,
IGetDepositHistoryRestClient
public interface IDepositRestClient : ISharedClient
{
/// <summary>
/// Deposit addresses request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetDepositAddressesOptions GetDepositAddressesOptions { get; }
/// <summary>
/// Get deposit addresses for an asset, see <see cref="GetDepositAddressesOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<HttpResult<SharedDepositAddress[]>> GetDepositAddressesAsync(GetDepositAddressesRequest request, CancellationToken ct = default);
/// <summary>
/// Deposits request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetDepositHistoryOptions GetDepositsOptions { get; }
/// <summary>
/// Get deposit records, see <see cref="GetDepositsOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<HttpResult<SharedDeposit[]>> GetDepositsAsync(GetDepositsRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
}
}
@@ -7,7 +7,20 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for requesting user trading fees
/// </summary>
public interface IFeeRestClient : IGetFeesRestClient
{
public interface IFeeRestClient : ISharedClient
{
/// <summary>
/// Fee request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetFeeOptions GetFeeOptions { get; }
/// <summary>
/// Get trading fees for a symbol, see <see cref="GetFeeOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedFee>> GetFeesAsync(GetFeeRequest request, CancellationToken ct = default);
}
}
@@ -7,7 +7,23 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for requesting kline/candlestick data
/// </summary>
public interface IKlineRestClient : IGetKlinesRestClient
public interface IKlineRestClient : ISharedClient
{
/// <summary>
/// Kline request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetKlinesOptions GetKlinesOptions { get; }
/// <summary>
/// Get kline/candlestick data, see <see cref="GetKlinesOptions"/> for request options and exchange specific required/optional parameters. <br />
/// 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.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<HttpResult<SharedKline[]>> GetKlinesAsync(GetKlinesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
}
}
@@ -7,7 +7,21 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for retrieving the order book for a symbol
/// </summary>
public interface IOrderBookRestClient : IGetOrderBookRestClient
{
public interface IOrderBookRestClient : ISharedClient
{
/// <summary>
/// Order book request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetOrderBookOptions GetOrderBookOptions { get; }
/// <summary>
/// Get the order book for a symbol, see <see cref="GetOrderBookOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<HttpResult<SharedOrderBook>> GetOrderBookAsync(GetOrderBookRequest request, CancellationToken ct = default);
}
}
@@ -7,7 +7,21 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for retrieving the most recent public trades
/// </summary>
public interface IRecentTradeRestClient : IGetRecentTradesRestClient
public interface IRecentTradeRestClient : ISharedClient
{
/// <summary>
/// Recent trades request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetRecentTradesOptions GetRecentTradesOptions { get; }
/// <summary>
/// Get the most recent public trades, see <see cref="GetRecentTradesOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<HttpResult<SharedTrade[]>> GetRecentTradesAsync(GetRecentTradesRequest request, CancellationToken ct = default);
}
}
@@ -7,7 +7,23 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for retrieving trading history
/// </summary>
public interface ITradeHistoryRestClient : IGetTradeHistoryRestClient
public interface ITradeHistoryRestClient : ISharedClient
{
/// <summary>
/// Trade history request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetTradeHistoryOptions GetTradeHistoryOptions { get; }
/// <summary>
/// Get public trade history, see <see cref="GetTradeHistoryOptions"/> for request options and exchange specific required/optional parameters. <br />
/// 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.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<HttpResult<SharedTrade[]>> GetTradeHistoryAsync(GetTradeHistoryRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
}
}
@@ -7,6 +7,9 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
/// <summary>
/// Client for withdrawing funds
/// </summary>
public interface IWithdrawRestClient : ISharedClient
{
/// <summary>
@@ -24,4 +27,4 @@ namespace CryptoExchange.Net.SharedApis
/// <returns></returns>
Task<HttpResult<SharedId>> WithdrawAsync(WithdrawRequest request, CancellationToken ct = default);
}
}
}
@@ -7,7 +7,23 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for retrieving withdrawal records
/// </summary>
public interface IWithdrawalRestClient : IGetWithdrawalHistoryRestClient
public interface IWithdrawalRestClient : ISharedClient
{
/// <summary>
/// Withdrawal records request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetWithdrawalHistoryOptions GetWithdrawalsOptions { get; }
/// <summary>
/// Get withdrawal records, see <see cref="GetWithdrawalsOptions"/> for request options and exchange specific required/optional parameters. <br />
/// 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.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<HttpResult<SharedWithdrawal[]>> GetWithdrawalsAsync(GetWithdrawalsRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
}
}
@@ -7,9 +7,33 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for managing spot orders using a client order id
/// </summary>
public interface ISpotOrderClientIdRestClient :
ICancelSpotOrderByClientOrderIdRestClient,
IGetSpotOrderByClientOrderIdRestClient
public interface ISpotOrderClientIdRestClient : ISharedClient
{
/// <summary>
/// Spot get order by client order id request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetSpotOrderByClientOrderIdOptions GetSpotOrderByClientOrderIdOptions { get; }
/// <summary>
/// Get info on a specific spot order using a client order id, see <see cref="GetSpotOrderByClientOrderIdOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedSpotOrder>> GetSpotOrderByClientOrderIdAsync(GetOrderRequest request, CancellationToken ct = default);
/// <summary>
/// Spot cancel order by client order id request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
CancelSpotOrderByClientOrderIdOptions CancelSpotOrderByClientOrderIdOptions { get; }
/// <summary>
/// Cancel a spot order using client order id, see <see cref="CancelSpotOrderByClientOrderIdOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedId>> CancelSpotOrderByClientOrderIdAsync(CancelOrderRequest request, CancellationToken ct = default);
}
}
@@ -7,14 +7,130 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for placing and managing spot orders
/// </summary>
public interface ISpotOrderRestClient :
IPlaceSpotOrderRestClient,
ICancelSpotOrderRestClient,
IGetSpotOrderRestClient,
IGetOpenSpotOrdersRestClient,
IGetClosedSpotOrdersRestClient,
IGetSpotOrderTradesRestClient,
IGetSpotUserTradeHistoryRestClient
public interface ISpotOrderRestClient : ISharedClient
{
/// <summary>
/// How the trading fee is deducted
/// </summary>
SharedFeeDeductionType SpotFeeDeductionType { get; }
/// <summary>
/// How the asset is determined in which the trading fee is paid
/// </summary>
SharedFeeAssetType SpotFeeAssetType { get; }
/// <summary>
/// Supported order types for spot orders
/// </summary>
SharedOrderType[] SpotSupportedOrderTypes { get; }
/// <summary>
/// Supported time in force types for placing spot orders
/// </summary>
SharedTimeInForce[] SpotSupportedTimeInForce { get; }
/// <summary>
/// Supported quantity types for placing spot orders
/// </summary>
SharedQuantitySupport SpotSupportedOrderQuantity { get; }
/// <summary>
/// Generate a new random client order id
/// </summary>
/// <returns></returns>
string GenerateClientOrderId();
/// <summary>
/// Spot place order request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
PlaceSpotOrderOptions PlaceSpotOrderOptions { get; }
/// <summary>
/// Place a new spot order, see <see cref="PlaceSpotOrderOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedId>> PlaceSpotOrderAsync(PlaceSpotOrderRequest request, CancellationToken ct = default);
/// <summary>
/// Spot get order request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetSpotOrderOptions GetSpotOrderOptions { get; }
/// <summary>
/// Get info on a specific spot order, see <see cref="GetSpotOrderOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedSpotOrder>> GetSpotOrderAsync(GetOrderRequest request, CancellationToken ct = default);
/// <summary>
/// Spot get open orders request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetOpenSpotOrdersOptions GetOpenSpotOrdersOptions { get; }
/// <summary>
/// Get info on a open spot orders, see <see cref="GetOpenSpotOrdersOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedSpotOrder[]>> GetOpenSpotOrdersAsync(GetOpenOrdersRequest request, CancellationToken ct = default);
/// <summary>
/// Spot get closed orders request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetSpotClosedOrdersOptions GetClosedSpotOrdersOptions { get; }
/// <summary>
/// Get info on closed spot orders, see <see cref="GetClosedSpotOrdersOptions"/> for request options and exchange specific required/optional parameters. <br />
/// 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.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedSpotOrder[]>> GetClosedSpotOrdersAsync(GetClosedOrdersRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
/// <summary>
/// Spot get order trades request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetSpotOrderTradesOptions GetSpotOrderTradesOptions { get; }
/// <summary>
/// Get trades for a specific spot order, see <see cref="GetSpotOrderTradesOptions"/> for request options and exchange specific required/optional parameters. <br />
/// 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.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedUserTrade[]>> GetSpotOrderTradesAsync(GetOrderTradesRequest request, CancellationToken ct = default);
/// <summary>
/// Spot user trades request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetSpotUserTradeHistoryOptions GetSpotUserTradesOptions { get; }
/// <summary>
/// Get spot user trade records, see <see cref="GetSpotUserTradesOptions"/> for request options and exchange specific required/optional parameters. <br />
/// 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.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedUserTrade[]>> GetSpotUserTradesAsync(GetUserTradesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
/// <summary>
/// Spot cancel order request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
CancelSpotOrderOptions CancelSpotOrderOptions { get; }
/// <summary>
/// Cancel a spot order, see <see cref="CancelSpotOrderOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedId>> CancelSpotOrderAsync(CancelOrderRequest request, CancellationToken ct = default);
}
}
@@ -7,7 +7,43 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for requesting spot symbols
/// </summary>
public interface ISpotSymbolRestClient : IGetSpotSymbolsRestClient
public interface ISpotSymbolRestClient : ISharedClient
{
/// <summary>
/// Get the spot symbol catalog. Only available if <see cref="GetSpotSymbolsAsync(GetSymbolsRequest, CancellationToken)"/> has been called previously.
/// </summary>
SharedSymbolCatalog? SpotSymbolCatalog { get; }
/// <summary>
/// Spot symbols request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetSpotSymbolsOptions GetSpotSymbolsOptions { get; }
/// <summary>
/// Get all spot symbols for a specific base asset
/// </summary>
/// <param name="baseAsset">Asset, for example `ETH`</param>
Task<ExchangeCallResult<SharedSymbol[]>> GetSpotSymbolsForBaseAssetAsync(string baseAsset);
/// <summary>
/// Gets whether the client supports a spot symbol
/// </summary>
/// <param name="symbol">The symbol</param>
Task<ExchangeCallResult<bool>> SupportsSpotSymbolAsync(SharedSymbol symbol);
/// <summary>
/// Gets whether the client supports a spot symbol
/// </summary>
/// <param name="symbolName">The symbol name</param>
Task<ExchangeCallResult<bool>> SupportsSpotSymbolAsync(string symbolName);
/// <summary>
/// Get info on all available spot symbols on the exchange, see <see cref="GetSpotSymbolsOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedSpotSymbol[]>> GetSpotSymbolsAsync(GetSymbolsRequest request, CancellationToken ct = default);
}
}
@@ -7,9 +7,31 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for requesting spot tickers
/// </summary>
public interface ISpotTickerRestClient :
IGetSpotTickerRestClient,
IGetAllSpotTickersRestClient
public interface ISpotTickerRestClient : ISharedClient
{
/// <summary>
/// Spot ticker request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetSpotTickerOptions GetSpotTickerOptions { get; }
/// <summary>
/// Get ticker for a specific spot symbol, see <see cref="GetSpotTickerOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedSpotTicker>> GetSpotTickerAsync(GetTickerRequest request, CancellationToken ct = default);
/// <summary>
/// Spot tickers request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetAllSpotTickersOptions GetSpotTickersOptions { get; }
/// <summary>
/// Get tickers for all spot symbols, see <see cref="GetSpotTickersOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedSpotTicker[]>> GetSpotTickersAsync(GetTickersRequest request, CancellationToken ct = default);
}
}
@@ -7,10 +7,47 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Client for placing trigger orders
/// </summary>
public interface ISpotTriggerOrderRestClient :
IPlaceSpotTriggerOrderRestClient,
IGetSpotTriggerOrderRestClient,
ICancelSpotTriggerOrderRestClient
public interface ISpotTriggerOrderRestClient : ISharedClient
{
/// <summary>
/// Place spot trigger order options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
PlaceSpotTriggerOrderOptions PlaceSpotTriggerOrderOptions { get; }
/// <summary>
/// Place a new trigger order, see <see cref="PlaceSpotTriggerOrderOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<HttpResult<SharedId>> PlaceSpotTriggerOrderAsync(PlaceSpotTriggerOrderRequest request, CancellationToken ct = default);
/// <summary>
/// Get trigger order request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetSpotTriggerOrderOptions GetSpotTriggerOrderOptions { get; }
/// <summary>
/// Get info on a specific trigger order, see <see cref="GetSpotTriggerOrderOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedSpotTriggerOrder>> GetSpotTriggerOrderAsync(GetOrderRequest request, CancellationToken ct = default);
/// <summary>
/// Cancel trigger order request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
CancelSpotTriggerOrderOptions CancelSpotTriggerOrderOptions { get; }
/// <summary>
/// Cancel a trigger order, see <see cref="CancelSpotTriggerOrderOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedId>> CancelSpotTriggerOrderAsync(CancelOrderRequest request, CancellationToken ct = default);
}
}
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetAllAssetsRestClient : ISharedClient
/// <summary>
/// Endpoint definition for retrieving all assets supported on an exchange.
/// </summary>
public interface IGetAllAssetsEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Assets request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetAssetsOptions GetAssetsOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetAssetRestClient : ISharedClient
/// <summary>
/// Endpoint definition for retrieving an asset on an exchange.
/// </summary>
public interface IGetAssetEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Asset request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetAssetOptions GetAssetOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetBalancesRestClient : ISharedClient
/// <summary>
/// Endpoint definition for retrieving user asset balances on an exchange.
/// </summary>
public interface IGetBalancesEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Balances request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetBalancesOptions GetBalancesOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetDepositAddressesRestClient : ISharedClient
/// <summary>
/// Endpoint definition for retrieving user deposit addresses on an exchange.
/// </summary>
public interface IGetDepositAddressesEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Deposit addresses request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetDepositAddressesOptions GetDepositAddressesOptions { get; }
@@ -7,20 +7,24 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetDepositHistoryRestClient : ISharedClient
/// <summary>
/// Endpoint definition for retrieving user deposit history on an exchange.
/// </summary>
public interface IGetDepositHistoryEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Deposits request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetDepositHistoryOptions GetDepositHistoryOptions { get; }
/// <summary>
/// Get deposit records, see <see cref="GetDepositHistoryOptions"/> for request options and exchange specific required/optional parameters. <br />
/// The result is paginated, if there are more results to be retrieved, the <see cref="HttpResult{T}.NextPageRequest"/> property of the result will contain the pagination request to be used for the next request to continue pagination.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="nextPageToken">The pagination request from the previous request result <see cref="HttpResult{T}.NextPageRequest"/> property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<HttpResult<SharedDeposit[]>> GetDepositHistoryAsync(GetDepositsRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetFeesRestClient : ISharedClient
/// <summary>
/// Endpoint definition for retrieving user trading fees on an exchange.
/// </summary>
public interface IGetFeesEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Fee request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetFeeOptions GetFeeOptions { get; }
@@ -7,20 +7,23 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetFundingRateHistoryRestClient : ISharedClient
/// <summary>
/// Endpoint definition for retrieving funding rate history for a symbol on an exchange.
/// </summary>
public interface IGetFundingRateHistoryEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Funding rate request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetFundingRateHistoryOptions GetFundingRateHistoryOptions { get; }
/// <summary>
/// Get funding rate records, see <see cref="GetFundingRateHistoryOptions"/> for request options and exchange specific required/optional parameters. <br />
/// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination.
/// The result is paginated, if there are more results to be retrieved, the <see cref="HttpResult{T}.NextPageRequest"/> property of the result will contain the pagination request to be used for the next request to continue pagination.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="nextPageToken">The pagination request from the previous request result <see cref="HttpResult{T}.NextPageRequest"/> property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedFundingRate[]>> GetFundingRateHistoryAsync(GetFundingRateHistoryRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
}
@@ -7,20 +7,23 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetIndexPriceKlinesRestClient : ISharedClient
/// <summary>
/// Endpoint definition for retrieving index price kline/candlestick data from an exchange
/// </summary>
public interface IGetIndexPriceKlinesEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Index price klines request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetIndexPriceKlinesOptions GetIndexPriceKlinesOptions { get; }
/// <summary>
/// Get index price kline/candlestick data, see <see cref="GetIndexPriceKlinesOptions"/> for request options and exchange specific required/optional parameters. <br />
/// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination.
/// The result is paginated, if there are more results to be retrieved, the <see cref="HttpResult{T}.NextPageRequest"/> property of the result will contain the pagination request to be used for the next request to continue pagination.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="nextPageToken">The pagination request from the previous request result <see cref="HttpResult{T}.NextPageRequest"/> property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedFuturesKline[]>> GetIndexPriceKlinesAsync(GetKlinesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
}
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetLeverageRestClient : ISharedClient
/// <summary>
/// Endpoint definition for retrieving leverage information for a symbol on an exchange.
/// </summary>
public interface IGetLeverageEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Leverage request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetLeverageOptions GetLeverageOptions { get; }
@@ -7,7 +7,10 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface ISetLeverageRestClient : ISharedClient
/// <summary>
/// Endpoint definition for setting leverage on an exchange.
/// </summary>
public interface ISetLeverageEndpoint : ISharedApiEndpoint
{
/// <summary>
/// How the leverage setting is configured on the exchange
@@ -16,7 +19,7 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Leverage set request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
SetLeverageOptions SetLeverageOptions { get; }
@@ -7,20 +7,23 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetMarkPriceKlinesRestClient : ISharedClient
/// <summary>
/// Endpoint definition for retrieving mark price kline/candlestick data from an exchange.
/// </summary>
public interface IGetMarkPriceKlinesEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Mark price klines request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetMarkPriceKlinesOptions GetMarkPriceKlinesOptions { get; }
/// <summary>
/// Get mark price kline/candlestick data, see <see cref="GetMarkPriceKlinesOptions"/> for request options and exchange specific required/optional parameters. <br />
/// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination.
/// The result is paginated, if there are more results to be retrieved, the <see cref="HttpResult{T}.NextPageRequest"/> property of the result will contain the pagination request to be used for the next request to continue pagination.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="nextPageToken">The pagination request from the previous request result <see cref="HttpResult{T}.NextPageRequest"/> property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedFuturesKline[]>> GetMarkPriceKlinesAsync(GetKlinesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
}
@@ -7,12 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetOpenInterestRestClient : ISharedClient
/// <summary>
/// Endpoint definition for retrieving open interest data from an exchange
/// </summary>
public interface IGetOpenInterestEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Open interest request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetOpenInterestOptions GetOpenInterestOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface ICancelFuturesOrderByClientOrderIdRestClient : ISharedClient
/// <summary>
/// Endpoint definition for canceling a futures order by client order id on an exchange.
/// </summary>
public interface ICancelFuturesOrderByClientOrderIdEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Futures cancel order by client order id request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
CancelFuturesOrderByClientOrderIdOptions CancelFuturesOrderByClientOrderIdOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface ICancelFuturesOrderRestClient : ISharedClient
/// <summary>
/// Endpoint definition for canceling a futures order on an exchange.
/// </summary>
public interface ICancelFuturesOrderEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Futures cancel order request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
CancelFuturesOrderOptions CancelFuturesOrderOptions { get; }
@@ -7,7 +7,10 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IPlaceFuturesOrderRestClient : ISharedClient
/// <summary>
/// Endpoint definition for placing a futures order on an exchange.
/// </summary>
public interface IPlaceFuturesOrderEndpoint : ISharedApiEndpoint
{
/// <summary>
/// How the trading fee is deducted
@@ -38,7 +41,7 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Futures place order request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
PlaceFuturesOrderOptions PlaceFuturesOrderOptions { get; }
@@ -7,20 +7,23 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetClosedFuturesOrdersRestClient : ISharedClient
/// <summary>
/// Endpoint definition for retrieving closed futures orders on an exchange.
/// </summary>
public interface IGetClosedFuturesOrdersEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Spot get closed orders request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetFuturesClosedOrdersOptions GetClosedFuturesOrdersOptions { get; }
/// <summary>
/// Get info on closed futures orders, see <see cref="GetClosedFuturesOrdersOptions"/> for request options and exchange specific required/optional parameters. <br />
/// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination.
/// The result is paginated, if there are more results to be retrieved, the <see cref="HttpResult{T}.NextPageRequest"/> property of the result will contain the pagination request to be used for the next request to continue pagination.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="nextPageToken">The pagination request from the previous request result <see cref="HttpResult{T}.NextPageRequest"/> property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedFuturesOrder[]>> GetClosedFuturesOrdersAsync(GetClosedOrdersRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
}
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetFuturesOrderByClientOrderIdRestClient : ISharedClient
/// <summary>
/// Endpoint definition for retrieving a futures order by client order id on an exchange.
/// </summary>
public interface IGetFuturesOrderByClientOrderIdEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Futures get order by client order id request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetFuturesOrderByClientOrderIdOptions GetFuturesOrderByClientOrderIdOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetFuturesOrderRestClient : ISharedClient
/// <summary>
/// Endpoint definition for retrieving a futures order on an exchange.
/// </summary>
public interface IGetFuturesOrderEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Futures get order request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetFuturesOrderOptions GetFuturesOrderOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetOpenFuturesOrdersRestClient : ISharedClient
/// <summary>
/// Endpoint definition for retrieving open futures orders on an exchange.
/// </summary>
public interface IGetOpenFuturesOrdersEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Futures get open orders request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetOpenFuturesOrdersOptions GetOpenFuturesOrdersOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetPositionModeRestClient : ISharedClient
/// <summary>
/// Request defintion for getting the current user position mode setting on an exchange.
/// </summary>
public interface IGetPositionModeEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Position mode request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetPositionModeOptions GetPositionModeOptions { get; }
@@ -7,7 +7,10 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface ISetPositionModeRestClient : ISharedClient
/// <summary>
/// Endpoint definition for setting the user position mode on an exchange.
/// </summary>
public interface ISetPositionModeEndpoint : ISharedApiEndpoint
{
/// <summary>
/// How the exchange handles setting the position mode
@@ -16,7 +19,7 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Position mode set request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
SetPositionModeOptions SetPositionModeOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IClosePositionRestClient : ISharedClient
/// <summary>
/// Request definition for closing a position on an exchange.
/// </summary>
public interface IClosePositionEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Close position order request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
ClosePositionOptions ClosePositionOptions { get; }
@@ -7,20 +7,23 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetPositionHistoryRestClient : ISharedClient
/// <summary>
/// Request definition for retrieving position history from an exchange.
/// </summary>
public interface IGetPositionHistoryEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Position history request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetPositionHistoryOptions GetPositionHistoryOptions { get; }
/// <summary>
/// Get position history, see <see cref="GetPositionHistoryOptions"/> for request options and exchange specific required/optional parameters. <br />
/// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination.
/// The result is paginated, if there are more results to be retrieved, the <see cref="HttpResult{T}.NextPageRequest"/> property of the result will contain the pagination request to be used for the next request to continue pagination.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="nextPageToken">The pagination request from the previous request result <see cref="HttpResult{T}.NextPageRequest"/> property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedPositionHistory[]>> GetPositionHistoryAsync(GetPositionHistoryRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
}
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetPositionsRestClient : ISharedClient
/// <summary>
/// Request definition for retrieving open positions from an exchange.
/// </summary>
public interface IGetPositionsEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Positions request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetPositionsOptions GetPositionsOptions { get; }
@@ -7,7 +7,10 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetFuturesSymbolsRestClient : ISharedClient
/// <summary>
/// Request definition for getting futures symbols from an exchange
/// </summary>
public interface IGetFuturesSymbolsEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Get the futures symbol catalog. Only available if <see cref="GetFuturesSymbolsAsync(GetSymbolsRequest, CancellationToken)"/> has been called previously.
@@ -16,7 +19,7 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Futures symbol request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetFuturesSymbolsOptions GetFuturesSymbolsOptions { get; }
@@ -0,0 +1,28 @@
using CryptoExchange.Net.Objects;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
/// <summary>
/// Request definition for retrieving all futures tickers from an exchange.
/// </summary>
public interface IGetAllFuturesTickersEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Futures get tickers request options.<br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetAllFuturesTickersOptions GetAllFuturesTickersOptions { get; }
/// <summary>
/// Get ticker info for all futures symbols, see <see cref="GetAllFuturesTickersOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedFuturesTicker[]>> GetAllFuturesTickersAsync(GetTickersRequest request, CancellationToken ct = default);
}
}
@@ -1,25 +0,0 @@
using CryptoExchange.Net.Objects;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetAllFuturesTickersRestClient : ISharedClient
{
/// <summary>
/// Futures get tickers request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetFuturesTickersOptions GetFuturesTickersOptions { get; }
/// <summary>
/// Get ticker info for all futures symbols, see <see cref="GetFuturesTickersOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedFuturesTicker[]>> GetFuturesTickersAsync(GetTickersRequest request, CancellationToken ct = default);
}
}
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetFuturesTickerRestClient : ISharedClient
/// <summary>
/// Request definition for retrieving a futures ticker from an exchange.
/// </summary>
public interface IGetFuturesTickerEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Futures get ticker request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetFuturesTickerOptions GetFuturesTickerOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface ICancelFuturesTpSlRestClient : ISharedClient
/// <summary>
/// Request definition for canceling a take profit and/or stop loss for an open position on an exchange.
/// </summary>
public interface ICancelFuturesTpSlEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Cancel a take profit and/or stop loss options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
CancelFuturesTpSlOptions CancelFuturesTpSlOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface ISetFuturesTpSlRestClient : ISharedClient
/// <summary>
/// Request definition for setting take profit and/or stop loss for an open position on an exchange.
/// </summary>
public interface ISetFuturesTpSlEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Set take profit and/or stop loss options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
SetFuturesTpSlOptions SetFuturesTpSlOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface ICancelFuturesTriggerOrderRestClient : ISharedClient
/// <summary>
/// Request definition for canceling a futures trigger order on an exchange.
/// </summary>
public interface ICancelFuturesTriggerOrderEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Cancel trigger order request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
CancelFuturesTriggerOrderOptions CancelFuturesTriggerOrderOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetFuturesTriggerOrderRestClient : ISharedClient
/// <summary>
/// Request definition for getting a specific futures trigger order from the exchange.
/// </summary>
public interface IGetFuturesTriggerOrderEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Get trigger order request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetFuturesTriggerOrderOptions GetFuturesTriggerOrderOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IPlaceFuturesTriggerOrderRestClient : ISharedClient
/// <summary>
/// Request definition for placing a futures trigger order on an exchange.
/// </summary>
public interface IPlaceFuturesTriggerOrderEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Place spot trigger order options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Place futures trigger order options.<br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
PlaceFuturesTriggerOrderOptions PlaceFuturesTriggerOrderOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetFuturesOrderTradesRestClient : ISharedClient
/// <summary>
/// Request definition for getting trades for a specific futures order on an exchange.
/// </summary>
public interface IGetFuturesOrderTradesEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Futures get order trades request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetFuturesOrderTradesOptions GetFuturesOrderTradesOptions { get; }
@@ -0,0 +1,30 @@
using CryptoExchange.Net.Objects;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
/// <summary>
/// Request definition for retrieving futures user trade history from an exchange.
/// </summary>
public interface IGetFuturesUserTradeHistoryEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Futures user trades request options.<br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetFuturesUserTradeHistoryOptions GetFuturesUserTradeHistoryOptions { get; }
/// <summary>
/// Get futures user trade records, see <see cref="GetFuturesUserTradeHistoryOptions"/> for request options and exchange specific required/optional parameters. <br />
/// The result is paginated, if there are more results to be retrieved, the <see cref="HttpResult{T}.NextPageRequest"/> property of the result will contain the pagination request to be used for the next request to continue pagination.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result <see cref="HttpResult{T}.NextPageRequest"/> property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedUserTrade[]>> GetFuturesUserTradesAsync(GetUserTradesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
}
}
@@ -1,27 +0,0 @@
using CryptoExchange.Net.Objects;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetFuturesUserTradesRestClient : ISharedClient
{
/// <summary>
/// Futures user trades request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetFuturesUserTradesOptions GetFuturesUserTradesOptions { get; }
/// <summary>
/// Get futures user trade records, see <see cref="GetFuturesUserTradesOptions"/> for request options and exchange specific required/optional parameters. <br />
/// 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.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedUserTrade[]>> GetFuturesUserTradesAsync(GetUserTradesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
}
}
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CryptoExchange.Net.SharedApis
{
/// <summary>
/// Identifies a fine-grained Shared API endpoint capability.
/// </summary>
public interface ISharedApiEndpoint : ISharedClient
{
}
}
@@ -7,21 +7,24 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetKlinesRestClient : ISharedClient
/// <summary>
/// Request definition for getting kline/candlestick data from an exchange.
/// </summary>
public interface IGetKlinesEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Kline request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetKlinesOptions GetKlinesOptions { get; }
/// <summary>
/// Get kline/candlestick data, see <see cref="GetKlinesOptions"/> for request options and exchange specific required/optional parameters. <br />
/// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination.
/// The result is paginated, if there are more results to be retrieved, the <see cref="HttpResult{T}.NextPageRequest"/> property of the result will contain the pagination request to be used for the next request to continue pagination.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="nextPageToken">The pagination request from the previous request result <see cref="HttpResult{T}.NextPageRequest"/> property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<HttpResult<SharedKline[]>> GetKlinesAsync(GetKlinesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetBookTickerRestClient : ISharedClient
/// <summary>
/// Request definition for retrieving the best bid/ask prices for a symbol on an exchange.
/// </summary>
public interface IGetBookTickerEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Book ticker request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetBookTickerOptions GetBookTickerOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetOrderBookRestClient : ISharedClient
/// <summary>
/// Request definition for retrieving an order book snapshot for a symbol on an exchange.
/// </summary>
public interface IGetOrderBookEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Order book request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetOrderBookOptions GetOrderBookOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface ICancelSpotOrderByClientOrderIdRestClient : ISharedClient
/// <summary>
/// Request definition for canceling a spot order by client order id on an exchange.
/// </summary>
public interface ICancelSpotOrderByClientOrderIdEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Spot cancel order by client order id request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
CancelSpotOrderByClientOrderIdOptions CancelSpotOrderByClientOrderIdOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface ICancelSpotOrderRestClient : ISharedClient
/// <summary>
/// Request definition for canceling a spot order on an exchange.
/// </summary>
public interface ICancelSpotOrderEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Spot cancel order request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
CancelSpotOrderOptions CancelSpotOrderOptions { get; }
@@ -7,7 +7,10 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IPlaceSpotOrderRestClient : ISharedClient
/// <summary>
/// Request definition for placing a spot order on an exchange.
/// </summary>
public interface IPlaceSpotOrderEndpoint : ISharedApiEndpoint
{
/// <summary>
/// How the trading fee is deducted
@@ -31,14 +34,14 @@ namespace CryptoExchange.Net.SharedApis
SharedQuantitySupport SpotSupportedOrderQuantity { get; }
/// <summary>
/// Generate a new random client order id
/// Generate a new random client order id in a format that is accepted by the exchange.
/// </summary>
/// <returns></returns>
string GenerateClientOrderId();
/// <summary>
/// Spot place order request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
PlaceSpotOrderOptions PlaceSpotOrderOptions { get; }
@@ -7,20 +7,23 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetClosedSpotOrdersRestClient : ISharedClient
/// <summary>
/// Request definition for retrieving closed spot orders from an exchange.
/// </summary>
public interface IGetClosedSpotOrdersEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Spot get closed orders request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetSpotClosedOrdersOptions GetClosedSpotOrdersOptions { get; }
/// <summary>
/// Get info on closed spot orders, see <see cref="GetClosedSpotOrdersOptions"/> for request options and exchange specific required/optional parameters. <br />
/// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination.
/// The result is paginated, if there are more results to be retrieved, the <see cref="HttpResult{T}.NextPageRequest"/> property of the result will contain the pagination request to be used for the next request to continue pagination.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="nextPageToken">The pagination request from the previous request result <see cref="HttpResult{T}.NextPageRequest"/> property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedSpotOrder[]>> GetClosedSpotOrdersAsync(GetClosedOrdersRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
}
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetOpenSpotOrdersRestClient : ISharedClient
/// <summary>
/// Request definition for retrieving open spot order from an exchange.
/// </summary>
public interface IGetOpenSpotOrdersEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Spot get open orders request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetOpenSpotOrdersOptions GetOpenSpotOrdersOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetSpotOrderByClientOrderIdRestClient : ISharedClient
/// <summary>
/// Request definition for retrieving a spot order by client order id from an exchange.
/// </summary>
public interface IGetSpotOrderByClientOrderIdEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Spot get order by client order id request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetSpotOrderByClientOrderIdOptions GetSpotOrderByClientOrderIdOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetSpotOrderRestClient : ISharedClient
/// <summary>
/// Request definition for retrieving a spot order from an exchange.
/// </summary>
public interface IGetSpotOrderEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Spot get order request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetSpotOrderOptions GetSpotOrderOptions { get; }
@@ -7,9 +7,11 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetSpotSymbolsRestClient : ISharedClient
/// <summary>
/// Request definition for retrieving spot symbols from an exchange.
/// </summary>
public interface IGetSpotSymbolsEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Get the spot symbol catalog. Only available if <see cref="GetSpotSymbolsAsync(GetSymbolsRequest, CancellationToken)"/> has been called previously.
/// </summary>
@@ -35,7 +37,7 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Spot symbols request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetSpotSymbolsOptions GetSpotSymbolsOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetAllSpotTickersRestClient : ISharedClient
/// <summary>
/// Request definition for retrieving all spot tickers from an exchange.
/// </summary>
public interface IGetAllSpotTickersEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Spot tickers request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetAllSpotTickersOptions GetAllSpotTickersOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetSpotTickerRestClient : ISharedClient
/// <summary>
/// Request definition for getting spot ticker info from an exchange.
/// </summary>
public interface IGetSpotTickerEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Spot ticker request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetSpotTickerOptions GetSpotTickerOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface ICancelSpotTriggerOrderRestClient : ISharedClient
/// <summary>
/// Request definition for canceling a spot trigger order on an exchange
/// </summary>
public interface ICancelSpotTriggerOrderEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Cancel trigger order request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
CancelSpotTriggerOrderOptions CancelSpotTriggerOrderOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetSpotTriggerOrderRestClient : ISharedClient
/// <summary>
/// Request definition for getting a specific spot trigger order on an exchange
/// </summary>
public interface IGetSpotTriggerOrderEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Get trigger order request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetSpotTriggerOrderOptions GetSpotTriggerOrderOptions { get; }
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IPlaceSpotTriggerOrderRestClient : ISharedClient
/// <summary>
/// Request definition for placing a spot trigger order on an exchange.
/// </summary>
public interface IPlaceSpotTriggerOrderEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Place spot trigger order options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
PlaceSpotTriggerOrderOptions PlaceSpotTriggerOrderOptions { get; }
@@ -7,12 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetSpotOrderTradesRestClient : ISharedClient
/// <summary>
/// Request definition for getting trades for a specific spot order on an exchange.
/// </summary>
public interface IGetSpotOrderTradesEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Spot get order trades request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetSpotOrderTradesOptions GetSpotOrderTradesOptions { get; }
@@ -7,20 +7,23 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetSpotUserTradeHistoryRestClient : ISharedClient
/// <summary>
/// Request definition for getting spot user trade history from an exchange
/// </summary>
public interface IGetSpotUserTradeHistoryEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Spot user trades request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetSpotUserTradeHistoryOptions GetSpotUserTradeHistoryOptions { get; }
/// <summary>
/// Get spot user trade records, see <see cref="SharedApis.GetSpotUserTradeHistoryOptions"/> for request options and exchange specific required/optional parameters. <br />
/// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination.
/// The result is paginated, if there are more results to be retrieved, the <see cref="HttpResult{T}.NextPageRequest"/> property of the result will contain the pagination request to be used for the next request to continue pagination.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="nextPageToken">The pagination request from the previous request result <see cref="HttpResult{T}.NextPageRequest"/> property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
Task<HttpResult<SharedUserTrade[]>> GetSpotUserTradeHistoryAsync(GetUserTradesRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
}
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetRecentTradesRestClient : ISharedClient
/// <summary>
/// Request definition for retrieving recent trades for a symbol on an exchange.
/// </summary>
public interface IGetRecentTradesEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Recent trades request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetRecentTradesOptions GetRecentTradesOptions { get; }
@@ -7,21 +7,24 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetTradeHistoryRestClient : ISharedClient
/// <summary>
/// Request definition for retrieving trade history from an exchange.
/// </summary>
public interface IGetTradeHistoryEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Trade history request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetTradeHistoryOptions GetTradeHistoryOptions { get; }
/// <summary>
/// Get public trade history, see <see cref="GetTradeHistoryOptions"/> for request options and exchange specific required/optional parameters. <br />
/// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination.
/// The result is paginated, if there are more results to be retrieved, the <see cref="HttpResult{T}.NextPageRequest"/> property of the result will contain the pagination request to be used for the next request to continue pagination.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="nextPageToken">The pagination request from the previous request result <see cref="HttpResult{T}.NextPageRequest"/> property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<HttpResult<SharedTrade[]>> GetTradeHistoryAsync(GetTradeHistoryRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface ITransferRestClient : ISharedClient
/// <summary>
/// Request definition for transferring funds between account types on an exchange.
/// </summary>
public interface ITransferEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Transfer request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
TransferOptions TransferOptions { get; }
@@ -7,21 +7,24 @@ using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
public interface IGetWithdrawalHistoryRestClient : ISharedClient
/// <summary>
/// Request definition for retrieving withdrawal history from an exchange
/// </summary>
public interface IGetWithdrawalHistoryEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Withdrawal records request options.<br />
/// Use <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
GetWithdrawalHistoryOptions GetWithdrawalHistoryOptions { get; }
/// <summary>
/// Get withdrawal records, see <see cref="GetWithdrawalHistoryOptions"/> for request options and exchange specific required/optional parameters. <br />
/// The result is paginated, if there are more results to be retrieved, the `NextPageRequest` property of the result will contain the pagination request to be used for the next request to continue pagination.
/// The result is paginated, if there are more results to be retrieved, the <see cref="HttpResult{T}.NextPageRequest"/> property of the result will contain the pagination request to be used for the next request to continue pagination.
/// </summary>
/// <param name="request">Request info</param>
/// <param name="nextPageToken">The pagination request from the previous request result `NextPageRequest` property to continue pagination</param>
/// <param name="nextPageToken">The pagination request from the previous request result <see cref="HttpResult{T}.NextPageRequest"/> property to continue pagination</param>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<HttpResult<SharedWithdrawal[]>> GetWithdrawalHistoryAsync(GetWithdrawalsRequest request, PageRequest? nextPageToken = null, CancellationToken ct = default);
@@ -0,0 +1,30 @@
using CryptoExchange.Net.Objects;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace CryptoExchange.Net.SharedApis
{
/// <summary>
/// Request definition for withdrawing a specific asset from an exchange.
/// </summary>
public interface IWithdrawEndpoint : ISharedApiEndpoint
{
/// <summary>
/// Withdraw request options.<br />
/// Use <see cref="EndpointOptions{TRequest, TClient}.RequiredRequestParameters"/>, <see cref="EndpointOptions.RequiredExchangeParameters"/> and <see cref="EndpointOptions.OptionalExchangeParameters"/> to check for required and optional parameters for the request. <br />
/// Exchange specific parameters can be added to the request via the `ExchangeParameters` property of the request object.
/// </summary>
WithdrawOptions WithdrawOptions { get; }
/// <summary>
/// Request a withdrawal, see <see cref="WithdrawOptions"/> for request options and exchange specific required/optional parameters. <br />
/// </summary>
/// <param name="request">Request info</param>
/// <param name="ct">Cancellation token</param>
/// <returns></returns>
Task<HttpResult<SharedId>> WithdrawAsync(WithdrawRequest request, CancellationToken ct = default);
}
}
@@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Globalization;
using System.Linq;
namespace CryptoExchange.Net.SharedApis
@@ -69,16 +70,7 @@ namespace CryptoExchange.Net.SharedApis
if (val == null)
return false;
try
{
Type t = Nullable.GetUnderlyingType(type) ?? type;
Convert.ChangeType(val, t);
return true;
}
catch
{
return false;
}
return TryConvertValue(val, type, out _);
}
/// <summary>
@@ -99,16 +91,7 @@ namespace CryptoExchange.Net.SharedApis
if (val == null)
return false;
try
{
Type t = Nullable.GetUnderlyingType(type) ?? type;
Convert.ChangeType(val, t);
return true;
}
catch
{
return false;
}
return TryConvertValue(val, type, out _);
}
/// <summary>
@@ -124,18 +107,14 @@ namespace CryptoExchange.Net.SharedApis
if (val == null)
return default;
if (val is T typeVal)
return typeVal;
if (!TryConvertValue(val, typeof(T), out var convertedValue))
{
throw new ArgumentException(
$"Incorrect type for parameter, expected {typeof(T).Name}",
name);
}
try
{
Type t = Nullable.GetUnderlyingType(typeof(T)) ?? typeof(T);
return (T)Convert.ChangeType(val, t);
}
catch
{
throw new ArgumentException("Incorrect type for parameter, expected " + typeof(T).Name, name);
}
return (T)convertedValue!;
}
/// <summary>
@@ -158,16 +137,52 @@ namespace CryptoExchange.Net.SharedApis
if (val == null)
return default;
if (!TryConvertValue(val, typeof(T), out var convertedValue))
{
throw new ArgumentException(
$"Incorrect type for parameter, expected {typeof(T).Name}",
name);
}
return (T)convertedValue!;
}
private static bool TryConvertValue(
object value,
Type expectedType,
out object? convertedValue)
{
var targetType = Nullable.GetUnderlyingType(expectedType) ?? expectedType;
if (targetType.IsInstanceOfType(value))
{
convertedValue = value;
return true;
}
if (targetType.IsEnum)
{
convertedValue = null;
return false;
}
try
{
var type = typeof(T);
Type t = Nullable.GetUnderlyingType(type) ?? type;
var result = Convert.ChangeType(val, t);
return (T)result;
convertedValue = Convert.ChangeType(
value,
targetType,
CultureInfo.InvariantCulture);
return true;
}
catch
catch (Exception ex) when (
ex is FormatException ||
ex is InvalidCastException ||
ex is OverflowException ||
ex is ArgumentException)
{
throw new ArgumentException("Incorrect type for parameter, expected " + typeof(T).Name, name);
convertedValue = null;
return false;
}
}
@@ -3,7 +3,7 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Options for canceling a futures order by client order id
/// </summary>
public class CancelFuturesOrderByClientOrderIdOptions : EndpointOptions<CancelOrderRequest, ICancelFuturesOrderByClientOrderIdRestClient>
public class CancelFuturesOrderByClientOrderIdOptions : EndpointOptions<CancelOrderRequest, ICancelFuturesOrderByClientOrderIdEndpoint>
{
/// <inheritdoc />
public override string Description => "Cancel a futures order by its client order id";
@@ -11,7 +11,7 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// ctor
/// </summary>
public CancelFuturesOrderByClientOrderIdOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesOrderByClientOrderIdRestClient.CancelFuturesOrderByClientOrderIdAsync))
public CancelFuturesOrderByClientOrderIdOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesOrderByClientOrderIdEndpoint.CancelFuturesOrderByClientOrderIdAsync))
{
}
}
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Options for canceling a futures order
/// </summary>
public class CancelFuturesOrderOptions : EndpointOptions<CancelOrderRequest, ICancelFuturesOrderRestClient>
public class CancelFuturesOrderOptions : EndpointOptions<CancelOrderRequest, ICancelFuturesOrderEndpoint>
{
/// <inheritdoc />
public override string Description => "Cancel a futures order";
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// ctor
/// </summary>
public CancelFuturesOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesOrderRestClient.CancelFuturesOrderAsync))
public CancelFuturesOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesOrderEndpoint.CancelFuturesOrderAsync))
{
}
}
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Options for canceling a TP/SL
/// </summary>
public class CancelFuturesTpSlOptions : EndpointOptions<CancelTpSlRequest, ICancelFuturesTpSlRestClient>
public class CancelFuturesTpSlOptions : EndpointOptions<CancelTpSlRequest, ICancelFuturesTpSlEndpoint>
{
/// <inheritdoc />
public override string Description => "Cancel a take profit or stop loss order for a futures position";
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// ctor
/// </summary>
public CancelFuturesTpSlOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesTpSlRestClient.CancelFuturesTpSlAsync))
public CancelFuturesTpSlOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesTpSlEndpoint.CancelFuturesTpSlAsync))
{
}
}
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Options for canceling spot trigger order
/// </summary>
public class CancelFuturesTriggerOrderOptions : EndpointOptions<CancelOrderRequest, ICancelFuturesTriggerOrderRestClient>
public class CancelFuturesTriggerOrderOptions : EndpointOptions<CancelOrderRequest, ICancelFuturesTriggerOrderEndpoint>
{
/// <inheritdoc />
public override string Description => "Cancel a futures trigger order";
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// ctor
/// </summary>
public CancelFuturesTriggerOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesTriggerOrderRestClient.CancelFuturesTriggerOrderAsync))
public CancelFuturesTriggerOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelFuturesTriggerOrderEndpoint.CancelFuturesTriggerOrderAsync))
{
}
}
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Options for canceling a spot order
/// </summary>
public class CancelSpotOrderByClientOrderIdOptions : EndpointOptions<CancelOrderRequest, ICancelSpotOrderByClientOrderIdRestClient>
public class CancelSpotOrderByClientOrderIdOptions : EndpointOptions<CancelOrderRequest, ICancelSpotOrderByClientOrderIdEndpoint>
{
/// <inheritdoc />
public override string Description => "Cancel a spot order by its client order id";
@@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// ctor
/// </summary>
public CancelSpotOrderByClientOrderIdOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelSpotOrderByClientOrderIdRestClient.CancelSpotOrderByClientOrderIdAsync))
public CancelSpotOrderByClientOrderIdOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelSpotOrderByClientOrderIdEndpoint.CancelSpotOrderByClientOrderIdAsync))
{
}
/// <inheritdoc />
public override Error? ValidateRequest(CancelOrderRequest request, ICancelSpotOrderByClientOrderIdRestClient client)
public override Error? ValidateRequest(CancelOrderRequest request, ICancelSpotOrderByClientOrderIdEndpoint client)
{
if (request.Symbol!.TradingMode != TradingMode.Spot)
return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot");
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Options for canceling a spot order
/// </summary>
public class CancelSpotOrderOptions : EndpointOptions<CancelOrderRequest, ICancelSpotOrderRestClient>
public class CancelSpotOrderOptions : EndpointOptions<CancelOrderRequest, ICancelSpotOrderEndpoint>
{
/// <inheritdoc />
public override string Description => "Cancel a spot order";
@@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// ctor
/// </summary>
public CancelSpotOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelSpotOrderRestClient.CancelSpotOrderAsync))
public CancelSpotOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelSpotOrderEndpoint.CancelSpotOrderAsync))
{
}
/// <inheritdoc />
public override Error? ValidateRequest(CancelOrderRequest request, ICancelSpotOrderRestClient client)
public override Error? ValidateRequest(CancelOrderRequest request, ICancelSpotOrderEndpoint client)
{
if (request.Symbol!.TradingMode != TradingMode.Spot)
return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot");
@@ -8,7 +8,7 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Options for requesting spot trigger order
/// </summary>
public class CancelSpotTriggerOrderOptions : EndpointOptions<CancelOrderRequest, ICancelSpotTriggerOrderRestClient>
public class CancelSpotTriggerOrderOptions : EndpointOptions<CancelOrderRequest, ICancelSpotTriggerOrderEndpoint>
{
/// <inheritdoc />
public override string Description => "Cancel a spot trigger order";
@@ -16,12 +16,12 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// ctor
/// </summary>
public CancelSpotTriggerOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelSpotTriggerOrderRestClient.CancelSpotTriggerOrderAsync))
public CancelSpotTriggerOrderOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(ICancelSpotTriggerOrderEndpoint.CancelSpotTriggerOrderAsync))
{
}
/// <inheritdoc />
public override Error? ValidateRequest(CancelOrderRequest request, ICancelSpotTriggerOrderRestClient client)
public override Error? ValidateRequest(CancelOrderRequest request, ICancelSpotTriggerOrderEndpoint client)
{
if (request.Symbol!.TradingMode != TradingMode.Spot)
return ArgumentError.Invalid("TradingMode", $"TradingMode.{request.Symbol!.TradingMode} is not supported, should be Spot");
@@ -7,7 +7,7 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// Options for closing position
/// </summary>
public class ClosePositionOptions : EndpointOptions<ClosePositionRequest, IClosePositionRestClient>
public class ClosePositionOptions : EndpointOptions<ClosePositionRequest, IClosePositionEndpoint>
{
/// <inheritdoc />
public override string Description => "Close an open futures position";
@@ -15,7 +15,7 @@ namespace CryptoExchange.Net.SharedApis
/// <summary>
/// ctor
/// </summary>
public ClosePositionOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IClosePositionRestClient.ClosePositionAsync))
public ClosePositionOptions(string exchange, bool authenticated) : base(exchange, authenticated, nameof(IClosePositionEndpoint.ClosePositionAsync))
{
}
}

Some files were not shown because too many files have changed in this diff Show More