Esempio n. 1
0
        public GanacheManager(EthereumSettings aEthereumSettings)
        {
            EthereumSettings = aEthereumSettings;
            var account = new Account(EthereumSettings.TestAccountPrivateKey);

            Web3 = new Web3(account, EthereumSettings.Endpoint);
        }
Esempio n. 2
0
 public OrdersService(AbiProvider abiProvider, IOptions <EthereumSettings> ethSettings, ApplicationDbContext context)
 {
     _abiProvider     = abiProvider;
     _nethereumClient = new Web3(ethSettings.Value.EthereumRpcNodeUrl);
     _context         = context;
     _ethSettings     = ethSettings.Value;
 }
        private void ConfigureServices(ServiceCollection aServiceCollection)
        {
            EthereumSettings ethereumSettings = Configuration.GetSection(nameof(EthereumSettings)).Get <EthereumSettings>();

            aServiceCollection.AddSingleton(ethereumSettings);

            //aServiceCollection.AddSingleton<MultiplierSmartContract>();
            aServiceCollection.AddSingleton <GanacheManager>();
        }
Esempio n. 4
0
 public EthereumService
 (
     ILogger <EthereumService> logger,
     IOptions <EthereumSettings> options,
     IRestClient restClient
 )
 {
     this.logger      = logger;
     ethereumSettings = options.Value;
     this.restClient  = restClient;
 }
Esempio n. 5
0
        public EthereumBalanceProvider(
            EthereumSettings settings,
            IAssetsServiceWithCache assetsServiceClient)
        {
            _balanceProvider = new SamuraiBalanceProvider
                               (
                settings.SamuraiApiUrl,
                new BlockchainAsset("ETH", "ETH", "ETH"),
                assetsServiceClient
                               );

            AsyncInitialization = InitializeAsync();
        }
Esempio n. 6
0
 public EthereumCommandHandler(
     [NotNull] ILogFactory logFactory,
     [NotNull] ISrvEthereumHelper srvEthereumHelper,
     [NotNull] IAssetsServiceWithCache assetsServiceWithCache,
     [NotNull] IBcnClientCredentialsRepository bcnClientCredentialsRepository,
     [NotNull] IEthereumTransactionRequestRepository ethereumTransactionRequestRepository,
     [NotNull] ITransactionService transactionService,
     [NotNull] EthereumSettings settings,
     TimeSpan retryTimeout)
 {
     _log = logFactory.CreateLog(this);
     _srvEthereumHelper                    = srvEthereumHelper ?? throw new ArgumentNullException(nameof(srvEthereumHelper));
     _assetsServiceWithCache               = assetsServiceWithCache ?? throw new ArgumentNullException(nameof(assetsServiceWithCache));
     _bcnClientCredentialsRepository       = bcnClientCredentialsRepository ?? throw new ArgumentNullException(nameof(bcnClientCredentialsRepository));
     _ethereumTransactionRequestRepository = ethereumTransactionRequestRepository ?? throw new ArgumentNullException(nameof(ethereumTransactionRequestRepository));
     _transactionService                   = transactionService ?? throw new ArgumentNullException(nameof(transactionService));
     _settings     = settings ?? throw new ArgumentNullException(nameof(settings));
     _retryTimeout = retryTimeout;
 }
Esempio n. 7
0
 public EthereumService(ApplicationDbContext context,
                        IOptions <EthereumSettings> ethSettings,
                        DbContextOptions <ApplicationDbContext> contextOptions,
                        ParametersService parametersService,
                        EtherscanService etherscanService,
                        ILogger <EthereumService> logger,
                        AbiProvider abiProvider, IOHCLService ohclService, IMemoryCache cache, IHubContext <OrderSignalR> ordersHubContext)
 {
     _context           = context;
     _contextOptions    = contextOptions;
     _parametersService = parametersService;
     _etherscanService  = etherscanService;
     _logger            = logger;
     _abiProvider       = abiProvider;
     _ohclService       = ohclService;
     _cache             = cache;
     _ordersHubContext  = ordersHubContext;
     _nethereumClient   = new Web3(ethSettings.Value.EthereumRpcNodeUrl);
     _ethSettings       = ethSettings.Value;
 }
Esempio n. 8
0
 public CreateTemplateHandler(Web3ContractManager aWeb3ContractManager, EthereumSettings aEthereumSettings)
 {
     Web3ContractManager = aWeb3ContractManager;
     EthereumSettings    = aEthereumSettings;
 }
Esempio n. 9
0
 public MintNftHandler(Web3ContractManager web3ContractManager, EthereumSettings ethereumSettings)
 {
     Web3ContractManager = web3ContractManager;
     EthereumSettings    = ethereumSettings;
 }
Esempio n. 10
0
 public Connector(EthereumSettings settings)
 {
     this.settings = settings;
     web3          = new Web3(new Account(settings.PrivateKey));
 }
 public MultiplierTests(TestFixture aTestFixture)
 {
     GanacheManager          = aTestFixture.GanacheManager;
     MultiplyContractService = aTestFixture.ServiceProvider.GetService <MultiplyContractService>();
     EthereumSettings        = aTestFixture.ServiceProvider.GetService <EthereumSettings>();
 }
Esempio n. 12
0
 public GanacheManager(Web3ContractManager aWeb3ContractManager, EthereumSettings aEthereumSettings, MultiplierSmartContract aMultiplierSmartContract)
 {
     Web3ContractManager     = aWeb3ContractManager;
     EthereumSettings        = aEthereumSettings;
     MultiplierSmartContract = aMultiplierSmartContract;
 }
Esempio n. 13
0
 public ViewTokenDataServerServiceHandler(EthereumSettings ethereumSettings, Web3ContractManager web3ContractManager)
 {
     EthereumSettings    = ethereumSettings;
     Web3ContractManager = web3ContractManager;
 }
Esempio n. 14
0
 public ParametersService(ApplicationDbContext context, IOptions <EthereumSettings> ethSettings)
 {
     _context     = context;
     _ethSettings = ethSettings.Value;
 }
 public BalanceHandler(Web3ContractManager aWeb3ContractManager, EthereumSettings aEthereumSettings)
 {
     EthereumSettings    = aEthereumSettings;
     Web3ContractManager = aWeb3ContractManager;
 }