Add zap history view (roadmap #9)

- fetchZapsReceived: kind 9735 filtered by #p tag (receipts)
- fetchZapsSent: kind 9734 filtered by authors (zap requests)
- ZapHistoryView: Received / Sent tabs with row count; header shows
  total sats in/out; each row: avatar, amount, counterpart name
  (clickable → profile), comment, time ago
- Receipt parsing: amount from embedded zap request in "description"
  tag (millisats → sats); sender from uppercase "P" tag with fallback
  to zap request pubkey
- Request parsing: amount from "amount" tag, recipient from "p" tag
-  zaps nav item added to sidebar between search and relays
- Logged-out fallback state with prompt to log in

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jure
2026-03-10 19:32:44 +01:00
parent cccae35169
commit 16446573c4
6 changed files with 263 additions and 2 deletions

View File

@@ -2,7 +2,7 @@ import { create } from "zustand";
import { NDKEvent } from "@nostr-dev-kit/ndk";
type View = "feed" | "search" | "relays" | "settings" | "profile" | "thread" | "article-editor" | "about";
type View = "feed" | "search" | "relays" | "settings" | "profile" | "thread" | "article-editor" | "about" | "zaps";
interface UIState {
currentView: View;