Пример #1
0
 public LykkePayErc20DepositContractService(
     [KeyFilter(Constants.LykkePayKey)] IErc223DepositContractRepository contractRepository,
     [KeyFilter(Constants.LykkePayKey)] IHotWalletOperationRepository operationsRepository,
     IContractService contractService,
     IErc20DepositContractQueueServiceFactory poolFactory,
     IBaseSettings settings,
     ILog log,
     IWeb3 web3,
     AppSettings appSettings,
     IQueueFactory factory,
     IErcInterfaceService ercInterfaceService,
     IUserTransferWalletRepository userTransferWalletRepository)
 {
     _contractRepository = contractRepository;
     _contractService    = contractService;
     _poolFactory        = poolFactory;
     _settings           = settings;
     _log                          = log;
     _web3                         = web3;
     _appSettings                  = appSettings;
     _transferQueue                = factory.Build(Constants.LykkePayErc223TransferQueue);
     _ercInterfaceService          = ercInterfaceService;
     _operationsRepository         = operationsRepository;
     _userTransferWalletRepository = userTransferWalletRepository;
 }
Пример #2
0
 public HotWalletService(IBaseSettings baseSettings,
                         IQueueFactory queueFactory,
                         IHotWalletOperationRepository hotWalletCashoutRepository,
                         IPrivateWalletService privateWalletService,
                         IErc20PrivateWalletService erc20PrivateWalletService,
                         ISignatureService signatureService,
                         ILog log,
                         Web3 web3,
                         IHotWalletTransactionRepository hotWalletCashoutTransactionRepository,
                         [KeyFilter(Constants.DefaultKey)] IErc20DepositContractService erc20DepositContractService,
                         AppSettings settingsWrapper,
                         IUserTransferWalletRepository userTransferWalletRepository,
                         IGasPriceRepository gasPriceRepository)
 {
     _hotWalletTransactionMonitoringQueue = queueFactory.Build(Constants.HotWalletTransactionMonitoringQueue);
     _hotWalletCashoutQueue      = queueFactory.Build(Constants.HotWalletCashoutQueue);
     _baseSettings               = baseSettings;//.HotWalletAddress
     _hotWalletCashoutRepository = hotWalletCashoutRepository;
     _privateWalletService       = privateWalletService;
     _erc20PrivateWalletService  = erc20PrivateWalletService;
     _log  = log;
     _web3 = web3;
     _hotWalletCashoutTransactionRepository = hotWalletCashoutTransactionRepository;
     _signatureService             = signatureService;
     _erc20DepositContractService  = erc20DepositContractService;
     _settingsWrapper              = settingsWrapper;
     _userTransferWalletRepository = userTransferWalletRepository;
     _semaphores         = new ConcurrentDictionary <string, SemaphoreSlim>();
     _gasPriceRepository = gasPriceRepository;
 }
 public MonitoringTransferContracts(IBaseSettings settings,
                                    IErcInterfaceService ercInterfaceService,
                                    ITransferContractRepository transferContractsRepository,
                                    ILog logger,
                                    IPaymentService paymentService,
                                    IUserPaymentRepository userPaymentRepository,
                                    TransferContractService transferContractService,
                                    IUserTransferWalletRepository userTransferWalletRepository,
                                    ITransferContractTransactionService transferContractTransactionService,
                                    IEthereumTransactionService ethereumTransactionService,
                                    ITransferContractUserAssignmentQueueService transferContractUserAssignmentQueueService,
                                    IUserAssignmentFailRepository userAssignmentFailRepository,
                                    IQueueFactory queueFactory,
                                    ISlackNotifier slackNotifier
                                    )
 {
     _util = new AddressUtil();
     _ethereumTransactionService = ethereumTransactionService;
     _ercInterfaceService        = ercInterfaceService;
     _settings = settings;
     _transferContractsRepository = transferContractsRepository;
     _logger                                     = logger;
     _paymentService                             = paymentService;
     _userPaymentRepository                      = userPaymentRepository;
     _transferContractService                    = transferContractService;
     _userTransferWalletRepository               = userTransferWalletRepository;
     _transferContractTransactionService         = transferContractTransactionService;
     _transferContractUserAssignmentQueueService = transferContractUserAssignmentQueueService;
     _userAssignmentFailRepository               = userAssignmentFailRepository;
     _queueUserAssignment                        = queueFactory.Build(Constants.TransferContractUserAssignmentQueueName);
     _slackNotifier                              = slackNotifier;
 }
