Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
Updated CryptoExchange.Net
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Oct 24, 2023
1 parent 1cea27a commit 9f04ed0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Bittrex.Net/Bittrex.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="CryptoExchange.Net" Version="6.1.5" />
<PackageReference Include="Microsoft.AspNet.SignalR.Client" Version="2.4.2" />
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
<PackageReference Include="ConfigureAwaitChecker.Analyzer" Version="5.0.0">
Expand All @@ -51,6 +50,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="CryptoExchange.Net" Version="6.2.0" />
</ItemGroup>
<ItemGroup>
<None Include="Icon\icon.png" Pack="true" PackagePath="\" />
Expand Down
2 changes: 1 addition & 1 deletion Bittrex.Net/BittrexAuthenticationProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ public override void AuthenticateRequest(RestApiClient apiClient, Uri uri, HttpM
headers.Add("Api-Signature", SignHMACSHA512(headers["Api-Timestamp"] + uriString + method + headers["Api-Content-Hash"]));
}

public override string Sign(string toSign) => SignHMACSHA512(toSign);
public string Sign(string toSign) => SignHMACSHA512(toSign);
}
}
4 changes: 2 additions & 2 deletions Bittrex.Net/Clients/SpotApi/BittrexSocketClientSpotApis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,13 @@ protected override async Task<CallResult<bool>> AuthenticateSocketAsync(SocketCo
if (s.ApiClient.AuthenticationProvider == null)
return new CallResult<bool>(new NoApiCredentialsError());

var bittrexAuthProvider = (BittrexAuthenticationProvider)s.ApiClient.AuthenticationProvider;
var timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
var randomContent = $"{Guid.NewGuid()}";
var content = string.Join("", timestamp, randomContent);
var signedContent = s.ApiClient.AuthenticationProvider.Sign(content);
var signedContent = bittrexAuthProvider.Sign(content);
var socket = (ISignalRSocket)s.GetSocket();

var bittrexAuthProvider = (BittrexAuthenticationProvider)s.ApiClient.AuthenticationProvider;
var result = await socket.InvokeProxy<ConnectionResponse>("Authenticate", bittrexAuthProvider.GetApiKey(), timestamp, randomContent, signedContent).ConfigureAwait(false);
if (!result.Success || !result.Data.Success)
{
Expand Down

0 comments on commit 9f04ed0

Please sign in to comment.