/// <summary> /// Sends a given amount of ether to an address. /// Uses an estimated gas limit for the transaction. /// </summary> /// <param name="privateKey"> The private key of the address which is sending the ether. </param> /// <param name="addressTo"> The address the ether is being sent to. </param> /// <param name="amount"> The amount of ether being sent, in eth. (not wei) </param> /// <param name="gasPrice"> The gas price (in wei) to use to send the transaction. </param> /// <returns> Task which returns the TransactionPoller which will await the transaction result. </returns> public static async Task <TransactionPoller> SendEther(string privateKey, string addressTo, decimal amount, BigInteger gasPrice) { return(await SendEther(privateKey, addressTo, amount, gasPrice, await GasUtils.EstimateEthGasLimit(addressTo, SolidityUtils.ConvertToUInt(amount, 18)))); }
/// <summary> /// Sends a given amount of ether to an address. /// Uses an estimated gas price and gas limit for the transaction. /// </summary> /// <param name="privateKey"> The private key of the address which is sending the ether. </param> /// <param name="addressTo"> The address the ether is being sent to. </param> /// <param name="amount"> The amount of ether being sent, in eth. (not wei) </param> /// <returns> Task which returns the TransactionPoller which will await the transaction result. </returns> public static async Task <TransactionPoller> SendEther(string privateKey, string addressTo, decimal amount) { return(await SendEther(privateKey, addressTo, amount, await GasUtils.EstimateGasPrice(GasUtils.GasPriceTarget.Standard))); }