Show address titles on transaction confirmation page
Some checks failed
check / check (push) Has been cancelled

Add addressTitle() helper that looks up an address across all wallets
and returns its title (e.g. "Address 1.2"). The confirm page now shows
titles for both sender and receiver when they belong to our wallet.
formatAddressHtml gains an optional title parameter shown above the
full address, alongside any ENS name.
This commit is contained in:
2026-02-26 12:38:34 +07:00
parent a590cfc3ad
commit 4bfcf17773
2 changed files with 40 additions and 10 deletions

View File

@@ -8,6 +8,7 @@ const {
showError,
hideError,
showView,
addressTitle,
formatAddressHtml,
} = require("./helpers");
const { state } = require("../../shared/state");
@@ -22,11 +23,19 @@ let pendingTx = null;
function show(txInfo) {
pendingTx = txInfo;
$("confirm-from").innerHTML = formatAddressHtml(txInfo.from, null, null);
const fromTitle = addressTitle(txInfo.from, state.wallets);
$("confirm-from").innerHTML = formatAddressHtml(
txInfo.from,
null,
null,
fromTitle,
);
const toTitle = addressTitle(txInfo.to, state.wallets);
$("confirm-to").innerHTML = formatAddressHtml(
txInfo.to,
txInfo.ensName,
null,
toTitle,
);
// Hide the separate ENS element — it's now inline in the address display