Skip to content

Commit

Permalink
Updated package versions, added CryptoCom
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Oct 22, 2024
1 parent 6e024b7 commit b9c0746
Show file tree
Hide file tree
Showing 12 changed files with 145 additions and 18 deletions.
25 changes: 13 additions & 12 deletions CryptoClients.Net/CryptoClients.Net.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<Nullable>enable</Nullable>
Expand Down Expand Up @@ -49,21 +49,22 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Binance.Net" Version="10.6.1" />
<PackageReference Include="Binance.Net" Version="10.7.0" />
<PackageReference Include="Bitfinex.Net" Version="7.8.2" />
<PackageReference Include="BitMart.Net" Version="1.3.2" />
<PackageReference Include="BitMart.Net" Version="1.4.0" />
<PackageReference Include="Bybit.Net" Version="3.14.3" />
<PackageReference Include="CoinEx.Net" Version="7.7.2" />
<PackageReference Include="CoinGecko.Net" Version="2.6.1" />
<PackageReference Include="GateIo.Net" Version="1.8.1" />
<PackageReference Include="JK.BingX.Net" Version="1.11.1" />
<PackageReference Include="JK.Bitget.Net" Version="1.10.3" />
<PackageReference Include="JK.Mexc.Net" Version="1.8.2" />
<PackageReference Include="JK.OKX.Net" Version="2.5.1" />
<PackageReference Include="JKorf.Coinbase.Net" Version="1.0.1" />
<PackageReference Include="JKorf.HTX.Net" Version="6.1.3" />
<PackageReference Include="KrakenExchange.Net" Version="5.0.0" />
<PackageReference Include="Kucoin.Net" Version="5.15.1" />
<PackageReference Include="CryptoCom.Net" Version="1.0.1" />
<PackageReference Include="GateIo.Net" Version="1.9.0" />
<PackageReference Include="JK.BingX.Net" Version="1.11.2" />
<PackageReference Include="JK.Bitget.Net" Version="1.10.4" />
<PackageReference Include="JK.Mexc.Net" Version="1.9.0" />
<PackageReference Include="JK.OKX.Net" Version="2.6.0" />
<PackageReference Include="JKorf.Coinbase.Net" Version="1.1.2" />
<PackageReference Include="JKorf.HTX.Net" Version="6.2.0" />
<PackageReference Include="KrakenExchange.Net" Version="5.0.2" />
<PackageReference Include="Kucoin.Net" Version="5.16.0" />
</ItemGroup>
<PropertyGroup>
<DocumentationFile>CryptoClients.Net.xml</DocumentationFile>
Expand Down
53 changes: 47 additions & 6 deletions CryptoClients.Net/CryptoClients.Net.xml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions CryptoClients.Net/Enums/Exchange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Bybit.Net;
using Coinbase.Net;
using CoinEx.Net;
using CryptoCom.Net;
using GateIo.Net;
using HTX.Net;
using Kraken.Net;
Expand Down Expand Up @@ -55,6 +56,10 @@ public static class Exchange
/// </summary>
public static string CoinEx => CoinExExchange.ExchangeName;
/// <summary>
/// Crypto.com
/// </summary>
public static string CryptoCom => CryptoComExchange.ExchangeName;
/// <summary>
/// Gate.io
/// </summary>
public static string GateIo => "GateIo";
Expand Down Expand Up @@ -92,6 +97,7 @@ public static class Exchange
Bybit,
Coinbase,
CoinEx,
CryptoCom,
GateIo,
HTX,
Kraken,
Expand Down
9 changes: 9 additions & 0 deletions CryptoClients.Net/ExchangeOrderBookFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
using CoinEx.Net.Interfaces;
using CryptoClients.Net.Enums;
using CryptoClients.Net.Interfaces;
using CryptoCom.Net.Clients;
using CryptoCom.Net.Interfaces;
using CryptoExchange.Net;
using CryptoExchange.Net.Interfaces;
using CryptoExchange.Net.SharedApis;
Expand Down Expand Up @@ -54,6 +56,8 @@ public class ExchangeOrderBookFactory : IExchangeOrderBookFactory
/// <inheritdoc />
public ICoinExOrderBookFactory CoinEx { get; }
/// <inheritdoc />
public ICryptoComOrderBookFactory CryptoCom { get; }
/// <inheritdoc />
public IGateIoOrderBookFactory GateIo { get; }
/// <inheritdoc />
public IHTXOrderBookFactory HTX { get; }
Expand All @@ -78,6 +82,7 @@ public ExchangeOrderBookFactory(
IBybitOrderBookFactory bybit,
ICoinbaseOrderBookFactory coinbase,
ICoinExOrderBookFactory coinEx,
ICryptoComOrderBookFactory cryptoCom,
IGateIoOrderBookFactory gateIo,
IHTXOrderBookFactory htx,
IKrakenOrderBookFactory kraken,
Expand All @@ -93,6 +98,7 @@ public ExchangeOrderBookFactory(
Bybit = bybit;
Coinbase = coinbase;
CoinEx = coinEx;
CryptoCom = cryptoCom;
GateIo = gateIo;
HTX = htx;
Kraken = kraken;
Expand Down Expand Up @@ -140,6 +146,9 @@ public ExchangeOrderBookFactory(
var coinexClient = new CoinExRestClient();
return symbol.TradingMode == TradingMode.Spot ? CoinEx.Spot.Create(symbol.GetSymbol(coinexClient.SpotApiV2.FormatSymbol))
: CoinEx.Futures.Create(symbol.GetSymbol(coinexClient.FuturesApi.FormatSymbol));
case "CryptoCom":
var cryptoComClient = new CryptoComSocketClient();
return CryptoCom.Exchange.Create(symbol.GetSymbol(cryptoComClient.ExchangeApi.FormatSymbol));
case "GateIo":
var gateClient = new GateIoRestClient();
return symbol.TradingMode == TradingMode.Spot ? GateIo.Spot.Create(symbol.GetSymbol(gateClient.SpotApi.FormatSymbol))
Expand Down
12 changes: 12 additions & 0 deletions CryptoClients.Net/ExchangeRestClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
using CoinEx.Net.Objects.Options;
using CryptoClients.Net.Interfaces;
using CryptoClients.Net.Models;
using CryptoCom.Net.Clients;
using CryptoCom.Net.Interfaces.Clients;
using CryptoCom.Net.Objects.Options;
using CryptoExchange.Net.Authentication;
using CryptoExchange.Net.Interfaces.CommonClients;
using CryptoExchange.Net.Objects;
Expand Down Expand Up @@ -78,6 +81,8 @@ public class ExchangeRestClient : IExchangeRestClient
/// <inheritdoc />
public ICoinExRestClient CoinEx { get; }
/// <inheritdoc />
public ICryptoComRestClient CryptoCom { get; }
/// <inheritdoc />
public IGateIoRestClient GateIo { get; }
/// <inheritdoc />
public IHTXRestClient HTX { get; }
Expand Down Expand Up @@ -251,6 +256,7 @@ public ExchangeRestClient()
Bybit = new BybitRestClient();
Coinbase = new CoinbaseRestClient();
CoinEx = new CoinExRestClient();
CryptoCom = new CryptoComRestClient();
GateIo = new GateIoRestClient();
HTX = new HTXRestClient();
Kraken = new KrakenRestClient();
Expand All @@ -275,6 +281,7 @@ public ExchangeRestClient(
Action<BybitRestOptions>? bybitRestOptions = null,
Action<CoinbaseRestOptions>? coinbaseRestOptions = null,
Action<CoinExRestOptions>? coinExRestOptions = null,
Action<CryptoComRestOptions>? cryptoComRestOptions = null,
Action<GateIoRestOptions>? gateIoRestOptions = null,
Action<HTXRestOptions>? htxRestOptions = null,
Action<KrakenRestOptions>? krakenRestOptions = null,
Expand Down Expand Up @@ -313,6 +320,7 @@ Action<TOptions> SetGlobalRestOptions<TOptions, TCredentials>(GlobalExchangeOpti
bybitRestOptions = SetGlobalRestOptions(global, bybitRestOptions, credentials?.Bybit);
coinbaseRestOptions = SetGlobalRestOptions(global, coinbaseRestOptions, credentials?.Coinbase);
coinExRestOptions = SetGlobalRestOptions(global, coinExRestOptions, credentials?.CoinEx);
cryptoComRestOptions = SetGlobalRestOptions(global, cryptoComRestOptions, credentials?.CryptoCom);
gateIoRestOptions = SetGlobalRestOptions(global, gateIoRestOptions, credentials?.GateIo);
htxRestOptions = SetGlobalRestOptions(global, htxRestOptions, credentials?.HTX);
krakenRestOptions = SetGlobalRestOptions(global, krakenRestOptions, credentials?.Kraken);
Expand All @@ -329,6 +337,7 @@ Action<TOptions> SetGlobalRestOptions<TOptions, TCredentials>(GlobalExchangeOpti
Bybit = new BybitRestClient(bybitRestOptions);
Coinbase = new CoinbaseRestClient(coinbaseRestOptions);
CoinEx = new CoinExRestClient(coinExRestOptions);
CryptoCom = new CryptoComRestClient(cryptoComRestOptions);
GateIo = new GateIoRestClient(gateIoRestOptions);
HTX = new HTXRestClient(htxRestOptions);
Kraken = new KrakenRestClient(krakenRestOptions);
Expand Down Expand Up @@ -378,6 +387,7 @@ private void InitSharedClients()
Coinbase.AdvancedTradeApi.SharedClient,
CoinEx.SpotApiV2.SharedClient,
CoinEx.FuturesApi.SharedClient,
CryptoCom.ExchangeApi.SharedClient,
GateIo.SpotApi.SharedClient,
GateIo.PerpetualFuturesApi.SharedClient,
HTX.SpotApi.SharedClient,
Expand All @@ -403,6 +413,7 @@ public ExchangeRestClient(
IBybitRestClient bybit,
ICoinbaseRestClient coinbase,
ICoinExRestClient coinEx,
ICryptoComRestClient cryptoCom,
IGateIoRestClient gateIo,
IHTXRestClient htx,
IKrakenRestClient kraken,
Expand All @@ -421,6 +432,7 @@ public ExchangeRestClient(
Bybit = bybit;
Coinbase = coinbase;
CoinEx = coinEx;
CryptoCom = cryptoCom;
GateIo = gateIo;
HTX = htx;
Kraken = kraken;
Expand Down
13 changes: 13 additions & 0 deletions CryptoClients.Net/ExchangeSocketClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
using CoinEx.Net.Objects.Options;
using CryptoClients.Net.Interfaces;
using CryptoClients.Net.Models;
using CryptoCom.Net.Clients;
using CryptoCom.Net.Interfaces.Clients;
using CryptoCom.Net.Objects.Options;
using CryptoExchange.Net.Authentication;
using CryptoExchange.Net.Objects;
using CryptoExchange.Net.Objects.Options;
Expand Down Expand Up @@ -77,6 +80,8 @@ public class ExchangeSocketClient : IExchangeSocketClient
/// <inheritdoc />
public ICoinExSocketClient CoinEx { get; }
/// <inheritdoc />
public ICryptoComSocketClient CryptoCom { get; }
/// <inheritdoc />
public IGateIoSocketClient GateIo { get; }
/// <inheritdoc />
public IHTXSocketClient HTX { get; }
Expand Down Expand Up @@ -177,6 +182,7 @@ public ExchangeSocketClient()
Bybit = new BybitSocketClient();
Coinbase = new CoinbaseSocketClient();
CoinEx = new CoinExSocketClient();
CryptoCom = new CryptoComSocketClient();
GateIo = new GateIoSocketClient();
HTX = new HTXSocketClient();
Kraken = new KrakenSocketClient();
Expand All @@ -200,6 +206,7 @@ public ExchangeSocketClient(
Action<BybitSocketOptions>? bybitSocketOptions = null,
Action<CoinExSocketOptions>? coinExSocketOptions = null,
Action<CoinbaseSocketOptions>? coinbaseSocketOptions = null,
Action<CryptoComSocketOptions>? cryptoComSocketOptions = null,
Action<GateIoSocketOptions>? gateIoSocketOptions = null,
Action<HTXSocketOptions>? htxSocketOptions = null,
Action<KrakenSocketOptions>? krakenSocketOptions = null,
Expand Down Expand Up @@ -239,6 +246,7 @@ Action<TOptions> SetGlobalSocketOptions<TOptions, TCredentials>(GlobalExchangeOp
bybitSocketOptions = SetGlobalSocketOptions(global, bybitSocketOptions, credentials?.Bybit);
coinbaseSocketOptions = SetGlobalSocketOptions(global, coinbaseSocketOptions, credentials?.Coinbase);
coinExSocketOptions = SetGlobalSocketOptions(global, coinExSocketOptions, credentials?.CoinEx);
cryptoComSocketOptions = SetGlobalSocketOptions(global, cryptoComSocketOptions, credentials?.CryptoCom);
gateIoSocketOptions = SetGlobalSocketOptions(global, gateIoSocketOptions, credentials?.GateIo);
htxSocketOptions = SetGlobalSocketOptions(global, htxSocketOptions, credentials?.HTX);
krakenSocketOptions = SetGlobalSocketOptions(global, krakenSocketOptions, credentials?.Kraken);
Expand All @@ -256,6 +264,7 @@ Action<TOptions> SetGlobalSocketOptions<TOptions, TCredentials>(GlobalExchangeOp
Coinbase = new CoinbaseSocketClient(coinbaseSocketOptions ?? new Action<CoinbaseSocketOptions>((x) => { }));
CoinEx = new CoinExSocketClient(coinExSocketOptions ?? new Action<CoinExSocketOptions>((x) => { }));
HTX = new HTXSocketClient(htxSocketOptions ?? new Action<HTXSocketOptions>((x) => { }));
CryptoCom = new CryptoComSocketClient(cryptoComSocketOptions ?? new Action<CryptoComSocketOptions>((x) => { }));
GateIo = new GateIoSocketClient(gateIoSocketOptions ?? new Action<GateIoSocketOptions>((x) => { }));
Kraken = new KrakenSocketClient(krakenSocketOptions ?? new Action<KrakenSocketOptions>((x) => { }));
Kucoin = new KucoinSocketClient(kucoinSocketOptions ?? new Action<KucoinSocketOptions>((x) => { }));
Expand All @@ -277,6 +286,7 @@ public ExchangeSocketClient(
IBybitSocketClient bybit,
ICoinbaseSocketClient coinbase,
ICoinExSocketClient coinEx,
ICryptoComSocketClient cryptoCom,
IGateIoSocketClient gateIo,
IHTXSocketClient htx,
IKrakenSocketClient kraken,
Expand All @@ -292,6 +302,7 @@ public ExchangeSocketClient(
Bybit = bybit;
Coinbase = coinbase;
CoinEx = coinEx;
CryptoCom = cryptoCom;
GateIo = gateIo;
HTX = htx;
Kraken = kraken;
Expand Down Expand Up @@ -323,6 +334,7 @@ private void InitSharedClients()
Coinbase.AdvancedTradeApi.SharedClient,
CoinEx.SpotApiV2.SharedClient,
CoinEx.FuturesApi.SharedClient,
CryptoCom.ExchangeApi.SharedClient,
GateIo.SpotApi.SharedClient,
GateIo.PerpetualFuturesApi.SharedClient,
HTX.SpotApi.SharedClient,
Expand Down Expand Up @@ -543,6 +555,7 @@ public async Task UnsubscribeAllAsync()
Bybit.UnsubscribeAllAsync(),
Coinbase.UnsubscribeAllAsync(),
CoinEx.UnsubscribeAllAsync(),
CryptoCom.UnsubscribeAllAsync(),
GateIo.UnsubscribeAllAsync(),
HTX.UnsubscribeAllAsync(),
Kraken.UnsubscribeAllAsync(),
Expand Down
14 changes: 14 additions & 0 deletions CryptoClients.Net/Exchanges.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Bybit.Net;
using Coinbase.Net;
using CoinEx.Net;
using CryptoCom.Net;
using CryptoExchange.Net.RateLimiting;
using GateIo.Net;
using HTX.Net;
Expand Down Expand Up @@ -102,6 +103,16 @@ public static class Exchanges
ApiDocsUrl = CoinExExchange.ApiDocsUrl
};

/// <summary>
/// Crypto.com exchange info
/// </summary>
public static ExchangeInfo CryptoCom { get; } = new ExchangeInfo
{
Name = CryptoComExchange.ExchangeName,
Url = CryptoComExchange.Url,
ApiDocsUrl = CryptoComExchange.ApiDocsUrl
};

/// <summary>
/// GateIo exchange info
/// </summary>
Expand Down Expand Up @@ -175,6 +186,7 @@ public static class Exchanges
Bybit,
Coinbase,
CoinEx,
CryptoCom,
GateIo,
HTX,
Kucoin,
Expand All @@ -195,6 +207,7 @@ public static event Action<RateLimitEvent> RateLimitTriggered
BitgetExchange.RateLimiter.RateLimitTriggered += value;
BitMartExchange.RateLimiter.RateLimitTriggered += value;
CoinbaseExchange.RateLimiter.RateLimitTriggered += value;
CryptoComExchange.RateLimiter.RateLimitTriggered += value;
GateIoExchange.RateLimiter.RateLimitTriggered += value;
HTXExchange.RateLimiter.RateLimitTriggered += value;
KrakenExchange.RateLimiter.RateLimitTriggered += value;
Expand All @@ -209,6 +222,7 @@ public static event Action<RateLimitEvent> RateLimitTriggered
BitgetExchange.RateLimiter.RateLimitTriggered -= value;
BitMartExchange.RateLimiter.RateLimitTriggered -= value;
CoinbaseExchange.RateLimiter.RateLimitTriggered -= value;
CryptoComExchange.RateLimiter.RateLimitTriggered -= value;
GateIoExchange.RateLimiter.RateLimitTriggered -= value;
HTXExchange.RateLimiter.RateLimitTriggered -= value;
KrakenExchange.RateLimiter.RateLimitTriggered -= value;
Expand Down
Loading

0 comments on commit b9c0746

Please sign in to comment.