Skip to content

Commit bf368eb

Browse files
committed
Updated CryptoExchange.Net to version 9.12.0|Added support for using SharedSymbol.UsdOrStable in Shared APIs
1 parent 915ca03 commit bf368eb

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

HTX.Net/HTX.Net.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<PrivateAssets>all</PrivateAssets>
5353
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
5454
</PackageReference>
55-
<PackageReference Include="CryptoExchange.Net" Version="9.11.0" />
55+
<PackageReference Include="CryptoExchange.Net" Version="9.12.0" />
5656
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0">
5757
<PrivateAssets>all</PrivateAssets>
5858
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

HTX.Net/HTX.Net.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7934,6 +7934,11 @@
79347934
Type of exchange
79357935
</summary>
79367936
</member>
7937+
<member name="P:HTX.Net.HTXExchange.AssetAliases">
7938+
<summary>
7939+
Aliases for HTX assets
7940+
</summary>
7941+
</member>
79377942
<member name="M:HTX.Net.HTXExchange.FormatSymbol(System.String,System.String,CryptoExchange.Net.SharedApis.TradingMode,System.Nullable{System.DateTime})">
79387943
<summary>
79397944
Format a base and quote asset to an HTX recognized symbol

HTX.Net/HTXExchange.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ public static class HTXExchange
4747

4848
internal static JsonSerializerContext _serializerContext = JsonSerializerContextCache.GetOrCreate<HTXSourceGenerationContext>();
4949

50+
/// <summary>
51+
/// Aliases for HTX assets
52+
/// </summary>
53+
public static AssetAliasConfiguration AssetAliases { get; } = new AssetAliasConfiguration
54+
{
55+
Aliases = [
56+
new AssetAlias("USDT", SharedSymbol.UsdOrStable.ToUpperInvariant(), AliasType.OnlyToExchange)
57+
]
58+
};
59+
5060
/// <summary>
5161
/// Format a base and quote asset to an HTX recognized symbol
5262
/// </summary>
@@ -57,10 +67,13 @@ public static class HTXExchange
5767
/// <returns></returns>
5868
public static string FormatSymbol(string baseAsset, string quoteAsset, TradingMode tradingMode, DateTime? deliverTime = null)
5969
{
70+
baseAsset = AssetAliases.CommonToExchangeName(baseAsset.ToUpperInvariant());
71+
quoteAsset = AssetAliases.CommonToExchangeName(quoteAsset.ToUpperInvariant());
72+
6073
if (tradingMode == TradingMode.Spot)
6174
return $"{baseAsset.ToLowerInvariant()}{quoteAsset.ToLowerInvariant()}";
6275

63-
return $"{baseAsset.ToUpperInvariant()}-{quoteAsset.ToUpperInvariant()}" + (!deliverTime.HasValue ? string.Empty : ("-" + deliverTime.Value.ToString("yyMMdd")));
76+
return $"{baseAsset}-{quoteAsset}" + (!deliverTime.HasValue ? string.Empty : ("-" + deliverTime.Value.ToString("yyMMdd")));
6477
}
6578

6679
/// <summary>

0 commit comments

Comments
 (0)