From da1686d95c2fd88a4228a4d31e0b762385e77d1f Mon Sep 17 00:00:00 2001
From: JKorf
Date: Fri, 9 Feb 2024 19:55:26 +0100
Subject: [PATCH] docs
---
docs/index.html | 1047 ++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 1038 insertions(+), 9 deletions(-)
diff --git a/docs/index.html b/docs/index.html
index 6f04a6a..bff0ad3 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -262,7 +262,421 @@
============================ -->
Dependency Injection
-
+
+ All client libraries support and encourage usage via the Dotnet dependency injection system. Add all necesary services by calling the Add[Library]();
extension method on the service collection. Options for the clients can be passed as parameters.
+
+
+
+
+
builder.Services.AddBinance();
+
+
+
builder.Services.AddBitfinex();
+
+
+
builder.Services.AddBitget();
+
+
+
builder.Services.AddBybit();
+
+
+
builder.Services.AddCoinGecko();
+
+
+
builder.Services.AddCoinEx();
+
+
+
builder.Services.AddHuobi();
+
+
+
builder.Services.AddKraken();
+
+
+
builder.Services.AddKucoin();
+
+
+
builder.Services.AddMexc();
+
+
+
builder.Services.AddOKX();
+
+
+
+ This registers the following interfaces which can then be injected
+
+
+
+
+ Interface | Description |
+
+ IBinanceRestClient |
+ The client for accessing the Binance REST API |
+
+
+ IBinanceSocketClient |
+ The client for accessing the Binance Websocket API |
+
+
+ IBinanceOrderBookFactory |
+ A factory for creating SymbolOrderBook instances for the Binance API |
+
+
+ ICryptoRestClient |
+ An aggregating client from which multiple different library REST clients can be accessed |
+
+
+ ICryptoSocketClient |
+ An aggregating client from which multiple different library Websocket clients can be accessed |
+
+
+ ISpotClient |
+ An implementation of the ISpotClient interface for Binance. The ISpotClient offers basic Spot API functionality in a combined interface |
+
+
+
+
+
+ Interface | Description |
+
+ IBitfinexRestClient |
+ The client for accessing the Bitfinex REST API |
+
+
+ IBitfinexSocketClient |
+ The client for accessing the Bitfinex Websocket API |
+
+
+ IBitfinexOrderBookFactory |
+ A factory for creating SymbolOrderBook instances for the Bitfinex API |
+
+
+ ICryptoRestClient |
+ An aggregating client from which multiple different library REST clients can be accessed |
+
+
+ ICryptoSocketClient |
+ An aggregating client from which multiple different library Websocket clients can be accessed |
+
+
+ ISpotClient |
+ An implementation of the ISpotClient interface for Bitfinex. The ISpotClient offers basic Spot API functionality in a combined interface |
+
+
+
+
+
+ Interface | Description |
+
+ IBitgetRestClient |
+ The client for accessing the Bitget REST API |
+
+
+ IBitgetSocketClient |
+ The client for accessing the Bitget Websocket API |
+
+
+ IBitgetOrderBookFactory |
+ A factory for creating SymbolOrderBook instances for the Bitget API |
+
+
+ ICryptoRestClient |
+ An aggregating client from which multiple different library REST clients can be accessed |
+
+
+ ICryptoSocketClient |
+ An aggregating client from which multiple different library Websocket clients can be accessed |
+
+
+ ISpotClient |
+ An implementation of the ISpotClient interface for Bitget. The ISpotClient offers basic Spot API functionality in a combined interface |
+
+
+
+
+
+ Interface | Description |
+
+ IBybitRestClient |
+ The client for accessing the Bybit REST API |
+
+
+ IBybitSocketClient |
+ The client for accessing the Bybit Websocket API |
+
+
+ IBybitOrderBookFactory |
+ A factory for creating SymbolOrderBook instances for the Bybit API |
+
+
+ ICryptoRestClient |
+ An aggregating client from which multiple different library REST clients can be accessed |
+
+
+ ICryptoSocketClient |
+ An aggregating client from which multiple different library Websocket clients can be accessed |
+
+
+ ISpotClient |
+ An implementation of the ISpotClient interface for Bybit. The ISpotClient offers basic Spot API functionality in a combined interface |
+
+
+
+
+
+ Interface | Description |
+
+ ICoinGeckoRestClient |
+ The client for accessing the CoinGecko REST API |
+
+
+ ICryptoRestClient |
+ An aggregating client from which multiple different library REST clients can be accessed |
+
+
+
+
+
+ Interface | Description |
+
+ ICoinExRestClient |
+ The client for accessing the CoinEx REST API |
+
+
+ ICoinExSocketClient |
+ The client for accessing the CoinEx Websocket API |
+
+
+ ICoinExOrderBookFactory |
+ A factory for creating SymbolOrderBook instances for the CoinEx API |
+
+
+ ICryptoRestClient |
+ An aggregating client from which multiple different library REST clients can be accessed |
+
+
+ ICryptoSocketClient |
+ An aggregating client from which multiple different library Websocket clients can be accessed |
+
+
+ ISpotClient |
+ An implementation of the ISpotClient interface for CoinEx. The ISpotClient offers basic Spot API functionality in a combined interface |
+
+
+
+
+
+ Interface | Description |
+
+ IHuobiRestClient |
+ The client for accessing the Huobi REST API |
+
+
+ IHuobiSocketClient |
+ The client for accessing the Huobi Websocket API |
+
+
+ IHuobiOrderBookFactory |
+ A factory for creating SymbolOrderBook instances for the Huobi API |
+
+
+ ICryptoRestClient |
+ An aggregating client from which multiple different library REST clients can be accessed |
+
+
+ ICryptoSocketClient |
+ An aggregating client from which multiple different library Websocket clients can be accessed |
+
+
+ ISpotClient |
+ An implementation of the ISpotClient interface for Huobi. The ISpotClient offers basic Spot API functionality in a combined interface |
+
+
+
+
+
+ Interface | Description |
+
+ IKrakenRestClient |
+ The client for accessing the Kraken REST API |
+
+
+ IKrakenSocketClient |
+ The client for accessing the Kraken Websocket API |
+
+
+ IKrakenOrderBookFactory |
+ A factory for creating SymbolOrderBook instances for the Kraken API |
+
+
+ ICryptoRestClient |
+ An aggregating client from which multiple different library REST clients can be accessed |
+
+
+ ICryptoSocketClient |
+ An aggregating client from which multiple different library Websocket clients can be accessed |
+
+
+ ISpotClient |
+ An implementation of the ISpotClient interface for Kraken. The ISpotClient offers basic Spot API functionality in a combined interface |
+
+
+
+
+
+ Interface | Description |
+
+ IKucoinRestClient |
+ The client for accessing the Kucoin REST API |
+
+
+ IKucoinSocketClient |
+ The client for accessing the Kucoin Websocket API |
+
+
+ IKucoinOrderBookFactory |
+ A factory for creating SymbolOrderBook instances for the Kucoin API |
+
+
+ ICryptoRestClient |
+ An aggregating client from which multiple different library REST clients can be accessed |
+
+
+ ICryptoSocketClient |
+ An aggregating client from which multiple different library Websocket clients can be accessed |
+
+
+ ISpotClient |
+ An implementation of the ISpotClient interface for Kucoin. The ISpotClient offers basic Spot API functionality in a combined interface |
+
+
+
+
+
+ Interface | Description |
+
+ IMexcRestClient |
+ The client for accessing the Mexc REST API |
+
+
+ IMexcSocketClient |
+ The client for accessing the Mexc Websocket API |
+
+
+ IMexcOrderBookFactory |
+ A factory for creating SymbolOrderBook instances for the Mexc API |
+
+
+ ICryptoRestClient |
+ An aggregating client from which multiple different library REST clients can be accessed |
+
+
+ ICryptoSocketClient |
+ An aggregating client from which multiple different library Websocket clients can be accessed |
+
+
+ ISpotClient |
+ An implementation of the ISpotClient interface for Mexc. The ISpotClient offers basic Spot API functionality in a combined interface |
+
+
+
+
+
+ Interface | Description |
+
+ IOKXRestClient |
+ The client for accessing the OKX REST API |
+
+
+ IOKXSocketClient |
+ The client for accessing the OKX Websocket API |
+
+
+ IOKXOrderBookFactory |
+ A factory for creating SymbolOrderBook instances for the OKX API |
+
+
+ ICryptoRestClient |
+ An aggregating client from which multiple different library REST clients can be accessed |
+
+
+ ICryptoSocketClient |
+ An aggregating client from which multiple different library Websocket clients can be accessed |
+
+
+ ISpotClient |
+ An implementation of the ISpotClient interface for OKX. The ISpotClient offers basic Spot API functionality in a combined interface |
+
+
+
+
@@ -271,8 +685,234 @@
============================ -->
+ Each library provides a REST API client. This client follows the following naming convention: [Library]RestClient
. The REST API client is split into different sub-API access clients, which in turn are split into different topics. This structure is the same for each library, which makes it easier to navigate the clients.
+
+ The client can be injected via dependency injection, or constructed manually.
+
+
+
+
var client = new BinanceRestClient();
+var tickersResult = await client.SpotApi.ExchangeData.GetTickersAsync();
+if (!tickersResult.Success)
+{
+ // Handle error, tickersResult.Error contains more information
+}
+else
+{
+ // Handle data, tickersResult.Data will contain the actual data
+}
+
+
+
var client = new BitfinexRestClient();
+var tickersResult = await client.SpotApi.ExchangeData.GetTickersAsync();
+if (!tickersResult.Success)
+{
+ // Handle error, tickersResult.Error contains more information
+}
+else
+{
+ // Handle data, tickersResult.Data will contain the actual data
+}
+
+
+
var client = new BitgetRestClient();
+var tickersResult = await client.SpotApi.ExchangeData.GetTickersAsync();
+if (!tickersResult.Success)
+{
+ // Handle error, tickersResult.Error contains more information
+}
+else
+{
+ // Handle data, tickersResult.Data will contain the actual data
+}
+
+
+
var client = new BybitRestClient();
+var tickersResult = await client.V5Api.ExchangeData.GetSpotTickersAsync();
+if (!tickersResult.Success)
+{
+ // Handle error, tickersResult.Error contains more information
+}
+else
+{
+ // Handle data, tickersResult.Data will contain the actual data
+}
+
+
+
var client = new CoinGeckoRestClient();
+var assetsResult = await client.Api.GetAssetsAsync();
+if (!assetsResult.Success)
+{
+ // Handle error, assetsResult.Error contains more information
+}
+else
+{
+ // Handle data, assetsResult.Data will contain the actual data
+}
+
+
+
var client = new CoinExRestClient();
+var tickersResult = await client.SpotApi.ExchangeData.GetTickersAsync();
+if (!tickersResult.Success)
+{
+ // Handle error, tickersResult.Error contains more information
+}
+else
+{
+ // Handle data, tickersResult.Data will contain the actual data
+}
+
+
+
var client = new HuobiRestClient();
+var tickersResult = await client.SpotApi.ExchangeData.GetTickersAsync();
+if (!tickersResult.Success)
+{
+ // Handle error, tickersResult.Error contains more information
+}
+else
+{
+ // Handle data, tickersResult.Data will contain the actual data
+}
+
+
+
var client = new KrakenRestClient();
+var tickersResult = await client.SpotApi.ExchangeData.GetTickersAsync();
+if (!tickersResult.Success)
+{
+ // Handle error, tickersResult.Error contains more information
+}
+else
+{
+ // Handle data, tickersResult.Data will contain the actual data
+}
+
+
+
var client = new KucoinRestClient();
+var tickersResult = await client.SpotApi.ExchangeData.GetTickersAsync();
+if (!tickersResult.Success)
+{
+ // Handle error, tickersResult.Error contains more information
+}
+else
+{
+ // Handle data, tickersResult.Data will contain the actual data
+}
+
+
+
var client = new MexcRestClient();
+var tickersResult = await client.SpotApi.ExchangeData.GetTickersAsync();
+if (!tickersResult.Success)
+{
+ // Handle error, tickersResult.Error contains more information
+}
+else
+{
+ // Handle data, tickersResult.Data will contain the actual data
+}
+
+
+
var client = new OKXRestClient();
+var tickersResult = await client.UnifiedApi.ExchangeData.GetTickersAsync(OKXInstrumentType.Spot);
+if (!tickersResult.Success)
+{
+ // Handle error, tickersResult.Error contains more information
+}
+else
+{
+ // Handle data, tickersResult.Data will contain the actual data
+}
+
+
+
+ The response object
+ Calls made with the REST API client will return a WebCallResult
object. This object contains information about both the request that was send and the response that was received. The WebCallResult
object exposes the following properties:
+
+ Property | Description |
+
+ Success |
+ Whether or not the call was completed successfully |
+
+
+ Data |
+ The parsed response object, only available when Success is true |
+
+
+ Error |
+ Error information, only available when Success is false |
+
+
+ OriginalData |
+ The raw response data, only filled when the OutputOriginalData is enabled in the client options |
+
+
+ RequestMethod |
+ The HTTP method that was used for the request |
+
+
+ RequestHeaders |
+ The list of headers which were send with the request |
+
+
+ RequestId |
+ A unique request id |
+
+
+ RequestUrl |
+ The full urls which was called |
+
+
+ RequestBody |
+ The request body send with the request |
+
+
+ ResponseLength |
+ The length of the response in bytes |
+
+
+ ResponseHeaders |
+ The list of headers send along with the response |
+
+
+ ResponseTime |
+ The time it took from sending the request to receiving the response |
+
+
+
+
@@ -280,8 +920,261 @@
============================ -->
+ If the API supports websocket connections then the library provides a Websocket API client. This client follows the following naming convention: [Library]SocketClient
. The Websocket API client is split into different sub-API access clients, which in turn are sometimes split into different topics. This structure is the same for each library, which makes it easier to navigate the clients.
+
+ The client can be injected via dependency injection, or constructed manually. When constructing manually keep in mind that when the client is disposed all connections will get closed as well.
+
+ Subscribing
+
+
+
+
var client = new BinanceSocketClient();
+var subscribeResult = await client.SpotApi.ExchangeData.SubscribeToAllTickerUpdatesAsync(update => {
+ // Handle the data update, update.Data will contain the actual data
+});
+if (!subscribeResult.Success)
+{
+ // Handle error, subscribeResult.Error contains more information on why the subscription failed
+}
+// Subscribing was successfull, the data will now be streamed into the data handler
+
+
+
var client = new BitfinexSocketClient();
+var subscribeResult = await client.SpotApi.SubscribeToTickerUpdatesAsync("tETHUST", update => {
+ // Handle the data update, update.Data will contain the actual data
+});
+if (!subscribeResult.Success)
+{
+ // Handle error, subscribeResult.Error contains more information on why the subscription failed
+}
+// Subscribing was successfull, the data will now be streamed into the data handler
+
+
+
var client = new BitgetSocketClient();
+var subscribeResult = await client.SpotApi.SubscribeToTickerUpdatesAsync("ETHUSDT", update => {
+ // Handle the data update, update.Data will contain the actual data
+});
+if (!subscribeResult.Success)
+{
+ // Handle error, subscribeResult.Error contains more information on why the subscription failed
+}
+// Subscribing was successfull, the data will now be streamed into the data handler
+
+
+
var client = new BybitSocketClient();
+var subscribeResult = await client.V5SpotApi.SubscribeToTickerUpdatesAsync("ETHUSDT", update => {
+ // Handle the data update, update.Data will contain the actual data
+});
+if (!subscribeResult.Success)
+{
+ // Handle error, subscribeResult.Error contains more information on why the subscription failed
+}
+// Subscribing was successfull, the data will now be streamed into the data handler
+
+
+
var client = new CoinExSocketClient();
+var subscribeResult = await client.SpotApi.SubscribeToTickerUpdatesAsync("ETHUSDT", update => {
+ // Handle the data update, update.Data will contain the actual data
+});
+if (!subscribeResult.Success)
+{
+ // Handle error, subscribeResult.Error contains more information on why the subscription failed
+}
+// Subscribing was successfull, the data will now be streamed into the data handler
+
+
+
var client = new HuobiSocketClient();
+var subscribeResult = await client.SpotApi.SubscribeToTickerUpdatesAsync(update => {
+ // Handle the data update, update.Data will contain the actual data
+});
+if (!subscribeResult.Success)
+{
+ // Handle error, subscribeResult.Error contains more information on why the subscription failed
+}
+// Subscribing was successfull, the data will now be streamed into the data handler
+
+
+
var client = new KrakenSocketClient();
+var subscribeResult = await client.SpotApi.SubscribeToTickerUpdatesAsync("ETH/USD", update => {
+ // Handle the data update, update.Data will contain the actual data
+});
+if (!subscribeResult.Success)
+{
+ // Handle error, subscribeResult.Error contains more information on why the subscription failed
+}
+// Subscribing was successfull, the data will now be streamed into the data handler
+
+
+
var client = new KucoinSocketClient();
+var subscribeResult = await client.SpotApi.SubscribeToAllTickerUpdatesAsync(update => {
+ // Handle the data update, update.Data will contain the actual data
+});
+if (!subscribeResult.Success)
+{
+ // Handle error, subscribeResult.Error contains more information on why the subscription failed
+}
+// Subscribing was successfull, the data will now be streamed into the data handler
+
+
+
var client = new MexcSocketClient();
+var subscribeResult = await client.SpotApi.SubscribeToMiniTickerUpdatesAsync(update => {
+ // Handle the data update, update.Data will contain the actual data
+});
+if (!subscribeResult.Success)
+{
+ // Handle error, subscribeResult.Error contains more information on why the subscription failed
+}
+// Subscribing was successfull, the data will now be streamed into the data handler
+
+
+
var client = new OKXSocketClient();
+var subscribeResult = await client.UnifiedApi.ExchangeData.SubscribeToTickerUpdatesAsync("ETH-USDT", update => {
+ // Handle the data update, update.Data will contain the actual data
+});
+if (!subscribeResult.Success)
+{
+ // Handle error, subscribeResult.Error contains more information on why the subscription failed
+}
+// Subscribing was successfull, the data will now be streamed into the data handler
+
+
+
+ The subscription result object
+ Subscriptions calls will return a CallResult<UpdateSubscription>
object. This object contains information about the status of the intial subscription, and the UpdateSubscription data object exposes events for status changes and methods for managing the subscription. The CallResult<UpdateSubscription>
object exposes the following properties:
+
+ Property | Description |
+
+ Success |
+ Whether or not the subscription was completed successfully |
+
+
+ Error |
+ Error information, only available when Success is false |
+
+
+ Data |
+ The UpdateSubscription object, only available when Success is true |
+
+
+ Data.Id |
+ Unique id of the subscription |
+
+
+ Data.SocketId |
+ The id of the underlying websocket |
+
+
+ Data.ConnectionLost |
+ Event which will be invoked whenever the connection to the server is lost and reconnecting will be started |
+
+
+ Data.ConnectionRestored |
+ Event which will be invoked when the connection to the server is restored after being disconnected |
+
+
+ Data.ActivityPaused |
+ Event which will be invoked when the server has indicated that currently no operations will be accepted |
+
+
+ Data.ActivityUnpaused |
+ Event which will be invoked when the server has indicated that operations will be accepted again after a previous ActivityPaused event |
+
+
+ Data.Exception |
+ Event which will be invoked when the data handler of the subscription throws an exception |
+
+
+
+ The subscription update event object
+ Whenever new data is received for a subscription the data handler will be called with a DataEvent<T>
object. This object contains information about the event and the actual update data. The DataEvent<T>
object exposes the following properties:
+
+ Property | Description |
+
+ Timestamp |
+ The timestamp the data was received |
+
+
+ Topic |
+ The topic of the update, typically the symbol or stream name |
+
+
+ OriginalData |
+ The raw update data, only filled when the OutputOriginalData is enabled in the client options |
+
+
+ UpdateType |
+ The type of update. SocketUpdateType.Snapshot means the update is a snapshot, not an incremental update. SocketUpdateType.Update means it's an update with new data |
+
+
+ Data |
+ The data received in the update |
+
+
+
+ Unsubscribing
+
+ When no longer interested in updates from a specific subscription it can be unsubscribed. This can be done in one of the following ways:
+
+
+ Unsubscribe via UpdateSubscription object
+ When you have the reference to the UpdateSubscription object received from the Subscribe method you can call the CloseAsync()
method on that to unsubscribe
+
var subscribeResult = await client.SpotApi.SubscribeToTickerUpdates(data => {});
+await subscribeResult.Data.CloseAsync();
+
+
+ Unsubscribe via CancellationToken
+ Passing in a CancellationToken
as parameter in the subscribe method will allow you to cancel subscriptions by canceling the token. This can be useful when you need to cancel some streams but not others. In this example, both BTCUSDT
and ETHUSDT
streams get canceled, while the XRPUSDT
stream remains active.
+
var cts = new CancellationTokenSource();
+var subscriptionResult1 = await client.SpotApi.SubscribeToTickerUpdatesAsync("BTCUSDT", DataHandler, cts.Token);
+var subscriptionResult2 = await client.SpotApi.SubscribeToTickerUpdatesAsync("ETHUSDT", DataHandler, cts.Token);
+var subscriptionResult3 = await client.SpotApi.SubscribeToTickerUpdatesAsync("XRPUSDT", DataHandler);
+cts.Cancel();
+
+
+ Unsubscribe via the websocket client
+ The Websocket client has multiple ways of unsubscribing one or more subscriptions:
+
var subscribeResult = await client.SpotApi.SubscribeToTickerUpdates(data => {});
+// Unsubscribe by passing the UpdateSubscription
+await client.UnsubscribeAsync(subscribeResult.Data);
+// OR store the ID and pass that
+var subId = subscribeResult.Data.Id;
+await client.UnsubscribeAsync(subId);
+// OR unsubscribe all subscriptions at the same time
+await client.UnsubscribeAllAsync();
+
+
+
@@ -587,7 +1480,7 @@ options.ApiCredentials = new ApiCredentials("YOUR PUBLIC KEY", "YOUR PRIVATE KEY
SetDefaultOptions
- The options can be defined in the static SetDefaultOptions method on the client BEFORE creating the client. Any client created after this call will use the specified options
+ The options can be defined using the static SetDefaultOptions method on the client BEFORE creating the client. Any client created after this call will use the specified options
-
Binance
@@ -712,9 +1605,145 @@ var client = new OKXRestClient();
Option definitions
- List of options:
- - Generic Options
- - Options per library
+
+ General options
+ Options available for all clients
+
+
+ Option | Description | Default value |
+
+ RequestTimeout |
+ The time to wait for an answer from the server on a request |
+ TimeSpan.FromSeconds(20) |
+
+
+ ApiCredentials |
+ The credentials to use for private endpoints and streams. See Authorization for more info |
+ null |
+
+
+ Proxy |
+ The proxy to use for connecting to the API |
+ null |
+
+
+ OutputOriginalData |
+ When enabled the originally received string data will be available as well as the deserialized object. For REST API client calls the data will be in the WebCallResult.OriginalData property, for Websocket API client subscriptions the data will be available in the DataEvent.OriginalData property when receiving an update. |
+ false |
+
+
+ Environment |
+ The environment the library should connect to. Some exchanges have testnet/sandbox environments which can be used instead of the real exchange. The environment option can be used to switch between different trade environments |
+ Live environment |
+
+
+
+
+ REST client options
+ Options available for REST clients
+
+ Option | Description | Default value |
+
+ AutoTimestamp |
+ Whether or not the client should attempt to sync the time between the client and server. If the time between server and client is not in sync authentication errors might occur. This option should be disabled when the client time sure is to be in sync |
+ true |
+
+
+ TimestampRecalculationInterval |
+ The interval of how often the time synchronization between client and server should be executed |
+ TimeSpan.FromHours(1) |
+
+
+ [API].RateLimiters |
+ A list of IRateLimiter s to use |
+ Dependent on the library |
+
+
+ [API].RateLimitingBehaviour |
+ What should happen when a rate limit is reached |
+ RateLimitingBehaviour.Wait |
+
+
+ [API].ApiCredentials |
+ Same as the in the base options, allows overriding per sub-API |
+ null |
+
+
+ [API].OutputOriginalData |
+ Same as the in the base options, allows overriding per sub-API |
+ null |
+
+
+ [API].AutoTimestamp |
+ Same as the in the base REST options, allows overriding per sub-API |
+ null |
+
+
+ [API].TimestampRecalculationInterval |
+ Same as the in the base REST options, allows overriding per sub-API |
+ null |
+
+
+
+
+
+
+ Websocket client options
+ Options available for websocket clients
+
+ Option | Description | Default value |
+
+ AutoReconnect |
+ Whether or not the socket should attempt to automatically reconnect when disconnected |
+ true |
+
+
+ ReconnectInterval |
+ The time to wait between connection tries when reconnecting |
+ TimeSpan.FromSeconds(5) |
+
+
+ SocketNoDataTimeout |
+ If no data is received during this timespan the connection is assumed to be dropped. This is mainly used for API's which have some sort of ping/keepalive system. For example; the Bitfinex API will sent a heartbeat message every 15 seconds, so the `SocketNoDataTimeout` could be set to 20 seconds. On API's without such a mechanism this might not work because there just might not be any update while still being fully connected |
+ default(TimeSpan) |
+
+
+ SocketSubscriptionsCombineTarget |
+ The number of subscriptions that should be made on a single socket connection before setting up a new connection. Not all exchanges support multiple subscriptions on a single socket and some have limits on the amount of connections. 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 delays in updates if the data isn't handled quickly enough |
+ Dependent on the library |
+
+
+ MaxConcurrentResubscriptionsPerSocket |
+ The maximum number of concurrent resubscriptions per socket when resubscribing after reconnecting |
+ 5 |
+
+
+ MaxSocketConnections |
+ The maximum number of distinct socket connections |
+ null |
+
+
+ DelayAfterConnect |
+ The time to wait before sending messages after connecting to the server |
+ null |
+
+
+ [API].RateLimiters |
+ A list of IRateLimiter s to use |
+ Dependent on the library |
+
+
+ [API].SocketNoDataTimeout |
+ Same as the in the base websocket client options, allows overriding per sub-API |
+ null |
+
+
+ [API].MaxSocketConnections |
+ Same as the in the base websocket client options, allows overriding per sub-API |
+ null |
+
+
+