mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-06-07 16:06:15 +00:00
Update index.html
This commit is contained in:
parent
2e957d7d9e
commit
a20cbb2f1c
@ -250,7 +250,6 @@
|
|||||||
<div class="tab-content my-3" id="myTabContent">
|
<div class="tab-content my-3" id="myTabContent">
|
||||||
<div class="tab-pane fade show active" id="install-cc" role="tabpanel" aria-labelledby="install-cc-tab">
|
<div class="tab-pane fade show active" id="install-cc" role="tabpanel" aria-labelledby="install-cc-tab">
|
||||||
<pre><code>dotnet add package CryptoClients.Net</code></pre>
|
<pre><code>dotnet add package CryptoClients.Net</code></pre>
|
||||||
<img src="assets/images/BinanceInstall.png" />
|
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade show" id="install-binance" role="tabpanel" aria-labelledby="install-binance-tab">
|
<div class="tab-pane fade show" id="install-binance" role="tabpanel" aria-labelledby="install-binance-tab">
|
||||||
<pre><code>dotnet add package Binance.Net</code></pre>
|
<pre><code>dotnet add package Binance.Net</code></pre>
|
||||||
@ -469,7 +468,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>ISpotClient</code></td>
|
<td><code>ISpotClient</code></td>
|
||||||
<td>An implementation of the ISpotClient interface for Binance. The ISpotClient offers basic Spot API functionality in a combined interface</td>
|
<td>An implementation of the ISpotClient interface for each exchange. The ISpotClient offers basic Spot API functionality in a combined interface</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@ -1139,7 +1138,7 @@ if (!subscribeResult.Success)
|
|||||||
}
|
}
|
||||||
// Subscribing was successfull, the data will now be streamed into the data handler</code></pre>
|
// Subscribing was successfull, the data will now be streamed into the data handler</code></pre>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade show active" id="socket-binance" role="tabpanel" aria-labelledby="socket-binance-tab">
|
<div class="tab-pane fade" id="socket-binance" role="tabpanel" aria-labelledby="socket-binance-tab">
|
||||||
<pre><code>var client = new BinanceSocketClient();
|
<pre><code>var client = new BinanceSocketClient();
|
||||||
var subscribeResult = await client.SpotApi.ExchangeData.SubscribeToAllTickerUpdatesAsync(update => {
|
var subscribeResult = await client.SpotApi.ExchangeData.SubscribeToAllTickerUpdatesAsync(update => {
|
||||||
// Handle the data update, update.Data will contain the actual data
|
// Handle the data update, update.Data will contain the actual data
|
||||||
@ -1381,7 +1380,7 @@ await client.UnsubscribeAllAsync();</code></pre>
|
|||||||
The <code>ExchangeRestClient</code> (or <code>ExchangeRestClient</code> when used directly) can be used to easily access REST clients for different API's.
|
The <code>ExchangeRestClient</code> (or <code>ExchangeRestClient</code> when used directly) can be used to easily access REST clients for different API's.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
For example, having the Binance, Bybit and Kucoin packages installed allows you to use it like this:
|
For example, using the Binance, Bybit and Kucoin API's can be done like this:
|
||||||
<pre><code>var exchangeRestClient = new ExchangeRestClient(); // Either construct it or inject the IExchangeRestClient into your service
|
<pre><code>var exchangeRestClient = new ExchangeRestClient(); // Either construct it or inject the IExchangeRestClient into your service
|
||||||
var binanceTicker = await exchangeRestClient.Binance.SpotApi.ExchangeData.GetTickersAsync();
|
var binanceTicker = await exchangeRestClient.Binance.SpotApi.ExchangeData.GetTickersAsync();
|
||||||
var bybitTicker = await exchangeRestClient.Bybit.V5Api.ExchangeData.GetTickers();
|
var bybitTicker = await exchangeRestClient.Bybit.V5Api.ExchangeData.GetTickers();
|
||||||
@ -1389,7 +1388,7 @@ var kucoinTicker = await exchangeRestClient.Kucoin.SpotApi.ExchangeData.GetTicke
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p><b>(I)ExchangeSocketClient</b><br />
|
<p><b>(I)ExchangeSocketClient</b><br />
|
||||||
Similarly as the (I)ExchangeRestClient this client allows you to access the different Websocket clients through a single access point.
|
Similarly as the <code>(I)ExchangeRestClient</code> this client allows you to access the different Websocket clients through a single access point.
|
||||||
</p>
|
</p>
|
||||||
<p>For example accessing the Bitget, Kraken and OKX API's could be done like this:
|
<p>For example accessing the Bitget, Kraken and OKX API's could be done like this:
|
||||||
<pre><code>var exchangeSocketClient = new ExchangeSocketClient(); // Either construct it or inject the ExchangeSocketClient into your service
|
<pre><code>var exchangeSocketClient = new ExchangeSocketClient(); // Either construct it or inject the ExchangeSocketClient into your service
|
||||||
@ -1399,10 +1398,10 @@ var okxSub = await exchangeSocketClient.OKX.UnifiedApi.ExchangeData.SubscribeToT
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p><b>ISpotClient</b><br />
|
<p><b>ISpotClient</b><br />
|
||||||
The ISpotClient is a REST API client interface implemented by each library which implements a Spot trading API. It provided a common way of doing basic operations on the Spot market, for example getting ticker or trade data, but also placing and retrieving orders. Because this interface is implemented for each exchange with a Spot market the interface is relatively basic, only exposing methods that are supported by all the APIs.
|
The <code>ISpotClient</code> is a REST API client interface implemented by each library which implements a Spot trading API. It provided a common way of doing basic operations on the Spot market, for example getting ticker or trade data, but also placing and retrieving orders. Because this interface is implemented for each exchange with a Spot market the interface is relatively basic, only exposing methods that are supported by all the APIs.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
The ISpotClient is added to the service collection when using <a href="#idocs_di">dependency injection</a>. Alternatively it can be accessed for a specific client by calling the `CommonSpotClient` property on the Spot sub-API of a client:
|
The <code>ISpotClient</code> is added to the service collection when using <a href="#idocs_di">dependency injection</a>. Alternatively it can be accessed for a specific client by calling the `CommonSpotClient` property on the Spot sub-API of a client:
|
||||||
<pre><code>var spotClient = restClient.SpotApi.CommonSpotClient;</code></pre>
|
<pre><code>var spotClient = restClient.SpotApi.CommonSpotClient;</code></pre>
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
@ -1507,6 +1506,10 @@ options.ApiCredentials = new ApiCredentials("YOUR PUBLIC KEY", "YOUR PRIVATE KEY
|
|||||||
<div class="tab-pane fade show active" id="options-cc" role="tabpanel" aria-labelledby="options-cc-tab">
|
<div class="tab-pane fade show active" id="options-cc" role="tabpanel" aria-labelledby="options-cc-tab">
|
||||||
<pre><code>builder.Services.AddCryptoClients(globalOptions => {
|
<pre><code>builder.Services.AddCryptoClients(globalOptions => {
|
||||||
globalOptions.RequestTimeout = TimeSpan.FromSeconds(30);
|
globalOptions.RequestTimeout = TimeSpan.FromSeconds(30);
|
||||||
|
},
|
||||||
|
// Exchange specific options can be provided as well
|
||||||
|
bybitRestOptions: bybitOptions => {
|
||||||
|
// Set options specific for the Bybit rest client here
|
||||||
});</code></pre>
|
});</code></pre>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade" id="options-binance" role="tabpanel" aria-labelledby="options-binance-tab">
|
<div class="tab-pane fade" id="options-binance" role="tabpanel" aria-labelledby="options-binance-tab">
|
||||||
@ -1623,7 +1626,7 @@ options.ApiCredentials = new ApiCredentials("YOUR PUBLIC KEY", "YOUR PRIVATE KEY
|
|||||||
<ul class="nav nav-tabs" id="options-constr" role="tablist" style="margin-bottom: -16px;">
|
<ul class="nav nav-tabs" id="options-constr" role="tablist" style="margin-bottom: -16px;">
|
||||||
<li class="nav-item" role="presentation">
|
<li class="nav-item" role="presentation">
|
||||||
<a class="nav-link active" id="options-cc-tab" data-toggle="tab" href="#options-constr-cc" role="tab" aria-controls="options-constr-cc" aria-selected="true">CryptoClients</a>
|
<a class="nav-link active" id="options-cc-tab" data-toggle="tab" href="#options-constr-cc" role="tab" aria-controls="options-constr-cc" aria-selected="true">CryptoClients</a>
|
||||||
</li
|
</li>
|
||||||
<li class="nav-item" role="presentation">
|
<li class="nav-item" role="presentation">
|
||||||
<a class="nav-link" id="options-binance-tab" data-toggle="tab" href="#options-constr-binance" role="tab" aria-controls="options-constr-binance" aria-selected="true">Binance</a>
|
<a class="nav-link" id="options-binance-tab" data-toggle="tab" href="#options-constr-binance" role="tab" aria-controls="options-constr-binance" aria-selected="true">Binance</a>
|
||||||
</li>
|
</li>
|
||||||
@ -2384,7 +2387,7 @@ var binanceClient = new BinanceRestClient(new HttpClient(), logFactory, options
|
|||||||
<a class="nav-link active" id="limit-cc-tab" data-toggle="tab" href="#limit-cc" role="tab" aria-controls="limit-cc" aria-selected="true">CryptoClients</a>
|
<a class="nav-link active" id="limit-cc-tab" data-toggle="tab" href="#limit-cc" role="tab" aria-controls="limit-cc" aria-selected="true">CryptoClients</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item" role="presentation">
|
<li class="nav-item" role="presentation">
|
||||||
<a class="nav-link active" id="limit-binance-tab" data-toggle="tab" href="#limit-binance" role="tab" aria-controls="limit-binance" aria-selected="true">Binance</a>
|
<a class="nav-link" id="limit-binance-tab" data-toggle="tab" href="#limit-binance" role="tab" aria-controls="limit-binance" aria-selected="true">Binance</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item" role="presentation">
|
<li class="nav-item" role="presentation">
|
||||||
<a class="nav-link" id="limit-kraken-tab" data-toggle="tab" href="#limit-kraken" role="tab" aria-controls="limit-kraken" aria-selected="false">Kraken</a>
|
<a class="nav-link" id="limit-kraken-tab" data-toggle="tab" href="#limit-kraken" role="tab" aria-controls="limit-kraken" aria-selected="false">Kraken</a>
|
||||||
@ -2405,7 +2408,7 @@ var binanceClient = new BinanceRestClient(new HttpClient(), logFactory, options
|
|||||||
// Output: Limit triggered: RateLimitEvent { ApiLimit = Spot Socket, LimitDescription = Limit of 6000 per 00:01:00, RequestDefinition = GET 1, Host = wss://ws-api.binance.com, Current = 5752, RequestWeight = 250, Limit = 6000, TimePeriod = 00:01:00, DelayTime = 00:00:38.7784145, Behaviour = Wait }
|
// Output: Limit triggered: RateLimitEvent { ApiLimit = Spot Socket, LimitDescription = Limit of 6000 per 00:01:00, RequestDefinition = GET 1, Host = wss://ws-api.binance.com, Current = 5752, RequestWeight = 250, Limit = 6000, TimePeriod = 00:01:00, DelayTime = 00:00:38.7784145, Behaviour = Wait }
|
||||||
</code></pre>
|
</code></pre>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade show active" id="limit-binance" role="tabpanel" aria-labelledby="limit-binance-tab">
|
<div class="tab-pane fade" id="limit-binance" role="tabpanel" aria-labelledby="limit-binance-tab">
|
||||||
<pre><code>services.AddBinance(x =>
|
<pre><code>services.AddBinance(x =>
|
||||||
x.RatelimiterEnabled = true;
|
x.RatelimiterEnabled = true;
|
||||||
x.RateLimitingBehaviour = RateLimitingBehaviour.Wait;
|
x.RateLimitingBehaviour = RateLimitingBehaviour.Wait;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user