Add address color dots and cached ENS reverse lookups
Some checks failed
check / check (push) Has been cancelled

Deterministic colored dots derived from address bytes (16-color palette)
displayed before every address. ENS reverse resolution for transaction
counterparties with 12-hour localStorage cache.
This commit is contained in:
2026-02-26 03:26:52 +07:00
parent fbff44ade6
commit d28d5a5a51
5 changed files with 155 additions and 11 deletions

View File

@@ -1,4 +1,10 @@
const { $, showView, showFlash, balanceLinesForAddress } = require("./helpers");
const {
$,
showView,
showFlash,
balanceLinesForAddress,
addressDotHtml,
} = require("./helpers");
const { state, saveState } = require("../../shared/state");
const { deriveAddressFromXpub } = require("../../shared/wallet");
const {
@@ -35,12 +41,13 @@ function render(ctx) {
wallet.addresses.forEach((addr, ai) => {
html += `<div class="address-row py-1 border-b border-border-light cursor-pointer hover:bg-hover" data-wallet="${wi}" data-address="${ai}">`;
html += `<div class="text-xs font-bold">Address ${wi + 1}.${ai + 1}</div>`;
const dot = addressDotHtml(addr.address);
if (addr.ensName) {
html += `<div class="text-xs font-bold">${addr.ensName}</div>`;
html += `<div class="text-xs font-bold flex items-center">${dot}${addr.ensName}</div>`;
}
const addrUsd = formatUsd(getAddressValueUsd(addr));
html += `<div class="flex text-xs">`;
html += `<span style="width:42ch;max-width:100%">${addr.address}</span>`;
html += `<span class="flex items-center" style="width:42ch;max-width:100%">${addr.ensName ? "" : dot}${addr.address}</span>`;
html += `<span class="text-right text-muted flex-1">${addrUsd}</span>`;
html += `</div>`;
html += balanceLinesForAddress(addr);