mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-06-09 17:06:19 +00:00
docs
This commit is contained in:
parent
5bfbcca25b
commit
55284c0549
@ -18,7 +18,7 @@ The rest client gives access to the Rest endpoint of the API. Rest endpoints are
|
||||
- ExchangeData
|
||||
- Trading
|
||||
|
||||
This rest client has 2 different API clients, the `SpotApi` and the `FuturesApi`, each offering their own set of endpoints.
|
||||
This rest client has 2 different API clients, the `SpotApi` and the `FuturesApi`, each offering their own set of endpoints.
|
||||
*Requesting ticker info on the spot API*
|
||||
```csharp
|
||||
var client = new KucoinClient();
|
||||
@ -126,14 +126,14 @@ subscriptionResult.Data.ConnectionRestored += (time) =>
|
||||
### Unsubscribing
|
||||
When no longer interested in specific updates there are a few ways to unsubscribe.
|
||||
|
||||
**Close subscription**
|
||||
**Close subscription**
|
||||
Subscribing to an update stream will respond with an `UpdateSubscription` object. You can call the `CloseAsync()` method on this to no longer receive updates from that subscription:
|
||||
```csharp
|
||||
var subscriptionResult = await kucoinSocketClient.SpotStreams.SubscribeToAllTickerUpdatesAsync(DataHandler);
|
||||
await subscriptionResult.Data.CloseAsync();
|
||||
```
|
||||
|
||||
**Cancellation token**
|
||||
**Cancellation token**
|
||||
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 `BTC-USDT` and `ETH-USDT` streams get canceled, while the `KCS-USDT` stream remains active.
|
||||
```csharp
|
||||
var cts = new CancellationTokenSource();
|
||||
@ -144,7 +144,7 @@ Console.ReadLine();
|
||||
cts.Cancel();
|
||||
```
|
||||
|
||||
**Client unsubscribe**
|
||||
**Client unsubscribe**
|
||||
Subscriptions can also be closed by calling the `UnsubscribeAsync` method on the client, while providing either the `UpdateSubscription` object or the subscription id:
|
||||
```csharp
|
||||
var subscriptionResult = await kucoinSocketClient.SpotStreams.SubscribeToTickerUpdatesAsync("BTC-USDT", DataHandler);
|
||||
|
@ -283,7 +283,7 @@ var client = new BinanceClient(new BinanceClientOptions
|
||||
A big debugging tool when opening an issue on Github is providing logging of what data caused the issue. This can be provided two ways, via the `OriginalData` property of the call result or data event, or collecting the Trace logging.
|
||||
### OriginalData
|
||||
This is only useful when there is an issue in deserialization. So either a call result is giving a Deserialization error, or the result has a value that is unexpected. If that is the issue, please provide the original data that is received so the deserialization issue can be resolved based on the received data.
|
||||
By default the `OriginalData` property in the `WebCallResult`/`DataEvent` object is not filled as saving the original data has a (very small) performance penalty. To save the original data in the `OriginalData` property the `OutputOriginalData` option should be set to `true` in the client options.
|
||||
By default the `OriginalData` property in the `WebCallResult`/`DataEvent` object is not filled as saving the original data has a (very small) performance penalty. To save the original data in the `OriginalData` property the `OutputOriginalData` option should be set to `true` in the client options.
|
||||
*Enabled output data*
|
||||
```csharp
|
||||
var client = new BinanceClient(new BinanceClientOptions
|
||||
@ -305,7 +305,7 @@ client.SpotStreams.SubscribeToAllTickerUpdatesAsync(update => {
|
||||
```
|
||||
|
||||
### Trace logging
|
||||
Trace logging, which is the most verbose log level, can be enabled in the client options.
|
||||
Trace logging, which is the most verbose log level, can be enabled in the client options.
|
||||
*Enabled output data*
|
||||
```csharp
|
||||
var client = new BinanceClient(new BinanceClientOptions
|
||||
|
@ -21,7 +21,7 @@ Socket clients are restructured as `client.[Api]Streams.Method()`:
|
||||
|
||||
## Options structure
|
||||
The options have been changed in 2 categories, options for the whole client, and options only for a specific sub Api. Some options might no longer be available on the base level and should be set on the Api options instead, for example the `BaseAddress`.
|
||||
The following example sets some basic options, and specifically overwrites the USD futures Api options to use the test net address and different Api credentials:
|
||||
The following example sets some basic options, and specifically overwrites the USD futures Api options to use the test net address and different Api credentials:
|
||||
*V4*
|
||||
```csharp
|
||||
var binanceClient = new BinanceClient(new BinanceApiClientOptions{
|
||||
|
@ -118,5 +118,5 @@ All clients have access to the following options, specific implementations might
|
||||
|`RateLimiters`|A list of `IRateLimiter`s to use.|`new List<IRateLimiter>()`|
|
||||
|`RateLimitingBehaviour`|What should happen when a rate limit is reached.|`RateLimitingBehaviour.Wait`|
|
||||
|
||||
**Options for Socket Api Client (extension of base api client options)**
|
||||
**Options for Socket Api Client (extension of base api client options)**
|
||||
There are currently no specific options for socket API clients, the base API options are still available.
|
||||
|
Loading…
x
Reference in New Issue
Block a user