Return parsed relay attributes for a relay URL, if that relay has been observed in a kind-30166 event.
The current set of relay URLs discovered from kind-30166 d-tags. Empty until start() fires at least one event.
Return relays in a named attribute group. Uses the group table passed to
createNip66Aggregator, or DEFAULT_RELAY_ATTRIBUTE_GROUPS.
Optionalgroups: Readonly<Record<string, readonly RelayAttributeMatcher[]>>Return relays matching any supplied ad hoc attribute matcher.
Tag/value matchers, OR semantics
Relay URLs whose N-tags declare support for the given NIP number.
NIP number to query support for (e.g. 44 for NIP-44 encrypted DMs)
Array of relay URLs supporting that NIP
Whether the relay at url has been seen with an N-tag declaring support for nip.
Relay WebSocket URL to check
NIP number to query support for
true iff the relay has been observed with a matching N-tag
Tear down the current subscription, clear accumulated state, and re-subscribe. Call when networks semantics change upstream.
Begin subscribing against the bootstrap relay set. Idempotent — calling twice is a no-op.
Tear down the current subscription. Idempotent — calling without a prior
start() is a safe no-op. Preserves accumulated state (getRelaySet,
relaySupportsNip) — use resync() if you need to clear state AND
re-subscribe in one step. A subsequent start() re-subscribes against
the bootstrap relays (identical contract to the first start).
Wire this to your consumer's teardown path (browser: beforeunload;
React: effect cleanup; Electron: app.before-quit) — the aggregator
holds a pool subscription that otherwise lives for the tab lifetime
(PITFALLS.md M-03).
Aggregator handle returned by createNip66Aggregator. Each call returns a fresh instance with its own closure-scoped state — multi-instance safe (unlike a module-globals pattern).
Example