diff --git a/CryptoExchange.Net/Clients/CryptoRestClient.cs b/CryptoExchange.Net/Clients/CryptoRestClient.cs deleted file mode 100644 index c1255aa..0000000 --- a/CryptoExchange.Net/Clients/CryptoRestClient.cs +++ /dev/null @@ -1,47 +0,0 @@ -using CryptoExchange.Net.Interfaces; -using CryptoExchange.Net.Interfaces.CommonClients; -using Microsoft.Extensions.DependencyInjection; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace CryptoExchange.Net.Clients -{ - /// - public class CryptoRestClient : CryptoBaseClient, ICryptoRestClient - { - /// - /// ctor - /// - public CryptoRestClient() - { - } - - /// - /// ctor - /// - /// - public CryptoRestClient(IServiceProvider serviceProvider) : base(serviceProvider) - { - } - - /// - /// Get a list of the registered ISpotClient implementations - /// - /// - public IEnumerable GetSpotClients() - { - if (_serviceProvider == null) - return new List(); - - return _serviceProvider.GetServices().ToList(); - } - - /// - /// Get an ISpotClient implementation by exchange name - /// - /// - /// - public ISpotClient? SpotClient(string exchangeName) => _serviceProvider?.GetServices()?.SingleOrDefault(s => s.ExchangeName.Equals(exchangeName, StringComparison.InvariantCultureIgnoreCase)); - } -} diff --git a/CryptoExchange.Net/CommonObjects/Balance.cs b/CryptoExchange.Net/CommonObjects/Balance.cs deleted file mode 100644 index 696a35c..0000000 --- a/CryptoExchange.Net/CommonObjects/Balance.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace CryptoExchange.Net.CommonObjects -{ - /// - /// Balance data - /// - public class Balance: BaseCommonObject - { - /// - /// The asset name - /// - public string Asset { get; set; } = string.Empty; - /// - /// Quantity available - /// - public decimal? Available { get; set; } - /// - /// Total quantity - /// - public decimal? Total { get; set; } - } -} diff --git a/CryptoExchange.Net/CommonObjects/BaseComonObject.cs b/CryptoExchange.Net/CommonObjects/BaseComonObject.cs deleted file mode 100644 index 88bf356..0000000 --- a/CryptoExchange.Net/CommonObjects/BaseComonObject.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace CryptoExchange.Net.CommonObjects -{ - /// - /// Base class for common objects - /// - public class BaseCommonObject - { - /// - /// The source object the data is derived from - /// - public object SourceObject { get; set; } = null!; - } -} diff --git a/CryptoExchange.Net/CommonObjects/Enums.cs b/CryptoExchange.Net/CommonObjects/Enums.cs deleted file mode 100644 index 1d73e03..0000000 --- a/CryptoExchange.Net/CommonObjects/Enums.cs +++ /dev/null @@ -1,73 +0,0 @@ -namespace CryptoExchange.Net.CommonObjects -{ - /// - /// Order type - /// - public enum CommonOrderType - { - /// - /// Limit type - /// - Limit, - /// - /// Market type - /// - Market, - /// - /// Other order type - /// - Other - } - - /// - /// Order side - /// - public enum CommonOrderSide - { - /// - /// Buy order - /// - Buy, - /// - /// Sell order - /// - Sell - } - /// - /// Order status - /// - public enum CommonOrderStatus - { - /// - /// placed and not fully filled order - /// - Active, - /// - /// canceled order - /// - Canceled, - /// - /// filled order - /// - Filled - } - - /// - /// Position side - /// - public enum CommonPositionSide - { - /// - /// Long position - /// - Long, - /// - /// Short position - /// - Short, - /// - /// Both - /// - Both - } -} diff --git a/CryptoExchange.Net/CommonObjects/Kline.cs b/CryptoExchange.Net/CommonObjects/Kline.cs deleted file mode 100644 index ae01746..0000000 --- a/CryptoExchange.Net/CommonObjects/Kline.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; - -namespace CryptoExchange.Net.CommonObjects -{ - /// - /// Kline data - /// - public class Kline: BaseCommonObject - { - /// - /// Opening time of the kline - /// - public DateTime OpenTime { get; set; } - /// - /// Price at the open time - /// - public decimal? OpenPrice { get; set; } - /// - /// Highest price of the kline - /// - public decimal? HighPrice { get; set; } - /// - /// Lowest price of the kline - /// - public decimal? LowPrice { get; set; } - /// - /// Close price of the kline - /// - public decimal? ClosePrice { get; set; } - /// - /// Volume of the kline - /// - public decimal? Volume { get; set; } - } -} diff --git a/CryptoExchange.Net/CommonObjects/Order.cs b/CryptoExchange.Net/CommonObjects/Order.cs deleted file mode 100644 index 9d630c0..0000000 --- a/CryptoExchange.Net/CommonObjects/Order.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; - -namespace CryptoExchange.Net.CommonObjects -{ - /// - /// Order data - /// - public class Order: BaseCommonObject - { - /// - /// Id of the order - /// - public string Id { get; set; } = string.Empty; - /// - /// Symbol of the order - /// - public string Symbol { get; set; } = string.Empty; - /// - /// Price of the order - /// - public decimal? Price { get; set; } - /// - /// Quantity of the order - /// - public decimal? Quantity { get; set; } - /// - /// The quantity of the order which has been filled - /// - public decimal? QuantityFilled { get; set; } - /// - /// Status of the order - /// - public CommonOrderStatus Status { get; set; } - /// - /// Side of the order - /// - public CommonOrderSide Side { get; set; } - /// - /// Type of the order - /// - public CommonOrderType Type { get; set; } - /// - /// Order time - /// - public DateTime Timestamp { get; set; } - } -} diff --git a/CryptoExchange.Net/CommonObjects/OrderBook.cs b/CryptoExchange.Net/CommonObjects/OrderBook.cs deleted file mode 100644 index 2703675..0000000 --- a/CryptoExchange.Net/CommonObjects/OrderBook.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace CryptoExchange.Net.CommonObjects -{ - /// - /// Order book data - /// - public class OrderBook: BaseCommonObject - { - /// - /// List of bids - /// - public IEnumerable Bids { get; set; } = Array.Empty(); - /// - /// List of asks - /// - public IEnumerable Asks { get; set; } = Array.Empty(); - } -} diff --git a/CryptoExchange.Net/CommonObjects/OrderBookEntry.cs b/CryptoExchange.Net/CommonObjects/OrderBookEntry.cs deleted file mode 100644 index 3384f41..0000000 --- a/CryptoExchange.Net/CommonObjects/OrderBookEntry.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace CryptoExchange.Net.CommonObjects -{ - /// - /// Order book entry - /// - public class OrderBookEntry - { - /// - /// Quantity of the entry - /// - public decimal Quantity { get; set; } - /// - /// Price of the entry - /// - public decimal Price { get; set; } - } -} diff --git a/CryptoExchange.Net/CommonObjects/OrderId.cs b/CryptoExchange.Net/CommonObjects/OrderId.cs deleted file mode 100644 index 333e742..0000000 --- a/CryptoExchange.Net/CommonObjects/OrderId.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace CryptoExchange.Net.CommonObjects -{ - /// - /// Id of an order - /// - public class OrderId: BaseCommonObject - { - /// - /// Id of an order - /// - public string Id { get; set; } = string.Empty; - } -} diff --git a/CryptoExchange.Net/CommonObjects/Position.cs b/CryptoExchange.Net/CommonObjects/Position.cs deleted file mode 100644 index 4319a9f..0000000 --- a/CryptoExchange.Net/CommonObjects/Position.cs +++ /dev/null @@ -1,65 +0,0 @@ -namespace CryptoExchange.Net.CommonObjects -{ - /// - /// Position data - /// - public class Position: BaseCommonObject - { - /// - /// Id of the position - /// - public string? Id { get; set; } - /// - /// Symbol of the position - /// - public string Symbol { get; set; } = string.Empty; - /// - /// Leverage - /// - public decimal Leverage { get; set; } - /// - /// Position quantity - /// - public decimal Quantity { get; set; } - /// - /// Entry price - /// - public decimal? EntryPrice { get; set; } - /// - /// Liquidation price - /// - public decimal? LiquidationPrice { get; set; } - /// - /// Unrealized profit and loss - /// - public decimal? UnrealizedPnl { get; set; } - /// - /// Realized profit and loss - /// - public decimal? RealizedPnl { get; set; } - /// - /// Mark price - /// - public decimal? MarkPrice { get; set; } - /// - /// Auto adding margin - /// - public bool? AutoMargin { get; set; } - /// - /// Position margin - /// - public decimal? PositionMargin { get; set; } - /// - /// Position side - /// - public CommonPositionSide? Side { get; set; } - /// - /// Is isolated - /// - public bool? Isolated { get; set; } - /// - /// Maintenance margin - /// - public decimal? MaintananceMargin { get; set; } - } -} diff --git a/CryptoExchange.Net/CommonObjects/Symbol.cs b/CryptoExchange.Net/CommonObjects/Symbol.cs deleted file mode 100644 index 21fcea6..0000000 --- a/CryptoExchange.Net/CommonObjects/Symbol.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace CryptoExchange.Net.CommonObjects -{ - /// - /// Symbol data - /// - public class Symbol: BaseCommonObject - { - /// - /// Name of the symbol - /// - public string Name { get; set; } = string.Empty; - /// - /// Minimal quantity of an order - /// - public decimal? MinTradeQuantity { get; set; } - /// - /// Step with which the quantity should increase - /// - public decimal? QuantityStep { get; set; } - /// - /// step with which the price should increase - /// - public decimal? PriceStep { get; set; } - /// - /// The max amount of decimals for quantity - /// - public int? QuantityDecimals { get; set; } - /// - /// The max amount of decimal for price - /// - public int? PriceDecimals { get; set; } - } -} diff --git a/CryptoExchange.Net/CommonObjects/Ticker.cs b/CryptoExchange.Net/CommonObjects/Ticker.cs deleted file mode 100644 index 4513bf5..0000000 --- a/CryptoExchange.Net/CommonObjects/Ticker.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace CryptoExchange.Net.CommonObjects -{ - /// - /// Ticker data - /// - public class Ticker: BaseCommonObject - { - /// - /// Symbol - /// - public string Symbol { get; set; } = string.Empty; - /// - /// Price 24 hours ago - /// - public decimal? Price24H { get; set; } - /// - /// Last trade price - /// - public decimal? LastPrice { get; set; } - /// - /// 24 hour low price - /// - public decimal? LowPrice { get; set; } - /// - /// 24 hour high price - /// - public decimal? HighPrice { get; set; } - /// - /// 24 hour volume - /// - public decimal? Volume { get; set; } - } -} diff --git a/CryptoExchange.Net/CommonObjects/Trade.cs b/CryptoExchange.Net/CommonObjects/Trade.cs deleted file mode 100644 index ea15d9c..0000000 --- a/CryptoExchange.Net/CommonObjects/Trade.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; - -namespace CryptoExchange.Net.CommonObjects -{ - /// - /// Trade data - /// - public class Trade: BaseCommonObject - { - /// - /// Symbol of the trade - /// - public string Symbol { get; set; } = string.Empty; - /// - /// Price of the trade - /// - public decimal Price { get; set; } - /// - /// Quantity of the trade - /// - public decimal Quantity { get; set; } - /// - /// Timestamp of the trade - /// - public DateTime Timestamp { get; set; } - } - - /// - /// User trade info - /// - public class UserTrade: Trade - { - /// - /// Id of the trade - /// - public string Id { get; set; } = string.Empty; - /// - /// Order id of the trade - /// - public string? OrderId { get; set; } - /// - /// Fee of the trade - /// - public decimal? Fee { get; set; } - /// - /// The asset the fee is paid in - /// - public string? FeeAsset { get; set; } - } -} diff --git a/CryptoExchange.Net/Interfaces/CommonClients/IBaseRestClient.cs b/CryptoExchange.Net/Interfaces/CommonClients/IBaseRestClient.cs deleted file mode 100644 index ebd2bdb..0000000 --- a/CryptoExchange.Net/Interfaces/CommonClients/IBaseRestClient.cs +++ /dev/null @@ -1,94 +0,0 @@ -using CryptoExchange.Net.CommonObjects; -using CryptoExchange.Net.Objects; -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; - -namespace CryptoExchange.Net.Interfaces.CommonClients -{ - /// - /// DEPRECATED; use instead for common/shared functionality. See for more info. - /// - public interface IBaseRestClient - { - /// - /// DEPRECATED; use instead for common/shared functionality. See for more info. - /// - string ExchangeName { get; } - - /// - /// DEPRECATED; use instead for common/shared functionality. See for more info. - /// - event Action OnOrderPlaced; - /// - /// DEPRECATED; use instead for common/shared functionality. See for more info. - /// - event Action OnOrderCanceled; - - /// - /// DEPRECATED; use instead for common/shared functionality. See for more info. - /// - string GetSymbolName(string baseAsset, string quoteAsset); - - /// - /// DEPRECATED; use instead for common/shared functionality. See for more info. - /// - Task>> GetSymbolsAsync(CancellationToken ct = default); - - /// - /// DEPRECATED; use instead for common/shared functionality. See for more info. - /// - Task> GetTickerAsync(string symbol, CancellationToken ct = default); - - /// - /// DEPRECATED; use instead for common/shared functionality. See for more info. - /// - Task>> GetTickersAsync(CancellationToken ct = default); - - /// - /// DEPRECATED; use instead for common/shared functionality. See for more info. - /// - Task>> GetKlinesAsync(string symbol, TimeSpan timespan, DateTime? startTime = null, DateTime? endTime = null, int? limit = null, CancellationToken ct = default); - - /// - /// DEPRECATED; use instead for common/shared functionality. See for more info. - /// - Task> GetOrderBookAsync(string symbol, CancellationToken ct = default); - - /// - /// DEPRECATED; use instead for common/shared functionality. See for more info. - /// - Task>> GetRecentTradesAsync(string symbol, CancellationToken ct = default); - - /// - /// DEPRECATED; use instead for common/shared functionality. See for more info. - /// - Task>> GetBalancesAsync(string? accountId = null, CancellationToken ct = default); - - /// - /// DEPRECATED; use instead for common/shared functionality. See for more info. - /// - Task> GetOrderAsync(string orderId, string? symbol = null, CancellationToken ct = default); - - /// - /// DEPRECATED; use instead for common/shared functionality. See for more info. - /// - Task>> GetOrderTradesAsync(string orderId, string? symbol = null, CancellationToken ct = default); - - /// - /// DEPRECATED; use instead for common/shared functionality. See for more info. - /// - Task>> GetOpenOrdersAsync(string? symbol = null, CancellationToken ct = default); - - /// - /// DEPRECATED; use instead for common/shared functionality. See for more info. - /// - Task>> GetClosedOrdersAsync(string? symbol = null, CancellationToken ct = default); - - /// - /// DEPRECATED; use instead for common/shared functionality. See for more info. - /// - Task> CancelOrderAsync(string orderId, string? symbol = null, CancellationToken ct = default); - } -} diff --git a/CryptoExchange.Net/Interfaces/CommonClients/IFuturesClient.cs b/CryptoExchange.Net/Interfaces/CommonClients/IFuturesClient.cs deleted file mode 100644 index 8a6feb3..0000000 --- a/CryptoExchange.Net/Interfaces/CommonClients/IFuturesClient.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using CryptoExchange.Net.CommonObjects; -using CryptoExchange.Net.Objects; - -namespace CryptoExchange.Net.Interfaces.CommonClients -{ - /// - /// DEPRECATED; use instead for common/shared functionality. See for more info. - /// - public interface IFuturesClient : IBaseRestClient - { - /// - /// DEPRECATED; use instead for common/shared functionality. See for more info. - /// - 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); - - /// - /// DEPRECATED; use instead for common/shared functionality. See for more info. - /// - Task>> GetPositionsAsync(CancellationToken ct = default); - } -} diff --git a/CryptoExchange.Net/Interfaces/CommonClients/ISpotClient.cs b/CryptoExchange.Net/Interfaces/CommonClients/ISpotClient.cs deleted file mode 100644 index 8ca7ec4..0000000 --- a/CryptoExchange.Net/Interfaces/CommonClients/ISpotClient.cs +++ /dev/null @@ -1,18 +0,0 @@ -using CryptoExchange.Net.CommonObjects; -using CryptoExchange.Net.Objects; -using System.Threading; -using System.Threading.Tasks; - -namespace CryptoExchange.Net.Interfaces.CommonClients -{ - /// - /// DEPRECATED; use instead for common/shared functionality. See for more info. - /// - public interface ISpotClient: IBaseRestClient - { - /// - /// DEPRECATED; use instead for common/shared functionality. See for more info. - /// - Task> PlaceOrderAsync(string symbol, CommonOrderSide side, CommonOrderType type, decimal quantity, decimal? price = null, string? accountId = null, string? clientOrderId = null, CancellationToken ct = default); - } -} diff --git a/CryptoExchange.Net/Interfaces/ICryptoRestClient.cs b/CryptoExchange.Net/Interfaces/ICryptoRestClient.cs deleted file mode 100644 index f072ebc..0000000 --- a/CryptoExchange.Net/Interfaces/ICryptoRestClient.cs +++ /dev/null @@ -1,32 +0,0 @@ -using CryptoExchange.Net.Interfaces.CommonClients; -using System; -using System.Collections.Generic; - -namespace CryptoExchange.Net.Interfaces -{ - /// - /// Client for accessing REST API's for different exchanges - /// - public interface ICryptoRestClient - { - /// - /// Get a list of all registered common ISpotClient types - /// - /// - IEnumerable GetSpotClients(); - - /// - /// Get an ISpotClient implementation by exchange name - /// - /// - /// - ISpotClient? SpotClient(string exchangeName); - - /// - /// Try get - /// - /// - /// - T TryGet(Func createFunc); - } -}