public async Task TransferEtherAsync(TruffleAccount sender, string receiverAddress, decimal etherValue) { var sourceAccount = new Account(sender.PrivateKey); var web3 = new Web3(sourceAccount, BlockchainMetadata.URL); var transactionReceipt = await web3.Eth.GetEtherTransferService().TransferEtherAndWaitForReceiptAsync(receiverAddress, etherValue); LogsRenderer.Log(transactionReceipt); }
public async Task SendJoinTheCauseAsync(TruffleAccount senderAccount) { var account = new Account(senderAccount.PrivateKey); var web3 = new Web3(account, URL); var transaction = new SendJoinTheCause(); var transactionHandler = web3.Eth.GetContractTransactionHandler <SendJoinTheCause>(); var transactionReceipt = await transactionHandler.SendRequestAndWaitForReceiptAsync(CONTRACT_ADDRESS, transaction); LogsRenderer.Log(transactionReceipt); }