diff --git a/Examples/BlazorClient/BlazorClient.csproj b/Examples/BlazorClient/BlazorClient.csproj index 69c43da..5ff316f 100644 --- a/Examples/BlazorClient/BlazorClient.csproj +++ b/Examples/BlazorClient/BlazorClient.csproj @@ -5,28 +5,29 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - + + + diff --git a/Examples/BlazorClient/Pages/Index.razor b/Examples/BlazorClient/Pages/Index.razor index 0233664..269fdf2 100644 --- a/Examples/BlazorClient/Pages/Index.razor +++ b/Examples/BlazorClient/Pages/Index.razor @@ -8,6 +8,7 @@ @inject IBybitRestClient bybitClient @inject ICoinbaseRestClient coinbaseClient @inject ICoinExRestClient coinexClient +@inject ICoinWRestClient coinWClient @inject ICryptoComRestClient cryptocomClient @inject IDeepCoinRestClient deepCoinClient @inject IGateIoRestClient gateioClient @@ -41,6 +42,7 @@ var bybitTask = bybitClient.V5Api.ExchangeData.GetSpotTickersAsync("BTCUSDT"); var coinbaseTask = coinbaseClient.AdvancedTradeApi.ExchangeData.GetSymbolAsync("BTC-USDT"); var coinexTask = coinexClient.SpotApiV2.ExchangeData.GetTickersAsync(["BTCUSDT"]); + var coinWTask = coinWClient.SpotApi.ExchangeData.GetTickersAsync(); var cryptocomTask = cryptocomClient.ExchangeApi.ExchangeData.GetTickersAsync("BTC_USDT"); var deepCoinTask = deepCoinClient.ExchangeApi.ExchangeData.GetTickersAsync(DeepCoin.Net.Enums.SymbolType.Spot); var gateioTask = gateioClient.SpotApi.ExchangeData.GetTickersAsync("BTC_USDT"); @@ -83,6 +85,9 @@ if (coinexTask.Result.Success) _prices.Add("CoinEx", coinexTask.Result.Data.Single().LastPrice); + if (coinWTask.Result.Success) + _prices.Add("CoinW", coinWTask.Result.Data.Single(x => x.Symbol == "BTC_USDT").LastPrice); + if (cryptocomTask.Result.Success) _prices.Add("CryptoCom", cryptocomTask.Result.Data.First().LastPrice ?? 0); diff --git a/Examples/BlazorClient/Pages/LiveData.razor b/Examples/BlazorClient/Pages/LiveData.razor index a983589..78318d9 100644 --- a/Examples/BlazorClient/Pages/LiveData.razor +++ b/Examples/BlazorClient/Pages/LiveData.razor @@ -8,6 +8,7 @@ @inject IBybitSocketClient bybitSocketClient @inject ICoinbaseSocketClient coinbaseSocketClient @inject ICoinExSocketClient coinExSocketClient +@inject ICoinWSocketClient coinWSocketClient @inject ICryptoComSocketClient cryptocomSocketClient @inject IDeepCoinSocketClient deepCoinSocketClient @inject IGateIoSocketClient gateioSocketClient @@ -49,6 +50,7 @@ bitmexSocketClient.ExchangeApi.SubscribeToSymbolUpdatesAsync("ETH_XBT", data => UpdateData("BitMEX", data.Data.LastPrice ?? 0)), bybitSocketClient.V5SpotApi.SubscribeToTickerUpdatesAsync("ETHBTC", data => UpdateData("Bybit", data.Data.LastPrice)), coinExSocketClient.SpotApiV2.SubscribeToTickerUpdatesAsync(["ETHBTC"], data => UpdateData("CoinEx", data.Data.First().LastPrice)), + coinWSocketClient.SpotApi.SubscribeToTickerUpdatesAsync("ETH_BTC", data => UpdateData("CoinW", data.Data.LastPrice)), coinbaseSocketClient.AdvancedTradeApi.SubscribeToTickerUpdatesAsync("ETH-BTC", data => UpdateData("Coinbase", data.Data.LastPrice ?? 0)), cryptocomSocketClient.ExchangeApi.SubscribeToTickerUpdatesAsync("ETH_BTC", data => UpdateData("CryptoCom", data.Data.LastPrice ?? 0)), deepCoinSocketClient.ExchangeApi.SubscribeToSymbolUpdatesAsync("ETH-BTC", data => UpdateData("DeepCoin", data.Data.LastPrice ?? 0)), diff --git a/Examples/BlazorClient/Pages/OrderBooks.razor b/Examples/BlazorClient/Pages/OrderBooks.razor index 7d371ef..4a67740 100644 --- a/Examples/BlazorClient/Pages/OrderBooks.razor +++ b/Examples/BlazorClient/Pages/OrderBooks.razor @@ -9,6 +9,7 @@ @using BitMEX.Net.Interfaces; @using Bybit.Net.Interfaces @using CoinEx.Net.Interfaces +@using CoinW.Net.Interfaces @using Coinbase.Net.Interfaces @using CryptoExchange.Net.Authentication @using CryptoExchange.Net.Interfaces @@ -34,6 +35,7 @@ @inject IBybitOrderBookFactory bybitFactory @inject ICoinbaseOrderBookFactory coinbaseFactory @inject ICoinExOrderBookFactory coinExFactory +@inject ICoinWOrderBookFactory coinWFactory @inject ICryptoComOrderBookFactory cryptocomFactory @inject IDeepCoinOrderBookFactory deepCoinFactory @inject IGateIoOrderBookFactory gateioFactory @@ -88,6 +90,7 @@ { "Bybit", bybitFactory.Create("ETHBTC", Bybit.Net.Enums.Category.Spot) }, { "Coinbase", coinbaseFactory.Create("ETH-BTC", null) }, { "CoinEx", coinExFactory.CreateSpot("ETHBTC") }, + { "CoinW", coinWFactory.CreateSpot("ETH_BTC") }, { "CryptoCom", cryptocomFactory.Create("ETH_BTC") }, { "GateIo", gateioFactory.CreateSpot("ETH_BTC") }, // DeepCoin does not support the ETH/BTC pair @@ -115,7 +118,7 @@ public void Dispose() { - _timer.Stop(); + _timer?.Stop(); _timer.Dispose(); foreach (var book in _books.Where(b => b.Value.Status != CryptoExchange.Net.Objects.OrderBookStatus.Disconnected)) // It's not necessary to wait for this diff --git a/Examples/BlazorClient/Pages/Trackers.razor b/Examples/BlazorClient/Pages/Trackers.razor index 7416cec..bb17b72 100644 --- a/Examples/BlazorClient/Pages/Trackers.razor +++ b/Examples/BlazorClient/Pages/Trackers.razor @@ -9,6 +9,7 @@ @using BitMart.Net.Interfaces; @using Bybit.Net.Interfaces @using CoinEx.Net.Interfaces +@using CoinW.Net.Interfaces @using Coinbase.Net.Interfaces @using CryptoExchange.Net.Interfaces @using CryptoCom.Net.Interfaces @@ -35,6 +36,7 @@ @inject IBybitTrackerFactory bybitFactory @inject ICoinbaseTrackerFactory coinbaseFactory @inject ICoinExTrackerFactory coinExFactory +@inject ICoinWTrackerFactory coinWFactory @inject ICryptoComTrackerFactory cryptocomFactory @inject IDeepCoinTrackerFactory deepCoinFactory @inject IGateIoTrackerFactory gateioFactory @@ -82,6 +84,7 @@ { bybitFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, { coinbaseFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, { coinExFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, + { coinWFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, { cryptocomFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, { deepCoinFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, { gateioFactory.CreateTradeTracker(usdtSymbol, period: TimeSpan.FromMinutes(5)) }, @@ -121,8 +124,8 @@ public void Dispose() { - _timer.Stop(); - _timer.Dispose(); + _timer?.Stop(); + _timer?.Dispose(); foreach (var tracker in _trackers.Where(b => b.Status != CryptoExchange.Net.Objects.SyncStatus.Disconnected)) // It's not necessary to wait for this _ = tracker.StopAsync(); diff --git a/Examples/BlazorClient/Startup.cs b/Examples/BlazorClient/Startup.cs index 1e0cb5c..6b1bb33 100644 --- a/Examples/BlazorClient/Startup.cs +++ b/Examples/BlazorClient/Startup.cs @@ -41,6 +41,7 @@ namespace BlazorClient services.AddBybit(); services.AddCoinbase(); services.AddCoinEx(); + services.AddCoinW(); services.AddCryptoCom(); services.AddDeepCoin(); services.AddGateIo(); diff --git a/Examples/BlazorClient/_Imports.razor b/Examples/BlazorClient/_Imports.razor index ce97d67..c47d96f 100644 --- a/Examples/BlazorClient/_Imports.razor +++ b/Examples/BlazorClient/_Imports.razor @@ -17,6 +17,7 @@ @using Bybit.Net.Interfaces.Clients; @using Coinbase.Net.Interfaces.Clients; @using CoinEx.Net.Interfaces.Clients; +@using CoinW.Net.Interfaces.Clients; @using CryptoCom.Net.Interfaces.Clients; @using DeepCoin.Net.Interfaces.Clients; @using GateIo.Net.Interfaces.Clients;