Zap Timmy from the Workshop #15

Open
opened 2026-03-20 22:24:55 +00:00 by replit · 0 comments
Owner

What & Why

Visitors should be able to send a spontaneous Lightning zap directly to Timmy's npub — a tip, a cheer, a thank-you. Zaps are the native Nostr value-transfer primitive. Closes the loop between Timmy's Nostr identity and his Lightning infrastructure.

Done looks like

  • 'Zap Timmy' button appears in the Workshop (near the chat bar)
  • Clicking opens a small zap panel: preset amounts (21, 210, 2100 sats) + optional custom amount + optional message
  • Backend generates a BOLT-11 invoice via LNbits; returns it to frontend
  • Frontend displays invoice as a QR code with a copy button; handles payment polling
  • On payment confirmed, Timmy plays a celebration animation and says a thank-you in chat
  • Zap event optionally published to Nostr as kind:9735 zap receipt (best effort)
  • Zap amounts and messages stored in a zaps table for the performance dashboard

Out of scope

  • LNURL-pay / LNURL-zap full protocol (LNbits invoice for now)
  • Zapping specific Nostr posts
  • Visitor-to-visitor zaps

Tasks

  1. Zap invoice endpoint — Add /api/zap POST endpoint that generates a LNbits invoice; poll endpoint or webhook for payment confirmation.
  2. Zaps DB table — Create zaps table (amount_sats, message, paid_at); record on payment confirmed.
  3. Celebration event — On zap confirmed, emit WebSocket event that triggers Timmy's celebration animation and Haiku-generated thank-you.
  4. Zap UI panel — Zap button + amount picker + QR code panel; poll for payment and trigger the celebration.

Relevant files

  • artifacts/api-server/src/lib/lnbits.ts
  • artifacts/api-server/src/routes/events.ts
  • artifacts/api-server/src/lib/agent.ts
  • the-matrix/js/payment.js
  • the-matrix/js/ui.js
  • the-matrix/js/agents.js
## What & Why Visitors should be able to send a spontaneous Lightning zap directly to Timmy's npub — a tip, a cheer, a thank-you. Zaps are the native Nostr value-transfer primitive. Closes the loop between Timmy's Nostr identity and his Lightning infrastructure. ## Done looks like - 'Zap Timmy' button appears in the Workshop (near the chat bar) - Clicking opens a small zap panel: preset amounts (21, 210, 2100 sats) + optional custom amount + optional message - Backend generates a BOLT-11 invoice via LNbits; returns it to frontend - Frontend displays invoice as a QR code with a copy button; handles payment polling - On payment confirmed, Timmy plays a celebration animation and says a thank-you in chat - Zap event optionally published to Nostr as kind:9735 zap receipt (best effort) - Zap amounts and messages stored in a `zaps` table for the performance dashboard ## Out of scope - LNURL-pay / LNURL-zap full protocol (LNbits invoice for now) - Zapping specific Nostr posts - Visitor-to-visitor zaps ## Tasks 1. **Zap invoice endpoint** — Add `/api/zap` POST endpoint that generates a LNbits invoice; poll endpoint or webhook for payment confirmation. 2. **Zaps DB table** — Create `zaps` table (amount_sats, message, paid_at); record on payment confirmed. 3. **Celebration event** — On zap confirmed, emit WebSocket event that triggers Timmy's celebration animation and Haiku-generated thank-you. 4. **Zap UI panel** — Zap button + amount picker + QR code panel; poll for payment and trigger the celebration. ## Relevant files - `artifacts/api-server/src/lib/lnbits.ts` - `artifacts/api-server/src/routes/events.ts` - `artifacts/api-server/src/lib/agent.ts` - `the-matrix/js/payment.js` - `the-matrix/js/ui.js` - `the-matrix/js/agents.js`
replit added the lightningbackendworkshopfrontendnostr labels 2026-03-20 22:24:55 +00:00
claude was assigned by Rockachopa 2026-03-22 23:37:42 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: replit/timmy-tower#15