public DrugTransactionService(
     IEthereumService ethereumService,
     ITransactionRepository transactionRepository)
 {
     this.ethereumService       = ethereumService;
     this.transactionRepository = transactionRepository;
 }
 public MedicineBatchTransferBackgroundJob(
     IEthereumService ethereumService,
     IMedicineBatchTransferRepository medicineBatchTransferRepository)
 {
     this.ethereumService = ethereumService;
     this.medicineBatchTransferRepository = medicineBatchTransferRepository;
 }
Beispiel #3
0
 public ManageController(
     UserManager <ApplicationUser> userManager,
     SignInManager <ApplicationUser> signInManager,
     IEmailSender emailSender,
     ILogger <ManageController> logger,
     UrlEncoder urlEncoder,
     IMerchantRepository merchantRepository,
     ITransactionRepository transactionRepository,
     ILogRepository logRepository,
     IMapper mapper,
     IBitcoinService bitcoinService,
     ISubscriptionsRepository subscriptionsRepository,
     IConfiguration configuration,
     IEthereumService ethereumService)
 {
     _userManager             = userManager;
     _signInManager           = signInManager;
     _emailSender             = emailSender;
     _logger                  = logger;
     _merchantRepository      = merchantRepository;
     _transactionRepository   = transactionRepository;
     _logRepository           = logRepository;
     _mapper                  = mapper;
     _bitcoinService          = bitcoinService;
     _subscriptionsRepository = subscriptionsRepository;
     _configuration           = configuration;
     _ethereumService         = ethereumService;
 }
 public EthereumTransactionSearchActionHandler(
     IEthereumService ethereumService,
     IEthereumTransactionMapper <EthereumTransactionDto> mapper)
 {
     _ethereumService = ethereumService;
     _mapper          = mapper;
 }
Beispiel #5
0
 public MusicAssetTransferUndergroundJob(
     IEthereumService ethereumService,
     IMusicAssetTransferRepository musicAssetTransferRepository)
 {
     this.ethereumService = ethereumService;
     this.musicAssetTransferRepository = musicAssetTransferRepository;
 }
        public CryptoProviderService(IBitcoinService bitcoinService, IEthereumService ethereumService)
        {
            registeredServices = new Dictionary <string, ICryptoService>();

            registeredServices.Add("BTC", bitcoinService);
            registeredServices.Add("ETH", ethereumService);
        }
