diff --git a/docs/assets/css/stylesheet.css b/docs/assets/css/stylesheet.css index c2ee343..e94a0e1 100644 --- a/docs/assets/css/stylesheet.css +++ b/docs/assets/css/stylesheet.css @@ -1804,7 +1804,7 @@ hr { } .accordion .card-body { line-height: 26px; - border: 1px solid #aaa; + border: 1px solid #ccc; margin-top: -4px; border-radius: 4px; } diff --git a/docs/index.html b/docs/index.html index 158b0d4..a143113 100644 --- a/docs/index.html +++ b/docs/index.html @@ -101,7 +101,15 @@ - + @@ -115,7 +123,7 @@

CryptoExchange.Net

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.

-
All libraries can be used in the same project as well as indivually.
+
All libraries can be used in the same project as well as indivually, just install the exchange libraries you need!

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

@@ -156,6 +164,7 @@

Discord

+

A Discord server is available here. Feel free to join for discussion and/or questions around the CryptoExchange.Net and implementation libraries.

Support the project

@@ -2177,44 +2186,277 @@ This adds another limit of 10 requests per 2 seconds for the order endpoint in a

Examples

See also the Examples folder in the source

- - Minimal API
-

A minimal API example allowing the retrieval of ticker information for a specific exchange and symbol
-

-
-
-
-
-
-
-

This API returns ticker information for the following path

- /Ticker/[Exchange]/[QuoteAsset]/[BaseAsset] for example /Ticker/Kraken/ETH/BTC
-

-
using CryptoExchange.Net.Interfaces;
-using Microsoft.AspNetCore.Mvc;
-
-var builder = WebApplication.CreateBuilder(args);
-builder.Services.AddBitfinex();
-builder.Services.AddBitget();
-builder.Services.AddKraken();
-var app = builder.Build();
-
-app.MapGet("Ticker/{exchange}/{baseAsset}/{quoteAsset}", async ([FromServices] ICryptoRestClient client, string exchange, string baseAsset, string quoteAsset) =>
-{
-    var spotClient = client.SpotClient(exchange)!;
-    var result = await spotClient.GetTickerAsync(spotClient.GetSymbolName(baseAsset, quoteAsset));
-    return result.Data;
-});
-
-app.Run();
-		  
+ Get Symbols
+

Get a list of supported symbols on the exchange and information about the symbols

+
+
+
+
+
+
+
+
+ + +
+
+
// Name of the exchange can be whatever exchange library you have installed, for example Binance, Bybit, Kraken etc
+var spotClient = cryptoRestClient.SpotClient("[Name of the exchange]");
+await spotClient.GetSymbolsAsync();
+
+
+
await binanceClient.SpotApi.ExchangeData.GetExchangeInfoAsync();
+
+
+
await bitfinexClient.SpotApi.ExchangeData.GetSymbolsAsync();
+
+
+
await bitgetClient.SpotApi.ExchangeData.GetSymbolsAsync();
+
+
+
await bybitClient.V5Api.ExchangeData.GetSpotSymbolsAsync();
+
+
+
await coinExClient.SpotApi.ExchangeData.GetSymbolsAsync();
+
+
+
await huobiClient.SpotApi.ExchangeData.GetSymbolsAsync();
+
+
+
await krakenClient.SpotApi.ExchangeData.GetSymbolsAsync();
+
+
+
await kucoinClient.SpotApi.ExchangeData.GetSymbolsAsync();
+
+
+
await mexcClient.SpotApi.ExchangeData.GetExchangeInfoAsync();
+
+
+
await okxClient.UnifiedApi.ExchangeData.GetSymbolsAsync(OKXInstrumentType.Spot);
+
+
+
- Placing an order
-

Place a limit buy order on exchange X for 0.1 BTC at a price of 50.000 USDT

+ Getting Ticker
+

Get ticker/price statistics for a specific asset pair

+
+
+
+
+
+
+
+
+ + +
+
+
// Name of the exchange can be whatever exchange library you have installed, for example Binance, Bybit, Kraken etc
+var spotClient = cryptoRestClient.SpotClient("[Name of the exchange]");
+await spotClient.GetTickerAsync(spotClient.GetSymbolName("BTC", "USDT"));
+
+
+
await binanceClient.SpotApi.ExchangeData.GetTickerAsync("BTCUSDT");
+
+
+
await bitfinexClient.SpotApi.ExchangeData.GetTickerAsync("tBTCUST");
+
+
+
await bitgetClient.SpotApi.ExchangeData.GetTickerAsync("BTCUSDT_SPBL");
+
+
+
await bybitClient.V5Api.ExchangeData.GetSpotTickersAsync("BTCUSDT");
+
+
+
await coinExClient.SpotApi.ExchangeData.GetTickerAsync("BTCUSDT");
+
+
+
await huobiClient.SpotApi.ExchangeData.GetTickerAsync("BTCUSDT");
+
+
+
await krakenClient.SpotApi.ExchangeData.GetTickerAsync("BTCUSDT");
+
+
+
await kucoinClient.SpotApi.ExchangeData.GetTickerAsync("BTC-USDT");
+
+
+
await mexcClient.SpotApi.ExchangeData.GetTickerAsync("BTCUSDT");
+
+
+
await okxClient.UnifiedApi.ExchangeData.GetTickerAsync("BTC-USDT");
+
+
+
+
+
+
+ + Get Balances
+

Get balance information. Requires API credentials to be set in the client options

+
+
+
+
+
+
+
+
+ + +
+
+
// Name of the exchange can be whatever exchange library you have installed, for example Binance, Bybit, Kraken etc
+var spotClient = cryptoRestClient.SpotClient("[Name of the exchange]");
+await spotClient.GetBalancesAsync();
+
+
+
await binanceClient.SpotApi.Account.GetBalancesAsync();
+
+
+
await bitfinexClient.SpotApi.Account.GetBalancesAsync();
+
+
+
await bitgetClient.SpotApi.Account.GetBalancesAsync();
+
+
+
await bybitClient.V5Api.Account.GetBalancesAsync(AccountType.Spot);
+
+
+
await coinExClient.SpotApi.Account.GetBalancesAsync();
+
+
+
// 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.Account.GetBalancesAsync();
+
+
+
await krakenClient.SpotApi.Account.GetBalancesAsync();
+
+
+
await kucoinClient.SpotApi.Account.GetAccountsAsync();
+
+
+
await mexcClient.SpotApi.Account.GetAccountInfoAsync();
+
+
+
await okxClient.UnifiedApi.Account.GetAccountBalanceAsync();
+
+
+
+
+
+
+ + Placing Order
+

Place a limit buy order for 0.1 BTC at a price of 50.000 USDT. Requires API credentials to be set in the client options

@@ -2261,7 +2503,8 @@ app.Run();
-
var spotClient = cryptoRestClient.SpotClient("[Name of the exchange]");
+		
// Name of the exchange can be whatever exchange library you have installed, for example Binance, Bybit, Kraken etc
+var spotClient = cryptoRestClient.SpotClient("[Name of the exchange]");
 await spotClient.PlaceOrderAsync(spotClient.GetSymbolName("BTC", "USDT"), CommonOrderSide.Buy, CommonOrderType.Limit, 0.1m, price: 50000);
@@ -2304,6 +2547,42 @@ var result = await huobiClient.SpotApi.Trading.PlaceOrderAsync(account.Id, "BTCU
+ Minimal API
+

A minimal API example allowing the caller to retrieve ticker information for a specific exchange and asset pair
+

+
+
+
+
+
+
+

This API returns ticker information for the following path

+ /Ticker/[Exchange]/[QuoteAsset]/[BaseAsset] for example /Ticker/Kraken/ETH/BTC
+ +

+
using CryptoExchange.Net.Interfaces;
+using Microsoft.AspNetCore.Mvc;
+
+var builder = WebApplication.CreateBuilder(args);
+builder.Services.AddBitfinex();
+builder.Services.AddBitget();
+builder.Services.AddKraken();
+var app = builder.Build();
+
+app.MapGet("Ticker/{exchange}/{baseAsset}/{quoteAsset}", async ([FromServices] ICryptoRestClient client, string exchange, string baseAsset, string quoteAsset) =>
+{
+    var spotClient = client.SpotClient(exchange)!;
+    var result = await spotClient.GetTickerAsync(spotClient.GetSymbolName(baseAsset, quoteAsset));
+    return result.Data;
+});
+
+app.Run();
+		  
+
+
+
+ +