1
0
forked from GRIN/grim

goblin: show the paid/used identity on the transaction detail view

The transaction receipt now has an Identity row telling the user which of the
wallet's held nostr identities was active when that payment was received or
sent. It uses the identity recorded on the transaction (TxNostrMeta's
recipient_pubkey), not a reconstruction, and falls back to the primary
identity for pre-feature rows. It shows the NIP-05 name when the identity has
one (any domain), otherwise a truncated npub, and is always shown on the
detail view (no clutter there whether the wallet holds one identity or many).
The activity list rows are unchanged. New goblin.receipt.identity string added
in all six locales.
This commit is contained in:
2ro
2026-07-05 16:15:42 -04:00
parent 8a382aa308
commit 69f647a009
8 changed files with 51 additions and 0 deletions
+1
View File
@@ -416,6 +416,7 @@ goblin:
to: "An"
from: "Von"
nostr: "nostr"
identity: "Identität"
fee_none: "Keine"
network_fee: "Netzwerkgebühr"
privacy: "Privatsphäre"
+1
View File
@@ -416,6 +416,7 @@ goblin:
to: "To"
from: "From"
nostr: "nostr"
identity: "Identity"
fee_none: "None"
network_fee: "Network fee"
privacy: "Privacy"
+1
View File
@@ -416,6 +416,7 @@ goblin:
to: "À"
from: "De"
nostr: "nostr"
identity: "Identité"
fee_none: "Aucun"
network_fee: "Frais de réseau"
privacy: "Confidentialité"
+1
View File
@@ -416,6 +416,7 @@ goblin:
to: "Кому"
from: "От"
nostr: "nostr"
identity: "Личность"
fee_none: "Нет"
network_fee: "Сетевая комиссия"
privacy: "Приватность"
+1
View File
@@ -416,6 +416,7 @@ goblin:
to: "Alıcı"
from: "Gönderen"
nostr: "nostr"
identity: "Kimlik"
fee_none: "Yok"
network_fee: "Ağ ücreti"
privacy: "Gizlilik"
+1
View File
@@ -416,6 +416,7 @@ goblin:
to: "收款方"
from: "付款方"
nostr: "nostr"
identity: "身份"
fee_none: "无"
network_fee: "网络费用"
privacy: "隐私"
+41
View File
@@ -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(
+4
View File
@@ -71,6 +71,9 @@ pub struct HeldIdentitySummary {
pub npub: String,
/// Claimed @name without the domain, if this identity has one.
pub name: Option<String>,
/// Full NIP-05 identifier ("user@domain") when this identity has a claimed
/// name, for the transaction detail view.
pub nip05: Option<String>,
/// 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,
})