Пример #4
0
 public AirlinesHotWalletMonitoringTransactionJob(ILog log,
                                                  ICoinTransactionService coinTransactionService,
                                                  AppSettings settings,
                                                  ISlackNotifier slackNotifier,
                                                  IEthereumTransactionService ethereumTransactionService,
                                                  [KeyFilter(Constants.AirLinesKey)] IHotWalletTransactionRepository hotWalletCashoutTransactionRepository,
                                                  [KeyFilter(Constants.AirLinesKey)] IHotWalletOperationRepository hotWalletCashoutRepository,
                                                  IRabbitQueuePublisher rabbitQueuePublisher,
                                                  ILykkePayEventsService transactionEventsService,
                                                  IUserTransferWalletRepository userTransferWalletRepository,
                                                  [KeyFilter(Constants.AirLinesKey)] IAirlinesErc20DepositContractService erc20DepositContractService,
                                                  IQueueFactory queueFactory)
 {
     _transactionEventsService   = transactionEventsService;
     _ethereumTransactionService = ethereumTransactionService;
     _settings = settings;
     _log      = log;
     _coinTransactionService = coinTransactionService;
     _slackNotifier          = slackNotifier;
     _hotWalletCashoutTransactionRepository = hotWalletCashoutTransactionRepository;
     _hotWalletCashoutRepository            = hotWalletCashoutRepository;
     _rabbitQueuePublisher         = rabbitQueuePublisher;
     _userTransferWalletRepository = userTransferWalletRepository;
     _erc20DepositContractService  = erc20DepositContractService;
     _transferStartQueue           = queueFactory.Build(Constants.AirlinesErc223TransferQueue);
 }
 public Erc20DepositTransactionService(IQueueFactory queueFactory,
                                       ILog logger,
                                       IExchangeContractService coinContractService,
                                       IBaseSettings baseSettings,
                                       IErc20DepositContractService erc20DepositContractService,
                                       TransferContractService transferContractService,
                                       IUserTransferWalletRepository userTransferWalletRepository,
                                       IUserPaymentHistoryRepository userPaymentHistoryRepository,
                                       ICoinTransactionService cointTransactionService,
                                       ICoinTransactionRepository coinTransactionRepository,
                                       ICoinEventService coinEventService,
                                       IEventTraceRepository eventTraceRepository,
                                       IErcInterfaceService ercInterfaceService,
                                       SettingsWrapper settingsWrapper,
                                       IHotWalletService hotWalletService)
 {
     _eventTraceRepository = eventTraceRepository;
     _logger       = logger;
     _baseSettings = baseSettings;
     _queue        = queueFactory.Build(Constants.Erc20DepositCashinTransferQueue);
     _erc20DepositContractService  = erc20DepositContractService;
     _transferContractService      = transferContractService;
     _userTransferWalletRepository = userTransferWalletRepository;
     _userPaymentHistoryRepository = userPaymentHistoryRepository;
     _cointTransactionService      = cointTransactionService;
     _coinTransactionRepository    = coinTransactionRepository;
     _coinEventService             = coinEventService;
     _ercInterfaceService          = ercInterfaceService;
     _hotWalletAddress             = settingsWrapper.Ethereum.HotwalletAddress;
     _hotWalletService             = hotWalletService;
 }
 public MonitoringCoinTransactionJob(ILog log, ICoinTransactionService coinTransactionService,
                                     IBaseSettings settings, ISlackNotifier slackNotifier, ICoinEventService coinEventService,
                                     IPendingTransactionsRepository pendingTransactionsRepository,
                                     IPendingOperationService pendingOperationService,
                                     ITransactionEventsService transactionEventsService,
                                     IEventTraceRepository eventTraceRepository,
                                     IUserTransferWalletRepository userTransferWalletRepository,
                                     IEthereumTransactionService ethereumTransactionService,
                                     IBlackListAddressesRepository blackListAddressesRepository,
                                     IWhiteListAddressesRepository whiteListAddressesRepository)
 {
     _ethereumTransactionService = ethereumTransactionService;
     _transactionEventsService   = transactionEventsService;
     _settings = settings;
     _log      = log;
     _coinTransactionService           = coinTransactionService;
     _slackNotifier                    = slackNotifier;
     _coinEventService                 = coinEventService;
     _pendingTransactionsRepository    = pendingTransactionsRepository;
     _pendingOperationService          = pendingOperationService;
     _eventTraceRepository             = eventTraceRepository;
     _userTransferWalletRepository     = userTransferWalletRepository;
     _broadcastMonitoringPeriodSeconds = TimeSpan.FromSeconds(_settings.BroadcastMonitoringPeriodSeconds);
     _blackListAddressesRepository     = blackListAddressesRepository;
     _whiteListAddressesRepository     = whiteListAddressesRepository;
 }
