public async Task <BigInteger> EstimateGas(IAccount account, string toAddress, BigInteger value) { var callInput = new Nethereum.RPC.Eth.DTOs.CallInput(null, toAddress, new HexBigInteger(value)); var gasPrice = await Web3Instance(account) .Eth .GasPrice .SendRequestAsync(); var estimatedGas = (await Web3Instance(account) .Eth .Transactions .EstimateGas .SendRequestAsync(callInput)).Value; return(BigInteger.Multiply(gasPrice, estimatedGas)); }
public IEnumerator SendRequest(Nethereum.RPC.Eth.DTOs.CallInput callInput) { var request = _ethEstimateGas.BuildRequest(callInput); yield return(SendRequest(request)); }
public IEnumerator SendRequest(Nethereum.RPC.Eth.DTOs.CallInput callInput, Nethereum.RPC.Eth.DTOs.BlockParameter block) { var request = _ethCall.BuildRequest(callInput, block); yield return(SendRequest(request)); }