From 932cc4864e77dfc39feeb1d26485d50ee1f63b1c Mon Sep 17 00:00:00 2001 From: Jkorf Date: Tue, 11 Mar 2025 15:15:43 +0100 Subject: [PATCH] Add ClientOrderId shared apis --- .../Futures/IFuturesOrderClientIdClient.cs | 37 +++++++++++++++++++ .../Rest/Spot/ISpotOrderClientIdClient.cs | 37 +++++++++++++++++++ .../SharedApis/Models/Rest/GetOrderRequest.cs | 2 +- 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 CryptoExchange.Net/SharedApis/Interfaces/Rest/Futures/IFuturesOrderClientIdClient.cs create mode 100644 CryptoExchange.Net/SharedApis/Interfaces/Rest/Spot/ISpotOrderClientIdClient.cs diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Futures/IFuturesOrderClientIdClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Futures/IFuturesOrderClientIdClient.cs new file mode 100644 index 0000000..eb31c1a --- /dev/null +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Futures/IFuturesOrderClientIdClient.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +using System.Threading; + +namespace CryptoExchange.Net.SharedApis +{ + /// + /// Client for managing futures orders using a client order id + /// + public interface IFuturesOrderClientIdClient : ISharedClient + { + /// + /// Futures get order by client order id request options + /// + EndpointOptions GetFuturesOrderByClientOrderIdOptions { get; } + + /// + /// Get info on a specific futures order using a client order id + /// + /// Request info + /// Cancellation token + Task> GetFuturesOrderByClientOrderIdAsync(GetOrderRequest request, CancellationToken ct = default); + + /// + /// Futures cancel order by client order id request options + /// + EndpointOptions CancelFuturesOrderByClientOrderIdOptions { get; } + /// + /// Cancel a futures order using client order id + /// + /// Request info + /// Cancellation token + Task> CancelFuturesOrderByClientOrderIdAsync(CancelOrderRequest request, CancellationToken ct = default); + } +} diff --git a/CryptoExchange.Net/SharedApis/Interfaces/Rest/Spot/ISpotOrderClientIdClient.cs b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Spot/ISpotOrderClientIdClient.cs new file mode 100644 index 0000000..42c96b0 --- /dev/null +++ b/CryptoExchange.Net/SharedApis/Interfaces/Rest/Spot/ISpotOrderClientIdClient.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +using System.Threading; + +namespace CryptoExchange.Net.SharedApis +{ + /// + /// Client for managing spot orders using a client order id + /// + public interface ISpotOrderClientIdClient : ISharedClient + { + /// + /// Spot get order by client order id request options + /// + EndpointOptions GetSpotOrderByClientOrderIdOptions { get; } + + /// + /// Get info on a specific spot order using a client order id + /// + /// Request info + /// Cancellation token + Task> GetSpotOrderByClientOrderIdAsync(GetOrderRequest request, CancellationToken ct = default); + + /// + /// Spot cancel order by client order id request options + /// + EndpointOptions CancelSpotOrderByClientOrderIdOptions { get; } + /// + /// Cancel a spot order using client order id + /// + /// Request info + /// Cancellation token + Task> CancelSpotOrderByClientOrderIdAsync(CancelOrderRequest request, CancellationToken ct = default); + } +} diff --git a/CryptoExchange.Net/SharedApis/Models/Rest/GetOrderRequest.cs b/CryptoExchange.Net/SharedApis/Models/Rest/GetOrderRequest.cs index cd86800..944edb2 100644 --- a/CryptoExchange.Net/SharedApis/Models/Rest/GetOrderRequest.cs +++ b/CryptoExchange.Net/SharedApis/Models/Rest/GetOrderRequest.cs @@ -1,7 +1,7 @@ namespace CryptoExchange.Net.SharedApis { /// - /// Request to retrieve info on a specifc order + /// Request to retrieve info on a specific order /// public record GetOrderRequest : SharedSymbolRequest {