diff --git a/convex-gui/src/main/java/convex/gui/components/WalletComponent.java b/convex-gui/src/main/java/convex/gui/components/WalletComponent.java index c99c55ba2..6e386f1c9 100644 --- a/convex-gui/src/main/java/convex/gui/components/WalletComponent.java +++ b/convex-gui/src/main/java/convex/gui/components/WalletComponent.java @@ -8,10 +8,12 @@ import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPopupMenu; +import javax.swing.JTextArea; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import convex.core.crypto.AKeyPair; import convex.core.crypto.WalletEntry; import convex.core.data.AccountStatus; import convex.core.data.Address; @@ -106,6 +108,22 @@ public WalletComponent(PeerGUI manager,WalletEntry initialWalletEntry) { JPopupMenu menu=new JPopupMenu(); JMenuItem m1=new JMenuItem("Edit..."); menu.add(m1); + JMenuItem m2=new JMenuItem("Show seed..."); + m2.addActionListener(e-> { + AKeyPair kp=walletEntry.getKeyPair(); + if (kp!=null) { + StringBuilder sb=new StringBuilder(); + sb.append("\nEd25519 private seed:\n"); + sb.append("\n"+kp.getSeed()+"\n\n"); + sb.append("\nWarning: keep this private, it can be used to control your accounts\n"); + JTextArea text = new JTextArea(sb.toString()); + JOptionPane.showMessageDialog(WalletComponent.this, text,"Private Seed",JOptionPane.INFORMATION_MESSAGE); + } else { + JOptionPane.showMessageDialog(WalletComponent.this, "Seed not available","Warning",JOptionPane.WARNING_MESSAGE); + } + }); + menu.add(m2); + DropdownMenu menuButton=new DropdownMenu(menu); buttons.add(menuButton); @@ -127,7 +145,8 @@ private String getInfoString() { AccountStatus as=s.getAccount(address); if (as!=null) { Long bal=as.getBalance(); - sb.append("Balance: " + Text.toFriendlyNumber(bal)); + sb.append("Public Key: " + walletEntry.getAccountKey()+"\n"); + sb.append("Balance: " + Text.toFriendlyNumber(bal)); } }); //sb.append("\n"); diff --git a/convex-gui/src/main/java/convex/gui/manager/mainpanels/WalletPanel.java b/convex-gui/src/main/java/convex/gui/manager/mainpanels/WalletPanel.java index d45870a20..c9ebb9fca 100644 --- a/convex-gui/src/main/java/convex/gui/manager/mainpanels/WalletPanel.java +++ b/convex-gui/src/main/java/convex/gui/manager/mainpanels/WalletPanel.java @@ -43,7 +43,7 @@ public WalletPanel(PeerGUI manager) { add(toolBar, BorderLayout.SOUTH); // new wallet button - JButton btnNew = new JButton("New"); + JButton btnNew = new JButton("New Account"); toolBar.add(btnNew); btnNew.addActionListener(e -> { Convex convex=PeerGUI.getDefaultConvex();