public async void WatchEventRpc() { var client = new RpcClient(new Uri("https://mainnet.infura.io")); var ethGetBlockByHash = new EthGetBlockWithTransactionsByNumber(client); var bts = await ethGetBlockByHash.SendRequestAsync(new BlockParameter(7865954)); if (null != bts) { var author = bts.Author; } var ethGetGasEstimate = new EthGasPrice(client); var gas = await ethGetGasEstimate.SendRequestAsync(); Console.WriteLine(gas.Value); var apiService = new EthApiService(client); var bal = await apiService.GetBalance.SendRequestAsync("0xDcCC7b8dDf511f7CE2Ecf8672F57a4E277d73198"); Console.WriteLine(bal.Value); var gass = await apiService.GasPrice.SendRequestAsync(); Console.WriteLine(gass.Value); }
public async Task <HexBigInteger> GetGasPriceAsync(TransactionInput transactionInput) { //if (transactionInput.GasPrice != null) return transactionInput.GasPrice; //if (DefaultGasPrice >= 0) return new HexBigInteger(DefaultGasPrice); var ethGetGasPrice = new EthGasPrice(Client); return(await ethGetGasPrice.SendRequestAsync().ConfigureAwait(false)); }
public async Task <HexBigInteger> GetGasPriceAsync(TransactionInput transactionInput, CancellationToken cancellationToken = default(CancellationToken)) { if (transactionInput.GasPrice != null) { return(transactionInput.GasPrice); } if (DefaultGasPrice >= 0) { return(new HexBigInteger(DefaultGasPrice)); } var ethGetGasPrice = new EthGasPrice(Client); return(await ethGetGasPrice.SendRequestAsync(cancellationToken).ConfigureAwait(false)); }
public async Task<dynamic> ExecuteTestAsync(RpcClient client) { var ethGasPrice = new EthGasPrice(client); return await ethGasPrice.SendRequestAsync(); }
public async Task <dynamic> ExecuteTestAsync(RpcClient client) { var ethGasPrice = new EthGasPrice(client); return(await ethGasPrice.SendRequestAsync()); }
public override async Task <HexBigInteger> ExecuteAsync(IClient client) { var ethGasPrice = new EthGasPrice(client); return(await ethGasPrice.SendRequestAsync()); }
/// <summary> /// Estimates the gas price of an ethereum transaction. /// </summary> /// <param name="gasPriceTarget"> The target gas price. </param> /// <returns> Task which returns the estimated gas price of an ethereum transaction. </returns> public static async Task <BigInteger> EstimateGasPrice(GasPriceTarget gasPriceTarget = GasPriceTarget.Standard) { EthGasPrice estimateGasPrice = new EthGasPrice(NetworkProvider.GetWeb3().Client); return(ModifyGasPrice(gasPriceTarget, (await estimateGasPrice.SendRequestAsync()).Value)); }
public async Task <object> ExecuteTestAsync(IClient client) { var ethGasPrice = new EthGasPrice(client); return(await ethGasPrice.SendRequestAsync()); }