示例#1
0
 public OrdersController(
     IRequestContext requestContext,
     ILykkePrincipal lykkePrincipal,
     IClientSessionsClient clientSessionsClient,
     IPersonalDataService personalDataService,
     IKycStatusService kycStatusService,
     IClientAccountClient clientAccountClient,
     IAssetsServiceWithCache assetsServiceWithCache,
     IMatchingEngineClient matchingEngineClient,
     ILimitOrdersRepositoryClient limitOrdersRepository,
     FeeSettings feeSettings,
     IOperationsClient operationsClient,
     BaseSettings baseSettings,
     IcoSettings icoSettings,
     GlobalSettings globalSettings)
 {
     _requestContext         = requestContext;
     _lykkePrincipal         = lykkePrincipal;
     _clientSessionsClient   = clientSessionsClient;
     _personalDataService    = personalDataService;
     _kycStatusService       = kycStatusService;
     _clientAccountClient    = clientAccountClient;
     _assetsServiceWithCache = assetsServiceWithCache;
     _matchingEngineClient   = matchingEngineClient;
     _limitOrdersRepository  = limitOrdersRepository;
     _feeSettings            = feeSettings;
     _operationsClient       = operationsClient;
     _baseSettings           = baseSettings;
     _icoSettings            = icoSettings;
     _globalSettings         = globalSettings;
 }
 public GrpcApiService(
     ISessionService sessionService,
     ISmsVerification smsVerification,
     ILogger <GrpcApiService> logger,
     IAuthService authService,
     IRegistrationTokenService registrationTokenService,
     IEmailVerification emailVerification,
     IPersonalData personalData,
     IClientWalletService clientWalletService,
     IClientAccountManager accountManager,
     IMarketDataService marketDataService,
     IMatchingEngineClient matchingEngineClient)
 {
     _sessionService           = sessionService;
     _smsVerification          = smsVerification;
     _logger                   = logger;
     _authService              = authService;
     _registrationTokenService = registrationTokenService;
     _emailVerification        = emailVerification;
     _personalData             = personalData;
     _clientWalletService      = clientWalletService;
     _accountManager           = accountManager;
     _marketDataService        = marketDataService;
     _matchingEngineClient     = matchingEngineClient;
 }
 public EthereumEventsQueue(AppSettings.RabbitMqSettings config, ILog log,
                            IMatchingEngineClient matchingEngineClient,
                            ICashOperationsRepository cashOperationsRepository,
                            IClientAccountsRepository clientAccountsRepository,
                            ISrvEmailsFacade srvEmailsFacade,
                            IBcnClientCredentialsRepository bcnClientCredentialsRepository,
                            IPaymentTransactionsRepository paymentTransactionsRepository,
                            IWalletCredentialsRepository walletCredentialsRepository,
                            IClientTradesRepository clientTradesRepository,
                            IEthereumTransactionRequestRepository ethereumTransactionRequestRepository,
                            ICachedAssetsService assetsService)
 {
     _log = log;
     _matchingEngineClient                 = matchingEngineClient;
     _cashOperationsRepository             = cashOperationsRepository;
     _clientAccountsRepository             = clientAccountsRepository;
     _srvEmailsFacade                      = srvEmailsFacade;
     _bcnClientCredentialsRepository       = bcnClientCredentialsRepository;
     _paymentTransactionsRepository        = paymentTransactionsRepository;
     _walletCredentialsRepository          = walletCredentialsRepository;
     _clientTradesRepository               = clientTradesRepository;
     _ethereumTransactionRequestRepository = ethereumTransactionRequestRepository;
     _assetsService = assetsService;
     _rabbitConfig  = config;
 }
 public OrdersController(
     IRequestContext requestContext,
     IClientSessionsClient clientSessionsClient,
     IPersonalDataService personalDataService,
     IKycStatusService kycStatusService,
     IClientAccountClient clientAccountClient,
     IAssetsServiceClient assetsServiceClient,
     IMatchingEngineClient matchingEngineClient,
     FeeSettings feeSettings,
     IOperationsClient operationsClient,
     BaseSettings baseSettings,
     IcoSettings icoSettings,
     GlobalSettings globalSettings,
     IHistoryClient historyClient)
 {
     _requestContext       = requestContext;
     _clientSessionsClient = clientSessionsClient;
     _personalDataService  = personalDataService;
     _kycStatusService     = kycStatusService;
     _clientAccountClient  = clientAccountClient;
     _assetsServiceClient  = assetsServiceClient;
     _matchingEngineClient = matchingEngineClient;
     _feeSettings          = feeSettings;
     _operationsClient     = operationsClient;
     _baseSettings         = baseSettings;
     _icoSettings          = icoSettings;
     _globalSettings       = globalSettings;
     _historyClient        = historyClient;
 }
 public MarketOrderOperations(IMatchingEngineClient matchingEngineClient,
                              IFeesClient feesClient, IAccountsClient accountsClient, ILogger <MarketOrderOperations> logger)
 {
     _matchingEngineClient = matchingEngineClient;
     _feesClient           = feesClient;
     _accountsClient       = accountsClient;
     _logger = logger;
 }
