diff --git a/Examples/BlazorClient/BlazorClient.csproj b/Examples/BlazorClient/BlazorClient.csproj index 102db8a..a5ee220 100644 --- a/Examples/BlazorClient/BlazorClient.csproj +++ b/Examples/BlazorClient/BlazorClient.csproj @@ -5,15 +5,15 @@ - - - - - - - - - + + + + + + + + + diff --git a/Examples/BlazorClient/Pages/Index.razor b/Examples/BlazorClient/Pages/Index.razor index 3971b1c..6e19cba 100644 --- a/Examples/BlazorClient/Pages/Index.razor +++ b/Examples/BlazorClient/Pages/Index.razor @@ -10,7 +10,7 @@ @inject IKucoinClient kucoinClient

BTC-USD prices:

-@foreach(var price in _prices) +@foreach(var price in _prices.OrderBy(p => p.Key)) {
@price.Key: @price.Value
} diff --git a/Examples/BlazorClient/Pages/LiveData.razor b/Examples/BlazorClient/Pages/LiveData.razor index e11fdab..8fdd989 100644 --- a/Examples/BlazorClient/Pages/LiveData.razor +++ b/Examples/BlazorClient/Pages/LiveData.razor @@ -22,7 +22,7 @@ @implements IDisposable

ETH-BTC prices, live updates:

-@foreach(var price in _prices) +@foreach(var price in _prices.OrderBy(p => p.Key)) {
@price.Key: @price.Value
} diff --git a/Examples/BlazorClient/Pages/OrderBooks.razor b/Examples/BlazorClient/Pages/OrderBooks.razor index fe70f5f..8058d65 100644 --- a/Examples/BlazorClient/Pages/OrderBooks.razor +++ b/Examples/BlazorClient/Pages/OrderBooks.razor @@ -11,13 +11,13 @@ @using Huobi.Net.SymbolOrderBooks @using Kraken.Net.SymbolOrderBooks @using Kucoin.Net.Clients -@using Kucoin.Net.SymbolOrderBook +@using Kucoin.Net.SymbolOrderBooks @using System.Collections.Concurrent @using System.Timers @implements IDisposable

ETH-BTC books, live updates:

-@foreach(var book in _books) +@foreach(var book in _books.OrderBy(p => p.Key)) {

@book.Key

@@ -25,7 +25,7 @@ { for (var i = 0; i < 3; i++) { -
@book.Value.Asks.ElementAt(i).Price - @book.Value.Bids.ElementAt(i).Price
+
@book.Value.Bids.ElementAt(i).Price - @book.Value.Asks.ElementAt(i).Price
} }
diff --git a/Examples/BlazorClient/Pages/ExchangeClient.razor b/Examples/BlazorClient/Pages/SpotClient.razor similarity index 56% rename from Examples/BlazorClient/Pages/ExchangeClient.razor rename to Examples/BlazorClient/Pages/SpotClient.razor index a8ecde6..2b658a3 100644 --- a/Examples/BlazorClient/Pages/ExchangeClient.razor +++ b/Examples/BlazorClient/Pages/SpotClient.razor @@ -1,4 +1,4 @@ -@page "/ExchangeClient" +@page "/SpotClient" @inject IBinanceClient binanceClient @inject IBitfinexClient bitfinexClient @inject IBittrexClient bittrexClient @@ -13,34 +13,34 @@ @using Bittrex.Net.Clients.SpotApi @using Bybit.Net.Clients.SpotApi @using CoinEx.Net.Clients.SpotApi -@using CryptoExchange.Net.ExchangeInterfaces +@using CryptoExchange.Net.Interfaces @using FTX.Net.Clients.TradeApi @using Huobi.Net.Clients.SpotApi @using Kraken.Net.Clients.SpotApi @using Kucoin.Net.Clients.SpotApi

ETH-BTC prices:

-@foreach(var price in _prices) +@foreach(var price in _prices.OrderBy(p => p.Key)) {
@price.Key: @price.Value
} @code{ - private Dictionary _prices = new Dictionary(); + private Dictionary _prices = new Dictionary(); protected override async Task OnInitializedAsync() { - var clients = new IExchangeClient[] + var clients = new ISpotClient[] { - binanceClient.SpotApi.AsExchangeClient(), - bitfinexClient.SpotApi.AsExchangeClient(), - bittrexClient.SpotApi.AsExchangeClient(), - bybitClient.SpotApi.AsExchangeClient(), - coinexClient.SpotApi.AsExchangeClient(), - ftxClient.TradeApi.AsExchangeClient(), - huobiClient.SpotApi.AsExchangeClient(), - krakenClient.SpotApi.AsExchangeClient(), - kucoinClient.SpotApi.AsExchangeClient() + binanceClient.SpotApi.ComonSpotClient, + bitfinexClient.SpotApi.ComonSpotClient, + bittrexClient.SpotApi.ComonSpotClient, + bybitClient.SpotApi.ComonSpotClient, + coinexClient.SpotApi.ComonSpotClient, + ftxClient.TradeApi.ComonSpotClient, + huobiClient.SpotApi.ComonSpotClient, + krakenClient.SpotApi.ComonSpotClient, + kucoinClient.SpotApi.ComonSpotClient }; var tasks = clients.Select(c => (c.ExchangeName, c.GetTickerAsync(c.GetSymbolName("ETH", "BTC")))); @@ -49,7 +49,7 @@ { if(task.Item2.Result.Success) // TODO new version - _prices.Add(task.Item1, task.Item2.Result.Data.CommonHighPrice); + _prices.Add(task.Item1, task.Item2.Result.Data.HighPrice); } } diff --git a/Examples/BlazorClient/Program.cs b/Examples/BlazorClient/Program.cs index 985c8c2..19bee04 100644 --- a/Examples/BlazorClient/Program.cs +++ b/Examples/BlazorClient/Program.cs @@ -1,11 +1,5 @@ using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace BlazorClient { diff --git a/Examples/BlazorClient/Shared/NavMenu.razor b/Examples/BlazorClient/Shared/NavMenu.razor index 962c016..63bcaaf 100644 --- a/Examples/BlazorClient/Shared/NavMenu.razor +++ b/Examples/BlazorClient/Shared/NavMenu.razor @@ -13,8 +13,8 @@