using CryptoExchange.Net.Objects; using CryptoExchange.Net.Objects.Options; using CryptoExchange.Net.Objects.Sockets; using CryptoExchange.Net.Sockets.Default.Interfaces; using CryptoExchange.Net.Sockets.HighPerf.Interfaces; using System.Threading.Tasks; namespace CryptoExchange.Net.Interfaces.Clients { /// /// Socket API client /// public interface ISocketApiClient: IBaseApiClient { /// /// The current amount of socket connections on the API client /// int CurrentConnections { get; } /// /// The current amount of subscriptions over all connections /// int CurrentSubscriptions { get; } /// /// Incoming data Kbps /// double IncomingKbps { get; } /// /// The factory for creating sockets. Used for unit testing /// IWebsocketFactory SocketFactory { get; set; } /// /// High performance websocket factory /// IHighPerfConnectionFactory? HighPerfConnectionFactory { get; set; } /// /// Current client options /// SocketExchangeOptions ClientOptions { get; } /// /// Current API options /// SocketApiOptions ApiOptions { get; } /// /// Log the current state of connections and subscriptions /// string GetSubscriptionsState(bool includeSubDetails = true); /// /// Reconnect all connections /// /// Task ReconnectAsync(); /// /// Unsubscribe all subscriptions /// /// Task UnsubscribeAllAsync(); /// /// Unsubscribe an update subscription /// /// The id of the subscription to unsubscribe /// Task UnsubscribeAsync(int subscriptionId); /// /// Unsubscribe an update subscription /// /// The subscription to unsubscribe /// Task UnsubscribeAsync(UpdateSubscription subscription); /// /// Prepare connections which can subsequently be used for sending websocket requests. Note that this is not required. If not prepared it will be initialized at the first websocket request. /// /// Task PrepareConnectionsAsync(); } }