-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from HuobiRDCenter/branch_20241023
删除私钥
- Loading branch information
Showing
73 changed files
with
1,030 additions
and
424 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[*.cs] | ||
|
||
# IDE0005: Using 指令是不需要的。 | ||
dotnet_diagnostic.IDE0005.severity = none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
// 使用 IntelliSense 了解相关属性。 | ||
// 悬停以查看现有属性的描述。 | ||
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
// { | ||
// "name": ".NET Core Launch (console)", | ||
// "type": "coreclr", | ||
// "request": "launch", | ||
// "preLaunchTask": "build", | ||
// "program": "${workspaceFolder}/bin/Debug/net6.0/MyCSharpApp.dll", // 修改为你的项目输出路径 | ||
// "args": [], | ||
// "cwd": "${workspaceFolder}", | ||
// "stopAtEntry": false, | ||
// "serverReadyAction": { | ||
// "action": "openExternally", | ||
// "pattern": "\\bNow listening on:\\s+(https?://\\S+)" | ||
// }, | ||
// "env": { | ||
// "ASPNETCORE_ENVIRONMENT": "Development" | ||
// }, | ||
// "sourceFileMap": { | ||
// "/Views": "${workspaceFolder}/Views" | ||
// } | ||
// } | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "build", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"build", | ||
"${workspaceFolder}/Huobi.SDK.Example/Huobi.SDK.Example.csproj" | ||
// 替换为你的项目文件 | ||
], | ||
"problemMatcher": "$msCompile" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.0</TargetFramework> | ||
|
||
<IsPackable>false</IsPackable> | ||
<ReleaseVersion>2.2.0</ReleaseVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" /> | ||
<PackageReference Include="xunit" Version="2.4.0" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" /> | ||
<PackageReference Include="coverlet.collector" Version="1.0.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Folder Include="RequestBuilder\" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Huobi.SDK.Core\Huobi.SDK.Core.csproj" /> | ||
<ProjectReference Include="..\Huobi.SDK.Model\Huobi.SDK.Model.csproj" /> | ||
</ItemGroup> | ||
</Project> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.0</TargetFramework> | ||
|
||
<IsPackable>false</IsPackable> | ||
<ReleaseVersion>2.2.0</ReleaseVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" /> | ||
<PackageReference Include="xunit" Version="2.4.0" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" /> | ||
<PackageReference Include="coverlet.collector" Version="1.0.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Folder Include="RequestBuilder\" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Huobi.SDK.Core\Huobi.SDK.Core.csproj" /> | ||
<ProjectReference Include="..\Huobi.SDK.Model\Huobi.SDK.Model.csproj" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using Huobi.SDK.Core.RequestBuilder; | ||
using Xunit; | ||
|
||
namespace Huobi.SDK.Core.Test.RequestBuilder | ||
{ | ||
public class Ed25519SignerTest | ||
{ | ||
private const string PrivateKey = "MC4CAQAwBQYDK2VwBCIEILHeu7fAq16wUfz/w91bQVEQO+J1dJ6HE4YGdyfYMPqt"; // 替换为有效的私钥 | ||
|
||
[Fact] | ||
public void Sign_FourString_Success() | ||
{ | ||
var signer = new Ed25519Signer(PrivateKey); | ||
string result = signer.Sign( | ||
"GET", | ||
"https://api.huobi.pro/v1/account/accounts?AccessKeyId=abcdefg-hijklmn-opqrst-uvwxyz&SignatureMethod=ED25519&SignatureVersion=2&Timestamp=2020-04-01T12%3A34%3A56" | ||
); | ||
|
||
Assert.Equal("expected_base64_encoded_signature", result); // 替换为您预期的签名 | ||
} | ||
|
||
[Fact] | ||
public void Sign_RunTwice_ReturnSameResult() | ||
{ | ||
var signer = new Ed25519Signer(PrivateKey); | ||
|
||
string result1 = signer.Sign("GET", "https://api.huobi.pro/v1/account/history?account-id=1¤cy=btcusdt"); | ||
string result2 = signer.Sign("GET", "https://api.huobi.pro/v1/account/history?account-id=1¤cy=btcusdt"); | ||
|
||
Assert.Equal(result1, result2); | ||
} | ||
|
||
[Fact] | ||
public void Sign_OneNullStringThreeString_ReturnEmpty() | ||
{ | ||
var signer = new Ed25519Signer(PrivateKey); | ||
|
||
string result = signer.Sign("GET", "https://api.huobi.pro", "", "account-id=currency=btcusdt"); | ||
|
||
Assert.Equal("", result); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Huobi.SDK.Core/Client/AccountWebSocketClient/RequestAccountWebSocketV1Client.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Huobi.SDK.Core/Client/MarketWebSocketClient/CandlestickWebSocketClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Huobi.SDK.Core/Client/MarketWebSocketClient/DepthWebSocketClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Huobi.SDK.Core/Client/MarketWebSocketClient/Last24hCandlestickWebSocketClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Huobi.SDK.Core/Client/MarketWebSocketClient/MarketByPriceTickWebSocketClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Huobi.SDK.Core/Client/MarketWebSocketClient/MarketByPriceWebSocketClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Huobi.SDK.Core/Client/MarketWebSocketClient/TradeWebSocketClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Huobi.SDK.Core/Client/OrderWebSocketClient/RequestOrderWebSocketV1Client.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Huobi.SDK.Core/Client/OrderWebSocketClient/RequestOrdersWebSocketV1Client.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.