Example #1
0
        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");
        }
Example #2
0
        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");
        }