Skip to main content

Module wrappers

Module wrappers 

Source
Expand description

Wrapper tracking — NIP-59 gift wrap dedup + NIP-77 negentropy.

Constants§

TRANSPORT_CONCORD
TRANSPORT_NIP17
Transport carriers for the shared outer-event ledger — stored as a small INTEGER discriminator (cheaper than a per-row string, and the ledger can grow large). Never renumber an existing value.

Functions§

load_negentropy_items
Load all processed wrappers as (EventId, Timestamp) pairs for negentropy (NIP-77).
load_processed_wrappers
Load all processed wrapper IDs as raw bytes for the dedup cache.
load_recent_wrapper_ids
Load recent wrapper IDs from events table (last N days) as raw bytes.
processed_wrapper_exists
Sync existence check against the ledger (any transport) — the DB half of the outer-event dedup for callers that can’t reach the async WRAPPER_ID_CACHE (e.g. the synchronous Concord ingest). Returns false on a missing/closed DB so a dedup failure never drops a genuinely-new event.
save_processed_wrapper
Persist an outer-event id for cross-session dedup (INSERT OR IGNORE), tagged by transport so the ledger is shared across transports while negentropy stays NIP-17-scoped.
update_wrapper_timestamp
Upsert a wrapper timestamp (backfill for pre-migration-17 wrappers).