private void btnSend_Click(object sender, EventArgs e) { var value = txtAmount.Text.ToBigInteger(NumberStyles.Integer); value = value * 1000000000000000000; var transaction = new Transaction() { To = txtSendTo.Text, From = cmdAccounts.SelectedItem.ToString(), Value = value.ToHexString() }; var txHash = EthereumService.SendTransaction(transaction); var sendTxHistory = new SendTxHistory() { DateTime = DateTime.Now.ToString(), Amount = transaction.Value.ToBigInteger().WeiToEther(), Hash = txHash }; SendTxHistoryList.Add(sendTxHistory); dgSendTransactions.DataSource = null; dgSendTransactions.DataSource = SendTxHistoryList; SetGridWidth(); txtTransactionHash.Text = txHash; // MessageBox.Show(txHash, "Transaction"); }
private string SendTransaction(string fromAccount, string ToAccount, string ethvalue) { //var value = txtAmount.Text.ToBigInteger(NumberStyles.Integer); SendTxHistoryList = new List <SendTxHistory>(); var privateConnection = new ConnectionOptions() { Port = "8545", Url = "http://localhost" }; ethereumService = new EthereumService(privateConnection); var value = ethvalue.ToBigInteger(NumberStyles.Integer) * 1000000000000000000; var transaction = new Transaction() { To = ToAccount, From = fromAccount, Value = value.ToHexString() }; var txHash = ethereumService.SendTransaction(transaction); return(txHash); }