示例#6
0
 public CashOperations(IMatchingEngineClient matchingEngineClient,
                       IFeesClient feesClient, IAccountsClient accountsClient, ILogger <CashOperations> logger)
 {
     _matchingEngineClient = matchingEngineClient;
     _feesClient           = feesClient;
     _logger         = logger;
     _accountsClient = accountsClient;
 }
 public LykkeSpotController(IBalancesClient balancesClient, PlaceOrderBookSettings settings, IMatchingEngineClient meclient,
                            OrderRepository orderRepository)
 {
     _balancesClient  = balancesClient;
     _settings        = settings;
     _meclient        = meclient;
     _orderRepository = orderRepository;
 }
示例#8
0
 public WalletsController(
     IBalancesClient balancesClient,
     IMatchingEngineClient matchingEngineClient,
     IMapper mapper)
 {
     _balancesClient       = balancesClient;
     _matchingEngineClient = matchingEngineClient;
     _mapper = mapper;
 }
示例#9
0
 public StartupManager(
     OrderBooksSubscriber orderBooksSubscriber,
     IMatchingEngineClient matchingEngineClient,
     IOrderBooksHandler orderBooksHandler)
 {
     _orderBooksSubscriber = orderBooksSubscriber;
     _matchingEngineClient = matchingEngineClient;
     _orderBooksHandler    = orderBooksHandler;
 }
        public LykkeExchange(ILogFactory logFactory,
                             IMatchingEngineClient matchingEngineClient,
                             string walletId)
        {
            _matchingEngineClient = matchingEngineClient;
            _walletId             = walletId;

            _log = logFactory.CreateLog(this);
        }
示例#11
0
 public LykkeExchangeService(
     IMatchingEngineClient matchingEngineClient,
     ISettingsService settingsService,
     ILogFactory logFactory)
 {
     _matchingEngineClient = matchingEngineClient;
     _settingsService      = settingsService;
     _log = logFactory.CreateLog(this);
 }
 public BurnStrategy(
     IBalanceService balanceService,
     IBurnOptions options,
     ILogFactory logFactory,
     IMatchingEngineClient meClient)
 {
     _balanceService = balanceService;
     _log            = logFactory.CreateLog(this);
     _meClient       = meClient;
     _options        = options;
 }
示例#13
0
 public EnrollToMatchingEngineCommandsHandler(
     IChaosKitty chaosKitty,
     ILogFactory logFactory,
     IBlockchainWalletsClient walletsClient,
     IMatchingEngineCallsDeduplicationRepository deduplicationRepository,
     IMatchingEngineClient meClient)
 {
     _chaosKitty = chaosKitty ?? throw new ArgumentNullException(nameof(chaosKitty));
     _log        = logFactory.CreateLog(this);
     _deduplicationRepository = deduplicationRepository ?? throw new ArgumentNullException(nameof(deduplicationRepository));
     _meClient = meClient ?? throw new ArgumentNullException(nameof(meClient));
 }
 public OrdersController(
     HistoryWrapperClient historyClient,
     ValidationService validationService,
     IMatchingEngineClient matchingEngineClient,
     IMapper mapper
     )
 {
     _historyClient        = historyClient;
     _validationService    = validationService;
     _matchingEngineClient = matchingEngineClient;
     _mapper = mapper;
 }
 public LykkeExchangeService(
     IMatchingEngineClient matchingEngineClient,
     IExchangeOperationsServiceClient exchangeOperationsServiceClient,
     ISettingsService settingsService,
     IReadOnlyDictionary <string, string> assetPairMapping,
     ILogFactory logFactory)
 {
     _matchingEngineClient            = matchingEngineClient;
     _exchangeOperationsServiceClient = exchangeOperationsServiceClient;
     _settingsService  = settingsService;
     _assetPairMapping = assetPairMapping;
     _log = logFactory.CreateLog(this);
 }
