public void import() { try { string seed = SeedPriKeyTextBox.Text; string password = PasswordTextBox.Text; List <string> keyPair = Utilities.getKeyPair(seed); string eotPrivateKey = keyPair.ElementAt(0); string eotAddress = keyPair.ElementAt(1); Wallet eotWallet = new Wallet(eotPrivateKey, eotAddress, seed); string file1 = @"wallet.eot"; string file2 = @"Address.txt"; if (File.Exists(file1) && File.Exists(file2)) { File.Delete(file1); File.Delete(file2); } Utilities.FileEncrypt(seed, password); Utilities.printWalletToFile(eotWallet); System.Windows.Forms.MessageBox.Show("Wallet imported successfully!"); EOTCoinWalletDashboard dashboard = new EOTCoinWalletDashboard(); dashboard.Show(); this.Hide(); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show("Import failed: " + ex.Message); } }
private void GenerateButton_Click(object sender, EventArgs e) { if (randcharstextBox.Text.Length < 120) { System.Windows.Forms.MessageBox.Show("Please enter 120 random characters"); } else { string inputString = randcharstextBox.Text; String Password = PasswordBox.Text; Random rnd = new Random(); string seed = Utilities.generateSeed(inputString, rnd); List <string> keyPair = Utilities.getKeyPair(seed); string eotPrivateKey = keyPair.ElementAt(0); string eotAddress = keyPair.ElementAt(1); Wallet eotWallet = new Wallet(eotPrivateKey, eotAddress, seed); Utilities.FileEncrypt(seed, Password); Utilities.printWalletToFile(eotWallet); EOTCoinWalletDashboard dashboardform = new EOTCoinWalletDashboard(); dashboardform.Show(); this.Hide(); } }
private void DashboardButton_Click(object sender, EventArgs e) { EOTCoinWalletDashboard dashboardform = new EOTCoinWalletDashboard(); dashboardform.Show(); this.Hide(); }
private void refreshButton_Click(object sender, EventArgs e) { EOTCoinWalletDashboard dashboard = new EOTCoinWalletDashboard(); dashboard.Show(); this.Hide(); }
private void LoginButton_Click(object sender, EventArgs e) { try { string password = PasswordBox.Text; string seed = Utilities.FileDecrypt("wallet.eot", password); string txtAddress = ""; string filename = "Address.txt"; string path = @"" + filename; if (File.Exists(path)) { txtAddress = File.ReadLines(path).First(); } else { System.Windows.Forms.MessageBox.Show("Address.txt does not exist!"); } //generate address using seed List <string> keyPair = Utilities.getKeyPair(seed); string eotPrivateKey = keyPair.ElementAt(0); string eotAddress = keyPair.ElementAt(1); Wallet eotWallet = new Wallet(eotPrivateKey, eotAddress, seed); //if address matches address.txt, go to dashboard if (txtAddress == eotWallet.eotAddress) { EOTCoinWalletDashboard dashboardform = new EOTCoinWalletDashboard(); dashboardform.Show(); this.Hide(); } else { System.Windows.Forms.MessageBox.Show("Incorrect password, please try again!"); } } catch (Exception ex) { System.Windows.Forms.MessageBox.Show("Login failed: " + ex.Message); } }