mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-08-11 16:32:57 +00:00
Updated examples
This commit is contained in:
@@ -2,15 +2,11 @@ using System.Collections.Generic;
|
||||
using Binance.Net;
|
||||
using Binance.Net.Clients;
|
||||
using Binance.Net.Interfaces.Clients;
|
||||
using Binance.Net.Objects;
|
||||
using Bitfinex.Net;
|
||||
using Bittrex.Net;
|
||||
using Bybit.Net;
|
||||
using CoinEx.Net;
|
||||
using CoinEx.Net.Clients;
|
||||
using CoinEx.Net.Interfaces.Clients;
|
||||
using CryptoExchange.Net.Authentication;
|
||||
using FTX.Net;
|
||||
using Huobi.Net;
|
||||
using Kraken.Net;
|
||||
using Kucoin.Net;
|
||||
@@ -43,35 +39,18 @@ namespace BlazorClient
|
||||
services.AddServerSideBlazor();
|
||||
|
||||
// Register the clients, options can be provided in the callback parameter
|
||||
services.AddBinance((restClientOptions, socketClientOptions) => {
|
||||
restClientOptions.ApiCredentials = new ApiCredentials("KEY", "SECRET");
|
||||
restClientOptions.LogLevel = LogLevel.Trace;
|
||||
|
||||
// Point the logging to use the ILogger configuration, which uses Serilog here
|
||||
restClientOptions.LogWriters = new List<ILogger> { _loggerFactory.CreateLogger<IBinanceClient>() };
|
||||
|
||||
socketClientOptions.ApiCredentials = new ApiCredentials("KEY", "SECRET");
|
||||
});
|
||||
|
||||
BinanceClient.SetDefaultOptions(new BinanceClientOptions
|
||||
services.AddBinance(restOptions =>
|
||||
{
|
||||
ApiCredentials = new ApiCredentials("KEY", "SECRET"),
|
||||
LogLevel = LogLevel.Trace
|
||||
});
|
||||
|
||||
BinanceSocketClient.SetDefaultOptions(new BinanceSocketClientOptions
|
||||
restOptions.ApiCredentials = new ApiCredentials("KEY", "SECRET");
|
||||
}, socketOptions =>
|
||||
{
|
||||
ApiCredentials = new ApiCredentials("KEY", "SECRET"),
|
||||
socketOptions.ApiCredentials = new ApiCredentials("KEY", "SECRET");
|
||||
});
|
||||
|
||||
services.AddTransient<IBinanceClient, BinanceClient>();
|
||||
services.AddScoped<IBinanceSocketClient, BinanceSocketClient>();
|
||||
|
||||
services.AddBitfinex();
|
||||
services.AddBittrex();
|
||||
services.AddBybit();
|
||||
services.AddCoinEx();
|
||||
services.AddFTX();
|
||||
services.AddHuobi();
|
||||
services.AddKraken();
|
||||
services.AddKucoin();
|
||||
|
||||
Reference in New Issue
Block a user