Files
amethyst/commons
Claude c5d89ff7a0 feat(amethyst): cache + keep-live the BOLT12 offer list (kind 10058)
Downloads and keeps kind 10058 fresh the way the per-user relay/payment lists do,
so a recipient's BOLT12 offer is available for discovery before a zap.

- LocalCache consumes 10058 as an addressable note (consumeBaseReplaceable),
  keyed by Address(10058, pubkey, "").
- User gains a pinned bolt12OfferListNote + bolt12OfferList()/bolt12Offers()
  accessors — this is how a payer reads a recipient's offers.
- Bolt12OfferListState: the logged-in user's own offer list as live account state
  (a StateFlow<List<String>> of offers), persisted across restarts and published
  via saveOffers() — cloned from NipA3PaymentTargetsState. Wired into Account
  (bolt12OfferList + saveBolt12Offers), AccountSettings (backup + updater), and
  LocalPreferences (persist/restore).
- Subscriptions: kind 10058 added to FilterUserMetadataForKey (fetches OTHER
  users' offers — the key edit for zap recipients) and to the account's
  FilterAccountInfoAndListsFromKey (fetches your own at login).

Editor UI and the payment intent follow next.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SpgpWLKzgD7vS9Fs4CXTR3
2026-07-24 19:28:43 +00:00
..