Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
336e3e5
chore: Bump trakx/bump-version-action from 8 to 9.0.0 (#22)
dependabot[bot] Apr 14, 2022
84f8233
chore: Bump anothrNick/github-tag-action from 1.38.0 to 1.39.0 (#23)
dependabot[bot] Apr 18, 2022
7b6b97b
chore: Bump Trakx.Utils.Testing from 0.3.1 to 0.3.11 (#25)
dependabot[bot] Apr 18, 2022
f35efe8
chore: Bump Trakx.Utils from 0.3.1 to 0.3.11 (#26)
dependabot[bot] Apr 18, 2022
bedf939
chore: Bump FluentAssertions from 6.5.1 to 6.6.0 (#24)
dependabot[bot] Apr 18, 2022
0722413
chore: Bump trakx/bump-version-action from 9.0.0 to 9.0.1 (#27)
dependabot[bot] Apr 19, 2022
ececddb
chore: Bump GitHubActionsTestLogger from 1.3.0 to 1.4.1 (#29)
dependabot[bot] Apr 19, 2022
3d252d0
chore: Bump Trakx.Utils from 0.3.11 to 0.3.13 (#36)
dependabot[bot] May 1, 2022
12cac6f
chore: Bump Serilog from 2.10.0 to 2.11.0 (#32)
dependabot[bot] May 1, 2022
2d9a062
chore: Bump Trakx.Utils.Testing from 0.3.11 to 0.3.13 (#35)
dependabot[bot] May 1, 2022
5ffa517
update bump-version
monsieurleberre May 1, 2022
a270142
Merge branch 'dev' of https://github.com/trakx/cryptocompare-api-clie…
monsieurleberre May 1, 2022
ffd55d4
update packages
monsieurleberre May 24, 2022
4dc22e8
refactor: rename from/to symbol to base/quote
emanuelgaspar Mar 28, 2023
7f5dc9b
Merge pull request #87 from trakx/feature/base-quote-symbols
emanuelgaspar Mar 29, 2023
5c41e79
Update to .Net 7
TiagoFroisPereira Apr 20, 2023
0c8044b
PUMP Trakx.WebSocket to latest version
TiagoFroisPereira Apr 20, 2023
dae6f8f
Fix unit test
TiagoFroisPereira Apr 20, 2023
85323d6
Update pipeline
TiagoFroisPereira Apr 20, 2023
5d48f8b
Update src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/…
TiagoFroisPereira Apr 20, 2023
24137be
Merge remote-tracking branch 'origin/feature/update-net7-tkx-14' into…
TiagoFroisPereira Apr 20, 2023
5be5fc1
Update .github/workflows/automerge.yml
TiagoFroisPereira Apr 20, 2023
558d821
Update .github/workflows/nuget.yml
TiagoFroisPereira Apr 20, 2023
d037cc8
fix issue in pipeline
TiagoFroisPereira Apr 20, 2023
e49d18a
Merge branch 'features/update-pipeline' of https://github.com/trakx/c…
TiagoFroisPereira Apr 20, 2023
d8be5cb
Merge pull request #88 from trakx/feature/update-net7-tkx-14
TiagoFroisPereira Apr 20, 2023
25041a4
Merge branch 'dev' into features/update-pipeline
TiagoFroisPereira Apr 20, 2023
a984cad
Update to get the configuration in test from AWS
TiagoFroisPereira Apr 20, 2023
1e11435
Merge remote-tracking branch 'origin/master' into fix/merge-master-to…
TiagoFroisPereira Apr 20, 2023
acb328f
Merge pull request #91 from trakx/fix/merge-master-to-dev
TiagoFroisPereira Apr 20, 2023
521626e
refactor: explicit method and strongly typed deserialize when AddInte…
emanuelgaspar May 23, 2023
32b7700
chore: version bumps
emanuelgaspar May 23, 2023
38f17af
chore: testing coverlet bump to v6
emanuelgaspar May 23, 2023
ac734d3
feat: explicit RemoveAsync with single TopicSubscription; more test c…
emanuelgaspar May 23, 2023
d4a78c4
Gonen's feedback (thanks)
emanuelgaspar May 24, 2023
9d3c48a
Merge pull request #92 from trakx/feature/add-internal-async-refactor
emanuelgaspar May 24, 2023
8ed48b1
Merge branch 'dev' into features/update-pipeline
emanuelgaspar May 24, 2023
5c9fdc4
ensure configuration is loaded from AWS, from CiCd or Development
emanuelgaspar May 24, 2023
9bc252b
ensure tests pass at all times
emanuelgaspar May 24, 2023
8dd796c
remove Development environment from test config
emanuelgaspar May 24, 2023
f6472de
increase buffer window to 30 seconds
emanuelgaspar May 24, 2023
1108f91
Update .github/workflows/delete.packages.yml
emanuelgaspar May 24, 2023
1b66d7f
Update .github/workflows/delete.packages.yml
emanuelgaspar May 24, 2023
ebf2491
Merge pull request #89 from trakx/features/update-pipeline
emanuelgaspar May 24, 2023
2bc0d78
Merge branch 'master' into feature/master-to-dev
emanuelgaspar May 24, 2023
7cb9abc
Merge pull request #94 from trakx/feature/master-to-dev
emanuelgaspar May 24, 2023
11c8127
Nuget bumps, fix IDE warnings and messages, nullable properties (#96)
emanuelgaspar Oct 31, 2023
d4379cb
chore: Bump trakx/github-actions from 10.0.14 to 10.0.26 (#97)
dependabot[bot] Oct 31, 2023
ec6e008
nuget bumps, dependabot is failing
emanuelgaspar Nov 2, 2023
f277c8f
Merge branch 'master' into chore/merge-master
emanuelgaspar Nov 2, 2023
3f4f4f4
Merge pull request #106 from trakx/chore/merge-master
emanuelgaspar Nov 2, 2023
95725bc
Merge branch 'dev' into chore/version-bumps
emanuelgaspar Nov 2, 2023
9192616
Merge pull request #105 from trakx/chore/version-bumps
emanuelgaspar Nov 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ jobs:
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Merge non major updates
uses: trakx/github-actions/dependabot-automerge@v10.0.14
uses: trakx/github-actions/dependabot-automerge@v10.0.26
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:

- name: Build and publish nuget packages
id: publish
uses: trakx/github-actions/publish-nuget@v10.0.14
uses: trakx/github-actions/publish-nuget@v10.0.26
with:
packageReadonlyPat: ${{secrets.TRAKX_BOT_READONLY_PAT}}
githubToken: ${{secrets.GITHUB_TOKEN}}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- name: Test and cover solutions
id: test
uses: trakx/github-actions/test-dotnet@v10.0.14
uses: trakx/github-actions/test-dotnet@v10.0.26
with:
packageReadonlyPat: ${{secrets.TRAKX_BOT_READONLY_PAT}}
codacyToken: ${{secrets.CODACY_TOKEN}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Threading.Tasks;
using System;
using System.Linq;
using System.Threading.Tasks;
using FluentAssertions;
using Xunit;

Expand Down Expand Up @@ -38,7 +40,8 @@ public async Task CanCallGenerateCustomAverageEndpoint()
Assert.NotNull(result);
}

[Fact] public async Task CanCallWithLargeNumberOfFSymbols()
[Fact]
public async Task CanCallWithLargeNumberOfFSymbols()
{
var symbols = new[]
{
Expand All @@ -50,8 +53,13 @@ [Fact] public async Task CanCallWithLargeNumberOfFSymbols()
"srm", "cake", "luna"
};
var result = await CryptoCompareClient.Prices.MultipleSymbolsPriceAsync(symbols, new[] { "USD", "EUR" });
result.Count.Should().Be(symbols.Length);
Assert.NotNull(result);

result.Should().NotBeEmpty();

var missingKeys = symbols.Except(result.Keys, StringComparer.OrdinalIgnoreCase).Order().ToList();

var maximumMissingAllowed = symbols.Length * 10 / 100; // 10% missing
missingKeys.Count.Should().BeLessThanOrEqualTo(maximumMissingAllowed);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="GitHubActionsTestLogger" Version="2.2.1">
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MartinCostello.Logging.XUnit" Version="0.3.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="NSubstitute" Version="5.0.0" />
<PackageReference Include="Trakx.Common.Testing.Documentation" Version="0.2.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="Trakx.Common.Testing.Documentation" Version="0.5.1" />
<PackageReference Include="xunit" Version="2.6.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using System;
using FluentAssertions;
using Trakx.CryptoCompare.ApiClient.Rest.Helpers;
using Xunit;

namespace Trakx.CryptoCompare.ApiClient.Tests.Unit.Rest.Helpers
{
public class CheckTest
{
public static string Blah = nameof(Blah);
internal const string Blah = nameof(Blah);

/// <summary>
/// NotNullOrWhiteSpace should not throw ArgumentNullException when string is not null.
Expand All @@ -27,7 +28,7 @@ public void NotNullOrWhiteSpaceShouldNotThrowArgumentNullExceptionWhenStringIsNo
public void NotNullOrWhiteSpaceShouldThrowArgumentNullExceptionWhenStringIsNullOrEmptyOrWhitespace(string value)
{
var exception = Assert.Throws<ArgumentNullException>(() => Check.NotNullOrWhiteSpace(value, Blah));
Assert.Equal(exception.ParamName, Blah);
exception.ParamName.Should().Be(Blah);
}

/// <summary>
Expand All @@ -46,7 +47,7 @@ public void NotNullShouldNotThrowArgumentNullExceptionWhenObjectIsNotNull()
public void NotNullShouldThrowArgumentNullExceptionWhenObjectIsNull()
{
var exception = Assert.Throws<ArgumentNullException>(() => Check.NotNull<int?>(null, Blah));
Assert.Equal(exception.ParamName, Blah);
exception.ParamName.Should().Be(Blah);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Extensions.DependencyInjection;
using FluentAssertions;
using Microsoft.Extensions.DependencyInjection;
using Xunit;

namespace Trakx.CryptoCompare.ApiClient.Tests.Unit
Expand All @@ -13,7 +14,10 @@ public void Services_should_be_built()
var serviceCollection = new ServiceCollection();
serviceCollection.AddCryptoCompareClient(configuration);
serviceCollection.AddLogging();
var serviceProvider = serviceCollection.BuildServiceProvider();

var action = () => _ = serviceCollection.BuildServiceProvider();

action.Should().NotThrow();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Globalization;
using System.Linq;
using System.Reactive.Linq;
using System.Reactive.Threading.Tasks;
Expand Down Expand Up @@ -40,12 +39,6 @@ public static IServiceProvider CreateServiceProvider()
return serviceCollection.BuildServiceProvider();
}

public void Dispose()
{
_serviceScope.Dispose();
}


private async Task<T> GetResult<T>(string subStr, int bufferSeconds = 10)
where T : InboundMessageBase
{
Expand All @@ -66,10 +59,9 @@ private async Task<T> GetResult<T>(string subStr, int bufferSeconds = 10)
public async Task Should_be_able_to_get_full_top_tier_volume_subscriptions()
{
var subscriptionString = CryptoCompareSubscriptionFactory.GetFullTopTierVolumeSubscriptionStr("btc");
var result = await GetResult<TopTierFullVolume>(subscriptionString).ConfigureAwait(false);
var result = await GetResult<TopTierFullVolume>(subscriptionString);
result!.Symbol.Should().Be("BTC");
decimal.TryParse(result.Volume, CultureInfo.InvariantCulture, out decimal volume);
volume.Should().BeGreaterThan(0);
result.Volume.Should().BeGreaterThan(0);
}

[Fact]
Expand All @@ -87,11 +79,35 @@ public async Task Should_be_able_to_get_oc_book()
public async Task Should_be_able_to_get_ohlcc_candles()
{
var subscriptionString = CryptoCompareSubscriptionFactory.GetOHLCCandlesSubscriptionStr("Binance", "btc", "usdt", "m");
var result = await GetResult<Ohlc>(subscriptionString).ConfigureAwait(false);
var result = await GetResult<Ohlc>(subscriptionString);
result!.Open.Should().BeGreaterThan(0);
result!.LastTimeStamp.Should().BeGreaterThan(0);
result!.Market.Should().NotBeNull();
result.Close.Should().BeGreaterThan(0);
}

#region IDisposable

private bool _wasDisposed;

protected virtual bool Dispose(bool disposing)
{
if (_wasDisposed) return false;
if (disposing)
{
_serviceScope.Dispose();
}

_wasDisposed = true;
return true;
}

public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}

#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="GitHubActionsTestLogger" Version="2.2.1">
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NSubstitute" Version="5.0.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="xunit" Version="2.6.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="Trakx.Common.Testing.Documentation" Version="0.2.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Trakx.Common.Testing.Documentation" Version="0.5.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Trakx.Common.Configuration;
using Trakx.Websocket;
using Trakx.Websocket.Interfaces;
using Trakx.Websocket.Model;
Expand All @@ -8,7 +9,10 @@ namespace Trakx.CryptoCompare.ApiClient.Websocket.Extensions;

public static class AddCryptoCompareWebsocketsExtensions
{
public static void AddCryptoCompareWebsockets(this IServiceCollection services, CryptoCompareApiConfiguration apiConfiguration, WebsocketConfiguration webSocketConfiguration)
public static void AddCryptoCompareWebsockets(
this IServiceCollection services,
CryptoCompareApiConfiguration apiConfiguration,
WebsocketConfiguration webSocketConfiguration)
{
services.AddSingleton<ICryptoCompareWebsocketHandler, CryptoCompareWebsocketHandler>();
services.AddSingleton<IClientWebsocketFactory, ClientWebsocketFactory>();
Expand All @@ -18,10 +22,8 @@ public static void AddCryptoCompareWebsockets(this IServiceCollection services,

public static void AddCryptoCompareWebsockets(this IServiceCollection services, IConfiguration config)
{
var apiConfiguration = config.GetSection(nameof(CryptoCompareApiConfiguration))
.Get<CryptoCompareApiConfiguration>();
var webSocketConfig = config.GetSection(nameof(WebsocketConfiguration)).Get<WebsocketConfiguration>();

var apiConfiguration = config.GetConfiguration<CryptoCompareApiConfiguration>();
var webSocketConfig = config.GetConfiguration<WebsocketConfiguration>();
AddCryptoCompareWebsockets(services, apiConfiguration, webSocketConfig);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ namespace Trakx.CryptoCompare.ApiClient.Websocket.Model;

public class HeartBeat : InboundMessageBase
{
[JsonPropertyName("MESSAGE")] public string Message { get; set; }
[JsonPropertyName("TIMEMS")] public ulong TimeMs { get; set; }
[JsonPropertyName("MESSAGE")] public string? Message { get; set; }
[JsonPropertyName("TIMEMS")] public ulong? TimeMs { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ namespace Trakx.CryptoCompare.ApiClient.Websocket.Model;

public class InboundMessageBase
{
[JsonPropertyName("TYPE")] public string Type { get; set; }
[JsonPropertyName("TYPE")] public string? Type { get; set; }
}
2 changes: 1 addition & 1 deletion src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ohlc.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Text.Json.Serialization;
using Trakx.Common.Serialization.Converters;
using Trakx.Common.Serialization.Comparers;

namespace Trakx.CryptoCompare.ApiClient.Websocket.Model;

Expand Down
10 changes: 4 additions & 6 deletions src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ticker.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
using System.Text.Json.Serialization;
using Trakx.Common.Serialization.Converters;
using Trakx.Common.Serialization.Comparers;

namespace Trakx.CryptoCompare.ApiClient.Websocket.Model;

public class Ticker : InboundMessageBase
{
#nullable disable
[JsonPropertyName("MARKET")] public string Market { get; set; }
[JsonPropertyName("FROMSYMBOL")] public string BaseSymbol { get; set; }
[JsonPropertyName("TOSYMBOL")] public string QuoteSymbol { get; set; }
[JsonPropertyName("MARKET")] public string? Market { get; set; }
[JsonPropertyName("FROMSYMBOL")] public string? BaseSymbol { get; set; }
[JsonPropertyName("TOSYMBOL")] public string? QuoteSymbol { get; set; }

[JsonPropertyName("FLAGS"), JsonConverter(typeof(ULongOrStringConverter))]
public ulong Flags { get; set; }
Expand All @@ -33,5 +32,4 @@ public class Ticker : InboundMessageBase
[JsonPropertyName("OPENHOUR")] public decimal? OpenHour { get; set; }
[JsonPropertyName("HIGHHOUR")] public decimal? HighHour { get; set; }
[JsonPropertyName("LOWHOUR")] public decimal? LowHour { get; set; }
#nullable restore
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ namespace Trakx.CryptoCompare.ApiClient.Websocket.Model;

public class TopTierFullVolume : InboundMessageBase
{
#nullable disable
[JsonPropertyName("SYMBOL")] public string Symbol { get; set; }
[JsonPropertyName("TOPTIERFULLVOLUME")] public string Volume { get; set; }
#nullable restore
[JsonPropertyName("SYMBOL")]
public string Symbol { get; set; } = default!;

[JsonPropertyName("TOPTIERFULLVOLUME")]
public decimal Volume { get; set; }
}
2 changes: 1 addition & 1 deletion src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Trade.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Text.Json.Serialization;
using Trakx.Common.Serialization.Converters;
using Trakx.Common.Serialization.Comparers;

namespace Trakx.CryptoCompare.ApiClient.Websocket.Model;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<Import Project="../Common.Projects.props" />
<Import Project="../Packable.Projects.props" />
<Import Project="../Common.Projects.props" />
<Import Project="../Packable.Projects.props" />

<ItemGroup>
<PackageReference Include="Trakx.Common" Version="0.2.2" />
<PackageReference Include="Trakx.Websocket" Version="1.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Trakx.Common" Version="0.5.1" />
<PackageReference Include="Trakx.Common.Configuration" Version="0.5.1" />
<PackageReference Include="Trakx.Websocket" Version="1.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Trakx.CryptoCompare.ApiClient\Trakx.CryptoCompare.ApiClient.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Trakx.CryptoCompare.ApiClient\Trakx.CryptoCompare.ApiClient.csproj" />
</ItemGroup>

</Project>
Loading