public DepositWalletsBalanceProcessingPeriodicalHandler(
            ILogFactory logFactory,
            TimeSpan period,
            int batchSize,
            string blockchainType,
            IBlockchainApiClientProvider blockchainApiClientProvider,
            ICqrsEngine cqrsEngine,
            IAssetsServiceWithCache assetsService,
            IEnrolledBalanceRepository enrolledBalanceRepository,
            IHotWalletsProvider hotWalletsProvider,
            ICashinRepository cashinRepository,
            IDepositWalletLockRepository depositWalletLockRepository,
            IChaosKitty chaosKitty)
        {
            _logFactory                  = logFactory;
            _batchSize                   = batchSize;
            _blockchainType              = blockchainType;
            _blockchainApiClient         = blockchainApiClientProvider.Get(blockchainType);
            _cqrsEngine                  = cqrsEngine;
            _assetsService               = assetsService;
            _enrolledBalanceRepository   = enrolledBalanceRepository;
            _hotWalletsProvider          = hotWalletsProvider;
            _cashinRepository            = cashinRepository;
            _depositWalletLockRepository = depositWalletLockRepository;
            _chaosKitty                  = chaosKitty;

            _timer = new TimerTrigger(
                $"{nameof(DepositWalletsBalanceProcessingPeriodicalHandler)} : {blockchainType}",
                period,
                _logFactory);

            _timer.Triggered += ProcessBalancesAsync;
        }
Beispiel #2
0
 public WalletService(
     IBlockchainApiClientProvider blockchainApiClientProvider,
     IEnrolledBalanceRepository enrolledBalanceRepository,
     AssetService assetService)
 {
     _blockchainApiClientProvider = blockchainApiClientProvider;
     _enrolledBalanceRepository   = enrolledBalanceRepository;
     _assetService = assetService;
 }
 public InMemoryDecoratorEnrolledBalanceRepository(
     ILogger <InMemoryDecoratorEnrolledBalanceRepository> logger,
     IEnrolledBalanceRepository enrolledBalanceRepository,
     IMemoryCache memCache)
 {
     _logger = logger;
     _enrolledBalanceRepository = enrolledBalanceRepository;
     _memCache = memCache;
 }
 public LockDepositWalletCommandsHandler(
     IChaosKitty chaosKitty,
     IDepositWalletLockRepository depositWalletLockRepository,
     IEnrolledBalanceRepository enrolledBalanceRepository)
 {
     _chaosKitty = chaosKitty;
     _depositWalletLockRepository = depositWalletLockRepository;
     _enrolledBalanceRepository   = enrolledBalanceRepository;
 }
        public BalanceProcessorService(
            string blockchainId,
            ILogger <BalanceProcessorService> log,
            IBlockchainApiClient blockchainApiClient,
            IEnrolledBalanceRepository enrolledBalanceRepository,
            IOperationRepository operationRepository,
            IReadOnlyDictionary <string, BlockchainAsset> blockchainAssets)
        {
            _blockchainId              = blockchainId;
            _log                       = log;
            _blockchainApiClient       = blockchainApiClient;
            _enrolledBalanceRepository = enrolledBalanceRepository;
            _blockchainAssets          = blockchainAssets;
            _operationRepository       = operationRepository;

            _warningAssets = new HashSet <string>();
        }
Beispiel #6
0
        public BalanceProcessor(
            string blockchainType,
            ILogFactory logFactory,
            IHotWalletsProvider hotWalletsProvider,
            IBlockchainApiClient blockchainApiClient,
            ICqrsEngine cqrsEngine,
            IEnrolledBalanceRepository enrolledBalanceRepository,
            IReadOnlyDictionary <string, Asset> assets,
            IReadOnlyDictionary <string, BlockchainAsset> blockchainAssets)
        {
            _blockchainType            = blockchainType;
            _log                       = logFactory.CreateLog(this);
            _hotWalletAddress          = hotWalletsProvider.GetHotWalletAddress(blockchainType);
            _blockchainApiClient       = blockchainApiClient;
            _cqrsEngine                = cqrsEngine;
            _enrolledBalanceRepository = enrolledBalanceRepository;
            _assets                    = assets;
            _blockchainAssets          = blockchainAssets;

            _warningAssets = new HashSet <string>();
        }
Beispiel #7
0
 public BalanceGrpcService(IEnrolledBalanceRepository enrolledBalanceRepository)
 {
     _enrolledBalanceRepository = enrolledBalanceRepository;
 }
 public ResetEnrolledBalanceCommandHandler(IEnrolledBalanceRepository enrolledBalanceRepository)
 {
     _enrolledBalanceRepository = enrolledBalanceRepository;
 }
 public BalanceController(IEnrolledBalanceRepository balanceRepository)
 {
     _balanceRepository = balanceRepository;
 }