public QuoteValueCriterionSubscriptionCommand(QuoteValueCriterionSubscriptionRequest request,
                                               ISubscriptionsManager subscriptionsManager, IExchangeRatesProvider exchangeRatesProvider)
 {
     _request = request ?? throw new ArgumentException($"{nameof(QuoteValueCriterionSubscriptionRequest)} {MessageTexts.NotSpecified}");
     _subscriptionsManager  = subscriptionsManager ?? throw new ArgumentException($"{nameof(ISubscriptionsManager)} {MessageTexts.NotSpecified}");
     _exchangeRatesProvider = exchangeRatesProvider ?? throw new ArgumentException($"{nameof(IExchangeRatesProvider)} {MessageTexts.NotSpecified}");
 }
        public App(IExchangeRatesProvider ratesProvider, ISubscriptionsManager ntSubscriber,
                   AppSettings appSettings, SensitiveSettings sensitiveConfiguration)
        {
            _ratesProvider        = ratesProvider;
            _subscriptionsManager = ntSubscriber;

            AppSettings = appSettings;
            if (AppSettings == null)
            {
                throw new ArgumentNullException(nameof(AppSettings));
            }

            SensitiveConfiguration = sensitiveConfiguration;
            if (AppSettings.NotificationSettings == null)
            {
                throw new ArgumentNullException(nameof(NotificationSettings));
            }

            Bot = SensitiveConfiguration.ProxyEnabled ?
                  new TelegramBotClient(SensitiveConfiguration.BotApiKey, new WebProxy(SensitiveConfiguration.Proxy))
                : new TelegramBotClient(SensitiveConfiguration.BotApiKey);
            ConfigureBot();

            SetupUsages();
        }
示例#3
0
        public CryptocurrencyExchange(IConsoleWriter consoleWriter, IInputReader inputReader, IExchangeRatesProvider exchangeRatesProvider)
        {
            _inputReader           = inputReader;
            _consoleWriter         = consoleWriter;
            _exchangeRatesProvider = exchangeRatesProvider;

            _exchangeRatesProvider.Run();
        }
 public AccountOperations(IConsoleWriter consoleWriter, IInputReader inputReader, IValidateInput validateInput, IShowUser showUser, IExchangeRatesProvider exchangeRatesProvider, ITransactionService transactionService)
 {
     _consoleWriter         = consoleWriter;
     _validateInput         = validateInput;
     _showUser              = showUser;
     _exchangeRatesProvider = exchangeRatesProvider;
     _transactionService    = transactionService;
     _inputReader           = inputReader;
 }
 public TimedHostedNotificationService(
     NotificationSettings notificationSettings,
     IExchangeRatesProvider exchangeRatesProvider,
     IAssetValueChangedEventHandler assetValueChangedEventHandler,
     ISubscriptionsManager subscriptionsManager)
     : base(notificationSettings.IntervalMilliseconds,
            notificationSettings.DueTimeSpanSeconds)
 {
     _exchangeRatesProvider  = exchangeRatesProvider;
     _subscriptionsManager   = subscriptionsManager;
     AssetValueChangedEvent += async(sender, args) => await assetValueChangedEventHandler.Handle(sender, args);
 }
        public TransactionService(ITransactionRepository transactionRepository, IExchangeRatesProvider exchangeRatesProvider)
        {
            var config = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap <Transaction, TransactionDto>();
                cfg.CreateMap <TransactionDto, Transaction>();
            });

            _mapper = config.CreateMapper();

            _transactionRepository = transactionRepository;
            _exchangeRatesProvider = exchangeRatesProvider;
            _exchangeRatesProvider.Run();
        }
        public WebApiCryptocurrencyExchange(IExchangeRatesProvider exchangeRatesProvider)
        {
            _exchangeRatesProvider = exchangeRatesProvider;

            _exchangeRatesProvider.Run();
        }
示例#8
0
 public CurrencyCalculator(IExchangeRatesProvider xrProvider)
 {
     _xrProvider = xrProvider;
 }
 public CurrencyConverter(IExchangeRatesProvider exchangeRateServiceClient)
 {
     _exchangeRateClient = exchangeRateServiceClient;
 }