diff --git a/CryptoExchange.Net.UnitTests/BaseClientTests.cs b/CryptoExchange.Net.UnitTests/BaseClientTests.cs index 39b9668..defb745 100644 --- a/CryptoExchange.Net.UnitTests/BaseClientTests.cs +++ b/CryptoExchange.Net.UnitTests/BaseClientTests.cs @@ -22,7 +22,7 @@ namespace CryptoExchange.Net.UnitTests // arrange // act // assert - Assert.Throws(typeof(ArgumentException), () => new TestBaseClient(new RestClientOptions("") { ApiCredentials = new ApiCredentials(key, secret) })); + Assert.Throws(typeof(ArgumentException), () => new TestBaseClient(new RestClientOptions() { ApiCredentials = new ApiCredentials(key, secret) })); } [TestCase] @@ -30,7 +30,7 @@ namespace CryptoExchange.Net.UnitTests { // arrange var logger = new TestStringLogger(); - var client = new TestBaseClient(new RestClientOptions("") + var client = new TestBaseClient(new RestClientOptions() { LogWriters = new List { logger } }); @@ -65,16 +65,18 @@ namespace CryptoExchange.Net.UnitTests [TestCase(null, LogLevel.Error, true)] [TestCase(null, LogLevel.Warning, true)] [TestCase(null, LogLevel.Information, true)] - [TestCase(null, LogLevel.Debug, true)] + [TestCase(null, LogLevel.Debug, false)] public void SettingLogLevel_Should_RestrictLogging(LogLevel? verbosity, LogLevel testVerbosity, bool expected) { // arrange var logger = new TestStringLogger(); - var client = new TestBaseClient(new RestClientOptions("") + var options = new RestClientOptions() { - LogWriters = new List { logger }, - LogLevel = verbosity - }); + LogWriters = new List { logger } + }; + if (verbosity != null) + options.LogLevel = verbosity.Value; + var client = new TestBaseClient(options); // act client.Log(testVerbosity, "Test"); diff --git a/CryptoExchange.Net.UnitTests/RestClientTests.cs b/CryptoExchange.Net.UnitTests/RestClientTests.cs index 9a569ca..6152424 100644 --- a/CryptoExchange.Net.UnitTests/RestClientTests.cs +++ b/CryptoExchange.Net.UnitTests/RestClientTests.cs @@ -105,7 +105,7 @@ namespace CryptoExchange.Net.UnitTests { // arrange // act - var client = new TestRestClient(new RestClientOptions("") + var client = new TestRestClient(new RestClientOptions() { BaseAddress = "http://test.address.com", RateLimiters = new List{new RateLimiterTotal(1, TimeSpan.FromSeconds(1))}, @@ -115,10 +115,10 @@ namespace CryptoExchange.Net.UnitTests // assert - Assert.IsTrue(client.BaseAddress == "http://test.address.com/"); - Assert.IsTrue(client.RateLimiters.Count() == 1); - Assert.IsTrue(client.RateLimitBehaviour == RateLimitingBehaviour.Fail); - Assert.IsTrue(client.RequestTimeout == TimeSpan.FromMinutes(1)); + Assert.IsTrue(client.ClientOptions.BaseAddress == "http://test.address.com/"); + Assert.IsTrue(client.ClientOptions.RateLimiters.Count() == 1); + Assert.IsTrue(client.ClientOptions.RateLimitingBehaviour == RateLimitingBehaviour.Fail); + Assert.IsTrue(client.ClientOptions.RequestTimeout == TimeSpan.FromMinutes(1)); } [TestCase("GET", HttpMethodParameterPosition.InUri)] // No need to test InBody for GET since thats not valid @@ -132,7 +132,7 @@ namespace CryptoExchange.Net.UnitTests { // arrange // act - var client = new TestRestClient(new RestClientOptions("") + var client = new TestRestClient(new RestClientOptions() { BaseAddress = "http://test.address.com", }); @@ -165,7 +165,7 @@ namespace CryptoExchange.Net.UnitTests public void SettingRateLimitingBehaviourToFail_Should_FailLimitedRequests() { // arrange - var client = new TestRestClient(new RestClientOptions("") + var client = new TestRestClient(new RestClientOptions() { RateLimiters = new List { new RateLimiterTotal(1, TimeSpan.FromSeconds(1)) }, RateLimitingBehaviour = RateLimitingBehaviour.Fail @@ -188,7 +188,7 @@ namespace CryptoExchange.Net.UnitTests public void SettingRateLimitingBehaviourToWait_Should_DelayLimitedRequests() { // arrange - var client = new TestRestClient(new RestClientOptions("") + var client = new TestRestClient(new RestClientOptions() { RateLimiters = new List { new RateLimiterTotal(1, TimeSpan.FromSeconds(1)) }, RateLimitingBehaviour = RateLimitingBehaviour.Wait @@ -213,7 +213,7 @@ namespace CryptoExchange.Net.UnitTests public void SettingApiKeyRateLimiter_Should_DelayRequestsFromSameKey() { // arrange - var client = new TestRestClient(new RestClientOptions("") + var client = new TestRestClient(new RestClientOptions() { RateLimiters = new List { new RateLimiterAPIKey(1, TimeSpan.FromSeconds(1)) }, RateLimitingBehaviour = RateLimitingBehaviour.Wait, diff --git a/CryptoExchange.Net.UnitTests/SocketClientTests.cs b/CryptoExchange.Net.UnitTests/SocketClientTests.cs index bacb863..0e3ca6d 100644 --- a/CryptoExchange.Net.UnitTests/SocketClientTests.cs +++ b/CryptoExchange.Net.UnitTests/SocketClientTests.cs @@ -17,7 +17,7 @@ namespace CryptoExchange.Net.UnitTests { //arrange //act - var client = new TestSocketClient(new SocketClientOptions("") + var client = new TestSocketClient(new SocketClientOptions() { BaseAddress = "http://test.address.com", ReconnectInterval = TimeSpan.FromSeconds(6) @@ -25,7 +25,7 @@ namespace CryptoExchange.Net.UnitTests //assert - Assert.IsTrue(client.BaseAddress == "http://test.address.com/"); + Assert.IsTrue(client.ClientOptions.BaseAddress == "http://test.address.com/"); Assert.IsTrue(client.ClientOptions.ReconnectInterval.TotalSeconds == 6); } @@ -49,7 +49,7 @@ namespace CryptoExchange.Net.UnitTests public void SocketMessages_Should_BeProcessedInDataHandlers() { // arrange - var client = new TestSocketClient(new SocketClientOptions("") { ReconnectInterval = TimeSpan.Zero, LogLevel = LogLevel.Debug }); + var client = new TestSocketClient(new SocketClientOptions() { ReconnectInterval = TimeSpan.Zero, LogLevel = LogLevel.Debug }); var socket = client.CreateSocket(); socket.ShouldReconnect = true; socket.CanConnect = true; @@ -77,7 +77,7 @@ namespace CryptoExchange.Net.UnitTests public void SocketMessages_Should_ContainOriginalDataIfEnabled(bool enabled) { // arrange - var client = new TestSocketClient(new SocketClientOptions("") { ReconnectInterval = TimeSpan.Zero, LogLevel = LogLevel.Debug, OutputOriginalData = enabled }); + var client = new TestSocketClient(new SocketClientOptions() { ReconnectInterval = TimeSpan.Zero, LogLevel = LogLevel.Debug, OutputOriginalData = enabled }); var socket = client.CreateSocket(); socket.ShouldReconnect = true; socket.CanConnect = true; @@ -105,7 +105,7 @@ namespace CryptoExchange.Net.UnitTests { // arrange bool reconnected = false; - var client = new TestSocketClient(new SocketClientOptions("") { ReconnectInterval = TimeSpan.Zero, LogLevel = LogLevel.Debug }); + var client = new TestSocketClient(new SocketClientOptions() { ReconnectInterval = TimeSpan.Zero, LogLevel = LogLevel.Debug }); var socket = client.CreateSocket(); socket.ShouldReconnect = true; socket.CanConnect = true; @@ -132,7 +132,7 @@ namespace CryptoExchange.Net.UnitTests public void UnsubscribingStream_Should_CloseTheSocket() { // arrange - var client = new TestSocketClient(new SocketClientOptions("") { ReconnectInterval = TimeSpan.Zero, LogLevel = LogLevel.Debug }); + var client = new TestSocketClient(new SocketClientOptions() { ReconnectInterval = TimeSpan.Zero, LogLevel = LogLevel.Debug }); var socket = client.CreateSocket(); socket.CanConnect = true; var sub = new SocketConnection(client, socket); @@ -150,7 +150,7 @@ namespace CryptoExchange.Net.UnitTests public void UnsubscribingAll_Should_CloseAllSockets() { // arrange - var client = new TestSocketClient(new SocketClientOptions("") { ReconnectInterval = TimeSpan.Zero, LogLevel = LogLevel.Debug }); + var client = new TestSocketClient(new SocketClientOptions() { ReconnectInterval = TimeSpan.Zero, LogLevel = LogLevel.Debug }); var socket1 = client.CreateSocket(); var socket2 = client.CreateSocket(); socket1.CanConnect = true; @@ -172,7 +172,7 @@ namespace CryptoExchange.Net.UnitTests public void FailingToConnectSocket_Should_ReturnError() { // arrange - var client = new TestSocketClient(new SocketClientOptions("") { ReconnectInterval = TimeSpan.Zero, LogLevel = LogLevel.Debug }); + var client = new TestSocketClient(new SocketClientOptions() { ReconnectInterval = TimeSpan.Zero, LogLevel = LogLevel.Debug }); var socket = client.CreateSocket(); socket.CanConnect = false; var sub = new SocketConnection(client, socket); diff --git a/CryptoExchange.Net.UnitTests/SymbolOrderBookTests.cs b/CryptoExchange.Net.UnitTests/SymbolOrderBookTests.cs index f3692a9..d28eeb3 100644 --- a/CryptoExchange.Net.UnitTests/SymbolOrderBookTests.cs +++ b/CryptoExchange.Net.UnitTests/SymbolOrderBookTests.cs @@ -12,11 +12,11 @@ namespace CryptoExchange.Net.UnitTests [TestFixture] public class SymbolOrderBookTests { - private static OrderBookOptions defaultOrderBookOptions = new OrderBookOptions("Test", true, false); + private static OrderBookOptions defaultOrderBookOptions = new OrderBookOptions(); private class TestableSymbolOrderBook : SymbolOrderBook { - public TestableSymbolOrderBook() : base("BTC/USD", defaultOrderBookOptions) + public TestableSymbolOrderBook() : base("Test", "BTC/USD", defaultOrderBookOptions) { } diff --git a/CryptoExchange.Net.UnitTests/TestImplementations/TestBaseClient.cs b/CryptoExchange.Net.UnitTests/TestImplementations/TestBaseClient.cs index cac8ca6..b42adee 100644 --- a/CryptoExchange.Net.UnitTests/TestImplementations/TestBaseClient.cs +++ b/CryptoExchange.Net.UnitTests/TestImplementations/TestBaseClient.cs @@ -8,7 +8,7 @@ namespace CryptoExchange.Net.UnitTests { public class TestBaseClient: BaseClient { - public TestBaseClient(): base("Test", new RestClientOptions("http://testurl.url"), null) + public TestBaseClient(): base("Test", new RestClientOptions(), null) { } @@ -23,7 +23,7 @@ namespace CryptoExchange.Net.UnitTests public CallResult Deserialize(string data) { - return Deserialize(data, false); + return Deserialize(data, null, null); } public string FillParameters(string path, params string[] values) diff --git a/CryptoExchange.Net.UnitTests/TestImplementations/TestRestClient.cs b/CryptoExchange.Net.UnitTests/TestImplementations/TestRestClient.cs index 3d70993..0ef722b 100644 --- a/CryptoExchange.Net.UnitTests/TestImplementations/TestRestClient.cs +++ b/CryptoExchange.Net.UnitTests/TestImplementations/TestRestClient.cs @@ -17,7 +17,7 @@ namespace CryptoExchange.Net.UnitTests.TestImplementations { public class TestRestClient: RestClient { - public TestRestClient() : base("Test", new RestClientOptions("http://testurl.url"), null) + public TestRestClient() : base("Test", new RestClientOptions(), null) { RequestFactory = new Mock().Object; } diff --git a/CryptoExchange.Net.UnitTests/TestImplementations/TestSocketClient.cs b/CryptoExchange.Net.UnitTests/TestImplementations/TestSocketClient.cs index de62926..db86c4c 100644 --- a/CryptoExchange.Net.UnitTests/TestImplementations/TestSocketClient.cs +++ b/CryptoExchange.Net.UnitTests/TestImplementations/TestSocketClient.cs @@ -11,7 +11,7 @@ namespace CryptoExchange.Net.UnitTests.TestImplementations { public class TestSocketClient: SocketClient { - public TestSocketClient() : this(new SocketClientOptions("http://testurl.url")) + public TestSocketClient() : this(new SocketClientOptions()) { } @@ -24,7 +24,7 @@ namespace CryptoExchange.Net.UnitTests.TestImplementations public TestSocket CreateSocket() { Mock.Get(SocketFactory).Setup(f => f.CreateWebsocket(It.IsAny(), It.IsAny())).Returns(new TestSocket()); - return (TestSocket)CreateSocket(BaseAddress); + return (TestSocket)CreateSocket(ClientOptions.BaseAddress); } public CallResult ConnectSocketSub(SocketConnection sub) diff --git a/CryptoExchange.Net/Authentication/ApiCredentials.cs b/CryptoExchange.Net/Authentication/ApiCredentials.cs index 9f7242f..60c6aa6 100644 --- a/CryptoExchange.Net/Authentication/ApiCredentials.cs +++ b/CryptoExchange.Net/Authentication/ApiCredentials.cs @@ -67,7 +67,7 @@ namespace CryptoExchange.Net.Authentication /// Copy the credentials /// /// - public ApiCredentials Copy() + public virtual ApiCredentials Copy() { if (PrivateKey == null) return new ApiCredentials(Key!.GetString(), Secret!.GetString()); diff --git a/CryptoExchange.Net/Converters/BaseConverter.cs b/CryptoExchange.Net/Converters/BaseConverter.cs index 02928a7..75d5948 100644 --- a/CryptoExchange.Net/Converters/BaseConverter.cs +++ b/CryptoExchange.Net/Converters/BaseConverter.cs @@ -43,7 +43,11 @@ namespace CryptoExchange.Net.Converters if (reader.Value == null) return null; - if (!GetValue(reader.Value.ToString(), out var result)) + var stringValue = reader.Value.ToString(); + if (string.IsNullOrWhiteSpace(stringValue)) + return null; + + if (!GetValue(stringValue, out var result)) { Debug.WriteLine($"Cannot map enum. Type: {typeof(T)}, Value: {reader.Value}"); return null; diff --git a/CryptoExchange.Net/CryptoExchange.Net.xml b/CryptoExchange.Net/CryptoExchange.Net.xml deleted file mode 100644 index e3846fd..0000000 --- a/CryptoExchange.Net/CryptoExchange.Net.xml +++ /dev/null @@ -1,4046 +0,0 @@ - - - - CryptoExchange.Net - - - - - Used for conversion in ArrayConverter - - - - - Marks property as optional - - - - - Api credentials info - - - - - The api key to authenticate requests - - - - - The api secret to authenticate requests - - - - - The private key to authenticate requests - - - - - Create Api credentials providing a private key for authentication - - The private key used for signing - - - - Create Api credentials providing an api key and secret for authentication - - The api key used for identification - The api secret used for signing - - - - Create Api credentials providing an api key and secret for authentication - - The api key used for identification - The api secret used for signing - - - - Copy the credentials - - - - - - Create Api credentials providing a stream containing json data. The json data should include two values: apiKey and apiSecret - - The stream containing the json data - A key to identify the credentials for the API. For example, when set to `binanceKey` the json data should contain a value for the property `binanceKey`. Defaults to 'apiKey'. - A key to identify the credentials for the API. For example, when set to `binanceSecret` the json data should contain a value for the property `binanceSecret`. Defaults to 'apiSecret'. - - - - Try get the value of a key from a JToken - - - - - - - - Dispose - - - - - Base class for authentication providers - - - - - The provided credentials - - - - - ctor - - - - - - Add authentication to the parameter list based on the provided credentials - - The uri the request is for - The HTTP method of the request - The provided parameters for the request - Wether or not the request needs to be signed. If not typically the parameters list can just be returned - Where parameters are placed, in the URI or in the request body - How array parameters are serialized - Should return the original parameter list including any authentication parameters needed - - - - Add authentication to the header dictionary based on the provided credentials - - The uri the request is for - The HTTP method of the request - The provided parameters for the request - Wether or not the request needs to be signed. If not typically the parameters list can just be returned - Where post parameters are placed, in the URI or in the request body - How array parameters are serialized - Should return a dictionary containing any header key/value pairs needed for authenticating the request - - - - Sign a string - - - - - - - Sign a byte array - - - - - - - Convert byte array to hex - - - - - - - Private key info - - - - - The private key - - - - - The private key's pass phrase - - - - - Indicates if the private key is encrypted or not - - - - - Create a private key providing an encrypted key information - - The private key used for signing - The private key's passphrase - - - - Create a private key providing an encrypted key information - - The private key used for signing - The private key's passphrase - - - - Create a private key providing an unencrypted key information - - The private key used for signing - - - - Create a private key providing an encrypted key information - - The private key used for signing - - - - Copy the private key - - - - - - Dispose - - - - - The base for all clients, websocket client and rest client - - - - - The name of the exchange the client is for - - - - - The log object - - - - - The authentication provider - - - - - The last used id, use NextId() to get the next id and up this - - - - - Lock for id generating - - - - - A default serializer - - - - - Provided client options - - - - - ctor - - The name of the exchange this client is for - The options for this client - The authentication provider for this client (can be null if no credentials are provided) - - - - Set the authentication provider, can be used when manually setting the API credentials - - - - - - Tries to parse the json data and returns a JToken, validating the input not being empty and being valid json - - The data to parse - - - - - Deserialize a string into an object - - The type to deserialize into - The data to deserialize - A specific serializer to use - Id of the request the data is returned from (used for grouping logging by request) - - - - - Deserialize a JToken into an object - - The type to deserialize into - The data to deserialize - A specific serializer to use - Id of the request the data is returned from (used for grouping logging by request) - - - - - Deserialize a stream into an object - - The type to deserialize into - The stream to deserialize - A specific serializer to use - Id of the request the data is returned from (used for grouping logging by request) - Milliseconds response time for the request this stream is a response for - - - - - Generate a new unique id. The id is staticly stored so it is guarenteed to be unique across different client instances - - - - - - Fill parameters in a path. Parameters are specified by '{}' and should be specified in occuring sequence - - The total path string - The values to fill - - - - - Dispose - - - - - Converter for arrays to objects. Can deserialize data like [0.1, 0.2, "test"] to an object. Mapping is done by marking the class with [JsonConverter(typeof(ArrayConverter))] and the properties - with [ArrayProperty(x)] where x is the index of the property in the array - - - - - - - - - - - - - - Mark property as an index in the array - - - - - The index in the array - - - - - ctor - - - - - - Base class for enum converters - - Type of enum to convert - - - - The enum->string mapping - - - - - ctor - - - - - - - - - - - - Convert a string value - - - - - - - - - - converter for milliseconds to datetime - - - - - - - - - - - - - - Converter for nanoseconds to datetime - - - - - - - - - - - - - - Converter for seconds to datetime - - - - - - - - - - - - - - converter for datetime string (yyyymmdd) to datetime - - - - - - - - - - - - - - Converter for utc datetime - - - - - - - - - - - - - - General helpers functions - - - - - Clamp a value between a min and max - - - - - - - - - Adjust a value to be between the min and max parameters and rounded to the closest step. - - The min value - The max value - The step size the value should be floored to. For example, value 2.548 with a step size of 0.01 will output 2.54 - How to round - The input value - - - - - Adjust a value to be between the min and max parameters and rounded to the closest precision. - - The min value - The max value - The precision the value should be rounded to. For example, value 2.554215 with a precision of 5 will output 2.5542 - How to round - The input value - - - - - Round a value to have the provided total number of digits. For example, value 253.12332 with 5 digits would be 253.12 - - The value to round - The total amount of digits (NOT decimal places) to round to - How to round - - - - - Rounds a value down to - - - - - - - - Strips any trailing zero's of a decimal value, useful when converting the value to string. - - - - - - - Common balance - - - - - The asset name - - - - - Quantity available - - - - - Total quantity - - - - - Common trade - - - - - Id of the trade - - - - - Price of the trade - - - - - Quantity of the trade - - - - - Fee paid for the trade - - - - - The asset fee was paid in - - - - - Trade time - - - - - Shared interface for exchange wrappers based on the CryptoExchange.Net package - - - - - Should be triggered on order placing - - - - - Should be triggered on order cancelling - - - - - Get the symbol name based on a base and quote asset - - - - - - - - Get a list of symbols for the exchange - - - - - - Get a list of tickers for the exchange - - - - - - Get a ticker for the exchange - - The symbol to get klines for - - - - - Get a list of candles for a given symbol on the exchange - - The symbol to retrieve the candles for - The timespan to retrieve the candles for. The supported value are dependent on the exchange - [Optional] Start time to retrieve klines for - [Optional] End time to retrieve klines for - [Optional] Max number of results - - - - - Get the order book for a symbol - - The symbol to get the book for - - - - - The recent trades for a symbol - - The symbol to get the trades for - - - - - 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 - The id of the resulting order - - - - Get an order by id - - The id - [Optional] The symbol the order is on, required for some exchanges, ignored otherwise - - - - - Get trades for an order by id - - The id - [Optional] The symbol the order is on, required for some exchanges, ignored otherwise - - - - - Get a list of open orders - - [Optional] The symbol to get open orders for, required for some exchanges, ignored otherwise - - - - - Get a list of closed orders - - [Optional] The symbol to get closed orders for, required for some exchanges, ignored otherwise - - - - - Cancel an order by id - - The id - [Optional] The symbol the order is on, required for some exchanges, ignored otherwise - - - - - Get balances - - [Optional] The account id to retrieve balances for, required for some exchanges, ignored otherwise - - - - - Common order id - - - - - Limit type - - - - - Market type - - - - - Other order type - - - - - Common order side - - - - - Buy order - - - - - Sell order - - - - - Common order status - - - - - placed and not fully filled order - - - - - canceled order - - - - - filled order - - - - - Common kline - - - - - High price for this kline - - - - - Low price for this kline - - - - - Open price for this kline - - - - - Close price for this kline - - - - - Open time for this kline - - - - - Volume of this kline - - - - - Common order - - - - - Symbol of the order - - - - - Price of the order - - - - - Quantity of the order - - - - - Status of the order - - - - - Whether the order is active - - - - - Side of the order - - - - - Type of the order - - - - - order time - - - - - Common order book - - - - - Bids - - - - - Asks - - - - - Common order id - - - - - Id of the order - - - - - Recent trade - - - - - Price of the trade - - - - - Quantity of the trade - - - - - Trade time - - - - - Common symbol - - - - - Symbol name - - - - - Minimum trade quantity - - - - - Common ticker - - - - - Symbol name - - - - - High price - - - - - Low price - - - - - Volume - - - - - Helper methods - - - - - Add a parameter - - - - - - - - Add a parameter - - - - - - - - - Add a parameter - - - - - - - - Add a parameter - - - - - - - - - Add an optional parameter. Not added if value is null - - - - - - - - Add an optional parameter. Not added if value is null - - - - - - - - - Add an optional parameter. Not added if value is null - - - - - - - - Add an optional parameter. Not added if value is null - - - - - - - - - Create a query string of the specified parameters - - The parameters to use - Whether or not the values should be url encoded - How to serialize array parameters - - - - - Get the string the secure string is representing - - The source secure string - - - - - Create a secure string from a string - - - - - - - String to JToken - - - - - - - - Validates an int is one of the allowed values - - Value of the int - Name of the parameter - Allowed values - - - - Validates an int is between two values - - The value of the int - Name of the parameter - Min value - Max value - - - - Validates a string is not null or empty - - The value of the string - Name of the parameter - - - - Validates a string is null or not empty - - - - - - - Validates an object is not null - - The value of the object - Name of the parameter - - - - Validates a list is not null or empty - - The value of the object - Name of the parameter - - - - Format an exception and inner exception to a readable string - - - - - - - A provider for a nonce value used when signing requests - - - - - Get nonce value. Nonce value should be unique and incremental for each call - - Nonce value - - - - Rate limiter interface - - - - - Limit the request if needed - - - - - - - - - - Request interface - - - - - Accept header - - - - - Content - - - - - Method - - - - - Uri - - - - - internal request id for tracing - - - - - Set byte content - - - - - - Set string content - - - - - - - Add a header to the request - - - - - - - Get all headers - - - - - - Get the response - - - - - - - Request factory interface - - - - - Create a request for an uri - - - - - - - - - Configure the requests created by this factory - - Request timeout to use - Proxy settings to use - Optional shared http client instance - - - - Response object interface - - - - - The response status code - - - - - Whether the status code indicates a success status - - - - - The response headers - - - - - Get the response stream - - - - - - Close the response - - - - - Base class for rest API implementations - - - - - The factory for creating requests. Used for unit testing - - - - - The total amount of requests made - - - - - Adds a rate limiter to the client. There are 2 choices, the and the . - - The limiter to add - - - - Removes all rate limiters from this client - - - - - Client options - - - - - Base class for socket API implementations - - - - - Client options - - - - - Incoming kilobytes per second of data - - - - - Unsubscribe from a stream - - The subscription to unsubscribe - - - - - Unsubscribe all subscriptions - - - - - - Interface for order book - - - - - The status of the order book. Order book is up to date when the status is `Synced` - - - - - Last update identifier - - - - - The symbol of the order book - - - - - Event when the state changes - - - - - Event when order book was updated. Be careful! It can generate a lot of events at high-liquidity markets - - - - - Event when the BestBid or BestAsk changes ie a Pricing Tick - - - - - Timestamp of the last update - - - - - The number of asks in the book - - - - - The number of bids in the book - - - - - Get a snapshot of the book at this moment - - - - - The list of asks - - - - - The list of bids - - - - - The best bid currently in the order book - - - - - The best ask currently in the order book - - - - - BestBid/BesAsk returned as a pair - - - - - Start connecting and synchronizing the order book - - - - - - Stop syncing the order book - - - - - - Get the average price that a market order would fill at at the current order book state. This is no guarentee that an order of that quantity would actually be filled - at that price since between this calculation and the order placement the book can have changed. - - The quantity in base asset to fill - The type - Average fill price - - - - String representation of the top x entries - - - - - - Interface for order book entries - - - - - The quantity of the entry - - - - - The price of the entry - - - - - Interface for order book entries - - - - - Sequence of the update - - - - - Interface for websocket interaction - - - - - Websocket closed - - - - - Websocket message received - - - - - Websocket error - - - - - Websocket opened - - - - - Id - - - - - Origin - - - - - Encoding to use - - - - - Reconnecting - - - - - The max amount of outgoing messages per second - - - - - The current kilobytes per second of data being received, averaged over the last 3 seconds - - - - - Handler for byte data - - - - - Handler for string data - - - - - Socket url - - - - - Is closed - - - - - Is open - - - - - Supported ssl protocols - - - - - Timeout - - - - - Connect the socket - - - - - - Send data - - - - - - Reset socket - - - - - Close the connecting - - - - - - Set proxy - - - - - - Websocket factory interface - - - - - Create a websocket for an url - - - - - - - - Create a websocket for an url - - - - - - - - - - Log to console - - - - - - - - - - - - - - Default log writer, writes to debug - - - - - - - - - - - - - - Log implementation - - - - - List of ILogger implementations to forward the message to - - - - - The verbosity of the logging, anything more verbose will not be forwarded to the writers - - - - - Client name - - - - - ctor - - The name of the client the logging is used in - - - - Set the writers - - - - - - Write a log entry - - The verbosity of the message - The message to log - - - - Proxy info - - - - - The host address of the proxy - - - - - The port of the proxy - - - - - The login of the proxy - - - - - The password of the proxy - - - - - Create new settings for a proxy - - The proxy hostname/ip - The proxy port - - - - Create new settings for a proxy - - The proxy hostname/ip - The proxy port - The proxy login - The proxy password - - - - Create new settings for a proxy - - The proxy hostname/ip - The proxy port - The proxy login - The proxy password - - - - Async auto reset based on Stephen Toub`s implementation - https://devblogs.microsoft.com/pfxteam/building-async-coordination-primitives-part-2-asyncautoresetevent/ - - - - - New AsyncResetEvent - - - - - - - Wait for the AutoResetEvent to be set - - - - - - Signal a waiter - - - - - Dispose - - - - - Comparer for byte order - - - - - Compare function - - - - - - - - The result of an operation - - - - - An error if the call didn't succeed, will always be filled if Success = false - - - - - Whether the call was successful - - - - - ctor - - - - - - Overwrite bool check so we can use if(callResult) instead of if(callResult.Success) - - - - - - Create an error result - - - - - - - The result of an operation - - - - - - The data returned by the call, only available when Success = true - - - - - The original data returned by the call, only available when `OutputOriginalData` is set to `true` in the client options - - - - - ctor - - - - - - - Overwrite bool check so we can use if(callResult) instead of if(callResult.Success) - - - - - - Whether the call was successful or not. Useful for nullability checking. - - The data returned by the call. - on failure. - true when succeeded, false otherwise. - - - - Create an error result - - - - - - - Copy the WebCallResult to a new data type - - The new type - The data of the new type - - - - - The result of a request - - - - - The status code of the response. Note that a OK status does not always indicate success, check the Success parameter for this. - - - - - The response headers - - - - - ctor - - Status code - Response headers - Error - - - - Create an error result - - Status code - Response headers - Error - - - - - Create an error result - - - - - - - The result of a request - - - - - - The status code of the response. Note that a OK status does not always indicate success, check the Success parameter for this. - - - - - The response headers - - - - - ctor - - - - - - - - - ctor - - - - - - - - - - Copy the WebCallResult to a new data type - - The new type - The data of the new type - - - - - Create an error result - - - - - - - - - Constants - - - - - Json content type header - - - - - Form content type header - - - - - What to do when a request would exceed the rate limit - - - - - Fail the request - - - - - Wait till the request can be send - - - - - Where the parameters for a HttpMethod should be added in a request - - - - - Parameters in body - - - - - Parameters in url - - - - - The format of the request body - - - - - Form data - - - - - Json - - - - - Status of the order book - - - - - Not connected - - - - - Connecting - - - - - Reconnecting - - - - - Syncing data - - - - - Data synced, order book is up to date - - - - - Order book entry type - - - - - Ask - - - - - Bid - - - - - Define how array parameters should be send - - - - - Send multiple key=value for each entry - - - - - Create an []=value array - - - - - How to round - - - - - Round down (flooring) - - - - - Round to closest value - - - - - Base class for errors - - - - - The error code from the server - - - - - The message for the error that occurred - - - - - The data which caused the error - - - - - ctor - - - - - - - - String representation - - - - - - Cant reach server error - - - - - ctor - - - - - No api credentials provided while trying to access a private endpoint - - - - - ctor - - - - - Error returned by the server - - - - - ctor - - - - - - - ctor - - - - - - - - Web error returned by the server - - - - - ctor - - - - - - - ctor - - - - - - - - Error while deserializing data - - - - - ctor - - The error message - The data which caused the error - - - - Unknown error - - - - - ctor - - Error message - Error data - - - - An invalid parameter has been provided - - - - - ctor - - - - - - Rate limit exceeded - - - - - ctor - - - - - - Cancellation requested - - - - - ctor - - - - - Invalid operation requested - - - - - ctor - - - - - - Base options - - - - - The minimum log level to output. Setting it to null will send all messages to the registered ILoggers. - - - - - The log writers - - - - - If true, the CallResult and DataEvent objects will also include the originally received json data in the OriginalData property - - - - - Copy the values of the def to the input - - - - - - - - - - - Base for order book options - - - - - Whether or not checksum validation is enabled. Default is true, disabling will ignore checksum messages. - - - - - Base client options - - - - - The base address of the client - - - - - The api credentials - - - - - Proxy to use - - - - - Copy the values of the def to the input - - - - - - - - - - - Base for rest client options - - - - - List of rate limiters to use - - - - - What to do when a call would exceed the rate limit - - - - - The time the server has to respond to a request before timing out - - - - - Http client to use. If a HttpClient is provided in this property the RequestTimeout and Proxy options will be ignored in requests and should be set on the provided HttpClient instance - - - - - Copy the values of the def to the input - - - - - - - - - - - Base for socket client options - - - - - Whether or not the socket should automatically reconnect when losing connection - - - - - Time to wait between reconnect attempts - - - - - The maximum number of times to try to reconnect - - - - - The maximum number of times to try to resubscribe after reconnecting - - - - - Max number of concurrent resubscription tasks per socket after reconnecting a socket - - - - - The time to wait for a socket response before giving a timeout - - - - - The time after which the connection is assumed to be dropped. This can only be used for socket connections where a steady flow of data is expected. - - - - - The amount of subscriptions that should be made on a single socket connection. Not all exchanges support multiple subscriptions on a single socket. - Setting this to a higher number increases subscription speed because not every subscription needs to connect to the server, but having more subscriptions on a - single connection will also increase the amount of traffic on that single connection, potentially leading to issues. - - - - - Copy the values of the def to the input - - - - - - - - - - - Buffer entry with a first and last update id - - - - - First update id - - - - - Last update id - - - - - List of asks - - - - - List of bids - - - - - Base for order book implementations - - - - - The process buffer, used while syncing - - - - - The ask list - - - - - The bid list - - - - - Order book implementation id - - - - - The log - - - - - Whether update numbers are consecutive - - - - - Whether levels should be strictly enforced - - - - - If order book is set - - - - - The amount of levels for this book - - - - - The status of the order book. Order book is up to date when the status is `Synced` - - - - - Last update identifier - - - - - The symbol of the order book - - - - - Event when the state changes - - - - - Event when the BestBid or BestAsk changes ie a Pricing Tick - - - - - Event when order book was updated, containing the changed bids and asks. Be careful! It can generate a lot of events at high-liquidity markets - - - - - Timestamp of the last update - - - - - The number of asks in the book - - - - - The number of bids in the book - - - - - The list of asks - - - - - The list of bids - - - - - Get a snapshot of the book at this moment - - - - - The best bid currently in the order book - - - - - The best ask currently in the order book - - - - - BestBid/BesAsk returned as a pair - - - - - ctor - - - - - - - - Start connecting and synchronizing the order book - - - - - - Get the average price that a market order would fill at at the current order book state. This is no guarentee that an order of that quantity would actually be filled - at that price since between this calculation and the order placement the book can have changed. - - The quantity in base asset to fill - The type - Average fill price - - - - Stop syncing the order book - - - - - - Start the order book - - - - - - Reset the order book - - - - - Resync the order book - - - - - - Validate a checksum with the current order book - - - - - - - Set the initial data for the order book - - The last update sequence number - List of asks - List of bids - - - - Update the order book using a single id for an update - - - - - - - - Add a checksum to the process queue - - - - - - Update the order book using a first/last update id - - - - - - - - - Update the order book using sequenced entries - - List of bids - List of asks - - - - Check and empty the process buffer; see what entries to update the book with - - - - - Update order book with an entry - - Sequence number of the update - Type of entry - The entry - - - - Wait until the order book has been set - - Max wait time - - - - - Dispose the order book - - - - - String representation of the top 3 entries - - - - - - String representation of the top x entries - - - - - - Limits the amount of requests per time period to a certain limit, counts the request per API key. - - - - - Create a new RateLimiterAPIKey. This rate limiter limits the amount of requests per time period to a certain limit, counts the request per API key. - - The amount to limit to - The time period over which the limit counts - - - - - - - Dispose - - - - - Limits the amount of requests per time period to a certain limit, counts the total amount of requests. - - - - - Create a new RateLimiterTotal. This rate limiter limits the amount of requests per time period to a certain limit, counts the total amount of requests. - - The amount to limit to - The time period over which the limit counts - - - - - - - Limits the amount of requests per time period to a certain limit, counts the request per endpoint. - - - - - Create a new RateLimiterPerEndpoint. This rate limiter limits the amount of requests per time period to a certain limit, counts the request per endpoint. - - The amount to limit to - The time period over which the limit counts - - - - - - - Limits the amount of requests per time period to a certain limit, counts the total amount of requests. - - - - - Create a new RateLimiterTotal. This rate limiter limits the amount of requests per time period to a certain limit, counts the total amount of requests. - - The amount to limit to - The time period over which the limit counts - - - - - - - Rate limiting object - - - - - Lock - - - - - ctor - - - - - Get time to wait for a specific time - - - - - - - - - Add an executed request time - - - - - - Request object - - - - - Create request object for web request - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - WebRequest factory - - - - - - - - - - - HttpWebResponse response object - - - - - - - - - - - - - - Create response for a http response message - - The actual response - - - - - - - - - - Base rest client - - - - - The factory for creating requests. Used for unit testing - - - - - Where to put the parameters for requests with different Http methods - - - - - Request body content type - - - - - Whether or not we need to manually parse an error instead of relying on the http status code - - - - - How to serialize array parameters when making requests - - - - - What request body should be set when no data is send (only used in combination with postParametersPosition.InBody) - - - - - List of rate limiters - - - - - Total requests made by this client - - - - - Request headers to be sent with each request - - - - - Client options - - - - - ctor - - The name of the exchange this client is for - The options for this client - The authentication provider for this client (can be null if no credentials are provided) - - - - Adds a rate limiter to the client. There are 2 choices, the and the . - - The limiter to add - - - - Removes all rate limiters from this client - - - - - Execute a request to the uri and deserialize the response into the provided type parameter - - The type to deserialize into - The uri to send the request to - The method of the request - Cancellation token - The parameters of the request - Whether or not the request should be authenticated - Whether or not the resulting object should be checked for missing properties in the mapping (only outputs if log verbosity is Debug) - Where the parameters should be placed, overwrites the value set in the client - How array parameters should be serialized, overwrites the value set in the client - Credits used for the request - The JsonSerializer to use for deserialization - Additional headers to send with the request - - - - - Executes the request and returns the result deserialized into the type parameter class - - The request object to execute - The JsonSerializer to use for deserialization - Cancellation token - - - - - Can be used to parse an error even though response status indicates success. Some apis always return 200 OK, even though there is an error. - When setting manualParseError to true this method will be called for each response to be able to check if the response is an error or not. - If the response is an error this method should return the parsed error, else it should return null - - Received data - Null if not an error, Error otherwise - - - - Creates a request object - - The uri to send the request to - The method of the request - The parameters of the request - Whether or not the request should be authenticated - Where the parameters should be placed - How array parameters should be serialized - Unique id of a request - Additional headers to send with the request - - - - - Writes the parameters of the request to the request object body - - The request to set the parameters on - The parameters to set - The content type of the data - - - - Parse an error response from the server. Only used when server returns a status other than Success(200) - - The string the request returned - - - - - Base for socket client implementations - - - - - The factory for creating sockets. Used for unit testing - - - - - List of socket connections currently connecting/connected - - - - - Semaphore used while creating sockets - - - - - The max amount of concurrent socket connections - - - - - Delegate used for processing byte data received from socket connections before it is processed by handlers - - - - - Delegate used for processing string data received from socket connections before it is processed by handlers - - - - - Handlers for data from the socket which doesn't need to be forwarded to the caller. Ping or welcome messages for example. - - - - - The task that is sending periodic data on the websocket. Can be used for sending Ping messages every x seconds or similair. Not necesarry. - - - - - Wait event for the periodicTask - - - - - If client is disposing - - - - - If true; data which is a response to a query will also be distributed to subscriptions - If false; data which is a response to a query won't get forwarded to subscriptions as well - - - - - If a message is received on the socket which is not handled by a handler this boolean determines whether this logs an error message - - - - - The max amount of outgoing messages per socket per second - - - - - The current kilobytes per second of data being received by all connection from this client, averaged over the last 3 seconds - - - - - Client options - - - - - ctor - - The name of the exchange this client is for - The options for this client - The authentication provider for this client (can be null if no credentials are provided) - - - - Set a delegate to be used for processing data received from socket connections before it is processed by handlers - - Handler for byte data - Handler for string data - - - - Connect to an url and listen for data on the BaseAddress - - The type of the expected data - The optional request object to send, will be serialized to json - The identifier to use, necessary if no request object is sent - If the subscription is to an authenticated endpoint - The handler of update data - Cancellation token for closing this subscription - - - - - Connect to an url and listen for data - - The type of the expected data - The URL to connect to - The optional request object to send, will be serialized to json - The identifier to use, necessary if no request object is sent - If the subscription is to an authenticated endpoint - The handler of update data - Cancellation token for closing this subscription - - - - - Sends the subscribe request and waits for a response to that request - - The connection to send the request on - The request to send, will be serialized to json - The subscription the request is for - - - - - Send a query on a socket connection to the BaseAddress and wait for the response - - Expected result type - The request to send, will be serialized to json - If the query is to an authenticated endpoint - - - - - Send a query on a socket connection and wait for the response - - The expected result type - The url for the request - The request to send - Whether the socket should be authenticated - - - - - Sends the query request and waits for the result - - The expected result type - The connection to send and wait on - The request to send - - - - - Checks if a socket needs to be connected and does so if needed. Also authenticates on the socket if needed - - The connection to check - Whether the socket should authenticated - - - - - The socketConnection received data (the data JToken parameter). The implementation of this method should check if the received data is a response to the query that was send (the request parameter). - For example; A query is sent in a request message with an Id parameter with value 10. The socket receives data and calls this method to see if the data it received is an - anwser to any query that was done. The implementation of this method should check if the response.Id == request.Id to see if they match (assuming the api has some sort of Id tracking on messages, - if not some other method has be implemented to match the messages). - If the messages match, the callResult out parameter should be set with the deserialized data in the from of (T) and return true. - - The type of response that is expected on the query - The socket connection - The request that a response is awaited for - The message received from the server - The interpretation (null if message wasn't a response to the request) - True if the message was a response to the query - - - - The socketConnection received data (the data JToken parameter). The implementation of this method should check if the received data is a response to the subscription request that was send (the request parameter). - For example; A subscribe request message is send with an Id parameter with value 10. The socket receives data and calls this method to see if the data it received is an - anwser to any subscription request that was done. The implementation of this method should check if the response.Id == request.Id to see if they match (assuming the api has some sort of Id tracking on messages, - if not some other method has be implemented to match the messages). - If the messages match, the callResult out parameter should be set with the deserialized data in the from of (T) and return true. - - The socket connection - A subscription that waiting for a subscription response - The request that the subscription sent - The message received from the server - The interpretation (null if message wasn't a response to the request) - True if the message was a response to the subscription request - - - - Needs to check if a received message matches a handler by request. After subscribing data message will come in. These data messages need to be matched to a specific connection - to pass the correct data to the correct handler. The implementation of this method should check if the message received matches the subscribe request that was sent. - - The received data - The subscription request - True if the message is for the subscription which sent the request - - - - Needs to check if a received message matches a handler by identifier. Generally used by GenericHandlers. For example; a generic handler is registered which handles ping messages - from the server. This method should check if the message received is a ping message and the identifer is the identifier of the GenericHandler - - The received data - The string identifier of the handler - True if the message is for the handler which has the identifier - - - - Needs to authenticate the socket so authenticated queries/subscriptions can be made on this socket connection - - The socket connection that should be authenticated - - - - - Needs to unsubscribe a subscription, typically by sending an unsubscribe request. If multiple subscriptions per socket is not allowed this can just return since the socket will be closed anyway - - The connection on which to unsubscribe - The subscription to unsubscribe - - - - - Optional handler to interpolate data before sending it to the handlers - - - - - - - Add a subscription to a connection - - The type of data the subscription expects - The request of the subscription - The identifier of the subscription (can be null if request param is used) - Whether or not this is a user subscription (counts towards the max amount of handlers on a socket) - The socket connection the handler is on - The handler of the data received - - - - - Adds a generic message handler. Used for example to reply to ping requests - - The name of the request handler. Needs to be unique - The action to execute when receiving a message for this handler (checked by ) - - - - Gets a connection for a new subscription or query. Can be an existing if there are open position or a new one. - - The address the socket is for - Whether the socket should be authenticated - - - - - Process an unhandled message - - The token that wasn't processed - - - - Connect a socket - - The socket to connect - - - - - Create a socket for an address - - The address the socket should connect to - - - - - Periodically sends data over a socket connection - - How often - Method returning the object to send - - - - Unsubscribe an update subscription - - The id of the subscription to unsubscribe - - - - - Unsubscribe an update subscription - - The subscription to unsubscribe - - - - - Unsubscribe all subscriptions - - - - - - Dispose the client - - - - - A wrapper around the ClientWebSocket - - - - - Received messages time -> size - - - - - Received messages lock - - - - - Log - - - - - Handlers for when an error happens on the socket - - - - - Handlers for when the socket connection is opened - - - - - Handlers for when the connection is closed - - - - - Handlers for when a message is received - - - - - The id of this socket - - - - - - - - Whether this socket is currently reconnecting - - - - - The timestamp this socket has been active for the last time - - - - - Delegate used for processing byte data received from socket connections before it is processed by handlers - - - - - Delegate used for processing string data received from socket connections before it is processed by handlers - - - - - Url this socket connects to - - - - - If the connection is closed - - - - - If the connection is open - - - - - Ssl protocols supported. NOT USED BY THIS IMPLEMENTATION - - - - - Encoding used for decoding the received bytes into a string - - - - - The max amount of outgoing messages per second - - - - - The timespan no data is received on the socket. If no data is received within this time an error is generated - - - - - The current kilobytes per second of data being received, averaged over the last 3 seconds - - - - - Socket closed event - - - - - Socket message received event - - - - - Socket error event - - - - - Socket opened event - - - - - ctor - - The log object to use - The url the socket should connect to - - - - ctor - - The log object to use - The url the socket should connect to - Cookies to sent in the socket connection request - Headers to sent in the socket connection request - - - - Set a proxy to use. Should be set before connecting - - - - - - Connect the websocket - - True if successfull - - - - Send data over the websocket - - Data to send - - - - Close the websocket - - - - - - Internal close method, will wait for each task to complete to gracefully close - - - - - - - - Dispose the socket - - - - - Reset the socket so a new connection can be attempted after it has been connected before - - - - - Create the socket object - - - - - Loop for sending data - - - - - - Loop for receiving and reassembling data - - - - - - Handles the message - - - - - - - - - Checks if there is no data received for a period longer than the specified timeout - - - - - - Helper to invoke handlers - - - - - - Helper to invoke handlers - - - - - - - - Get the next identifier - - - - - - Update the received messages list, removing messages received longer than 3s ago - - - - - Received message info - - - - - Timestamp of the received data - - - - - Number of bytes received - - - - - ctor - - - - - - - An update received from a socket update subscription - - The type of the data - - - - The timestamp the data was received - - - - - The topic of the update, what symbol/asset etc.. - - - - - The original data that was received, only available when OutputOriginalData is set to true in the client options - - - - - The received data deserialized into an object - - - - - Create a new DataEvent with data in the from of type K based on the current DataEvent. Topic, OriginalData and Timestamp will be copied over - - The type of the new data - The new data - - - - - Create a new DataEvent with data in the from of type K based on the current DataEvent. OriginalData and Timestamp will be copied over - - The type of the new data - The new data - The new topic - - - - - Message received event - - - - - The connection the message was received on - - - - - The json object of the data - - - - - The originally received string data - - - - - The timestamp of when the data was received - - - - - - - - - - - - - - Socket connecting - - - - - Connection lost event - - - - - Connection closed and no reconnect is happening - - - - - Connecting restored event - - - - - The connection is paused event - - - - - The connection is unpaused event - - - - - Connecting closed event - - - - - Unhandled message event - - - - - The amount of subscriptions on this connection - - - - - If connection is authenticated - - - - - If connection is made - - - - - The underlying socket - - - - - If the socket should be reconnected upon closing - - - - - Current reconnect try - - - - - Current resubscribe try - - - - - Time of disconnecting - - - - - If activity is paused - - - - - New socket connection - - The socket client - The socket - - - - Process a message received by the socket - - - - - - Add subscription to this connection - - - - - - Get a subscription on this connection - - - - - - Send data and wait for an answer - - The data type expected in response - The object to send - The timeout for response - The response handler - - - - - Send data over the websocket connection - - The type of the object to send - The object to send - How null values should be serialized - - - - Send string data over the websocket connection - - The data to send - - - - Handler for a socket opening - - - - - Handler for a socket closing. Reconnects the socket if needed, or removes it from the active socket list if not - - - - - Close the connection - - - - - - Close a subscription on this connection. If all subscriptions on this connection are closed the connection gets closed as well - - Subscription to close - - - - - Socket subscription - - - - - Subscription id - - - - - Exception event - - - - - Message handlers for this subscription. Should return true if the message is handled and should not be distributed to the other handlers - - - - - Request object - - - - - Subscription identifier - - - - - Is user subscription or generic - - - - - If the subscription has been confirmed - - - - - Cancellation token registration, should be disposed when subscription is closed - - - - - Create SocketSubscription for a request - - - - - - - - - - Create SocketSubscription for an identifier - - - - - - - - - - Invoke the exception event - - - - - - Subscription to a data stream - - - - - Event when the connection is lost. The socket will automatically reconnect when possible. - - - - - Event when the connection is closed. This event happens when reconnecting/resubscribing has failed too often based on the and options, - or is false - - - - - Event when the connection is restored. Timespan parameter indicates the time the socket has been offline for before reconnecting. - Note that when the executing code is suspended and resumed at a later period (for example laptop going to sleep) the disconnect time will be incorrect as the diconnect - will only be detected after resuming. This will lead to an incorrect disconnected timespan. - - - - - Event when the connection to the server is paused based on a server indication. No operations can be performed while paused - - - - - Event when the connection to the server is unpaused after being paused - - - - - Event when an exception happens during the handling of the data - - - - - The id of the socket - - - - - The id of the subscription - - - - - ctor - - The socket connection the subscription is on - The subscription - - - - Close the subscription - - - - - - Close the socket to cause a reconnect - - - - - - Unsubscribe a subscription - - - - - - Resubscribe this subscription - - - - - - Default weboscket factory implementation - - - - - - - - - - - Specifies that is allowed as an input even if the - corresponding type disallows it. - - - - - Initializes a new instance of the class. - - - - - Specifies that is disallowed as an input even if the - corresponding type allows it. - - - - - Initializes a new instance of the class. - - - - - Specifies that a method that will never return under any circumstance. - - - - - Initializes a new instance of the class. - - - - - Specifies that the method will not return if the associated - parameter is passed the specified value. - - - - - Gets the condition parameter value. - Code after the method is considered unreachable by diagnostics if the argument - to the associated parameter matches this value. - - - - - Initializes a new instance of the - class with the specified parameter value. - - - The condition parameter value. - Code after the method is considered unreachable by diagnostics if the argument - to the associated parameter matches this value. - - - - - Specifies that an output may be even if the - corresponding type disallows it. - - - - - Initializes a new instance of the class. - - - - - Specifies that when a method returns , - the parameter may be even if the corresponding type disallows it. - - - - - Gets the return value condition. - If the method returns this value, the associated parameter may be . - - - - - Initializes the attribute with the specified return value condition. - - - The return value condition. - If the method returns this value, the associated parameter may be . - - - - - Specifies that an output is not even if the - corresponding type allows it. - - - - - Initializes a new instance of the class. - - - - - Specifies that the output will be non- if the - named parameter is non-. - - - - - Gets the associated parameter name. - The output will be non- if the argument to the - parameter specified is non-. - - - - - Initializes the attribute with the associated parameter name. - - - The associated parameter name. - The output will be non- if the argument to the - parameter specified is non-. - - - - - Specifies that when a method returns , - the parameter will not be even if the corresponding type allows it. - - - - - Gets the return value condition. - If the method returns this value, the associated parameter will not be . - - - - - Initializes the attribute with the specified return value condition. - - - The return value condition. - If the method returns this value, the associated parameter will not be . - - - -