diff --git a/locales/de.yml b/locales/de.yml index 2ed1cc9d..e98e8cd2 100644 --- a/locales/de.yml +++ b/locales/de.yml @@ -416,6 +416,7 @@ goblin: to: "An" from: "Von" nostr: "nostr" + identity: "Identität" fee_none: "Keine" network_fee: "Netzwerkgebühr" privacy: "Privatsphäre" diff --git a/locales/en.yml b/locales/en.yml index 192c2789..7ee12484 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -416,6 +416,7 @@ goblin: to: "To" from: "From" nostr: "nostr" + identity: "Identity" fee_none: "None" network_fee: "Network fee" privacy: "Privacy" diff --git a/locales/fr.yml b/locales/fr.yml index b0f6fa15..709ac017 100644 --- a/locales/fr.yml +++ b/locales/fr.yml @@ -416,6 +416,7 @@ goblin: to: "À" from: "De" nostr: "nostr" + identity: "Identité" fee_none: "Aucun" network_fee: "Frais de réseau" privacy: "Confidentialité" diff --git a/locales/ru.yml b/locales/ru.yml index e250d060..9fffd758 100644 --- a/locales/ru.yml +++ b/locales/ru.yml @@ -416,6 +416,7 @@ goblin: to: "Кому" from: "От" nostr: "nostr" + identity: "Личность" fee_none: "Нет" network_fee: "Сетевая комиссия" privacy: "Приватность" diff --git a/locales/tr.yml b/locales/tr.yml index dbb58d7a..8e504614 100644 --- a/locales/tr.yml +++ b/locales/tr.yml @@ -416,6 +416,7 @@ goblin: to: "Alıcı" from: "Gönderen" nostr: "nostr" + identity: "Kimlik" fee_none: "Yok" network_fee: "Ağ ücreti" privacy: "Gizlilik" diff --git a/locales/zh-CN.yml b/locales/zh-CN.yml index 7d1e5b56..795d6d28 100644 --- a/locales/zh-CN.yml +++ b/locales/zh-CN.yml @@ -416,6 +416,7 @@ goblin: to: "收款方" from: "付款方" nostr: "nostr" + identity: "身份" fee_none: "无" network_fee: "网络费用" privacy: "隐私" diff --git a/src/gui/views/goblin/mod.rs b/src/gui/views/goblin/mod.rs index 733e4a6d..53bd2329 100644 --- a/src/gui/views/goblin/mod.rs +++ b/src/gui/views/goblin/mod.rs @@ -1554,6 +1554,47 @@ impl GoblinWalletView { }; w::info_row(ui, &t!("goblin.receipt.to"), &to); w::info_row(ui, &t!("goblin.receipt.from"), &from); + // Which of the wallet's held nostr identities was active + // when this payment was received/sent — the "front door" + // it used. Uses the identity recorded on the tx + // (recipient_pubkey), falling back to the primary for + // pre-feature rows. NIP-05 name when claimed, else a + // truncated npub. + let owning_hex = d + .slate_id + .as_deref() + .and_then(|sid| { + wallet + .nostr_service() + .and_then(|s| s.store.tx_meta(sid)) + }) + .map(|m| m.recipient_pubkey) + .filter(|h| !h.is_empty()); + let id_label = match owning_hex { + Some(hex) => wallet + .nostr_identities() + .iter() + .find(|i| i.pubkey_hex == hex) + .map(|i| { + i.nip05.clone().unwrap_or_else(|| { + data::short_npub(&i.pubkey_hex) + }) + }) + .unwrap_or_else(|| data::short_npub(&hex)), + // Legacy/primary row: the first held identity. + None => wallet + .nostr_identities() + .first() + .map(|i| { + i.nip05.clone().unwrap_or_else(|| { + data::short_npub(&i.pubkey_hex) + }) + }) + .unwrap_or_default(), + }; + if !id_label.is_empty() { + w::info_row(ui, &t!("goblin.receipt.identity"), &id_label); + } } if let Some(npub) = &d.npub { w::info_row( diff --git a/src/wallet/wallet.rs b/src/wallet/wallet.rs index 1abf7747..f525a1c2 100644 --- a/src/wallet/wallet.rs +++ b/src/wallet/wallet.rs @@ -71,6 +71,9 @@ pub struct HeldIdentitySummary { pub npub: String, /// Claimed @name without the domain, if this identity has one. pub name: Option, + /// Full NIP-05 identifier ("user@domain") when this identity has a claimed + /// name, for the transaction detail view. + pub nip05: Option, /// Short human label (its @name, or "Primary"). pub label: String, /// Whether this is the currently active identity. @@ -744,6 +747,7 @@ impl Wallet { pubkey_hex: entry.pubkey.clone(), npub: identity.npub.clone(), name, + nip05: identity.nip05.clone(), label: entry.label.clone(), active: entry.pubkey == index.active, })