Esempio n. 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));
        }
Esempio n. 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));
        }
Esempio n. 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);
        }
Esempio n. 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));
        }