feat: delete an address from an HD wallet (with confirmation) #162
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
README.md:879lists "Delete address from HD wallet (with confirmation)" as anopen TODO, and nothing implements it. Grepping
src/fordeleteAddress/delete-address/removeAddressreturns nothing; the onlyaddress-removal code path in the tree is the whole-wallet
addresses.spliceatsrc/popup/views/deleteWallet.js:65.src/popup/views/home.js:291-310implements the "+" add-address button, butthere is no corresponding remove control and
src/popup/index.htmlhas noaddress-delete element. So a user who adds addresses can never tidy them up.
Implementation requirements
exactly one address and no "+" button (
README.md:245-250), so it must notget a remove control either; the same applies to
type: "xprv"wallets ifthey present a single address.
(
src/popup/views/deleteWallet.js) for consistency. Decide whether itshould also be password-gated: delete-wallet is, but removing a derived
address destroys no secret — it is recoverable by re-deriving from the same
phrase. Recommend the lighter treatment (an explicit confirm screen, no
password) and state the choice and reasoning in the PR.
locally; funds at that address are untouched and the address can be
re-derived from the recovery phrase. Full sentences.
delete-wallet (#156):
activeAddressto adefined fallback and emit
AUTISTMASK_ACTIVE_CHANGED(seehome.js:277for the call shape). Consider whether connected dApps needbroadcastAccountsChanged(src/background/index.js:567-590) — a removedaddress should not remain an authorized account.
accounting for the index shift from the splice.
allowedSitesanddeniedSites, asdeleteWallet.js:67-71does.addresses or reappear.
if a user removes address index 1 of 3, does the next "+" re-derive index 1,
or continue at index 3? Gaps versus renumbering affect
deriveAddressFromXpuband thescanForAddressesgap-limit logic atsrc/shared/balances.js:225. Pick one, state it in the PR, and make surethe "+" button and any address scan agree with it.
that is what delete-wallet is for. Enforce it and say so in the UI.
README policy.
Definition of done
do not.
funds are untouched and the address is re-derivable.
fallback and broadcasts the change; connected dApps see it.
index shift.
cleaned up.
is consistent between the "+" button and address scanning.
address).
README.md:879is ticked and the Screen Mapupdated if a new screen is introduced.
TODO.mdupdated in the same commit.make checkpasses.