/// <summary> /// Constructor, /// </summary> /// <param name="transactionExecutorFactory">Transaction execution factory.</param> /// <param name="contractInfoRegistry">Contract info registry.</param> /// <param name="logger">Logging.</param> public TransactionService(ITransactionExecutorFactory transactionExecutorFactory, IContractInfoRegistry contractInfoRegistry, ILogger <TransactionService> logger) { this._transactionExecutorFactory = transactionExecutorFactory ?? throw new ArgumentNullException(nameof(transactionExecutorFactory)); this._logger = logger ?? throw new ArgumentNullException(nameof(logger)); this._contractInfo = contractInfoRegistry.FindContractInfo(WellKnownContracts.GameManager); }
/// <summary> /// Constructor. /// </summary> /// <param name="transactionExecutorFactory">Transaction execution</param> /// <param name="faucetDataManager">Data manager for faucet.</param> /// <param name="ethereumAccountBalanceSource">Balance source for Ethereum/ERC20 tokens.</param> /// <param name="contractInfoRegistry">Registry of contracts.</param> /// <param name="houseFundingIpWhiteList">IP Whitelist for faucet/funding operations.</param> /// <param name="executionEnvironment">The Execution Environment.</param> /// <param name="faucetConfiguration">Faucet configuration.</param> /// <param name="ethereumAccountManager">Ethereum account manager</param> /// <param name="logger">Logging.</param> public FaucetManager(ITransactionExecutorFactory transactionExecutorFactory, IFaucetDataManager faucetDataManager, IEthereumAccountBalanceSource ethereumAccountBalanceSource, IContractInfoRegistry contractInfoRegistry, IWhiteListedIpAddressIdentifier houseFundingIpWhiteList, ExecutionEnvironment executionEnvironment, IFaucetConfiguration faucetConfiguration, IEthereumAccountManager ethereumAccountManager, ILogger <FaucetManager> logger) { if (contractInfoRegistry == null) { throw new ArgumentNullException(nameof(contractInfoRegistry)); } if (faucetConfiguration == null) { throw new ArgumentNullException(nameof(faucetConfiguration)); } this._faucetDataManager = faucetDataManager ?? throw new ArgumentNullException(nameof(faucetDataManager)); this._ethereumAccountBalanceSource = ethereumAccountBalanceSource ?? throw new ArgumentNullException(nameof(ethereumAccountBalanceSource)); this._transactionExecutorFactory = transactionExecutorFactory ?? throw new ArgumentNullException(nameof(transactionExecutorFactory)); this._fundingWhiteList = houseFundingIpWhiteList ?? throw new ArgumentNullException(nameof(houseFundingIpWhiteList)); this._executionEnvironment = executionEnvironment; this._ethereumAccountManager = ethereumAccountManager ?? throw new ArgumentNullException(nameof(ethereumAccountManager)); this._nativeCurrencyLimits = new Limits <EthereumAmount>(amountToIssue: faucetConfiguration.NativeCurrencyToGive, faucetConfiguration.NativeCurrencyToGive / 2); this._tokenCurrencyLimits = new Limits <Token>(amountToIssue: faucetConfiguration.TokenToGive, faucetConfiguration.TokenToGive / 2); this._logger = logger ?? throw new ArgumentNullException(nameof(logger)); this._tokenContract = (Erc20TokenContractInfo)contractInfoRegistry.FindContractInfo(WellKnownContracts.Token); this._faucetContract = contractInfoRegistry.FindContractInfo(WellKnownContracts.Faucet); }
/// <summary> /// Constructor. /// </summary> /// <param name="transactionExecutorFactory">Transaction execution</param> /// <param name="faucetDataManager">Data manager for faucet.</param> /// <param name="ethereumAccountBalanceSource">Balance source for Ethereum/ERC20 tokens.</param> /// <param name="contractInfoRegistry">Registry of contracts.</param> /// <param name="houseFundingIpWhiteList">IP Whitelist for faucet/funding operations.</param> /// <param name="executionEnvironment">The Execution Environment.</param> /// <param name="faucetConfiguration">Faucet configuration.</param> /// <param name="ethereumAccountManager">Ethereum account manager</param> /// <param name="logger">Logging.</param> public FaucetManager(ITransactionExecutorFactory transactionExecutorFactory, IFaucetDataManager faucetDataManager, IEthereumAccountBalanceSource ethereumAccountBalanceSource, IContractInfoRegistry contractInfoRegistry, IWhiteListedIpAddressIdentifier houseFundingIpWhiteList, ExecutionEnvironment executionEnvironment, IFaucetConfiguration faucetConfiguration, IEthereumAccountManager ethereumAccountManager, ILogger <FaucetManager> logger) { if (contractInfoRegistry == null) { throw new ArgumentNullException(nameof(contractInfoRegistry)); } if (faucetConfiguration == null) { throw new ArgumentNullException(nameof(faucetConfiguration)); } this._faucetDataManager = faucetDataManager ?? throw new ArgumentNullException(nameof(faucetDataManager)); this._ethereumAccountBalanceSource = ethereumAccountBalanceSource ?? throw new ArgumentNullException(nameof(ethereumAccountBalanceSource)); this._transactionExecutorFactory = transactionExecutorFactory ?? throw new ArgumentNullException(nameof(transactionExecutorFactory)); this._fundingWhiteList = houseFundingIpWhiteList ?? throw new ArgumentNullException(nameof(houseFundingIpWhiteList)); this._executionEnvironment = executionEnvironment; this._ethereumAccountManager = ethereumAccountManager; this._ethToGive = faucetConfiguration.EthToGive; this._tokenToGiven = faucetConfiguration.TokenToGive; this._maximumRecipientEthBalance = this._ethToGive / 2; this._maximumRecipientTokenBalance = this._tokenToGiven / 2; this._logger = logger ?? throw new ArgumentNullException(nameof(logger)); this._tokenContract = (Erc20TokenContractInfo)contractInfoRegistry.FindContractInfo(WellKnownContracts.Token); this._faucetContract = contractInfoRegistry.FindContractInfo(WellKnownContracts.Faucet); }
public TransferCommand(IExpressChainManagerFactory chainManagerFactory, ITransactionExecutorFactory txExecutorFactory) { this.chainManagerFactory = chainManagerFactory; this.txExecutorFactory = txExecutorFactory; }
private Task <PendingTransaction> IssueEthereumAndFunAsync(INetworkSigningAccount networkSigningAccount, TransactionContext context, ITransactionExecutorFactory transactionExecutorFactory) { return(this._contractInfo.SubmitTransactionAsync(transactionExecutorFactory: transactionExecutorFactory, account: networkSigningAccount, priority: TransactionPriority.NORMAL, input: new DistributeTokenAndEthInput(recipient: this.Recipient.Address, ethAmount: this.EthToIssue, tokenAmount: this.TokenToIssue), context: context, cancellationToken: CancellationToken.None)); }
public Task <PendingTransaction> SendFundsAsync(INetworkSigningAccount networkSigningAccount, TransactionContext context, ITransactionExecutorFactory transactionExecutorFactory) { if (this.EthToIssue != EthereumAmount.Zero && this.TokenToIssue != Token.Zero) { return(this.IssueEthereumAndFunAsync(networkSigningAccount: networkSigningAccount, context: context, transactionExecutorFactory: transactionExecutorFactory)); } if (this.TokenToIssue != Token.Zero) { return(this.IssueFunAsync(networkSigningAccount: networkSigningAccount, context: context, transactionExecutorFactory: transactionExecutorFactory)); } return(this.IssueEthereumAsync(networkSigningAccount: networkSigningAccount, context: context, transactionExecutorFactory: transactionExecutorFactory)); }
public Response(IExpressChainManagerFactory chainManagerFactory, ITransactionExecutorFactory txExecutorFactory) { this.chainManagerFactory = chainManagerFactory; this.txExecutorFactory = txExecutorFactory; }
public BatchCommand(IExpressChainManagerFactory chainManagerFactory, IFileSystem fileSystem, ITransactionExecutorFactory txExecutorFactory) { this.chainManagerFactory = chainManagerFactory; this.fileSystem = fileSystem; this.txExecutorFactory = txExecutorFactory; }