Skip to content

Commit

Permalink
Update static assets and symbols
Browse files Browse the repository at this point in the history
CHAT
  • Loading branch information
sonvister committed Jan 31, 2018
1 parent d5726af commit 3873ecb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
15 changes: 7 additions & 8 deletions samples/BinanceConsoleApp/Examples/AccountBalancesExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,24 @@ public static async Task ExampleMain(string[] args)
services.GetService<ILoggerFactory>()
.AddFile(configuration.GetSection("Logging:File"));

var asset = Asset.BTC;

var api = services.GetService<IBinanceApi>();
var cache = services.GetService<IAccountInfoCache>();
var userProvider = services.GetService<IBinanceApiUserProvider>();

using (var controller = new RetryTaskController())
using (var user = userProvider.CreateUser(key, secret))
{
var api = services.GetService<IBinanceApi>();

// Query and display current account balance.
var account = await api.GetAccountInfoAsync(user);

var asset = Asset.BTC;

Display(account.GetBalance(asset));

var cache = services.GetService<IAccountInfoCache>();

// Display updated account balance.
controller.Begin(tkn => cache.SubscribeAndStreamAsync(user,
evt => Display(evt.AccountInfo.GetBalance(asset)), tkn),
controller.Begin(
tkn => cache.SubscribeAndStreamAsync(user,
evt => Display(evt.AccountInfo.GetBalance(asset)), tkn),
err => Console.WriteLine(err.Message));

Console.WriteLine("...press any key to continue.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ public static async Task ExampleMain(string[] args)
var asset = symbol.BaseAsset;

var api = services.GetService<IBinanceApi>();

var cache = services.GetService<IOrderBookCache>();
var client = services.GetService<IMultiUserDataWebSocketClient>();
var userProvider = services.GetService<IBinanceApiUserProvider>();

using (var controller1 = new RetryTaskController())
using (var controller2 = new RetryTaskController())
using (var user = new BinanceApiUser(key, secret))
using (var user = userProvider.CreateUser(key, secret))
{
// Query and display order book and current asset balance.
var balance = (await api.GetAccountInfoAsync(user)).GetBalance(asset);
Expand Down
4 changes: 3 additions & 1 deletion src/Binance/Asset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public sealed class Asset : IComparable<Asset>, IEquatable<Asset>
/// <summary>
/// When the assets were last updated.
/// </summary>
public static readonly long LastUpdateAt = 1517170491339;
public static readonly long LastUpdateAt = 1517441739039;

// Redirect (BCH) Bitcoin Cash (BCC = BitConnect)
public static readonly Asset BCH;
Expand All @@ -40,6 +40,7 @@ public sealed class Asset : IComparable<Asset>, IEquatable<Asset>
public static readonly Asset BTG = new Asset("BTG", 8);
public static readonly Asset BTS = new Asset("BTS", 8);
public static readonly Asset CDT = new Asset("CDT", 8);
public static readonly Asset CHAT = new Asset("CHAT", 8);
public static readonly Asset CMT = new Asset("CMT", 8);
public static readonly Asset CND = new Asset("CND", 8);
public static readonly Asset CTR = new Asset("CTR", 8);
Expand Down Expand Up @@ -175,6 +176,7 @@ public static implicit operator Asset(string s)
{ "BTG", BTG },
{ "BTS", BTS },
{ "CDT", CDT },
{ "CHAT", CHAT },
{ "CMT", CMT },
{ "CND", CND },
{ "CTR", CTR },
Expand Down
6 changes: 5 additions & 1 deletion src/Binance/Symbol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public sealed class Symbol : IComparable<Symbol>, IEquatable<Symbol>
/// <summary>
/// When the symbols (currency pairs) were last updated.
/// </summary>
public static readonly long LastUpdateAt = 1517170491339;
public static readonly long LastUpdateAt = 1517441739039;

// Redirect (BCH) Bitcoin Cash (BCC = BitConnect)
public static readonly Symbol BCH_USDT;
Expand Down Expand Up @@ -47,6 +47,7 @@ public sealed class Symbol : IComparable<Symbol>, IEquatable<Symbol>
public static readonly Symbol BTG_BTC = new Symbol(SymbolStatus.Trading, Asset.BTG, Asset.BTC, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00000100m, 100000.00000000m, 0.00000100m), 0.00200000m, true, new [] {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit});
public static readonly Symbol BTS_BTC = new Symbol(SymbolStatus.Trading, Asset.BTS, Asset.BTC, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000001m, 100000.00000000m, 0.00000001m), 0.00200000m, true, new [] {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit});
public static readonly Symbol CDT_BTC = new Symbol(SymbolStatus.Trading, Asset.CDT, Asset.BTC, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000001m, 100000.00000000m, 0.00000001m), 0.00200000m, true, new [] {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit});
public static readonly Symbol CHAT_BTC = new Symbol(SymbolStatus.Trading, Asset.CHAT, Asset.BTC, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000001m, 100000.00000000m, 0.00000001m), 0.00200000m, true, new [] {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit});
public static readonly Symbol CMT_BTC = new Symbol(SymbolStatus.Trading, Asset.CMT, Asset.BTC, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000001m, 100000.00000000m, 0.00000001m), 0.00200000m, true, new [] {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit});
public static readonly Symbol CND_BTC = new Symbol(SymbolStatus.Trading, Asset.CND, Asset.BTC, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000001m, 100000.00000000m, 0.00000001m), 0.00200000m, true, new [] {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit});
public static readonly Symbol CTR_BTC = new Symbol(SymbolStatus.Trading, Asset.CTR, Asset.BTC, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000001m, 100000.00000000m, 0.00000001m), 0.00200000m, true, new [] {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit});
Expand Down Expand Up @@ -152,6 +153,7 @@ public sealed class Symbol : IComparable<Symbol>, IEquatable<Symbol>
public static readonly Symbol BTG_ETH = new Symbol(SymbolStatus.Trading, Asset.BTG, Asset.ETH, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00000100m, 100000.00000000m, 0.00000100m), 0.02000000m, true, new [] {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit});
public static readonly Symbol BTS_ETH = new Symbol(SymbolStatus.Trading, Asset.BTS, Asset.ETH, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000001m, 100000.00000000m, 0.00000001m), 0.02000000m, true, new [] {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit});
public static readonly Symbol CDT_ETH = new Symbol(SymbolStatus.Trading, Asset.CDT, Asset.ETH, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000001m, 100000.00000000m, 0.00000001m), 0.02000000m, true, new [] {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit});
public static readonly Symbol CHAT_ETH = new Symbol(SymbolStatus.Trading, Asset.CHAT, Asset.ETH, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000001m, 100000.00000000m, 0.00000001m), 0.02000000m, true, new [] {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit});
public static readonly Symbol CMT_ETH = new Symbol(SymbolStatus.Trading, Asset.CMT, Asset.ETH, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000001m, 100000.00000000m, 0.00000001m), 0.02000000m, true, new [] {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit});
public static readonly Symbol CND_ETH = new Symbol(SymbolStatus.Trading, Asset.CND, Asset.ETH, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000001m, 100000.00000000m, 0.00000001m), 0.02000000m, true, new [] {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit});
public static readonly Symbol CTR_ETH = new Symbol(SymbolStatus.Trading, Asset.CTR, Asset.ETH, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000010m, 100000.00000000m, 0.00000010m), 0.02000000m, true, new [] {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit});
Expand Down Expand Up @@ -361,6 +363,8 @@ public static implicit operator Symbol(string s)
{ "BTSETH", BTS_ETH },
{ "CDTBTC", CDT_BTC },
{ "CDTETH", CDT_ETH },
{ "CHATBTC", CHAT_BTC },
{ "CHATETH", CHAT_ETH },
{ "CMTBNB", CMT_BNB },
{ "CMTBTC", CMT_BTC },
{ "CMTETH", CMT_ETH },
Expand Down

0 comments on commit 3873ecb

Please sign in to comment.