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
22 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
5d48f8b
Update src/Trakx.CryptoCompare.ApiClient.Websocket.Tests/Integration/…
TiagoFroisPereira Apr 20, 2023
d8be5cb
Merge pull request #88 from trakx/feature/update-net7-tkx-14
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
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/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
dotnet-version: 7.0.x

- name: Add github nuget source
run: dotnet nuget add source "https://nuget.pkg.github.com/trakx/index.json" --name "github" --username "trakx-bot" --password ${{secrets.TRAKX_BOT_READONLY_PAT}} --store-password-in-clear-text
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/publish.nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,14 @@ jobs:

- name: Bump version
id: bumpVersion
uses: trakx/bump-version-action@v8
uses: trakx/bump-version-action/get-tag@v9.1.1
with:
semverIncrementLevel: ${{github.event.inputs.semverIncrementLevel}}
releaseBranches: master
githubToken: ${{secrets.GITHUB_TOKEN}}

- name: Setup .NET Core
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
dotnet-version: 7.0.x

- name: Add github nuget source
run: dotnet nuget add source "https://nuget.pkg.github.com/trakx/index.json" --name "github" --username "trakx-bot" --password ${{secrets.TRAKX_BOT_READONLY_PAT}} --store-password-in-clear-text
Expand Down Expand Up @@ -88,8 +86,9 @@ jobs:
for f in ./nuget/*.symbols.nupkg; do echo "pushing $f file.." && dotnet nuget push $f --api-key ${{secrets.GITHUB_TOKEN}} \
--source "https://nuget.pkg.github.com/trakx/index.json"; done

- name: push version tag
uses: anothrNick/github-tag-action@1.38.0
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
CUSTOM_TAG: v${{steps.bumpVersion.outputs.fullVersion}}
- name: Push version tag
id: pushTag
uses: trakx/bump-version-action/push-tag@v9.1.1
with:
tag: v${{steps.bumpVersion.outputs.fullVersion}}
githubToken: ${{secrets.GITHUB_TOKEN}}
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ In order to be able to run some integration tests, you should create a `.env` fi
CryptoCompareApiConfiguration__ApiKey=********
```

## AWS Parameters
In order to be able to run some integration tests you should ensure that you have access to the following AWS parameters :
```awsParams
/Trakx/CryptoCompare/ApiClient/CryptoCompareApiConfiguration/ApiKey
```

## Basic usage
````csharp
Expand Down Expand Up @@ -80,3 +75,9 @@ Console.WriteLine(eth.Data.General.Name);


[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjoancaron%2Fcryptocompare-api.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjoancaron%2Fcryptocompare-api?ref=badge_large)

## AWS Parameters
In order to be able to run some integration tests, you should ensure that you have access to the AWS parameters starting in `/CiCd`. In order for the applications in this solution to run correctly on AWS, please ensure that variables starting in `/[environment]` are defined for all 3 environments \( _Production_, _Staging_, _Development_ \) :
```awsParams
/[environment]/Trakx/CryptoCompare/ApiClient/CryptoCompareApiConfiguration/ApiKey
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Trakx.Utils.Testing.ReadmeUpdater;
using Trakx.Common.Testing.Documentation.ReadmeUpdater;
using Xunit.Abstractions;

namespace Trakx.CryptoCompare.ApiClient.Tests.Integration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using Microsoft.Extensions.DependencyInjection;
using Trakx.Common.Testing.Configuration;
using Trakx.CryptoCompare.ApiClient.Rest;
using Trakx.Utils.Testing;
using Xunit;

namespace Trakx.CryptoCompare.ApiClient.Tests.Integration.Rest.Clients
Expand Down Expand Up @@ -29,7 +29,7 @@ public class CryptoCompareApiFixture : IDisposable
public ICryptoCompareClient CryptoCompareClient { get; }
public CryptoCompareApiFixture()
{
var configuration = ConfigurationHelper.GetConfigurationFromEnv<CryptoCompareApiConfiguration>();
var configuration = EnvConfigurationHelper.GetConfigurationFromEnv<CryptoCompareApiConfiguration>();
var services = new ServiceCollection();
services.AddCryptoCompareClient(configuration);
var provider = services.BuildServiceProvider();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.Options;
using Trakx.Common.Testing.Configuration;
using Trakx.CryptoCompare.ApiClient.Rest;
using Trakx.Utils.Testing;
using Xunit;

namespace Trakx.CryptoCompare.ApiClient.Tests.Integration.Rest.Core
Expand All @@ -16,7 +15,7 @@ public async Task WaitsBetweenQueries()
var throttleDelayMs = 200;
var queriesCount = 5;

var configuration = ConfigurationHelper.GetConfigurationFromEnv<CryptoCompareApiConfiguration>()
var configuration = EnvConfigurationHelper.GetConfigurationFromEnv<CryptoCompareApiConfiguration>()
with {
ThrottleDelayMs = throttleDelayMs
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,40 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<IsPackable>false</IsPackable>
</PropertyGroup>
<Import Project="../Common.Projects.props" />

<Import Project="../Common.Projects.props" />
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="GitHubActionsTestLogger" Version="2.0.1">
<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.5.0" />
<PackageReference Include="NSubstitute" Version="5.0.0" />
<PackageReference Include="Trakx.Common.Testing.Documentation" Version="0.2.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="DotNetEnv" Version="2.3.0" />
<PackageReference Include="FluentAssertions" Version="6.5.1" />
<PackageReference Include="GitHubActionsTestLogger" Version="1.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MartinCostello.Logging.XUnit" Version="0.2.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="NSubstitute" Version="4.3.0" />
<PackageReference Include="Serilog.Sinks.XUnit" Version="3.0.3" />
<PackageReference Include="Trakx.Utils.Testing" Version="0.3.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference
Include="..\Trakx.CryptoCompare.ApiClient\Trakx.CryptoCompare.ApiClient.csproj" />
</ItemGroup>

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

</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
using FluentAssertions;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Globalization;
using System.Linq;
using System.Reactive.Linq;
using System.Reactive.Threading.Tasks;
using System.Threading.Tasks;
using Trakx.Common.Testing.Configuration;
using Trakx.CryptoCompare.ApiClient.Websocket.Extensions;
using Trakx.CryptoCompare.ApiClient.Websocket.Model;
using Trakx.Utils.Testing;
using Trakx.Websocket;
using Trakx.Websocket.Interfaces;
using Trakx.Websocket.Model;
using Xunit;

Expand All @@ -34,7 +33,7 @@ public IServiceProvider CreateServiceProvider()
BufferSize = 4096,
MaxSubscriptionsPerScope = 100
};
var configuration = ConfigurationHelper.GetConfigurationFromEnv<CryptoCompareApiConfiguration>()
var configuration = EnvConfigurationHelper.GetConfigurationFromEnv<CryptoCompareApiConfiguration>()
with { WebSocketBaseUrl = "wss://streamer.cryptocompare.com/v2?api_key=", };

serviceCollection.AddCryptoCompareWebsockets(configuration, websocketConfiguration);
Expand Down Expand Up @@ -68,7 +67,8 @@ public async Task Should_be_able_to_get_full_top_tier_volume_subscriptions()
var result = await GetResult<TopTierFullVolume>(CryptoCompareSubscriptionFactory.GetFullTopTierVolumeSubscriptionStr("btc"))
.ConfigureAwait(false);
result!.Symbol.Should().Be("BTC");
decimal.Parse(result.Volume).Should().BeGreaterThan(0);
decimal.TryParse(result.Volume, CultureInfo.InvariantCulture, out decimal volume);
volume.Should().BeGreaterThan(0);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk">

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

<IsPackable>false</IsPackable>
</PropertyGroup>

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

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.5.1" />
<PackageReference Include="GitHubActionsTestLogger" Version="1.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="NSubstitute" Version="4.3.0" />
<PackageReference Include="Trakx.Websockets.Testing" Version="0.2.1" />
<PackageReference Include="Trakx.Utils.Testing" Version="0.3.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Trakx.Websockets.Testing" Version="1.0.0" />
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="GitHubActionsTestLogger" Version="2.0.1">
<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">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="Trakx.Common.Testing.Documentation" Version="0.2.0" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ohlc.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System.Text.Json.Serialization;
using Trakx.Utils.Serialization.Converters;
using Trakx.Common.Serialization.Converters;

namespace Trakx.CryptoCompare.ApiClient.Websocket.Model;

public class Ohlc : InboundMessageBase
{
#nullable disable
[JsonPropertyName("MARKET")] public string Market { get; set; }
[JsonPropertyName("FROMSYMBOL")] public string FromSymbol { get; set; }
[JsonPropertyName("TOSYMBOL")] public string ToSymbol { get; set; }
[JsonPropertyName("FROMSYMBOL")] public string BaseSymbol { get; set; }
[JsonPropertyName("TOSYMBOL")] public string QuoteSymbol { get; set; }
[JsonPropertyName("TS"), JsonConverter(typeof(ULongOrStringConverter))] public ulong TimeStamp { get; set; }
[JsonPropertyName("UNIT")] public string Unit { get; set; }
[JsonPropertyName("ACTION")] public string Action { get; set; }
Expand Down
6 changes: 3 additions & 3 deletions src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Ticker.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System.Text.Json.Serialization;
using Trakx.Utils.Serialization.Converters;
using Trakx.Common.Serialization.Converters;

namespace Trakx.CryptoCompare.ApiClient.Websocket.Model;

public class Ticker : InboundMessageBase
{
#nullable disable
[JsonPropertyName("MARKET")] public string Market { get; set; }
[JsonPropertyName("FROMSYMBOL")] public string FromSymbol { get; set; }
[JsonPropertyName("TOSYMBOL")] public string ToSymbol { 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 Down
6 changes: 3 additions & 3 deletions src/Trakx.CryptoCompare.ApiClient.Websocket/Model/Trade.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System.Text.Json.Serialization;
using Trakx.Utils.Serialization.Converters;
using Trakx.Common.Serialization.Converters;

namespace Trakx.CryptoCompare.ApiClient.Websocket.Model;

public class Trade : InboundMessageBase
{
#nullable disable
[JsonPropertyName("M")] public string Market { get; set; }
[JsonPropertyName("FSYM")] public string FromSymbol { get; set; }
[JsonPropertyName("TSYM")] public string ToSymbol { get; set; }
[JsonPropertyName("FSYM")] public string BaseSymbol { get; set; }
[JsonPropertyName("TSYM")] public string QuoteSymbol { get; set; }
[JsonPropertyName("F"), JsonConverter(typeof(ULongOrStringConverter))] public ulong Flags { get; set; }
[JsonPropertyName("ID")] public string Id { get; set; }
[JsonPropertyName("TS"), JsonConverter(typeof(ULongOrStringConverter))] public ulong TimeStamp { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

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

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

<ItemGroup>
<PackageReference Include="Trakx.Utils" Version="0.3.1" />
<PackageReference Include="Trakx.Websocket" Version="0.2.1" />
<PackageReference Include="Trakx.Common" Version="0.2.0" />
<PackageReference Include="Trakx.Websocket" Version="1.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Text.Json.Serialization;
using Trakx.Utils.Attributes;
using Trakx.Common.Attributes;

namespace Trakx.CryptoCompare.ApiClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class AggregatedData
public string Flags { get; set; }

[JsonProperty("FROMSYMBOL")]
public string FromSymbol { get; set; }
public string BaseSymbol { get; set; }

[JsonProperty("HIGH24HOUR")]
public double? High24Hour { get; set; }
Expand Down Expand Up @@ -41,7 +41,7 @@ public class AggregatedData
public double? Price { get; set; }

[JsonProperty("TOSYMBOL")]
public string ToSymbol { get; set; }
public string QuoteSymbol { get; set; }

[JsonProperty("TYPE")]
public string Type { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class CoinFullAggregatedDataDisplay
public string ChangePCTDay { get; set; }

[JsonProperty("FROMSYMBOL")]
public string FromSymbol { get; set; }
public string BaseSymbol { get; set; }

[JsonProperty("HIGH24HOUR")]
public string High24Hour { get; set; }
Expand Down Expand Up @@ -66,7 +66,7 @@ public class CoinFullAggregatedDataDisplay
public string Supply { get; set; }

[JsonProperty("TOSYMBOL")]
public string ToSymbol { get; set; }
public string QuoteSymbol { get; set; }

[JsonProperty("TOTALVOLUME24H")]
public string TotalVolume24H { get; set; }
Expand Down
Loading