1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-13 01:12:59 +00:00

Compare commits

...

5 Commits

6 changed files with 16 additions and 9 deletions
@@ -87,11 +87,11 @@ namespace CryptoExchange.Net.Converters.SystemTextJson
if (prop.JsonConverterType == null && IsSimple(prop.PropertyInfo.PropertyType)) if (prop.JsonConverterType == null && IsSimple(prop.PropertyInfo.PropertyType))
{ {
if (prop.PropertyInfo.PropertyType == typeof(string)) if (prop.TargetType == typeof(string))
writer.WriteStringValue(Convert.ToString(objValue, CultureInfo.InvariantCulture)); writer.WriteStringValue(Convert.ToString(objValue, CultureInfo.InvariantCulture));
else if(prop.PropertyInfo.PropertyType.IsEnum) else if(prop.TargetType.IsEnum)
writer.WriteStringValue(EnumConverter.GetString(objValue)); writer.WriteStringValue(EnumConverter.GetString(objValue));
else if (prop.PropertyInfo.PropertyType == typeof(bool)) else if (prop.TargetType == typeof(bool))
writer.WriteBooleanValue((bool)objValue); writer.WriteBooleanValue((bool)objValue);
else else
writer.WriteRawValue(Convert.ToString(objValue, CultureInfo.InvariantCulture)!); writer.WriteRawValue(Convert.ToString(objValue, CultureInfo.InvariantCulture)!);
@@ -47,7 +47,7 @@ namespace CryptoExchange.Net.Converters.SystemTextJson
if (reader.TokenType is JsonTokenType.Number) if (reader.TokenType is JsonTokenType.Number)
{ {
var longValue = reader.GetDouble(); var longValue = reader.GetDouble();
if (longValue == 0 || longValue == -1) if (longValue == 0 || longValue < 0)
return default; return default;
return ParseFromDouble(longValue); return ParseFromDouble(longValue);
+3 -3
View File
@@ -6,9 +6,9 @@
<PackageId>CryptoExchange.Net</PackageId> <PackageId>CryptoExchange.Net</PackageId>
<Authors>JKorf</Authors> <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> <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>8.7.2</PackageVersion> <PackageVersion>8.7.3</PackageVersion>
<AssemblyVersion>8.7.2</AssemblyVersion> <AssemblyVersion>8.7.3</AssemblyVersion>
<FileVersion>8.7.2</FileVersion> <FileVersion>8.7.3</FileVersion>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance> <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</PackageTags> <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</PackageTags>
<RepositoryType>git</RepositoryType> <RepositoryType>git</RepositoryType>
@@ -1,12 +1,13 @@
using CryptoExchange.Net.Objects; using CryptoExchange.Net.Objects;
using System; using System;
using System.Collections.Generic;
namespace CryptoExchange.Net.SharedApis namespace CryptoExchange.Net.SharedApis
{ {
/// <summary> /// <summary>
/// A symbol representation based on a base and quote asset /// A symbol representation based on a base and quote asset
/// </summary> /// </summary>
public class SharedSymbol public record SharedSymbol
{ {
/// <summary> /// <summary>
/// The base asset of the symbol /// The base asset of the symbol
@@ -604,7 +604,7 @@ namespace CryptoExchange.Net.Sockets
} }
catch (Exception wse) catch (Exception wse)
{ {
if (!_ctsSource.Token.IsCancellationRequested) if (!_ctsSource.Token.IsCancellationRequested && !_stopRequested)
// Connection closed unexpectedly // Connection closed unexpectedly
await (OnError?.Invoke(wse) ?? Task.CompletedTask).ConfigureAwait(false); await (OnError?.Invoke(wse) ?? Task.CompletedTask).ConfigureAwait(false);
+6
View File
@@ -68,6 +68,12 @@ 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). Alternatively, sponsor me on Github using [Github Sponsors](https://github.com/sponsors/JKorf).
## Release notes ## Release notes
* Version 8.7.3 - 05 Feb 2025
* Added handling of negative number DateTime deserialization to default
* Updated SharedSymbol from class to record
* Fixed issue with serialization of nullable types in System.Text.Json ArrayConverter
* Fix for unnecessary error message in logging when closing websocket connection
* Version 8.7.2 - 27 Jan 2025 * Version 8.7.2 - 27 Jan 2025
* Some small fixes in the System.Text.Json ArrayConverter * Some small fixes in the System.Text.Json ArrayConverter
* Added support for Flags enum deserialization in System.Text.Json EnumConverter * Added support for Flags enum deserialization in System.Text.Json EnumConverter