diff --git a/Examples/BlazorClient/BlazorClient.csproj b/Examples/BlazorClient/BlazorClient.csproj
index b9bf64f..d08e083 100644
--- a/Examples/BlazorClient/BlazorClient.csproj
+++ b/Examples/BlazorClient/BlazorClient.csproj
@@ -5,20 +5,21 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Examples/BlazorClient/Pages/Index.razor b/Examples/BlazorClient/Pages/Index.razor
index 3772236..aa33306 100644
--- a/Examples/BlazorClient/Pages/Index.razor
+++ b/Examples/BlazorClient/Pages/Index.razor
@@ -7,6 +7,7 @@
@inject IBybitRestClient bybitClient
@inject ICoinbaseRestClient coinbaseClient
@inject ICoinExRestClient coinexClient
+@inject ICryptoComRestClient cryptocomClient
@inject IGateIoRestClient gateioClient
@inject IHTXRestClient huobiClient
@inject IKrakenRestClient krakenClient
@@ -33,6 +34,7 @@
var bybitTask = bybitClient.V5Api.ExchangeData.GetSpotTickersAsync("BTCUSDT");
var coinbaseTask = coinbaseClient.AdvancedTradeApi.ExchangeData.GetSymbolAsync("BTC-USDT");
var coinexTask = coinexClient.SpotApi.ExchangeData.GetTickerAsync("BTCUSDT");
+ var cryptocomTask = cryptocomClient.ExchangeApi.ExchangeData.GetTickersAsync("BTC_USDT");
var gateioTask = gateioClient.SpotApi.ExchangeData.GetTickersAsync("BTC_USDT");
var htxTask = huobiClient.SpotApi.ExchangeData.GetTickerAsync("btcusdt");
var krakenTask = krakenClient.SpotApi.ExchangeData.GetTickerAsync("XBTUSD");
@@ -66,6 +68,9 @@
if (coinexTask.Result.Success)
_prices.Add("CoinEx", coinexTask.Result.Data.Ticker.LastPrice);
+ if (cryptocomTask.Result.Success)
+ _prices.Add("CryptoCom", cryptocomTask.Result.Data.First().LastPrice ?? 0);
+
if (gateioTask.Result.Success)
_prices.Add("GateIo", gateioTask.Result.Data.First().LastPrice);
diff --git a/Examples/BlazorClient/Pages/LiveData.razor b/Examples/BlazorClient/Pages/LiveData.razor
index ec5f879..b51f5a9 100644
--- a/Examples/BlazorClient/Pages/LiveData.razor
+++ b/Examples/BlazorClient/Pages/LiveData.razor
@@ -7,6 +7,7 @@
@inject IBybitSocketClient bybitSocketClient
@inject ICoinbaseSocketClient coinbaseSocketClient
@inject ICoinExSocketClient coinExSocketClient
+@inject ICryptoComSocketClient cryptocomSocketClient
@inject IGateIoSocketClient gateioSocketClient
@inject IHTXSocketClient htxSocketClient
@inject IKrakenSocketClient krakenSocketClient
@@ -41,9 +42,10 @@
bybitSocketClient.V5SpotApi.SubscribeToTickerUpdatesAsync("ETHBTC", data => UpdateData("Bybit", data.Data.LastPrice)),
coinExSocketClient.SpotApi.SubscribeToTickerUpdatesAsync("ETHBTC", data => UpdateData("CoinEx", data.Data.LastPrice)),
coinbaseSocketClient.AdvancedTradeApi.SubscribeToTickerUpdatesAsync("ETH-BTC", data => UpdateData("Coinbase", data.Data.LastPrice)),
+ cryptocomSocketClient.ExchangeApi.SubscribeToTickerUpdatesAsync("ETH_BTC", data => UpdateData("CryptoCom", data.Data.LastPrice ?? 0)),
gateioSocketClient.SpotApi.SubscribeToTickerUpdatesAsync("ETH_BTC", data => UpdateData("GateIo", data.Data.LastPrice)),
htxSocketClient.SpotApi.SubscribeToTickerUpdatesAsync("ethbtc", data => UpdateData("HTX", data.Data.ClosePrice ?? 0)),
- krakenSocketClient.SpotApi.SubscribeToTickerUpdatesAsync("ETH/XBT", data => UpdateData("Kraken", data.Data.LastTrade.Price)),
+ krakenSocketClient.SpotApi.SubscribeToTickerUpdatesAsync("ETH/XBT", data => UpdateData("Kraken", data.Data.LastPrice)),
kucoinSocketClient.SpotApi.SubscribeToTickerUpdatesAsync("ETH-BTC", data => UpdateData("Kucoin", data.Data.LastPrice ?? 0)),
mexcSocketClient.SpotApi.SubscribeToMiniTickerUpdatesAsync("ETHBTC", data => UpdateData("Mexc", data.Data.LastPrice)),
okxSocketClient.UnifiedApi.ExchangeData.SubscribeToTickerUpdatesAsync("ETH-BTC", data => UpdateData("OKX", data.Data.LastPrice ?? 0)),
diff --git a/Examples/BlazorClient/Pages/OrderBooks.razor b/Examples/BlazorClient/Pages/OrderBooks.razor
index e102bcd..1bec6f7 100644
--- a/Examples/BlazorClient/Pages/OrderBooks.razor
+++ b/Examples/BlazorClient/Pages/OrderBooks.razor
@@ -10,6 +10,7 @@
@using CoinEx.Net.Interfaces
@using Coinbase.Net.Interfaces
@using CryptoExchange.Net.Interfaces
+@using CryptoCom.Net.Interfaces
@using GateIo.Net.Interfaces
@using HTX.Net.Interfaces
@using Kraken.Net.Interfaces
@@ -25,6 +26,7 @@
@inject IBybitOrderBookFactory bybitFactory
@inject ICoinbaseOrderBookFactory coinbaseFactory
@inject ICoinExOrderBookFactory coinExFactory
+@inject ICryptoComOrderBookFactory cryptocomFactory
@inject IGateIoOrderBookFactory gateioFactory
@inject IHTXOrderBookFactory htxFactory
@inject IKrakenOrderBookFactory krakenFactory
@@ -72,6 +74,7 @@
{ "Bybit", bybitFactory.Create("ETHBTC", Bybit.Net.Enums.Category.Spot) },
{ "Coinbase", coinbaseFactory.Create("ETH-BTC", null) },
{ "CoinEx", coinExFactory.CreateSpot("ETHBTC") },
+ { "CryptoCom", cryptocomFactory.CreateExchange("ETH_BTC") },
{ "GateIo", gateioFactory.CreateSpot("ETH_BTC") },
{ "HTX", htxFactory.CreateSpot("ethbtc") },
{ "Kraken", krakenFactory.CreateSpot("ETH/XBT") },
diff --git a/Examples/BlazorClient/Shared/NavMenu.razor b/Examples/BlazorClient/Shared/NavMenu.razor
index 12b1f0a..d691d6e 100644
--- a/Examples/BlazorClient/Shared/NavMenu.razor
+++ b/Examples/BlazorClient/Shared/NavMenu.razor
@@ -14,7 +14,7 @@
- Get data ISpotClient
+ Get data SharedClient
diff --git a/Examples/BlazorClient/Startup.cs b/Examples/BlazorClient/Startup.cs
index 2d1749e..65c1ab3 100644
--- a/Examples/BlazorClient/Startup.cs
+++ b/Examples/BlazorClient/Startup.cs
@@ -43,6 +43,7 @@ namespace BlazorClient
services.AddBybit();
services.AddCoinbase();
services.AddCoinEx();
+ services.AddCryptoCom();
services.AddGateIo();
services.AddHTX();
services.AddKraken();
diff --git a/Examples/BlazorClient/_Imports.razor b/Examples/BlazorClient/_Imports.razor
index 792d814..4b198c2 100644
--- a/Examples/BlazorClient/_Imports.razor
+++ b/Examples/BlazorClient/_Imports.razor
@@ -16,6 +16,7 @@
@using Bybit.Net.Interfaces.Clients;
@using Coinbase.Net.Interfaces.Clients;
@using CoinEx.Net.Interfaces.Clients;
+@using CryptoCom.Net.Interfaces.Clients;
@using GateIo.Net.Interfaces.Clients;
@using HTX.Net.Interfaces.Clients;
@using Kraken.Net.Interfaces.Clients;
diff --git a/Examples/ConsoleClient/ConsoleClient.csproj b/Examples/ConsoleClient/ConsoleClient.csproj
index 4a5bf53..7aaa715 100644
--- a/Examples/ConsoleClient/ConsoleClient.csproj
+++ b/Examples/ConsoleClient/ConsoleClient.csproj
@@ -6,19 +6,20 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Examples/ConsoleClient/Exchanges/BybitExchange.cs b/Examples/ConsoleClient/Exchanges/BybitExchange.cs
index 580b5c3..3a734d2 100644
--- a/Examples/ConsoleClient/Exchanges/BybitExchange.cs
+++ b/Examples/ConsoleClient/Exchanges/BybitExchange.cs
@@ -27,7 +27,7 @@ namespace ConsoleClient.Exchanges
{
using var client = new BybitRestClient();
var result = await client.V5Api.Account.GetBalancesAsync(Bybit.Net.Enums.AccountType.Spot);
- return result.Data.List.First().Assets.ToDictionary(d => d.Asset, d => d.WalletBalance);
+ return result.Data.List.First().Assets.ToDictionary(d => d.Asset, d => d.WalletBalance ?? 0);
}
public async Task> GetOpenOrders()
diff --git a/Examples/SharedClients/SharedClients.csproj b/Examples/SharedClients/SharedClients.csproj
index 4a4094b..555ee9a 100644
--- a/Examples/SharedClients/SharedClients.csproj
+++ b/Examples/SharedClients/SharedClients.csproj
@@ -8,9 +8,9 @@
-
-
-
+
+
+
diff --git a/docs/index.html b/docs/index.html
index b5879be..73148e9 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -154,6 +154,7 @@
Coinbase | JKorf/Coinbase.Net |  |
CoinEx | JKorf/CoinEx.Net |  |
CoinGecko | JKorf/CoinGecko.Net |  |
+ Crypto.com | JKorf/CryptoCom.Net |  |
Gate.io | JKorf/GateIo.Net |  |
HTX | JKorf/HTX.Net |  |
Kraken | JKorf/Kraken.Net |  |
@@ -251,6 +252,9 @@
CoinGecko
+
+ Crypto.com
+
GateIo
@@ -307,6 +311,9 @@
dotnet add package CoinEx.Net
+
+
dotnet add package CryptoCom.Net
+
dotnet add package GateIo.Net
@@ -373,6 +380,9 @@
Coinex
+
+ Crypto.com
+
GateIo
@@ -422,6 +432,9 @@
builder.Services.AddCoinEx();
+
+
+
builder.Services.AddCryptoCom();
+
+
+ Interface | Description |
+
+ ICryptoComRestClient |
+ The client for accessing the Crypto.com REST API |
+
+
+ ICryptoComSocketClient |
+ The client for accessing the Crypto.com Websocket API |
+
+
+ ICryptoComOrderBookFactory |
+ A factory for creating SymbolOrderBook instances for the Crypto.com API |
+
+
+ ICryptoRestClient |
+ An aggregating client from which multiple different library REST clients can be accessed |
+
+
+ ICryptoSocketClient |
+ An aggregating client from which multiple different library Websocket clients can be accessed |
+
+
+ ISharedClient |
+ Various interfaces deriving from ISharedClient which can be used for common functionality |
+
+
+
Interface | Description |
@@ -1004,6 +1049,9 @@
Coinex
+
+ Crypto.com
+
GateIo
@@ -1140,6 +1188,18 @@ if (!tickersResult.Success)
// Handle error, tickersResult.Error contains more information
}
else
+{
+ // Handle data, tickersResult.Data will contain the actual data
+}
+
+
+
var client = new CryptoComRestClient();
+var tickersResult = await client.ExchangeApi.ExchangeData.GetTickersAsync();
+if (!tickersResult.Success)
+{
+ // Handle error, tickersResult.Error contains more information
+}
+else
{
// Handle data, tickersResult.Data will contain the actual data
}
@@ -1317,6 +1377,9 @@ else
Coinex
+
+ Crypto.com
+
GateIo
@@ -1434,6 +1497,17 @@ if (!subscribeResult.Success)
{
// Handle error, subscribeResult.Error contains more information on why the subscription failed
}
+// Subscribing was successfull, the data will now be streamed into the data handler
+
+
+
var client = new CryptoComSocketClient();
+var subscribeResult = await client.ExchangeApi.SubscribeToTickerUpdatesAsync("ETH_USD", update => {
+ // Handle the data update, update.Data will contain the actual data
+});
+if (!subscribeResult.Success)
+{
+ // Handle error, subscribeResult.Error contains more information on why the subscription failed
+}
// Subscribing was successfull, the data will now be streamed into the data handler
@@ -1681,6 +1755,9 @@ var binanceTriggered = CheckForTrigger(lastBinanceTicker);
GateIo
+
+ Crypto.com
+
HTX
@@ -1798,7 +1875,14 @@ var usdFuturesSharedRestClient = coinExRestClient.FuturesApi.SharedClient;
// Futures API common functionality socket client
var usdFuturesSharedSocketClient = coinExSocketClient.FuturesApi.SharedClient;
-
+
+
+
// Spot/Futures API common functionality rest client
+var sharedRestClients = cryptoComRestClient.ExchangeApi.SharedClient;
+
+// Spot/Futures API common functionality socket client
+var sharedSocketClient = cryptoComSocketClient.ExchangeApi.SharedClient;
+
// Spot API common functionality rest client
var spotSharedRestClients = gateioRestClient.SpotApi.SharedClient;
@@ -2127,6 +2211,9 @@ options.ApiCredentials = new ApiCredentials("YOUR PUBLIC KEY", "YOUR PRIVATE KEY
Coinex
+
+ Crypto.com
+
GateIo
@@ -2227,6 +2314,15 @@ options.ApiCredentials = new ApiCredentials("YOUR PUBLIC KEY", "YOUR PRIVATE KEY
builder.Services.AddCoinEx(
+ restOptions => {
+ restOptions.RequestTimeout = TimeSpan.FromSeconds(30);
+ },
+ socketOptions => {
+ socketOptions.RequestTimeout = TimeSpan.FromSeconds(10);
+ });
+
+
+
builder.Services.AddCryptoCom(
restOptions => {
restOptions.RequestTimeout = TimeSpan.FromSeconds(30);
},
@@ -2325,6 +2421,9 @@ options.ApiCredentials = new ApiCredentials("YOUR PUBLIC KEY", "YOUR PRIVATE KEY
Coinex
+
+ Crypto.com
+
GateIo
@@ -2401,6 +2500,12 @@ options.ApiCredentials = new ApiCredentials("YOUR PUBLIC KEY", "YOUR PRIVATE KEY
var client = new CoinExRestClient(opts =>
+{
+ opts.RequestTimeout = TimeSpan.FromSeconds(30);
+});
+
+
+
var client = new CryptoComRestClient(opts =>
{
opts.RequestTimeout = TimeSpan.FromSeconds(30);
});
@@ -2475,6 +2580,9 @@ options.ApiCredentials = new ApiCredentials("YOUR PUBLIC KEY", "YOUR PRIVATE KEY
Coinex
+
+ Crypto.com
+
GateIo
@@ -2557,6 +2665,13 @@ var client = new CoinGeckoRestClient();
options.RequestTimeout = TimeSpan.FromSeconds(30);
});
var client = new CoinExRestClient();
+
+
+
CryptoComRestClient.SetDefaultOptions(options =>
+{
+ options.RequestTimeout = TimeSpan.FromSeconds(30);
+});
+var client = new CryptoComRestClient();
GateIoRestClient.SetDefaultOptions(options =>
@@ -2810,6 +2925,9 @@ var client = new OKXRestClient();
Coinex
+
+ Crypto.com
+
GateIo
@@ -2957,6 +3075,19 @@ if (!startResult.Success)
}
// Book has successfully started and synchronized
+// Once no longer needed you can stop the live sync functionality by calling StopAsync()
+await book.StopAsync();
+
+
+
+
var book = new CryptoComSpotSymbolOrderBook("ETH_USDT");
+var startResult = await book.StartAsync();
+if (!startResult.Success)
+{
+ // Handle error, error info available in startResult.Error
+}
+// Book has successfully started and synchronized
+
// Once no longer needed you can stop the live sync functionality by calling StopAsync()
await book.StopAsync();
@@ -3204,6 +3335,9 @@ var binanceClient = new BinanceRestClient(new HttpClient(), logFactory, options
Coinbase
+
+ Crypto.com
+
GateIo
@@ -3304,6 +3438,20 @@ var binanceClient = new BinanceRestClient(new HttpClient(), logFactory, options
To be notified of when a rate limit is hit the static CoinbaseExchange.RateLimiter
exposes an event which triggers when a rate limit is reached
CoinbaseExchange.RateLimiter.RateLimitTriggered += (rateLimitEvent) => Console.WriteLine("Limit triggered: " + rateLimitEvent);
+
+
+
+
services.AddCryptoCom(x =>
+ x.RatelimiterEnabled = true;
+ x.RateLimitingBehaviour = RateLimitingBehaviour.Wait;
+}, x =>
+{
+ x.RatelimiterEnabled = true;
+ x.RateLimitingBehaviour = RateLimitingBehaviour.Wait;
+});
+
To be notified of when a rate limit is hit the static CryptoComExchange.RateLimiter
exposes an event which triggers when a rate limit is reached
+
CryptoComExchange.RateLimiter.RateLimitTriggered += (rateLimitEvent) => Console.WriteLine("Limit triggered: " + rateLimitEvent);
+
@@ -3472,6 +3620,9 @@ var responseSource = result.DataSource;
Coinex
+
+ Crypto.com
+
GateIo
@@ -3519,6 +3670,9 @@ await exchangeRestClient.Binance.SpotApi.ExchangeData.GetExchangeInfoAsync();
await coinExClient.SpotApiV2.ExchangeData.GetSymbolsAsync();
+
+
+
await cryptoComClient.ExchangeApi.ExchangeData.GetSymbolsAsync();
await gateIoClient.SpotApi.ExchangeData.GetSymbolsAsync();
@@ -3583,6 +3737,9 @@ await exchangeRestClient.Binance.SpotApi.ExchangeData.GetExchangeInfoAsync();
Coinex
+
+ Crypto.com
+
GateIo
@@ -3631,6 +3788,9 @@ await coinbaseClient.AdvancedTradeApi.ExchangeData.GetSymbolAsync("BTC-USDT");
await coinExClient.SpotApiV2.ExchangeData.GetTickersAsync(new[] { "BTCUSDT" });
+
+
+
await cryptoComClient.ExchangeApi.ExchangeData.GetTickersAsync("BTC_USDT");
await gateioClient.SpotApi.ExchangeData.GetTickersAsync("BTC_USDT");
@@ -3695,6 +3855,9 @@ await coinbaseClient.AdvancedTradeApi.ExchangeData.GetSymbolAsync("BTC-USDT");
Coinex
+
+ Crypto.com
+
GateIo
@@ -3742,6 +3905,9 @@ await exchangeRestClient.Binance.SpotApi.Account.GetBalancesAsync();
await coinExClient.SpotApiV2.Account.GetBalancesAsync();
+
+
+
await cryptoComClient.ExchangeApi.Account.GetBalancesAsync();
await gateioClient.SpotApi.Account.GetBalancesAsync();
@@ -3810,6 +3976,9 @@ var result = await htxClient.SpotApi.Account.GetBalancesAsync();
Coinex
+
+ Crypto.com
+
GateIo
@@ -3857,6 +4026,9 @@ await exchangeRestClient.Binance.SpotApi.Trading.PlaceOrderAsync("BTCUSDT", Orde
await coinExClient.SpotApiV2.Trading.PlaceOrderAsync("BTCUSDT", AccountType.Spot, OrderSide.Buy, OrderTypeV2.Limit, 0.1m, 50000);
+
+
+
await cryptoComClient.ExchangeApi.Trading.PlaceOrderAsync("BTC_USDT", OrderSide.Buy, OrderType.Limit, 0.1m, price: 50000, timeInForce: TimeInForce.GoodTillCancel);
await gateIoClient.SpotApi.Trading.PlaceOrderAsync("BTC_USDT", OrderSide.Buy, NewOrderType.Limit, 0.1m, 50000, timeInForce: TimeInForce.GoodTillCancel);
@@ -3925,6 +4097,9 @@ var result = await htxClient.SpotApi.Trading.PlaceOrderAsync(account.Id, "BTCUSD
Coinex
+
+ Crypto.com
+
GateIo
@@ -3989,6 +4164,11 @@ await exchangeSocketClient.Binance.SpotApi.ExchangeData.SubscribeToTickerUpdates
await coinExSocketClient.SpotApiV2.SubscribeToTickerUpdatesAsync(new[] { "ETHUSDT" }, data => {
// Handle update
+});
+
+
+
await cryptoComSocketClient.ExchangeApi.SubscribeToTickerUpdatesAsync("ETH_USDT", data => {
+ // Handle update
});
@@ -4044,7 +4224,7 @@ await exchangeSocketClient.Binance.SpotApi.ExchangeData.SubscribeToTickerUpdates
CryptoClients
- Binance
+ Binance
BingX
@@ -4067,6 +4247,9 @@ await exchangeSocketClient.Binance.SpotApi.ExchangeData.SubscribeToTickerUpdates
Coinex
+
+ Crypto.com
+
GateIo
@@ -4108,7 +4291,7 @@ _ = Task.Run(async () => {
}
});
-
+
// Retrieve the listen key
var listenKey = await binanceClient.SpotApi.Account.StartUserStreamAsync();
@@ -4174,6 +4357,11 @@ _ = Task.Run(async () => {
await coinExSocketClient.SpotApiV2.SubscribeToOrderUpdatesAsync(data => {
// Handle update
+});
+
+
+
await cryptoComSocketClient.ExchangeApi.SubscribeToOrderUpdatesAsync(data => {
+ // Handle update
});