fix: the ETH line reads unknown at an address no refresh has read (closes #736)
check / check (push) Canceled after 0s
e2e / e2e-chrome (push) Canceled after 0s
e2e / e2e-firefox (push) Canceled after 0s

An address's ETH balance is now null until a refresh has read it. That covers
a new address, a new wallet, addresses a wallet scan finds, and every address
after a network switch.

Its line reads `quantity unknown`, Home's balance `unknown (ETH)`, and Send
`Current balance: unknown (ETH)`. Max says the balance is unknown. Send is no
longer refused as zero. The address has no total, and DeleteAddress warns that
it may hold a balance.

A refresh also deletes `balanceNotFetched` only when it read every address in
the stored record.

Model: opus-5-5
This commit was merged in pull request #741.
This commit is contained in:
clawbot committed 2026-11-03 11:24:18 +01:00
1 parent 448afdb5ce
commit 9c691dfa6b
21 files changed
+470 -67

No files matched your search

+9 -2
View File
@@ -87,15 +87,22 @@ function recoveryPathText(wallet) {
// when every holding here is one with no price, since "$0.00" directly under
// "This address holds a balance." is a contradiction. A token holding below
// 0.000001 does not count, as the lines below leave it out.
//
// While no refresh has read the ETH balance the address may be empty, so the
// sentence says "may hold".
function balanceWarningHtml(addr) {
if (!addressHoldsFunds(addr)) return " ";
const line = formatAddressTotal(getAddressValue(addr));
const total = line
? `<div class="text-xs text-muted mt-1">${escapeHtml(line)}</div>`
: "";
const sentence =
addr.balance == null
? "This address may hold a balance."
: "This address holds a balance.";
return (
`<p class="mb-1">This address holds a balance. Removing it does not ` +
`move or spend anything; the balance stays at the address.</p>` +
`<p class="mb-1">${sentence} Removing it does not move or spend ` +
`anything; the balance stays at the address.</p>` +
balanceLinesForAddress(addr, state.trackedTokens, false) +
total
);