diff --git a/CryptoExchange.Net/Interfaces/ISpotClient.cs b/CryptoExchange.Net/Interfaces/CommonClients/IBaseRestClient.cs similarity index 71% rename from CryptoExchange.Net/Interfaces/ISpotClient.cs rename to CryptoExchange.Net/Interfaces/CommonClients/IBaseRestClient.cs index 6293e49..4624edf 100644 --- a/CryptoExchange.Net/Interfaces/ISpotClient.cs +++ b/CryptoExchange.Net/Interfaces/CommonClients/IBaseRestClient.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -namespace CryptoExchange.Net.Interfaces +namespace CryptoExchange.Net.Interfaces.CommonClients { /// /// Common rest client endpoints @@ -135,50 +135,4 @@ namespace CryptoExchange.Net.Interfaces /// Task> CancelOrderAsync(string orderId, string? symbol = null, CancellationToken ct = default); } - - /// - /// Common futures endpoints - /// - public interface IFuturesClient: IBaseRestClient - { - /// - /// Place an order - /// - /// The symbol the order is for - /// The side of the order - /// The type of the order - /// The quantity of the order - /// The price of the order, only for limit orders - /// [Optional] The account id to place the order on, required for some exchanges, ignored otherwise - /// [Optional] Leverage for this order. This is needed for some exchanges. For exchanges where this is not needed this parameter is ignored (and should be set before hand) - /// [Optional] Cancellation token for cancelling the request - /// The id of the resulting order - Task> PlaceOrderAsync(string symbol, CommonOrderSide side, CommonOrderType type, decimal quantity, decimal? price = null, int? leverage = null, string? accountId = null, CancellationToken ct = default); - - /// - /// Get position - /// - /// [Optional] Cancellation token for cancelling the request - /// - Task>> GetPositionsAsync(CancellationToken ct = default); - } - - /// - /// Common spot endpoints - /// - public interface ISpotClient: IBaseRestClient - { - /// - /// Place an order - /// - /// The symbol the order is for - /// The side of the order - /// The type of the order - /// The quantity of the order - /// The price of the order, only for limit orders - /// [Optional] The account id to place the order on, required for some exchanges, ignored otherwise - /// [Optional] Cancellation token for cancelling the request - /// The id of the resulting order - Task> PlaceOrderAsync(string symbol, CommonOrderSide side, CommonOrderType type, decimal quantity, decimal? price = null, string? accountId = null, CancellationToken ct = default); - } } diff --git a/CryptoExchange.Net/Interfaces/CommonClients/IFuturesClient.cs b/CryptoExchange.Net/Interfaces/CommonClients/IFuturesClient.cs new file mode 100644 index 0000000..af6c214 --- /dev/null +++ b/CryptoExchange.Net/Interfaces/CommonClients/IFuturesClient.cs @@ -0,0 +1,37 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using CryptoExchange.Net.CommonObjects; +using CryptoExchange.Net.Interfaces.CommonClients; +using CryptoExchange.Net.Objects; + +namespace CryptoExchange.Net.Interfaces.CommonClients +{ + /// + /// Common futures endpoints + /// + public interface IFuturesClient : IBaseRestClient + { + /// + /// Place an order + /// + /// The symbol the order is for + /// The side of the order + /// The type of the order + /// The quantity of the order + /// The price of the order, only for limit orders + /// [Optional] The account id to place the order on, required for some exchanges, ignored otherwise + /// [Optional] Leverage for this order. This is needed for some exchanges. For exchanges where this is not needed this parameter is ignored (and should be set before hand) + /// [Optional] Client specified id for this order + /// [Optional] Cancellation token for cancelling the request + /// The id of the resulting order + Task> PlaceOrderAsync(string symbol, CommonOrderSide side, CommonOrderType type, decimal quantity, decimal? price = null, int? leverage = null, string? accountId = null, string? clientOrderId = null, CancellationToken ct = default); + + /// + /// Get position + /// + /// [Optional] Cancellation token for cancelling the request + /// + Task>> GetPositionsAsync(CancellationToken ct = default); + } +} diff --git a/CryptoExchange.Net/Interfaces/CommonClients/ISpotClient.cs b/CryptoExchange.Net/Interfaces/CommonClients/ISpotClient.cs new file mode 100644 index 0000000..601786b --- /dev/null +++ b/CryptoExchange.Net/Interfaces/CommonClients/ISpotClient.cs @@ -0,0 +1,28 @@ +using CryptoExchange.Net.CommonObjects; +using CryptoExchange.Net.Interfaces.CommonClients; +using CryptoExchange.Net.Objects; +using System.Threading; +using System.Threading.Tasks; + +namespace CryptoExchange.Net.Interfaces.CommonClients +{ + /// + /// Common spot endpoints + /// + public interface ISpotClient: IBaseRestClient + { + /// + /// Place an order + /// + /// The symbol the order is for + /// The side of the order + /// The type of the order + /// The quantity of the order + /// The price of the order, only for limit orders + /// [Optional] The account id to place the order on, required for some exchanges, ignored otherwise + /// [Optional] Client specified id for this order + /// [Optional] Cancellation token for cancelling the request + /// The id of the resulting order + Task> PlaceOrderAsync(string symbol, CommonOrderSide side, CommonOrderType type, decimal quantity, decimal? price = null, string? accountId = null, string? clientOrderId = null, CancellationToken ct = default); + } +}