1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-11 16:32:57 +00:00

Compare commits

..

9 Commits

Author SHA1 Message Date
Jkorf d8dc121386 Updated to version 9.12.0 2025-11-03 09:48:29 +01:00
Jkorf 10c3868c00 Revert "Updated to version 9.11.0"
This reverts commit 411ba00a82.
2025-11-03 09:46:55 +01:00
Jkorf 411ba00a82 Updated to version 9.11.0 2025-11-03 09:45:41 +01:00
JKorf c1b2b62dbc Added AliasType to specify only one way conversion for AssetAliases 2025-11-02 15:17:44 +01:00
JKorf 3960cab7a7 Merge branch 'master' of https://github.com/JKorf/CryptoExchange.Net 2025-11-02 11:41:30 +01:00
JKorf 34e9447e55 Added constant for selecting a USD asset for use in a Shared API/SharedSymbol 2025-11-02 11:41:26 +01:00
Jkorf 9d3295acc7 Removed some unhelpful verbose logs 2025-10-31 15:08:14 +01:00
Jkorf 995cd3d84c Updated to version 9.11.1 2025-10-30 14:33:26 +01:00
Jkorf 919cdf0075 Updated CryptoExchange.Net version 2025-10-30 14:32:41 +01:00
10 changed files with 54 additions and 27 deletions
@@ -6,9 +6,9 @@
<PackageId>CryptoExchange.Net.Protobuf</PackageId>
<Authors>JKorf</Authors>
<Description>Protobuf support for CryptoExchange.Net</Description>
<PackageVersion>9.11.0</PackageVersion>
<AssemblyVersion>9.11.0</AssemblyVersion>
<FileVersion>9.11.0</FileVersion>
<PackageVersion>9.11.1</PackageVersion>
<AssemblyVersion>9.11.1</AssemblyVersion>
<FileVersion>9.11.1</FileVersion>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageTags>CryptoExchange;CryptoExchange.Net</PackageTags>
<RepositoryType>git</RepositoryType>
@@ -41,7 +41,7 @@
<DocumentationFile>CryptoExchange.Net.Protobuf.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CryptoExchange.Net" Version="9.10.0" />
<PackageReference Include="CryptoExchange.Net" Version="9.11.0" />
<PackageReference Include="protobuf-net" Version="3.2.56" />
</ItemGroup>
</Project>
+3
View File
@@ -5,6 +5,9 @@
Protobuf support for CryptoExchange.Net.
## Release notes
* Version 9.11.1 - 30 Oct 2025
* Updated CryptoExchange.Net version to 9.11.0, see https://github.com/JKorf/CryptoExchange.Net/releases/
* Version 9.11.0 - 30 Oct 2025
* Updated CryptoExchange.Net version to 9.11.0, see https://github.com/JKorf/CryptoExchange.Net/releases/
-2
View File
@@ -102,7 +102,6 @@ namespace CryptoExchange.Net.Clients
if (ClientOptions == null)
throw new InvalidOperationException("Client should have called Initialize before adding API clients");
_logger.Log(LogLevel.Trace, $" {apiClient.GetType().Name}, base address: {apiClient.BaseAddress}");
ApiClients.Add(apiClient);
return apiClient;
}
@@ -122,7 +121,6 @@ namespace CryptoExchange.Net.Clients
/// </summary>
public virtual void Dispose()
{
_logger.Log(LogLevel.Debug, "Disposing client");
foreach (var client in ApiClients)
client.Dispose();
}
+3 -3
View File
@@ -6,9 +6,9 @@
<PackageId>CryptoExchange.Net</PackageId>
<Authors>JKorf</Authors>
<Description>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.</Description>
<PackageVersion>9.11.0</PackageVersion>
<AssemblyVersion>9.11.0</AssemblyVersion>
<FileVersion>9.11.0</FileVersion>
<PackageVersion>9.12.0</PackageVersion>
<AssemblyVersion>9.12.0</AssemblyVersion>
<FileVersion>9.12.0</FileVersion>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageTags>OKX;OKX.Net;Mexc;Mexc.Net;Kucoin;Kucoin.Net;Kraken;Kraken.Net;Huobi;Huobi.Net;CoinEx;CoinEx.Net;Bybit;Bybit.Net;Bitget;Bitget.Net;Bitfinex;Bitfinex.Net;Binance;Binance.Net;CryptoCurrency;CryptoCurrency Exchange;CryptoExchange.Net</PackageTags>
<RepositoryType>git</RepositoryType>
@@ -13,7 +13,6 @@ namespace CryptoExchange.Net.Logging.Extensions
private static readonly Action<ILogger, int, Exception?> _unknownExceptionWhileProcessingReconnection;
private static readonly Action<ILogger, int, WebSocketError, string?, Exception?> _webSocketErrorCodeAndDetails;
private static readonly Action<ILogger, int, string?, Exception?> _webSocketError;
private static readonly Action<ILogger, int, int, Exception?> _messageSentNotPending;
private static readonly Action<ILogger, int, string, Exception?> _receivedData;
private static readonly Action<ILogger, int, string, Exception?> _failedToParse;
private static readonly Action<ILogger, int, string, Exception?> _failedToEvaluateMessage;
@@ -72,11 +71,6 @@ namespace CryptoExchange.Net.Logging.Extensions
new EventId(2005, "WebSocketError"),
"[Sckt {SocketId}] error: {ErrorMessage}");
_messageSentNotPending = LoggerMessage.Define<int, int>(
LogLevel.Debug,
new EventId(2006, "MessageSentNotPending"),
"[Sckt {SocketId}] [Req {RequestId}] message sent, but not pending");
_receivedData = LoggerMessage.Define<int, string>(
LogLevel.Trace,
new EventId(2007, "ReceivedData"),
@@ -234,11 +228,6 @@ namespace CryptoExchange.Net.Logging.Extensions
_webSocketError(logger, socketId, errorMessage, e);
}
public static void MessageSentNotPending(this ILogger logger, int socketId, int requestId)
{
_messageSentNotPending(logger, socketId, requestId, null);
}
public static void ReceivedData(this ILogger logger, int socketId, string originalData)
{
_receivedData(logger, socketId, originalData, null);
+21 -1
View File
@@ -9,6 +9,10 @@ namespace CryptoExchange.Net.Objects
/// </summary>
public class AssetAlias
{
/// <summary>
/// Alias type
/// </summary>
public AliasType Type { get; set; }
/// <summary>
/// The name of the asset on the exchange
/// </summary>
@@ -21,10 +25,26 @@ namespace CryptoExchange.Net.Objects
/// <summary>
/// ctor
/// </summary>
public AssetAlias(string exchangeName, string commonName)
public AssetAlias(string exchangeName, string commonName, AliasType type = AliasType.BothWays)
{
ExchangeAssetName = exchangeName;
CommonAssetName = commonName;
Type = type;
}
}
/// <summary>
/// Alias type
/// </summary>
public enum AliasType
{
/// <summary>
/// Translate both from and to exchange
/// </summary>
BothWays,
/// <summary>
/// Only translate when converting to exchange
/// </summary>
OnlyToExchange
}
}
@@ -23,12 +23,22 @@ namespace CryptoExchange.Net.Objects
/// <summary>
/// Map the common name to an exchange name for an asset. If there is no alias the input name is returned
/// </summary>
public string CommonToExchangeName(string commonName) => !AutoConvertEnabled ? commonName : Aliases.SingleOrDefault(x => x.CommonAssetName == commonName)?.ExchangeAssetName ?? commonName;
public string CommonToExchangeName(string commonName) => !AutoConvertEnabled ? commonName : Aliases.FirstOrDefault(x => x.CommonAssetName == commonName)?.ExchangeAssetName ?? commonName;
/// <summary>
/// Map the exchange name to a common name for an asset. If there is no alias the input name is returned
/// </summary>
public string ExchangeToCommonName(string exchangeName) => !AutoConvertEnabled ? exchangeName : Aliases.SingleOrDefault(x => x.ExchangeAssetName == exchangeName)?.CommonAssetName ?? exchangeName;
public string ExchangeToCommonName(string exchangeName)
{
if (!AutoConvertEnabled)
return exchangeName;
var alias = Aliases.FirstOrDefault(x => x.ExchangeAssetName == exchangeName);
if (alias == null || alias.Type == AliasType.OnlyToExchange)
return exchangeName;
return alias.CommonAssetName;
}
}
}
@@ -33,6 +33,11 @@ namespace CryptoExchange.Net.SharedApis
/// </summary>
public DateTime? DeliverTime { get; set; }
/// <summary>
/// Use this constant to dynamically select a USD or USD equivalent asset (stable coin) supported on the exchange
/// </summary>
public const string UsdOrStable = "CE-UsdStable";
/// <summary>
/// Create a new SharedSymbol
/// </summary>
@@ -449,10 +449,7 @@ namespace CryptoExchange.Net.Sockets
}
if (query == null)
{
_logger.MessageSentNotPending(SocketId, requestId);
return Task.CompletedTask;
}
return Task.CompletedTask;
query.IsSend(query.RequestTimeout ?? ApiClient.ClientOptions.RequestTimeout);
return Task.CompletedTask;
+5
View File
@@ -66,6 +66,11 @@ Make a one time donation in a crypto currency of your choice. If you prefer to d
Alternatively, sponsor me on Github using [Github Sponsors](https://github.com/sponsors/JKorf).
## Release notes
* Version 9.12.0 - 03 Nov 2025
* Added constant for selecting a supported USD asset for use in a Shared API/SharedSymbol
* Added AliasType to specify only one way conversion for AssetAliases
* Removed some unhelpful verbose logs
* Version 9.11.0 - 30 Oct 2025
* Added StaticLogger to LibraryHelpers, updated warning logging for converters to use StaticLogger
* Added client reference helper to LibraryHelpers