示例#16
0
 public TransferStrategy(
     IBalanceService balanceService,
     ILogFactory logFactory,
     IMatchingEngineClient meClient,
     IMigrationRepository migrationRepository,
     ITransferOptions options)
 {
     _balanceService      = balanceService;
     _log                 = logFactory.CreateLog(this);
     _meClient            = meClient;
     _migrationRepository = migrationRepository;
     _options             = options;
 }
 public CashInHandler(
     [NotNull] ILog log,
     [NotNull] IMatchingEngineClient matchingEngineClient,
     [NotNull] ICashOperationsRepositoryClient cashOperationsRepositoryClient,
     [NotNull] IBitcoinCashinRepository bitcoinCashinRepository,
     [NotNull] IPostponedCashInRepository postponedCashInRepository)
 {
     _log = log.CreateComponentScope(nameof(CashInHandler));
     _matchingEngineClient           = matchingEngineClient ?? throw new ArgumentNullException(nameof(matchingEngineClient));
     _cashOperationsRepositoryClient = cashOperationsRepositoryClient ?? throw new ArgumentNullException(nameof(cashOperationsRepositoryClient));
     _bitcoinCashinRepository        = bitcoinCashinRepository ?? throw new ArgumentNullException(nameof(bitcoinCashinRepository));
     _postponedCashInRepository      = postponedCashInRepository ?? throw new ArgumentNullException(nameof(postponedCashInRepository));
 }
示例#18
0
 public EnrollToMatchingEngineCommandsHandler(
     IChaosKitty chaosKitty,
     ILogFactory logFactory,
     IBlockchainWalletsClient walletsClient,
     IMatchingEngineCallsDeduplicationRepository deduplicationRepository,
     IMatchingEngineClient meClient)
 {
     _chaosKitty              = chaosKitty;
     _log                     = logFactory.CreateLog(this);
     _walletsClient           = walletsClient;
     _deduplicationRepository = deduplicationRepository;
     _meClient                = meClient;
 }
示例#19
0
 public OrdersController(
     HistoryHttpClient historyClient,
     ValidationService validationService,
     IMatchingEngineClient matchingEngineClient,
     IMyNoSqlServerDataReader <OrderEntity> ordersReader,
     IMapper mapper
     )
 {
     _historyClient        = historyClient;
     _validationService    = validationService;
     _matchingEngineClient = matchingEngineClient;
     _ordersReader         = ordersReader;
     _mapper = mapper;
 }
示例#20
0
 public ApiService(
     ILykkeWalletAPIv1Client walletApiV1Client,
     ILykkeWalletAPIv2Client walletApiV2Client,
     IAssetsService assetsService,
     AssetsHelper assetsHelper,
     IMyNoSqlServerDataReader <PriceEntity> pricesReader,
     PricesStreamService priceStreamService,
     CandlesStreamService candlesStreamService,
     OrderbookStreamService orderbookStreamService,
     PublicTradesStreamService publicTradesStreamService,
     ICandleshistoryservice candlesHistoryService,
     ValidationService validationService,
     OrderbooksService orderbooksService,
     SessionService sessionService,
     IMatchingEngineClient matchingEngineClient,
     IBalancesClient balancesClient,
     IClientAccountClient clientAccountClient,
     IRateCalculatorClient rateCalculatorClient,
     ITradesAdapterClient tradesAdapterClient,
     IRegistrationServiceClient registrationServiceClient,
     IPushNotificationsClient pushNotificationsClient,
     WalletApiConfig walletApiConfig,
     AppConfig config,
     IMapper mapper
     )
 {
     _walletApiV1Client         = walletApiV1Client;
     _walletApiV2Client         = walletApiV2Client;
     _assetsService             = assetsService;
     _assetsHelper              = assetsHelper;
     _pricesReader              = pricesReader;
     _priceStreamService        = priceStreamService;
     _candlesStreamService      = candlesStreamService;
     _orderbookStreamService    = orderbookStreamService;
     _publicTradesStreamService = publicTradesStreamService;
     _candlesHistoryService     = candlesHistoryService;
     _validationService         = validationService;
     _orderbooksService         = orderbooksService;
     _sessionService            = sessionService;
     _matchingEngineClient      = matchingEngineClient;
     _balancesClient            = balancesClient;
     _clientAccountClient       = clientAccountClient;
     _rateCalculatorClient      = rateCalculatorClient;
     _tradesAdapterClient       = tradesAdapterClient;
     _registrationServiceClient = registrationServiceClient;
     _pushNotificationsClient   = pushNotificationsClient;
     _walletApiConfig           = walletApiConfig;
     _config = config;
     _mapper = mapper;
 }
