+ Permanently delete the currently selected wallet. This
+ cannot be undone. Make sure you have backed up your
+ recovery phrase before proceeding.
+
+
+
+
+
+
+ Confirm Deletion
+
+
+ Deleting is
+ permanent. Any funds on this wallet will be
+ unrecoverable if you have not backed up your recovery
+ phrase.
+
+
Enter your password to confirm:
+
+
+
+
+
+
diff --git a/src/popup/views/settings.js b/src/popup/views/settings.js
index 8562b96..eb01cf3 100644
--- a/src/popup/views/settings.js
+++ b/src/popup/views/settings.js
@@ -2,6 +2,7 @@ const { $, showView, showFlash, escapeHtml } = require("./helpers");
const { state, saveState } = require("../../shared/state");
const { ETHEREUM_MAINNET_CHAIN_ID } = require("../../shared/constants");
const { log, debugFetch } = require("../../shared/log");
+const { decryptWithPassword } = require("../../shared/vault");
const runtime =
typeof browser !== "undefined" ? browser.runtime : chrome.runtime;
@@ -192,6 +193,74 @@ function init(ctx) {
ctx.renderWalletList();
showView("main");
});
+
+ $("btn-delete-wallet").addEventListener("click", () => {
+ if (state.selectedWallet === null || state.wallets.length === 0) {
+ showFlash("No wallet selected.");
+ return;
+ }
+ const wallet = state.wallets[state.selectedWallet];
+ $("delete-wallet-name").textContent = wallet.name || "this wallet";
+ $("delete-wallet-password").value = "";
+ $("delete-wallet-confirm").classList.remove("hidden");
+ });
+
+ $("btn-delete-wallet-cancel").addEventListener("click", () => {
+ $("delete-wallet-confirm").classList.add("hidden");
+ $("delete-wallet-password").value = "";
+ });
+
+ $("btn-delete-wallet-confirm").addEventListener("click", async () => {
+ const pw = $("delete-wallet-password").value;
+ if (!pw) {
+ showFlash("Password required.");
+ return;
+ }
+
+ const walletIdx = state.selectedWallet;
+ const wallet = state.wallets[walletIdx];
+
+ // Verify password against the wallet's encrypted data
+ try {
+ await decryptWithPassword(wallet.encrypted, pw);
+ } catch (_e) {
+ showFlash("Wrong password.");
+ return;
+ }
+
+ // Collect addresses to clean up from allowedSites/deniedSites
+ const addresses = (wallet.addresses || []).map((a) => a.address);
+
+ // Remove wallet
+ state.wallets.splice(walletIdx, 1);
+
+ // Clean up site permissions for deleted addresses
+ for (const addr of addresses) {
+ delete state.allowedSites[addr];
+ delete state.deniedSites[addr];
+ }
+
+ if (state.wallets.length === 0) {
+ // No wallets left — reset selection and show welcome
+ state.selectedWallet = null;
+ state.selectedAddress = null;
+ state.activeAddress = null;
+ await saveState();
+ $("delete-wallet-confirm").classList.add("hidden");
+ showView("welcome");
+ } else {
+ // Switch to first wallet if deleted wallet was active
+ state.selectedWallet = 0;
+ state.selectedAddress = 0;
+ state.activeAddress =
+ state.wallets[0].addresses[0]?.address || null;
+ await saveState();
+ $("delete-wallet-confirm").classList.add("hidden");
+ showFlash("Wallet deleted.");
+ ctx.renderWalletList();
+ showView("main");
+ }
+ });
}
module.exports = { init, show, renderSiteLists };
From 34cd72be88a5cf5471f390fe61e5cc077a1f8392 Mon Sep 17 00:00:00 2001
From: clawbot
Date: Fri, 27 Feb 2026 12:44:40 -0800
Subject: [PATCH 2/7] fix: rework wallet deletion per review feedback
- Remove all red/danger styling, use standard monochrome colors
- Add wallet picker dropdown instead of relying on selectedWallet
- Fix encryptedSecret field name (was wallet.encrypted)
- Populate dropdown when settings view opens
- Confirmation modal uses standard border styling
---
src/popup/views/settings.js | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/popup/views/settings.js b/src/popup/views/settings.js
index eb01cf3..a6f9083 100644
--- a/src/popup/views/settings.js
+++ b/src/popup/views/settings.js
@@ -71,6 +71,17 @@ function show() {
$("settings-blockscout").value = state.blockscoutUrl;
renderTrackedTokens();
renderSiteLists();
+ // Populate wallet deletion dropdown
+ const sel = $("delete-wallet-select");
+ sel.innerHTML = "";
+ for (let i = 0; i < state.wallets.length; i++) {
+ const opt = document.createElement("option");
+ opt.value = i;
+ opt.textContent = state.wallets[i].name || "Wallet " + (i + 1);
+ sel.appendChild(opt);
+ }
+ $("delete-wallet-confirm").classList.add("hidden");
+
showView("settings");
}
From 655b90c7dfa3341e1fa19727162776a3f8098fca Mon Sep 17 00:00:00 2001
From: clawbot
Date: Fri, 27 Feb 2026 12:46:03 -0800
Subject: [PATCH 3/7] feat: add wallet deletion from settings (closes #13)
- Per-wallet [delete] links in settings wallet list
- Monochrome styling throughout, no red/danger colors
- Password confirmation modal with warning text
- Cleans up site permissions for deleted addresses
- Switches to first remaining wallet or shows welcome if none left
---
src/popup/index.html | 38 +++++-----------------
src/popup/views/settings.js | 63 ++++++++++++++++++++++++-------------
2 files changed, 50 insertions(+), 51 deletions(-)
diff --git a/src/popup/index.html b/src/popup/index.html
index 68edf66..4a2b899 100644
--- a/src/popup/index.html
+++ b/src/popup/index.html
@@ -708,9 +708,7 @@
Wallets
-
- Add a new wallet from a recovery phrase or private key.
-
+
-
-
Danger Zone
-
- Permanently delete the currently selected wallet. This
- cannot be undone. Make sure you have backed up your
- recovery phrase before proceeding.
-
-
-
-
-
- Confirm Deletion
-
+
Confirm Deletion
- Deleting is
- permanent. Any funds on this wallet will be
- unrecoverable if you have not backed up your recovery
- phrase.
+ Delete ? This
+ is permanent. Any funds will be unrecoverable without
+ your recovery phrase.
Enter your password to confirm:
+
-
+
+
-
Confirm Deletion
-
- Delete ? This
- is permanent. Any funds will be unrecoverable without
- your recovery phrase.
-
-
Enter your password to confirm:
+ < Back
+
+
Delete Wallet
+
+ Deleting
+ is permanent. Any
+ funds will be unrecoverable without your recovery phrase.
+