mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-06-08 16:36:15 +00:00
Docs
This commit is contained in:
parent
76e95cf870
commit
bdbec48155
@ -1804,6 +1804,9 @@ hr {
|
||||
}
|
||||
.accordion .card-body {
|
||||
line-height: 26px;
|
||||
border: 1px solid #aaa;
|
||||
margin-top: -4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.accordion.arrow-right .card-header a {
|
||||
padding-left: 1.25rem;
|
||||
@ -2009,6 +2012,19 @@ hr {
|
||||
-webkit-transform: translateY(-3px);
|
||||
transform: translateY(-3px);
|
||||
}
|
||||
.nav-tabs .nav-item .nav-link:not(.active):after {
|
||||
height: 2px;
|
||||
width: calc(100% - 10px);
|
||||
content: ' ';
|
||||
background-color: #aaa;
|
||||
display: block;
|
||||
margin: 0 5px;
|
||||
position: absolute;
|
||||
bottom: -3px;
|
||||
left: 0;
|
||||
-webkit-transform: translateY(-3px);
|
||||
transform: translateY(-3px);
|
||||
}
|
||||
.nav-tabs .nav-item .nav-link:not(.active):hover {
|
||||
color: #0366d6;
|
||||
}
|
||||
@ -2044,7 +2060,6 @@ hr {
|
||||
}
|
||||
|
||||
.nav-tabs:not(.flex-column) {
|
||||
flex-wrap: nowrap;
|
||||
overflow: hidden;
|
||||
overflow-x: auto;
|
||||
-ms-overflow-style: -ms-autohiding-scrollbar;
|
||||
|
150
docs/index.html
150
docs/index.html
@ -113,7 +113,7 @@
|
||||
<div class="container">
|
||||
<section id="idocs_intro">
|
||||
<h1>CryptoExchange.Net</h1>
|
||||
|
||||
|
||||
<p>CryptoExchange.Net is a base library which is used to implement different cryptocurrency (exchange) API's. It provides a standardized way of implementing different API's, which results in a very similar experience for users of the API implementations.</p>
|
||||
<div class="alert alert-info">All libraries can be used in the same project as well as indivually.</div>
|
||||
<p>The following API's are directly supported. Note that there are 3rd party implementations going around, but only these are created and supported by me</p>
|
||||
@ -124,19 +124,37 @@
|
||||
<th>Repository</th>
|
||||
<th>Nuget</th>
|
||||
</tr>
|
||||
<tr><td>Binance</td><td><a href="https://github.com/JKorf/Binance.Net">JKorf/Binance.Net</a></td><td><a href="https://www.nuget.org/packages/Binance.Net"><img src="https://img.shields.io/nuget/v/Binance.net.svg" /></a></td></tr>
|
||||
<tr><td>Bitfinex</td><td><a href="https://github.com/JKorf/Bitfinex.Net">JKorf/Bitfinex.Net</a></td><td><a href="https://www.nuget.org/packages/Bitfinex.Net"><img src="https://img.shields.io/nuget/v/Bitfinex.net.svg" /></a></td></tr>
|
||||
<tr><td>Bitget</td><td><a href="https://github.com/JKorf/Bitget.Net">JKorf/Bitget.Net</a></td><td><a href="https://www.nuget.org/packages/JK.Bitget.Net"><img src="https://img.shields.io/nuget/v/JK.Bitget.net.svg" /></a></td></tr>
|
||||
<tr><td>Bybit</td><td><a href="https://github.com/JKorf/Bybit.Net">JKorf/Bybit.Net</a></td><td><a href="https://www.nuget.org/packages/Bybit.Net"><img src="https://img.shields.io/nuget/v/Bybit.net.svg" /></a></td></tr>
|
||||
<tr><td>CoinEx</td><td><a href="https://github.com/JKorf/CoinEx.Net">JKorf/CoinEx.Net</a></td><td><a href="https://www.nuget.org/packages/CoinEx.Net"><img src="https://img.shields.io/nuget/v/CoinEx.net.svg" /></a></td></tr>
|
||||
<tr><td>CoinGecko</td><td><a href="https://github.com/JKorf/CoinGecko.Net">JKorf/CoinGecko.Net</a></td><td><a href="https://www.nuget.org/packages/CoinGecko.Net"><img src="https://img.shields.io/nuget/v/CoinGecko.net.svg" /></a></td></tr>
|
||||
<tr><td>Huobi</td><td><a href="https://github.com/JKorf/Huobi.Net">JKorf/Huobi.Net</a></td><td><a href="https://www.nuget.org/packages/Huobi.Net"><img src="https://img.shields.io/nuget/v/Huobi.net.svg" /></a></td></tr>
|
||||
<tr><td>Kraken</td><td><a href="https://github.com/JKorf/Kraken.Net">JKorf/Kraken.Net</a></td><td><a href="https://www.nuget.org/packages/KrakenExchange.Net"><img src="https://img.shields.io/nuget/v/KrakenExchange.net.svg" /></a></td></tr>
|
||||
<tr><td>Kucoin</td><td><a href="https://github.com/JKorf/Kucoin.Net">JKorf/Kucoin.Net</a></td><td><a href="https://www.nuget.org/packages/Kucoin.Net"><img src="https://img.shields.io/nuget/v/Kucoin.net.svg" /></a></td></tr>
|
||||
<tr><td>Mexc</td><td><a href="https://github.com/JKorf/Mexc.Net">JKorf/Mexc.Net</a></td><td><a href="https://www.nuget.org/packages/JK.Mexc.Net"><img src="https://img.shields.io/nuget/v/JK.Mexc.net.svg" /></a></td></tr>
|
||||
<tr><td>OKX</td><td><a href="https://github.com/JKorf/OKX.Net">JKorf/OKX.Net</a></td><td><a href="https://www.nuget.org/packages/JK.OKX.Net"><img src="https://img.shields.io/nuget/v/JK.OKX.net.svg" /></a></td></tr>
|
||||
<tr><td>Binance</td><td><a href="https://github.com/JKorf/Binance.Net">JKorf/Binance.Net</a></td><td><a href="https://www.nuget.org/packages/Binance.Net"><img src="https://img.shields.io/nuget/v/Binance.net.svg?style=flat-square" /></a></td></tr>
|
||||
<tr><td>Bitfinex</td><td><a href="https://github.com/JKorf/Bitfinex.Net">JKorf/Bitfinex.Net</a></td><td><a href="https://www.nuget.org/packages/Bitfinex.Net"><img src="https://img.shields.io/nuget/v/Bitfinex.net.svg?style=flat-square" /></a></td></tr>
|
||||
<tr><td>Bitget</td><td><a href="https://github.com/JKorf/Bitget.Net">JKorf/Bitget.Net</a></td><td><a href="https://www.nuget.org/packages/JK.Bitget.Net"><img src="https://img.shields.io/nuget/v/JK.Bitget.net.svg?style=flat-square" /></a></td></tr>
|
||||
<tr><td>Bybit</td><td><a href="https://github.com/JKorf/Bybit.Net">JKorf/Bybit.Net</a></td><td><a href="https://www.nuget.org/packages/Bybit.Net"><img src="https://img.shields.io/nuget/v/Bybit.net.svg?style=flat-square" /></a></td></tr>
|
||||
<tr><td>CoinEx</td><td><a href="https://github.com/JKorf/CoinEx.Net">JKorf/CoinEx.Net</a></td><td><a href="https://www.nuget.org/packages/CoinEx.Net"><img src="https://img.shields.io/nuget/v/CoinEx.net.svg?style=flat-square" /></a></td></tr>
|
||||
<tr><td>CoinGecko</td><td><a href="https://github.com/JKorf/CoinGecko.Net">JKorf/CoinGecko.Net</a></td><td><a href="https://www.nuget.org/packages/CoinGecko.Net"><img src="https://img.shields.io/nuget/v/CoinGecko.net.svg?style=flat-square" /></a></td></tr>
|
||||
<tr><td>Huobi</td><td><a href="https://github.com/JKorf/Huobi.Net">JKorf/Huobi.Net</a></td><td><a href="https://www.nuget.org/packages/Huobi.Net"><img src="https://img.shields.io/nuget/v/Huobi.net.svg?style=flat-square" /></a></td></tr>
|
||||
<tr><td>Kraken</td><td><a href="https://github.com/JKorf/Kraken.Net">JKorf/Kraken.Net</a></td><td><a href="https://www.nuget.org/packages/KrakenExchange.Net"><img src="https://img.shields.io/nuget/v/KrakenExchange.net.svg?style=flat-square" /></a></td></tr>
|
||||
<tr><td>Kucoin</td><td><a href="https://github.com/JKorf/Kucoin.Net">JKorf/Kucoin.Net</a></td><td><a href="https://www.nuget.org/packages/Kucoin.Net"><img src="https://img.shields.io/nuget/v/Kucoin.net.svg?style=flat-square" /></a></td></tr>
|
||||
<tr><td>Mexc</td><td><a href="https://github.com/JKorf/Mexc.Net">JKorf/Mexc.Net</a></td><td><a href="https://www.nuget.org/packages/JK.Mexc.Net"><img src="https://img.shields.io/nuget/v/JK.Mexc.net.svg?style=flat-square" /></a></td></tr>
|
||||
<tr><td>OKX</td><td><a href="https://github.com/JKorf/OKX.Net">JKorf/OKX.Net</a></td><td><a href="https://www.nuget.org/packages/JK.OKX.Net"><img src="https://img.shields.io/nuget/v/JK.OKX.net.svg?style=flat-square" /></a></td></tr>
|
||||
</table>
|
||||
|
||||
<h4>Supported Frameworks</h4>
|
||||
<p>
|
||||
The library is targeting both `.NET Standard 2.0` and `.NET Standard 2.1` for optimal compatibility
|
||||
</p>
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th>.NET implementation</th>
|
||||
<th>Version Support</th>
|
||||
</tr>
|
||||
<tr><td>.NET Core</td><td><code>2.0</code> and higher</td></tr>
|
||||
<tr><td>.NET Framework</td><td><code>4.6.1</code> and higher</td></tr>
|
||||
<tr><td>Mono</td><td><code>5.4</code> and higher</td></tr>
|
||||
<tr><td>Xamarin.iOS</td><td><code>10.14</code> and higher</td></tr>
|
||||
<tr><td>Xamarin.Android</td><td><code>8.0</code> and higher</td></tr>
|
||||
<tr><td>UWP</td><td><code>10.0.16299</code> and higher</td></tr>
|
||||
<tr><td>Unity</td><td><code>2018.1</code> and higher</td></tr>
|
||||
</table>
|
||||
|
||||
<h4>Discord</h4>
|
||||
<p>A Discord server is available <a href="https://discord.gg/MSpeEtSY8t">here</a>. Feel free to join for discussion and/or questions around the CryptoExchange.Net and implementation libraries.</p>
|
||||
|
||||
@ -171,7 +189,7 @@
|
||||
<section id="idocs_installation">
|
||||
<h2>Installation</h2>
|
||||
|
||||
<p>Add the package via dotnet, or add it via the package manager</p>
|
||||
<p>Add the package via dotnet, or add it via the package manager. Any number of libraries can be installed, just make sure you're always using the latest at that moment.</p>
|
||||
<ul class="nav nav-tabs" id="install" role="tablist" style="margin-bottom: -16px;">
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link active" id="install-binance-tab" data-toggle="tab" href="#install-binance" role="tab" aria-controls="install-binance" aria-selected="true">Binance</a>
|
||||
@ -2147,10 +2165,16 @@ This adds another limit of 10 requests per 2 seconds for the order endpoint in a
|
||||
<p>See also the Examples folder in the <a href="https://github.com/JKorf/CryptoExchange.Net/tree/master/Examples">source</a></p>
|
||||
|
||||
<b>Minimal API</b><br />
|
||||
<p>A minimal API example allowing the retrieval of ticker information for a specific exchange and symbol. This API returns ticker information for the following paths<br />
|
||||
<code>/Ticker/Bitfinex/ETH/BTC</code><br />
|
||||
<code>/Ticker/Bitget/ETH/BTC</code><br />
|
||||
<code>/Ticker/Kraken/ETH/BTC</code><br />
|
||||
<p>A minimal API example allowing the retrieval of ticker information for a specific exchange and symbol<br />
|
||||
<div class="accordion" id="accordionMinimalApi">
|
||||
<div class="card">
|
||||
<div class="card-header" id="headingMinimalApi">
|
||||
<h5 class="mb-0"> <a href="#" class="collapsed" data-toggle="collapse" data-target="#collapseMinimalApi" aria-expanded="false" aria-controls="collapseOne">Show code</a> </h5>
|
||||
</div>
|
||||
<div id="collapseMinimalApi" class="collapse" aria-labelledby="headingMinimalApi" data-parent="#accordionMinimalApi">
|
||||
<div class="card-body">
|
||||
<p>This API returns ticker information for the following path</p>
|
||||
<code>/Ticker/[Exchange]/[QuoteAsset]/[BaseAsset]</code> for example <code>/Ticker/Kraken/ETH/BTC</code><br />
|
||||
|
||||
</p>
|
||||
<pre><code class="language-csharp">using CryptoExchange.Net.Interfaces;
|
||||
@ -2171,7 +2195,99 @@ app.MapGet("Ticker/{exchange}/{baseAsset}/{quoteAsset}", async ([FromServices] I
|
||||
|
||||
app.Run();
|
||||
</pre></code>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<b>Placing an order</b><br />
|
||||
<p>Place a limit buy order on exchange X for 0.1 BTC at a price of 50.000 USDT</p>
|
||||
<div class="accordion" id="accordionPlaceOrder">
|
||||
<div class="card">
|
||||
<div class="card-header" id="headingPlaceOrder">
|
||||
<h5 class="mb-0"> <a href="#" class="collapsed" data-toggle="collapse" data-target="#collapsePlaceOrder" aria-expanded="false" aria-controls="collapseOne">Show code</a> </h5>
|
||||
</div>
|
||||
<div id="collapsePlaceOrder" class="collapse" aria-labelledby="headingPlaceOrder" data-parent="#accordionPlaceOrder">
|
||||
<div class="card-body">
|
||||
<div>
|
||||
<ul class="nav nav-tabs" id="example-place" role="tablist" style="margin-bottom: -16px;">
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link active" id="example-place-general-tab" data-toggle="tab" href="#example-place-general" role="tab" aria-controls="example-place-general" aria-selected="true">CryptoRestClient</a>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link" id="example-place-binance-tab" data-toggle="tab" href="#example-place-binance" role="tab" aria-controls="example-place-binance" aria-selected="true">Binance</a>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link" id="example-place-bitfinex-tab" data-toggle="tab" href="#example-place-bitfinex" role="tab" aria-controls="example-place-bitfinex" aria-selected="false">Bitfinex</a>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link" id="example-place-bitget-tab" data-toggle="tab" href="#example-place-bitget" role="tab" aria-controls="example-place-bitget" aria-selected="false">Bitget</a>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link" id="example-place-bybit-tab" data-toggle="tab" href="#example-place-bybit" role="tab" aria-controls="example-place-bybit" aria-selected="false">Bybit</a>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link" id="example-place-coinex-tab" data-toggle="tab" href="#example-place-coinex" role="tab" aria-controls="example-place-coinex" aria-selected="false">Coinex</a>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link" id="example-place-huobi-tab" data-toggle="tab" href="#example-place-huobi" role="tab" aria-controls="example-place-huobi" aria-selected="false">Huobi</a>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link" id="example-place-kraken-tab" data-toggle="tab" href="#example-place-kraken" role="tab" aria-controls="example-place-kraken" aria-selected="false">Kraken</a>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link" id="example-place-kucoin-tab" data-toggle="tab" href="#example-place-kucoin" role="tab" aria-controls="example-place-kucoin" aria-selected="false">Kucoin</a>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link" id="example-place-mexc-tab" data-toggle="tab" href="#example-place-mexc" role="tab" aria-controls="example-place-mexc" aria-selected="false">Mexc</a>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<a class="nav-link" id="example-place-okx-tab" data-toggle="tab" href="#example-place-okx" role="tab" aria-controls="example-place-okx" aria-selected="false">OKX</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content my-3" id="myTabContent">
|
||||
<div class="tab-pane fade show active" id="example-place-general" role="tabpanel" aria-labelledby="example-place-general-tab">
|
||||
<pre><code>var spotClient = cryptoRestClient.SpotClient("[Name of the exchange]");
|
||||
await spotClient.PlaceOrderAsync(spotClient.GetSymbolName("BTC", "USDT"), CommonOrderSide.Buy, CommonOrderType.Limit, 0.1m, price: 50000);</code></pre>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="example-place-binance" role="tabpanel" aria-labelledby="example-place-binance-tab">
|
||||
<pre><code>await binanceClient.SpotApi.Trading.PlaceOrderAsync("BTCUSDT", OrderSide.Buy, SpotOrderType.Limit, 0.1m, price: 50000, timeInForce: TimeInForce.GoodTillCanceled);</code></pre>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="example-place-bitfinex" role="tabpanel" aria-labelledby="example-place-bitfinex-tab">
|
||||
<pre><code>await bitfinexClient.SpotApi.Trading.PlaceOrderAsync("tBTCUST", OrderSide.Buy, OrderType.Limit, 0.1m, 50000);</code></pre>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="example-place-bitget" role="tabpanel" aria-labelledby="example-place-bitget-tab">
|
||||
<pre><code>await bitgetClient.SpotApi.Trading.PlaceOrderAsync("BTCUSDT_SPBL", BitgetOrderSide.Buy, BitgetOrderType.Limit, 0.1m, timeInForce: BitgetTimeInForce.GoodTillCanceled, 50000);</code></pre>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="example-place-bybit" role="tabpanel" aria-labelledby="example-place-bybit-tab">
|
||||
<pre><code>await bybitClient.V5Api.Trading.PlaceOrderAsync(Category.Spot, "BTCUSDT", OrderSide.Buy, NewOrderType.Limit, 0.1m, price: 50000);</code></pre>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="example-place-coinex" role="tabpanel" aria-labelledby="example-place-coinex-tab">
|
||||
<pre><code>await coinExClient.SpotApi.Trading.PlaceOrderAsync("BTCUSDT", OrderSide.Buy, OrderType.Limit, 0.1m, 50000);</code></pre>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="example-place-huobi" role="tabpanel" aria-labelledby="example-place-huobi-tab">
|
||||
<pre><code>// Need an account id, you probably want to already have done this before placing the order
|
||||
var accounts = await huobiClient.SpotApi.Account.GetAccountsAsync();
|
||||
var account = accounts.Data.Single(a => a.Type == AccountType.Spot);
|
||||
|
||||
var result = await huobiClient.SpotApi.Trading.PlaceOrderAsync(account.Id, "BTCUSDT", OrderSide.Buy, OrderType.Limit, 0.1m, price: 50000);</code></pre>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="example-place-kraken" role="tabpanel" aria-labelledby="example-place-kraken-tab">
|
||||
<pre><code>await krakenClient.SpotApi.Trading.PlaceOrderAsync("BTCUSDT",OrderSide.Buy, OrderType.Limit, 0.1m, 50000);</code></pre>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="example-place-kucoin" role="tabpanel" aria-labelledby="example-place-kucoin-tab">
|
||||
<pre><code>await kucoinClient.SpotApi.Trading.PlaceOrderAsync("BTC-USDT", OrderSide.Buy, NewOrderType.Limit, 0.1m, 50000);</code></pre>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="example-place-mexc" role="tabpanel" aria-labelledby="example-place-mexc-tab">
|
||||
<pre><code>await mexcClient.SpotApi.Trading.PlaceOrderAsync("BTCUSDT", Mexc.Net.Enums.OrderSide.Buy, Mexc.Net.Enums.OrderType.Limit, 0.1m, price: 50000);</code></pre>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="example-place-okx" role="tabpanel" aria-labelledby="example-place-okx-tab">
|
||||
<pre><code>await okxClient.UnifiedApi.Trading.PlaceOrderAsync("BTC-USDT", OKXOrderSide.Buy, OKXOrderType.LimitOrder, 0.1m, 50000);</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user