Пример #7
0
 public TransferContractTransactionService(Func <string, IQueueExt> queueFactory,
                                           ILog logger,
                                           IExchangeContractService coinContractService,
                                           IBaseSettings baseSettings,
                                           ITransferContractRepository transferContractRepository,
                                           TransferContractService transferContractService,
                                           IUserTransferWalletRepository userTransferWalletRepository,
                                           IUserPaymentHistoryRepository userPaymentHistoryRepository,
                                           ICoinTransactionService cointTransactionService,
                                           ICoinTransactionRepository coinTransactionRepository,
                                           ICoinEventService coinEventService,
                                           IEventTraceRepository eventTraceRepository)
 {
     _eventTraceRepository = eventTraceRepository;
     _logger       = logger;
     _baseSettings = baseSettings;
     _queue        = queueFactory(Constants.ContractTransferQueue);
     _transferContractRepository   = transferContractRepository;
     _transferContractService      = transferContractService;
     _userTransferWalletRepository = userTransferWalletRepository;
     _userPaymentHistoryRepository = userPaymentHistoryRepository;
     _cointTransactionService      = cointTransactionService;
     _coinTransactionRepository    = coinTransactionRepository;
     _coinEventService             = coinEventService;
 }
Пример #8
0
        public static async Task <IUserTransferWallet> GetUserTransferWalletAsync(IUserTransferWalletRepository userTransferWalletRepository,
                                                                                  string contractAddress, string erc20TokenAddress, string userAddress)
        {
            string formattedAddress =
                userTransferWalletRepository.FormatAddressForErc20(contractAddress, erc20TokenAddress).ToLower();
            IUserTransferWallet wallet =
                await userTransferWalletRepository.GetUserContractAsync(userAddress, formattedAddress);

            return(wallet);
        }
Пример #9
0
        public static async Task UpdateUserTransferWalletAsync(IUserTransferWalletRepository userTransferWalletRepository,
                                                               string contractAddress, string erc20TokenAddress, string userAddress, string balance = "")
        {
            string formattedAddress =
                userTransferWalletRepository.FormatAddressForErc20(contractAddress?.ToLower(), erc20TokenAddress?.ToLower());

            await userTransferWalletRepository.ReplaceAsync(new UserTransferWallet()
            {
                LastBalance             = balance,
                TransferContractAddress = formattedAddress,
                UpdateDate  = DateTime.UtcNow,
                UserAddress = userAddress
            });
        }
 public Erc20DepositTransactionService(IQueueFactory queueFactory,
                                       ILog logger,
                                       IUserTransferWalletRepository userTransferWalletRepository,
                                       IUserPaymentHistoryRepository userPaymentHistoryRepository,
                                       IErcInterfaceService ercInterfaceService,
                                       AppSettings settingsWrapper,
                                       IHotWalletService hotWalletService,
                                       ISlackNotifier slackNotifier)
 {
     _logger = logger;
     _queue  = queueFactory.Build(Constants.Erc20DepositCashinTransferQueue);
     _userTransferWalletRepository = userTransferWalletRepository;
     _userPaymentHistoryRepository = userPaymentHistoryRepository;
     _ercInterfaceService          = ercInterfaceService;
     _hotWalletAddress             = settingsWrapper.Ethereum.HotwalletAddress;
     _hotWalletService             = hotWalletService;
     _cointTransactionQueue        = queueFactory.Build(Constants.HotWalletTransactionMonitoringQueue);
     _slackNotifier = slackNotifier;
 }