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 @@
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.
-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
A Discord server is available here. Feel free to join for discussion and/or questions around the CryptoExchange.Net and implementation libraries.
See also the Examples folder in the source
- - Minimal APIA 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 SymbolsGet 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);
+ Place a limit buy order on exchange X for 0.1 BTC at a price of 50.000 USDT
+ Getting TickerGet 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 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();
+ 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
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);
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();
+
+