Beispiel #7
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="blockchainRepository">Blockchain repository.</param>
 /// <param name="ethereumService">Ethereum service.</param>
 public MaterialManufacturingService(
     IBlockchainRepository blockchainRepository,
     IEthereumService <MaterialManufacturingDeployment> ethereumService)
 {
     _blockchainRepository = blockchainRepository ?? throw new ArgumentNullException(nameof(blockchainRepository));
     _ethereumService      = ethereumService ?? throw new ArgumentNullException(nameof(ethereumService));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AppService" /> class.
 /// </summary>
 /// <param name="ethereumService">The ethereum service.</param>
 /// <param name="config">The configuration.</param>
 /// <param name="logger">The logger.</param>
 public AppService(IEthereumService ethereumService,
                   IOptions <EthereumSettings> config,
                   ILogger <AppService> logger)
 {
     this.ethereumService = ethereumService;
     this.accountAddress  = config.Value.EhtereumAccount;
     this.logger          = logger;
 }
Beispiel #9
0
 public PKIEncordeService(
     IEthereumService ethereumService,
     IMusicRepository musicRepository,
     IOptions <EthereumSettings> options)
 {
     this.ethereumService = ethereumService;
     this.musicRepository = musicRepository;
     MusicAbi             = options.Value.MusicAbi;
 }
 public TransactionSearchService(
     IEthereumService ethereumService,
     IMapper mapper,
     ILogger <TransactionSearchService> logger)
 {
     _ethereumService = ethereumService;
     _mapper          = mapper;
     _logger          = logger;
 }
 public MedicineBackgroundJob(
     IEthereumService ethereumService,
     IMedicineRepository medicineBatchRepository,
     IOptions <EthereumSettings> options
     )
 {
     this.ethereumService         = ethereumService;
     this.medicineBatchRepository = medicineBatchRepository;
     MedicineAbi = options.Value.MedicineAbi;
 }
 public MedicineBatchService(
     IMedicineBatchRepository medicineBatchRepository,
     IEthereumService ethereumService,
     IOptions <EthereumSettings> options
     )
 {
     this.medicineBatchRepository = medicineBatchRepository;
     this.ethereumService         = ethereumService;
     MedicineBatchAbi             = options.Value.MedicineBatchAbi;
 }
Beispiel #13
0
 public TenantBackgroundJob(
     IEthereumService ethereumService,
     ITenantRepository tenantRepository,
     ITenantService tenantService,
     IOptions <EthereumSettings> options)
 {
     this.ethereumService  = ethereumService;
     this.tenantRepository = tenantRepository;
     this.tenantService    = tenantService;
     TenantAbi             = options.Value.TenantAbi;
 }
Beispiel #14
0
 public MusicAssetTransferService(
     IMusicRepository musicRepository,
     IMusicAssetTransferRepository musicAssetTransferRepository,
     IEthereumService ethereumService,
     IOptions <EthereumSettings> options)
 {
     this.musicRepository = musicRepository;
     this.musicAssetTransferRepository = musicAssetTransferRepository;
     this.ethereumService  = ethereumService;
     MusicAssetTransferAbi = options.Value.MusicAssetTransferAbi;
 }
 public MusicUndergroundJob(
     IEthereumService ethereumService,
     IMusicRepository musicRepository,
     IMusicService musicService,
     IOptions <EthereumSettings> options)
 {
     this.ethereumService = ethereumService;
     this.musicRepository = musicRepository;
     this.musicService    = musicService;
     MusicAbi             = options.Value.MusicAbi;
 }
Beispiel #16
0
 public CertificateService(
     IConfiguration configuration,
     ICertificateRepository certificateRepository,
     IHashValueComputationService hashValueComputationService,
     IEthereumService ethereumService
     )
 {
     this.certificateRepository       = certificateRepository;
     this.hashValueComputationService = hashValueComputationService;
     this.ethereumService             = ethereumService;
 }
 public TenantService(
     IAuth0Service auth0Service,
     IEthereumService ethereumService,
     IDrugTransactionService drugTransactionService,
     ITenantRepository tenantRepository,
     IOptions <EthereumSettings> options)
 {
     this.auth0Service           = auth0Service;
     this.ethereumService        = ethereumService;
     this.drugTransactionService = drugTransactionService;
     this.tenantRepository       = tenantRepository;
     TenantAbi = options.Value.TenantAbi;
 }
 public SyncPersonalWalletCommandHandler(
     IFortifex4DBContext context,
     IDateTimeOffsetService dateTimeOffset,
     IBitcoinService bitcoinService,
     IEthereumService ethereumService,
     IDogecoinService dogecoinService,
     ISteemService steemService,
     IHiveService hiveService)
 {
     _context         = context;
     _dateTimeOffset  = dateTimeOffset;
     _bitcoinService  = bitcoinService;
     _ethereumService = ethereumService;
     _dogecoinService = dogecoinService;
     _steemService    = steemService;
     _hiveService     = hiveService;
 }
Beispiel #19
0
 public PurchaserController(ITransactionRepository transactionRepository,
                            IBitcoinService bitcoinService,
                            UserManager <ApplicationUser> userManager,
                            IMerchantRepository merchantRepository,
                            ILogger <PurchaserController> logger, ILogRepository logRepository,
                            IMapper mapper,
                            IEthereumService ethereumService,
                            IEmailSender emailSender)
 {
     _transactionRepository = transactionRepository;
     _bitcoinService        = bitcoinService;
     _userManager           = userManager;
     _merchantRepository    = merchantRepository;
     _logger          = logger;
     _logRepository   = logRepository;
     _mapper          = mapper;
     _ethereumService = ethereumService;
     _emailSender     = emailSender;
 }
 public FundchainController()
 {
     service = new BasicEthereumService();
 }
Beispiel #21
0
 public TxnsController(ILogger <TxnsController> logger, IEthereumService ethereumService)
 {
     this.logger          = logger;
     this.ethereumService = ethereumService;
 }
 public EthFunctionsController(IEthereumService ethereumService, ILogger <EthFunctionsController> logger)
 {
     EthereumService = ethereumService;
     _logger         = logger;
 }
Beispiel #23
0
 public EthereumTestController(IEthereumService ethereumService)
 {
     service = ethereumService;
 }
Beispiel #24
0
        public static async Task <WalletDTO> ImportEthereumTransactions(IFortifex4DBContext _context, IEthereumService _ethereumService, Wallet wallet, CancellationToken cancellationToken)
        {
            WalletDTO walletDTO = new WalletDTO
            {
                WalletID         = wallet.WalletID,
                BlockchainID     = wallet.BlockchainID,
                Name             = wallet.Name,
                Address          = wallet.Address,
                Balance          = 0m,
                BlockchainSymbol = wallet.Blockchain.Symbol,
                BlockchainName   = wallet.Blockchain.Name,
            };

            var pockets = await _context.Pockets
                          .Where(x => x.WalletID == wallet.WalletID)
                          .Include(a => a.Transactions)
                          .AsNoTracking()
                          .ToListAsync(cancellationToken);

            #region Main Pocket
            var mainPocket = pockets.Single(x => x.IsMain);

            var mainPocketCurrency = await _context.Currencies
                                     .Where(x => x.CurrencyID == mainPocket.CurrencyID)
                                     .SingleAsync(cancellationToken);

            decimal unitPriceInUSD = mainPocketCurrency.UnitPriceInUSD;

            var transactionCollection = await _ethereumService.GetEthereumTransactionCollectionAsync(mainPocket.Address);

            var lastTransactionDateTime = mainPocket.Transactions
                                          .OrderByDescending(x => x.TransactionDateTime)
                                          .Select(x => x.TransactionDateTime)
                                          .First();

            long lastTransactionTimeStamp = lastTransactionDateTime.ToUnixTimeSeconds();

            var newTransactions = transactionCollection.Transactions
                                  .Where(x => x.TimeStamp > lastTransactionTimeStamp)
                                  .OrderBy(x => x.TimeStamp)
                                  .ToList();

            foreach (var transaction in newTransactions)
            {
                TransactionType transactionType   = TransactionType.SyncTransactionIN;
                decimal         amount            = transaction.Amount;
                string          pairWalletAddress = transaction.FromAddress;

                if (transaction.FromAddress == mainPocket.Address)
                {
                    transactionType   = TransactionType.SyncTransactionOUT;
                    amount            = -transaction.Amount;
                    pairWalletAddress = transaction.ToAddress;
                }

                _context.Transactions.Add(new Transaction
                {
                    PocketID            = mainPocket.PocketID,
                    TransactionHash     = transaction.Hash,
                    PairWalletAddress   = pairWalletAddress,
                    Amount              = amount,
                    UnitPriceInUSD      = unitPriceInUSD,
                    TransactionType     = transactionType,
                    TransactionDateTime = DateTimeOffset.FromUnixTimeSeconds(transaction.TimeStamp)
                });
            }

            await _context.SaveChangesAsync(cancellationToken);

            #endregion

            #region Token Pockets
            #endregion

            decimal mainPocketBalance = _context.Transactions
                                        .Where(x => x.PocketID == mainPocket.PocketID)
                                        .Sum(x => x.Amount);

            walletDTO.Balance = mainPocketBalance;

            return(walletDTO);
        }
Beispiel #25
0
 public TradingController()
 {
     service = new BasicEthereumService();
 }
Beispiel #26
0
 public HomeController(IOffChainStorageService storageService, IEthereumService ethereumService)
 {
     db       = storageService;
     ethereum = ethereumService;
 }
Beispiel #27
0
 public HomeController(IEthereumService ethereumService)
 {
     _service = ethereumService;
 }
Beispiel #28
0
 public FundChainController(IEthereumService ethereumService)
 {
     service = ethereumService;
 }
 public NetworkController(IEthereumService ethereumService)
 {
     this.ethereumService = ethereumService;
 }
Beispiel #30
0
 public EthereumController(IConfiguration configuration, IEthereumService ethereumServices)
 {
     _ethereumServices = ethereumServices;
     _ethUrl           = configuration["EthereumUrl"];
 }