diff --git a/src/components/Nip61WalletViewer.tsx b/src/components/Nip61WalletViewer.tsx index 2d5f70b..e359124 100644 --- a/src/components/Nip61WalletViewer.tsx +++ b/src/components/Nip61WalletViewer.tsx @@ -58,6 +58,8 @@ import { useNip61Wallet } from "@/hooks/useNip61Wallet"; import { useGrimoire } from "@/core/state"; import { useAccount } from "@/hooks/useAccount"; import { formatTimestamp } from "@/hooks/useLocale"; +import { UserName } from "@/components/nostr/UserName"; +import { getTagValue } from "applesauce-core/helpers"; import type { WalletHistory } from "applesauce-wallet/casts"; /** @@ -223,6 +225,28 @@ function HistoryEntryRow({ const direction = meta?.direction || "in"; const amount = meta?.amount || 0; + // Check for p-tag to show username + const pTagPubkey = getTagValue(entry.event, "p"); + + // Build label: username if p-tagged, mint if available, or Received/Sent + const getLabel = () => { + if (pTagPubkey) { + return ; + } + if (meta?.mint) { + try { + return {new URL(meta.mint).hostname}; + } catch { + // Invalid URL, fall through + } + } + return ( + + {direction === "in" ? "Received" : "Sent"} + + ); + }; + return (
)}
- - {formatTimestamp(entry.event.created_at, "datetime")} - + {getLabel()} {!entry.unlocked && ( (locked) )}
-

- {blurred - ? "✦✦✦✦" - : `${direction === "in" ? "+" : "-"}${amount.toLocaleString()}`} +

+ {blurred ? "✦✦✦✦" : amount.toLocaleString()}

@@ -585,12 +603,8 @@ function TransactionDetailDialog({

{direction === "in" ? "Received" : "Sent"}

-

- {blurred - ? "✦✦✦✦✦✦" - : `${direction === "in" ? "+" : "-"}${amount.toLocaleString()}`} +

+ {blurred ? "✦✦✦✦✦✦" : amount.toLocaleString()}