示例#21
0
 public OrdersController(IRequestContext requestContext,
                         IAssetsServiceWithCache assetsServiceWithCache,
                         IMatchingEngineClient matchingEngineClient,
                         ILimitOrdersRepositoryClient limitOrdersRepository,
                         IFeeCalculatorClient feeCalculatorClient,
                         FeeSettings feeSettings,
                         BaseSettings baseSettings)
 {
     _requestContext         = requestContext;
     _assetsServiceWithCache = assetsServiceWithCache;
     _matchingEngineClient   = matchingEngineClient;
     _limitOrdersRepository  = limitOrdersRepository;
     _feeCalculatorClient    = feeCalculatorClient;
     _feeSettings            = feeSettings;
     _baseSettings           = baseSettings;
 }
示例#22
0
        public MatchingEngineAdapter(IMatchingEngineClient matchingEngineClient,
                                     IFeeCalculatorAdapter feeCalculator,
                                     bool calculateOrderFees,
                                     ILogFactory logFactory)
        {
            _matchingEngineClient = matchingEngineClient ?? throw new ArgumentNullException(nameof(matchingEngineClient));
            _feeCalculator        = feeCalculator ?? throw new ArgumentNullException(nameof(feeCalculator));
            _calculateOrderFees   = calculateOrderFees;

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

            _log = logFactory.CreateLog(this);
        }
示例#23
0
        public static async Task <T> Retry <T>(this IMatchingEngineClient client, Func <IMatchingEngineClient, Task <T> > action,
                                               int times = 5, int waitPeriodInMs = 500)
        {
            var waitPeriod = TimeSpan.FromMilliseconds(waitPeriodInMs);

            for (var i = 0; i < times; i++)
            {
                if (client.IsConnected)
                {
                    return(await action(client));
                }
                Console.WriteLine($"Matching Engine client is not connected. Retrying after {waitPeriod}...");
                await Task.Delay(waitPeriod);
            }

            throw new TimeoutException($"Connection to Matching Engine failed after {times} retries.");
        }
 public DistributionPlanService(
     IAssetsService assetService,
     IClaimedGasAmountRepository claimedGasAmountRepository,
     IDistributionPlanRepository distributionPlanRepository,
     ILogFactory logFactory,
     IMatchingEngineClient matchingEngineClient,
     ISnapshotRepository snapshotRepository,
     string gasAssetId)
 {
     _assetService = assetService;
     _claimedGasAmountRepository = claimedGasAmountRepository;
     _distributionPlanRepository = distributionPlanRepository;
     _gasAssetId           = gasAssetId;
     _log                  = logFactory.CreateLog(this);
     _matchingEngineClient = matchingEngineClient;
     _snapshotRepository   = snapshotRepository;
 }
 public DepositsDetectorService(
     ILastCursorRepository lastCursorRepository,
     IOperationIdsRepository operationIdsRepository,
     IMatchingEngineClient meClient,
     IAssetsServiceWithCache assetsService,
     IApiClient apiClient,
     ICqrsEngine cqrsEngine,
     long brokerAccountId,
     ILogFactory logFactory
     )
 {
     _lastCursorRepository   = lastCursorRepository;
     _operationIdsRepository = operationIdsRepository;
     _meClient        = meClient;
     _assetsService   = assetsService;
     _apiClient       = apiClient;
     _cqrsEngine      = cqrsEngine;
     _brokerAccountId = brokerAccountId;
     _log             = logFactory.CreateLog(this);
 }
示例#26
0
 public PrivateService(
     HistoryHttpClient historyClient,
     IBalanceService balanceService,
     ValidationService validationService,
     IMatchingEngineClient matchingEngineClient,
     IStreamService <BalanceUpdate> balanceUpdateService,
     IStreamService <OrderUpdate> orderUpdateService,
     IStreamService <TradeUpdate> tradeUpdateService,
     IMyNoSqlServerDataReader <OrderEntity> ordersReader,
     IMapper mapper
     )
 {
     _historyClient        = historyClient;
     _balanceService       = balanceService;
     _validationService    = validationService;
     _matchingEngineClient = matchingEngineClient;
     _balanceUpdateService = balanceUpdateService;
     _orderUpdateService   = orderUpdateService;
     _tradeUpdateService   = tradeUpdateService;
     _ordersReader         = ordersReader;
     _mapper = mapper;
 }
