12 changed files with 263 additions and 38 deletions
@ -0,0 +1,12 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<OutputType>Exe</OutputType> |
||||
|
<TargetFramework>netcoreapp3.1</TargetFramework> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<PackageReference Include="Binance.Net" Version="8.0.1" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
</Project> |
@ -0,0 +1,27 @@ |
|||||
|
using Binance.Net.Clients; |
||||
|
using Binance.Net.Objects; |
||||
|
using CryptoExchange.Net.Authentication; |
||||
|
using System; |
||||
|
|
||||
|
namespace Binance.SDK.Test |
||||
|
{ |
||||
|
internal class Program |
||||
|
{ |
||||
|
static void Main(string[] args) |
||||
|
{ |
||||
|
var apiKey = "muiZ1IA2sPMQ2m0YFPubEvZepjzn2nxeuPHqQ6mejKVXljYDQTOIYbm22NlXxKcv"; |
||||
|
var apiSecret = "3Clur3D1hDeZYhtVSJzPBiEBb7S0ktC8WpaRQ3F7ysQe55kbsPTBZ6U4X9XsX4Ww"; |
||||
|
var client = new BinanceClient(new BinanceClientOptions() |
||||
|
{ |
||||
|
UsdFuturesApiOptions = new BinanceApiClientOptions() |
||||
|
{ |
||||
|
BaseAddress = "https://fapi.binance.com", |
||||
|
ApiCredentials = new ApiCredentials(apiKey, apiSecret) |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
var result = client.UsdFuturesApi.Account.GetBalancesAsync().Result; |
||||
|
Console.WriteLine(result); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
using FreeSql.DataAnnotations; |
||||
|
using System; |
||||
|
|
||||
|
namespace Binance.TradeRobot.Model.Db |
||||
|
{ |
||||
|
|
||||
|
[Table(DisableSyncStructure = true)] |
||||
|
public partial class ExchangeAPIKey { |
||||
|
|
||||
|
[Column(IsPrimary = true)] |
||||
|
public long Id { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 交易所账号Id
|
||||
|
/// </summary>
|
||||
|
public long AccountId { get; set; } |
||||
|
|
||||
|
[Column(StringLength = 100, IsNullable = false)] |
||||
|
public string APIKey { get; set; } |
||||
|
|
||||
|
[Column(InsertValueSql = "getdate()")] |
||||
|
public DateTime CreateTime { get; set; } |
||||
|
|
||||
|
public long? RobotId { get; set; } |
||||
|
|
||||
|
[Column(StringLength = 100, IsNullable = false)] |
||||
|
public string SecretKey { get; set; } |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,37 @@ |
|||||
|
using Binance.TradeRobot.Model.Base; |
||||
|
using FreeSql.DataAnnotations; |
||||
|
using System; |
||||
|
|
||||
|
namespace Binance.TradeRobot.Model.Db |
||||
|
{ |
||||
|
|
||||
|
[Table(DisableSyncStructure = true)] |
||||
|
public partial class ExchangeAccount |
||||
|
{ |
||||
|
|
||||
|
[Column(IsPrimary = true)] |
||||
|
public long Id { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 业务类型
|
||||
|
/// </summary>
|
||||
|
public int BusinessType { get; set; } |
||||
|
|
||||
|
[Column(InsertValueSql = "getdate()")] |
||||
|
public DateTime CreateTime { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 账号登录名
|
||||
|
/// </summary>
|
||||
|
[Column(StringLength = 50, IsNullable = false)] |
||||
|
public string LoginName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 交易策略
|
||||
|
/// </summary>
|
||||
|
[Column(MapType = typeof(int))] |
||||
|
public Enums.TradePolicy TradePolicy { get; set; } |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,19 @@ |
|||||
|
using Binance.TradeRobot.Model.Base; |
||||
|
using FreeSql.DataAnnotations; |
||||
|
|
||||
|
namespace Binance.TradeRobot.Model.Db |
||||
|
{ |
||||
|
[Table(DisableSyncStructure = true)] |
||||
|
public partial class PyramidPolicy |
||||
|
{ |
||||
|
|
||||
|
[Column(IsPrimary = true)] |
||||
|
public long Id { get; set; } |
||||
|
|
||||
|
[Column(MapType = typeof(int))] |
||||
|
public Enums.SignalPeriod SignalPeriod { get; set; } |
||||
|
|
||||
|
public long RobotId { get; set; } |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,37 @@ |
|||||
|
using Binance.TradeRobot.Model.Base; |
||||
|
using FreeSql.DataAnnotations; |
||||
|
using System; |
||||
|
|
||||
|
namespace Binance.TradeRobot.Model.Db |
||||
|
{ |
||||
|
|
||||
|
[Table(DisableSyncStructure = true)] |
||||
|
public partial class Robot |
||||
|
{ |
||||
|
|
||||
|
[Column(IsPrimary = true)] |
||||
|
public long Id { get; set; } |
||||
|
|
||||
|
[Column(InsertValueSql = "getdate()")] |
||||
|
public DateTime CreateTime { get; set; } |
||||
|
|
||||
|
[Column(MapType = (typeof(int)))] |
||||
|
public Enums.TradePolicy TradePolicy { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 运行时长(s)
|
||||
|
/// </summary>
|
||||
|
public long RunningTime { get; set; } = 0; |
||||
|
|
||||
|
[Column(MapType = (typeof(int)))] |
||||
|
public Enums.RobotStatus State { get; set; } |
||||
|
|
||||
|
[Column(StringLength = 50, IsNullable = false)] |
||||
|
public string Symbol { get; set; } |
||||
|
|
||||
|
[Column(MapType = (typeof(int)))] |
||||
|
public Enums.BusinessType BusinessType { get; set; } |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
@ -1 +1 @@ |
|||||
FreeSql.Generator -Razor 1 -NameOptions 1,0,0,0 -NameSpace Binance.TradeRobot.Model.Db -DB "SqlServer,data source=.;initial catalog=Binance.TradeRobot.DB;User Id=sa;Password=pc911103;TrustServerCertificate=true;pooling=true;max pool size=2" -FileName "{name}.cs" |
FreeSql.Generator -Razor 1 -NameOptions 1,0,0,0 -NameSpace Binance.TradeRobot.Model.Db -DB "SqlServer,data source=18.179.56.42;initial catalog=Binance.TradeRobot.DB;User Id=sa;Password=kaicn1132+-;TrustServerCertificate=true;pooling=true;max pool size=2" -FileName "{name}.cs" |
||||
|
Loading…
Reference in new issue