Beispiel #1
0
        public Task <string> TransferEtherAsync(string toAddress, decimal etherAmount, decimal?gasPriceGwei = null, BigInteger?gas = null)
        {
            var fromAddress      = _transactionManager?.Account?.Address;
            var transactionInput = EtherTransferTransactionInputBuilder.CreateTransactionInput(fromAddress, toAddress, etherAmount, gasPriceGwei, gas);

            return(_transactionManager.SendTransactionAsync(transactionInput));
        }
Beispiel #2
0
        public Task <TransactionReceipt> TransferEtherAndWaitForReceiptAsync(string toAddress, decimal etherAmount, decimal?gasPriceGwei = null, BigInteger?gas = null, CancellationTokenSource tokenSource = null)
        {
            var fromAddress      = _transactionManager?.Account?.Address;
            var transactionInput = EtherTransferTransactionInputBuilder.CreateTransactionInput(fromAddress, toAddress, etherAmount, gasPriceGwei, gas);

            return(_transactionManager.SendTransactionAndWaitForReceiptAsync(transactionInput, tokenSource));
        }
Beispiel #3
0
        public async Task <BigInteger> EstimateGasAsync(string toAddress, decimal etherAmount)
        {
            var fromAddress = _transactionManager?.Account?.Address;
            var callInput   = (CallInput)EtherTransferTransactionInputBuilder.CreateTransactionInput(fromAddress, toAddress, etherAmount);
            var hexEstimate = await _transactionManager.EstimateGasAsync(callInput);

            return(hexEstimate.Value);
        }
Beispiel #4
0
        public Task <string> TransferEtherAsync(string toAddress, decimal etherAmount, BigInteger maxPriorityFeePerGas, BigInteger maxFeePerGas, BigInteger?gas = null, BigInteger?nonce = null)
        {
            //Make the the maxPriorityFee and maxFeePerGas
            var fromAddress      = _transactionManager?.Account?.Address;
            var transactionInput = EtherTransferTransactionInputBuilder.CreateTransactionInput(fromAddress, toAddress, etherAmount, maxPriorityFeePerGas, maxFeePerGas, gas, nonce);

            return(_transactionManager.SendTransactionAsync(transactionInput));
        }