Documentation
    Preparing search index...

    Function createNip65Registry

    • Create a closure-scoped Nip65Registry for accumulating kind-10002 relay lists and resolving outbox/inbox relays.

      Framework-agnostic: it knows nothing about relay pools, subscriptions, or storage. Feed it kind-10002 events (e.g. from your pool's onevent callback) via Nip65Registry.ingest and query the outbox model with Nip65Registry.resolveOutboxRelays.

      Returns Nip65Registry

      A fresh registry with its own state

      import { createNip65Registry } from '@kehto/nip/65';
      import { SimplePool } from 'nostr-tools/pool';

      const registry = createNip65Registry();
      const pool = new SimplePool();
      pool.subscribeMany(discoveryRelays, [{ kinds: [10002], authors }], {
      onevent: (e) => registry.ingest(e),
      });
      // Later, before publishing on behalf of `author`:
      const outbox = registry.resolveOutboxRelays([author]);