/// <summary> /// Constructor. /// </summary> /// <param name="client"></param> /// <param name="orderBookSerializer"></param> /// <param name="orderBookTopSerializer"></param> /// <param name="aggregateTradeSerializer"></param> /// <param name="candlestickSerializer"></param> /// <param name="symbolPriceSerializer"></param> /// <param name="symbolStatisticsSerializer"></param> /// <param name="accountTradeSerializer"></param> /// <param name="tradeSerializer"></param> /// <param name="orderSerializer"></param> /// <param name="logger"></param> public BinanceApi( IBinanceHttpClient client, IOrderBookSerializer orderBookSerializer = null, IOrderBookTopSerializer orderBookTopSerializer = null, IAggregateTradeSerializer aggregateTradeSerializer = null, ICandlestickSerializer candlestickSerializer = null, ISymbolPriceSerializer symbolPriceSerializer = null, ISymbolStatisticsSerializer symbolStatisticsSerializer = null, IAccountTradeSerializer accountTradeSerializer = null, ITradeSerializer tradeSerializer = null, IOrderSerializer orderSerializer = null, ILogger <BinanceApi> logger = null) { Throw.IfNull(client, nameof(client)); HttpClient = client; _orderBookSerializer = orderBookSerializer ?? new OrderBookSerializer(); _orderBookTopSerializer = orderBookTopSerializer ?? new OrderBookTopSerializer(); _aggregateTradeSerializer = aggregateTradeSerializer ?? new AggregateTradeSerializer(); _candlestickSerializer = candlestickSerializer ?? new CandlestickSerializer(); _symbolPriceSerializer = symbolPriceSerializer ?? new SymbolPriceSerializer(); _symbolStatisticsSerializer = symbolStatisticsSerializer ?? new SymbolStatisticsSerializer(); _accountTradeSerializer = accountTradeSerializer ?? new AccountTradeSerializer(); _tradeSerializer = tradeSerializer ?? new TradeSerializer(); _orderSerializer = orderSerializer ?? new OrderSerializer(); _logger = logger; }
/// <summary> /// Constructor. /// </summary> /// <param name="client"></param> /// <param name="orderBookSerializer"></param> /// <param name="logger"></param> public BinanceApi( IBinanceHttpClient client, IOrderBookSerializer orderBookSerializer = null, ITradeSerializer tradeSerializer = null, IOrderSerializer orderSerializer = null, ILogger <BinanceApi> logger = null) { Throw.IfNull(client, nameof(client)); HttpClient = client; _orderBookSerializer = orderBookSerializer ?? new OrderBookSerializer(); _tradeSerializer = tradeSerializer ?? new TradeSerializer(); _orderSerializer = orderSerializer ?? new OrderSerializer(); _logger = logger; }