示例#27
0
 public PrivateService(
     HistoryWrapperClient historyClient,
     IBalanceService balanceService,
     ValidationService validationService,
     IMatchingEngineClient matchingEngineClient,
     BalancesStreamService balanceUpdateService,
     OrdersStreamService orderUpdateService,
     TradesStreamService tradeUpdateService,
     ISiriusWalletsService siriusWalletsService,
     IMapper mapper
     )
 {
     _historyClient        = historyClient;
     _balanceService       = balanceService;
     _validationService    = validationService;
     _matchingEngineClient = matchingEngineClient;
     _balanceUpdateService = balanceUpdateService;
     _orderUpdateService   = orderUpdateService;
     _tradeUpdateService   = tradeUpdateService;
     _siriusWalletsService = siriusWalletsService;
     _mapper = mapper;
 }
示例#28
0
 public EthereumCoreCommandHandler(
     ILogFactory logFactory,
     IMatchingEngineClient matchingEngineClient,
     ICashOperationsRepositoryClient cashOperationsRepositoryClient,
     IClientAccountClient clientAccountClient,
     ISrvEmailsFacade srvEmailsFacade,
     IBcnClientCredentialsRepository bcnClientCredentialsRepository,
     IPaymentTransactionsRepository paymentTransactionsRepository,
     ITradeOperationsRepositoryClient clientTradesRepositoryClient,
     IEthereumTransactionRequestRepository ethereumTransactionRequestRepository,
     ITransferOperationsRepositoryClient transferEventsRepositoryClient,
     IAssetsServiceWithCache assetsServiceWithCache,
     ITransactionService transactionService,
     IAssetsService assetsService,
     IEthererumPendingActionsRepository ethererumPendingActionsRepository,
     IExchangeOperationsServiceClient exchangeOperationsServiceClient,
     IClientCommentsRepository clientCommentsRepository,
     IPersonalDataService personalDataService)
 {
     _log = logFactory.CreateLog(this);
     _matchingEngineClient           = matchingEngineClient;
     _cashOperationsRepositoryClient = cashOperationsRepositoryClient;
     _clientAccountClient            = clientAccountClient;
     _srvEmailsFacade = srvEmailsFacade;
     _bcnClientCredentialsRepository       = bcnClientCredentialsRepository;
     _paymentTransactionsRepository        = paymentTransactionsRepository;
     _clientTradesRepositoryClient         = clientTradesRepositoryClient;
     _ethereumTransactionRequestRepository = ethereumTransactionRequestRepository;
     _assetsServiceWithCache         = assetsServiceWithCache;
     _transferEventsRepositoryClient = transferEventsRepositoryClient;
     _transactionService             = transactionService;
     _assetsService = assetsService;
     _ethererumPendingActionsRepository = ethererumPendingActionsRepository;
     _exchangeOperationsServiceClient   = exchangeOperationsServiceClient;
     _clientCommentsRepository          = clientCommentsRepository;
     _personalDataService = personalDataService;
 }
 public CashoutProcessorService(
     ILastCursorRepository lastCursorRepository,
     IWithdrawalLogsRepository withdrawalLogsRepository,
     IRefundsRepository refundsRepository,
     IMatchingEngineClient meClient,
     IAssetsServiceWithCache assetsService,
     IApiClient apiClient,
     IOperationsClient operationsClient,
     ICqrsEngine cqrsEngine,
     long brokerAccountId,
     ILogFactory logFactory
     )
 {
     _lastCursorRepository     = lastCursorRepository;
     _withdrawalLogsRepository = withdrawalLogsRepository;
     _refundsRepository        = refundsRepository;
     _meClient         = meClient;
     _assetsService    = assetsService;
     _apiClient        = apiClient;
     _operationsClient = operationsClient;
     _cqrsEngine       = cqrsEngine;
     _brokerAccountId  = brokerAccountId;
     _log = logFactory.CreateLog(this);
 }
 public BalancesService(IMatchingEngineClient matchingEngineClient, IMapper mapper)
 {
     _matchingEngineClient = matchingEngineClient;
     _mapper = mapper;
 }