mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-08-11 16:32:57 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d8dc121386 | |||
| 10c3868c00 | |||
| 411ba00a82 | |||
| c1b2b62dbc | |||
| 3960cab7a7 | |||
| 34e9447e55 | |||
| 9d3295acc7 | |||
| 995cd3d84c | |||
| 919cdf0075 |
@@ -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>
|
||||
@@ -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/
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user