@qntx/nostr 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/README.md +1 -1
  2. package/dist/{builder-aNU2gGFP.mjs → builder-CVRmUeNm.mjs} +4 -4
  3. package/dist/{builder-aNU2gGFP.mjs.map → builder-CVRmUeNm.mjs.map} +1 -1
  4. package/dist/{builder-CTwkB2zM.d.mts → builder-GBddxj8i.d.mts} +3 -3
  5. package/dist/{client-Cj2lUaVh.mjs → client-CeyDLoyO.mjs} +50 -28
  6. package/dist/client-CeyDLoyO.mjs.map +1 -0
  7. package/dist/client.d.mts +1 -1
  8. package/dist/client.mjs +1 -1
  9. package/dist/core.d.mts +8 -8
  10. package/dist/core.mjs +8 -8
  11. package/dist/{event-CHf47dPM.mjs → event-C2eLiPpV.mjs} +15 -5
  12. package/dist/event-C2eLiPpV.mjs.map +1 -0
  13. package/dist/{event-DJeb_DIL.d.mts → event-j3BwI5dF.d.mts} +2 -4
  14. package/dist/{filter-jI_9htF7.d.mts → filter-CfEgQBXt.d.mts} +3 -5
  15. package/dist/{filter-BQl3GlHt.mjs → filter-TrF2LEoy.mjs} +3 -36
  16. package/dist/filter-TrF2LEoy.mjs.map +1 -0
  17. package/dist/{gossip-DFxIBlsr.mjs → gossip-5ezg0Quo.mjs} +3 -3
  18. package/dist/gossip-5ezg0Quo.mjs.map +1 -0
  19. package/dist/{gossip-OOeeFzG5.d.mts → gossip-BWb9HmfK.d.mts} +8 -5
  20. package/dist/gossip.d.mts +1 -1
  21. package/dist/gossip.mjs +1 -1
  22. package/dist/http-CuazNRIP.mjs.map +1 -1
  23. package/dist/{http-C4HwIu4B.d.mts → http-kwWG-V1X.d.mts} +9 -3
  24. package/dist/{index-C_w2WfVz.d.mts → index-C0mFpelb.d.mts} +6 -6
  25. package/dist/{index-Cl_1XdYP.d.mts → index-C1m5cHpd.d.mts} +22 -14
  26. package/dist/{index-BxCBX-8R.d.mts → index-CoX7SnO7.d.mts} +7 -4
  27. package/dist/{index-CPVEyzNX.d.mts → index-D0M3kjY2.d.mts} +9 -9
  28. package/dist/{index-DU9tRFTZ.d.mts → index-Hp26bgYG.d.mts} +11 -4
  29. package/dist/{index-DyKwQnbt.d.mts → index-JD1O7m2v.d.mts} +4 -4
  30. package/dist/index.d.mts +19 -19
  31. package/dist/index.mjs +17 -17
  32. package/dist/{instance-C62w3cEt.mjs → instance-CI_IaZpf.mjs} +2 -2
  33. package/dist/{instance-C62w3cEt.mjs.map → instance-CI_IaZpf.mjs.map} +1 -1
  34. package/dist/{instance-DjsL8h84.d.mts → instance-X_WkCnpR.d.mts} +3 -3
  35. package/dist/{key-D_5OgGT7.d.mts → key-CyKN1RTi.d.mts} +2 -2
  36. package/dist/{key-DnVpchl6.mjs → key-DY_HEIpY.mjs} +5 -4
  37. package/dist/key-DY_HEIpY.mjs.map +1 -0
  38. package/dist/{kind-Cxwhhkx8.mjs → kind-D8fENiiL.mjs} +11 -5
  39. package/dist/kind-D8fENiiL.mjs.map +1 -0
  40. package/dist/{loaders-BmPkQfzI.mjs → loaders-DifimjJ7.mjs} +9 -8
  41. package/dist/{loaders-BmPkQfzI.mjs.map → loaders-DifimjJ7.mjs.map} +1 -1
  42. package/dist/loaders.d.mts +2 -2
  43. package/dist/loaders.mjs +1 -1
  44. package/dist/{memory-CdJ07kub.mjs → memory-DENGQ_f6.mjs} +2 -2
  45. package/dist/{memory-CdJ07kub.mjs.map → memory-DENGQ_f6.mjs.map} +1 -1
  46. package/dist/{memory-index-Cbc83vOZ.mjs → memory-index-D_lvlYAy.mjs} +4 -4
  47. package/dist/{memory-index-Cbc83vOZ.mjs.map → memory-index-D_lvlYAy.mjs.map} +1 -1
  48. package/dist/{message-tclYCVNc.d.mts → message-CcUz22qh.d.mts} +3 -3
  49. package/dist/{message-oNr7t0SJ.mjs → message-Rd5Z_17h.mjs} +5 -4
  50. package/dist/{message-oNr7t0SJ.mjs.map → message-Rd5Z_17h.mjs.map} +1 -1
  51. package/dist/{nip17-B5WgW4C4.d.mts → nip17-B7MI82Iq.d.mts} +4 -4
  52. package/dist/{nip51-CR0Q8eym.d.mts → nip51-O_vhOiK2.d.mts} +3 -3
  53. package/dist/{nip59-C-RWFQIv.d.mts → nip59-CdDoJptA.d.mts} +2 -2
  54. package/dist/{nip65-D1fbmhOg.d.mts → nip65-BL79HI8N.d.mts} +3 -3
  55. package/dist/{nip77-DzUwUxHq.d.mts → nip77-wHA_nEV5.d.mts} +2 -2
  56. package/dist/nips/blossom.d.mts +3 -3
  57. package/dist/nips/blossom.mjs +2 -2
  58. package/dist/nips/nip05.d.mts +1 -1
  59. package/dist/nips/nip10.d.mts +2 -2
  60. package/dist/nips/nip10.mjs +3 -3
  61. package/dist/nips/nip11.d.mts +1 -1
  62. package/dist/nips/nip13.d.mts +1 -1
  63. package/dist/nips/nip17.d.mts +1 -1
  64. package/dist/nips/nip17.mjs +3 -3
  65. package/dist/nips/nip27.d.mts +1 -1
  66. package/dist/nips/nip42.d.mts +1 -1
  67. package/dist/nips/nip42.mjs +1 -1
  68. package/dist/nips/nip51.d.mts +1 -1
  69. package/dist/nips/nip51.mjs +3 -3
  70. package/dist/nips/nip57.d.mts +1 -1
  71. package/dist/nips/nip57.mjs +3 -3
  72. package/dist/nips/nip59.d.mts +1 -1
  73. package/dist/nips/nip59.mjs +4 -4
  74. package/dist/nips/nip65.d.mts +1 -1
  75. package/dist/nips/nip65.mjs +2 -2
  76. package/dist/nips/nip77.d.mts +1 -1
  77. package/dist/nips/nip77.mjs +8 -5
  78. package/dist/nips/nip77.mjs.map +1 -1
  79. package/dist/nips/nip98.d.mts +1 -1
  80. package/dist/nips/nip98.mjs +3 -3
  81. package/dist/{pool-CqQvUnsq.d.mts → pool-BDI_u03Q.d.mts} +8 -7
  82. package/dist/{pool-vlw74C4t.mjs → pool-jok2-iBJ.mjs} +28 -21
  83. package/dist/pool-jok2-iBJ.mjs.map +1 -0
  84. package/dist/{put-w13ci3sC.mjs → put-JsiCKMyZ.mjs} +4 -4
  85. package/dist/put-JsiCKMyZ.mjs.map +1 -0
  86. package/dist/{reactive-Tz0otDIP.mjs → reactive-6Wn9qf_d.mjs} +5 -5
  87. package/dist/{reactive-Tz0otDIP.mjs.map → reactive-6Wn9qf_d.mjs.map} +1 -1
  88. package/dist/{reactive-gGqUrzW8.d.mts → reactive-X4p6nABy.d.mts} +4 -4
  89. package/dist/{relay-quCs7MHD.mjs → relay-__QtO33h.mjs} +18 -10
  90. package/dist/relay-__QtO33h.mjs.map +1 -0
  91. package/dist/relay.d.mts +3 -3
  92. package/dist/relay.mjs +2 -2
  93. package/dist/{signer-poTGe6Er.mjs → signer-D7PtVvQn.mjs} +14 -7
  94. package/dist/signer-D7PtVvQn.mjs.map +1 -0
  95. package/dist/signer.d.mts +2 -2
  96. package/dist/signer.mjs +1 -1
  97. package/dist/{storage-B5IXTVuS.mjs → storage-oihjE0_x.mjs} +10 -10
  98. package/dist/{storage-B5IXTVuS.mjs.map → storage-oihjE0_x.mjs.map} +1 -1
  99. package/dist/storage.d.mts +2 -2
  100. package/dist/storage.mjs +3 -3
  101. package/dist/store.d.mts +1 -1
  102. package/dist/store.mjs +1 -1
  103. package/dist/testing.d.mts +2 -2
  104. package/dist/testing.mjs +7 -7
  105. package/dist/{types-DNmiscfd.d.mts → types-BJ4wZ7JJ.d.mts} +2 -2
  106. package/dist/{types-BacwnDtU.d.mts → types-Ccox7-5v.d.mts} +3 -3
  107. package/dist/{verifier-CgTFpgsC.d.mts → verifier-BjL2M0ka.d.mts} +2 -2
  108. package/dist/{verifier-B51Wkt5H.mjs → verifier-uC_jd-Nw.mjs} +3 -3
  109. package/dist/verifier-uC_jd-Nw.mjs.map +1 -0
  110. package/dist/wasm.browser.d.mts +1 -1
  111. package/dist/wasm.browser.mjs +1 -1
  112. package/dist/wasm.d.mts +1 -1
  113. package/dist/wasm.mjs +1 -1
  114. package/package.json +5 -5
  115. package/dist/client-Cj2lUaVh.mjs.map +0 -1
  116. package/dist/event-CHf47dPM.mjs.map +0 -1
  117. package/dist/filter-BQl3GlHt.mjs.map +0 -1
  118. package/dist/gossip-DFxIBlsr.mjs.map +0 -1
  119. package/dist/key-DnVpchl6.mjs.map +0 -1
  120. package/dist/kind-Cxwhhkx8.mjs.map +0 -1
  121. package/dist/pool-vlw74C4t.mjs.map +0 -1
  122. package/dist/put-w13ci3sC.mjs.map +0 -1
  123. package/dist/relay-quCs7MHD.mjs.map +0 -1
  124. package/dist/signer-poTGe6Er.mjs.map +0 -1
  125. package/dist/verifier-B51Wkt5H.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { o as isReplaceableKind, r as isAddressableKind } from "./kind-Cxwhhkx8.mjs";
1
+ import { o as isReplaceableKind, r as isAddressableKind } from "./kind-D8fENiiL.mjs";
2
2
  //#region src/core/filter.ts
3
3
  /** Local NIP-01 match. `search` is ignored; relays interpret NIP-50. */
4
4
  function matchFilter(filter, event) {
@@ -27,39 +27,6 @@ function matchFilters(filters, event) {
27
27
  for (const filter of filters) if (matchFilter(filter, event)) return true;
28
28
  return false;
29
29
  }
30
- /** Merge filters by unioning list fields; returns a new plain object. */
31
- function mergeFilters(...filters) {
32
- const result = {};
33
- const mergeList = (property, values) => {
34
- if (values === void 0) return;
35
- const existing = result[property];
36
- const list = Array.isArray(existing) ? [...existing] : [];
37
- for (const value of values) if (!list.includes(value)) list.push(value);
38
- result[property] = list;
39
- };
40
- const mergeMax = (property, value) => {
41
- if (value === void 0) return;
42
- const prev = result[property];
43
- if (typeof prev !== "number" || value > prev) result[property] = value;
44
- };
45
- for (const filter of filters) {
46
- mergeList("ids", filter.ids);
47
- mergeList("authors", filter.authors);
48
- mergeList("kinds", filter.kinds);
49
- for (const key of Object.keys(filter)) {
50
- if (!key.startsWith("#")) continue;
51
- mergeList(key, filter[key]);
52
- }
53
- mergeMax("limit", filter.limit);
54
- mergeMax("until", filter.until);
55
- if (filter.since !== void 0) {
56
- const prev = result["since"];
57
- if (typeof prev !== "number" || filter.since < prev) result["since"] = filter.since;
58
- }
59
- if (filter.search !== void 0) result["search"] = filter.search;
60
- }
61
- return result;
62
- }
63
30
  /**
64
31
  * Intrinsic upper bound implied by the filter alone. Returns a positive integer, or `Infinity` when
65
32
  * unbounded.
@@ -115,6 +82,6 @@ function filterFingerprint(filters) {
115
82
  return `[${parts.join(",")}]`;
116
83
  }
117
84
  //#endregion
118
- export { matchFilter as a, getFilterLimit as i, canonicalizeFilters as n, matchFilters as o, filterFingerprint as r, mergeFilters as s, canonicalizeFilter as t };
85
+ export { matchFilter as a, getFilterLimit as i, canonicalizeFilters as n, matchFilters as o, filterFingerprint as r, canonicalizeFilter as t };
119
86
 
120
- //# sourceMappingURL=filter-BQl3GlHt.mjs.map
87
+ //# sourceMappingURL=filter-TrF2LEoy.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-TrF2LEoy.mjs","names":[],"sources":["../src/core/filter.ts"],"sourcesContent":["import type { Event } from \"./event.ts\";\nimport { isAddressableKind, isReplaceableKind } from \"./kind.ts\";\n\n/** NIP-01 filter object (immutable-friendly; callers may still pass plain objects). */\nexport type Filter = {\n readonly ids?: ReadonlyArray<string> | undefined;\n readonly kinds?: ReadonlyArray<number> | undefined;\n readonly authors?: ReadonlyArray<string> | undefined;\n readonly since?: number | undefined;\n readonly until?: number | undefined;\n readonly limit?: number | undefined;\n /** NIP-50 full-text search. Relays interpret this. Local `matchFilter` / `query` ignore it. */\n readonly search?: string | undefined;\n readonly [key: `#${string}`]: ReadonlyArray<string> | undefined;\n};\n\n/** Local NIP-01 match. `search` is ignored; relays interpret NIP-50. */\nexport function matchFilter(filter: Filter, event: Event): boolean {\n if (filter.ids && !filter.ids.some((id) => id.toLowerCase() === event.id)) {\n return false;\n }\n if (filter.kinds && !filter.kinds.includes(event.kind)) {\n return false;\n }\n if (filter.authors && !filter.authors.some((pk) => pk.toLowerCase() === event.pubkey)) {\n return false;\n }\n\n for (const key of Object.keys(filter)) {\n if (!key.startsWith(\"#\")) {\n continue;\n }\n const tagName = key.slice(1);\n const values = filter[`#${tagName}`];\n if (!values) {\n continue;\n }\n const hexTag = tagName === \"e\" || tagName === \"p\";\n const hit = event.tags.some((tag) => {\n const [tagKey, tagValue] = tag;\n if (tagKey !== tagName || tagValue === undefined) {\n return false;\n }\n if (hexTag) {\n return values.some((v) => v.toLowerCase() === tagValue.toLowerCase());\n }\n return values.includes(tagValue);\n });\n if (!hit) {\n return false;\n }\n }\n\n if (filter.since !== undefined && event.created_at < filter.since) {\n return false;\n }\n if (filter.until !== undefined && event.created_at > filter.until) {\n return false;\n }\n\n return true;\n}\n\n/** True when the event matches any of the filters (NIP-01 OR semantics). */\nexport function matchFilters(filters: ReadonlyArray<Filter>, event: Event): boolean {\n for (const filter of filters) {\n if (matchFilter(filter, event)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Intrinsic upper bound implied by the filter alone. Returns a positive integer, or `Infinity` when\n * unbounded.\n */\nexport function getFilterLimit(filter: Filter): number {\n if (filter.ids && filter.ids.length === 0) {\n return 0;\n }\n if (filter.kinds && filter.kinds.length === 0) {\n return 0;\n }\n if (filter.authors && filter.authors.length === 0) {\n return 0;\n }\n\n let limit = Number.POSITIVE_INFINITY;\n if (filter.ids) {\n limit = Math.min(limit, filter.ids.length);\n }\n if (filter.limit !== undefined) {\n limit = Math.min(limit, filter.limit);\n }\n\n if (filter.kinds && filter.authors) {\n const allReplaceable = filter.kinds.every((k) => isReplaceableKind(k) || isAddressableKind(k));\n if (allReplaceable) {\n const dTags = filter[\"#d\"];\n const perAuthor = dTags && dTags.length > 0 ? dTags.length : 1;\n limit = Math.min(limit, filter.authors.length * filter.kinds.length * perAuthor);\n }\n }\n\n return limit;\n}\n\nconst HEX_LIST_KEYS = new Set([\"ids\", \"authors\", \"#e\", \"#p\"]);\n\n/** Lowercase hex lists and sort every array. Omits undefined so `[]` stays distinct from missing. */\nexport function canonicalizeFilter(filter: Filter): Filter {\n const raw = filter as Record<string, unknown>;\n const out: Record<string, unknown> = {};\n for (const key of Object.keys(raw).sort()) {\n const value = raw[key];\n // omit undefined so a missing key is not `[]` / null\n if (value === undefined) {\n continue;\n }\n if (Array.isArray(value)) {\n if (HEX_LIST_KEYS.has(key)) {\n out[key] = value.map((v) => String(v).toLowerCase()).sort();\n } else if (key === \"kinds\") {\n out[key] = value.map(Number).sort((a, b) => a - b);\n } else {\n out[key] = value.map(String).sort();\n }\n } else {\n out[key] = value;\n }\n }\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- built key by key above; the record is filter-shaped by construction\n return out as Filter;\n}\n\n/** Apply {@link canonicalizeFilter} to each filter. */\nexport function canonicalizeFilters(filters: ReadonlyArray<Filter>): Filter[] {\n return filters.map(canonicalizeFilter);\n}\n\n/**\n * Canonical identity for live REQ coalescing. Relays treat a missing list key as unconstrained and\n * `[]` as match-nothing.\n */\nexport function filterFingerprint(filters: ReadonlyArray<Filter>): string {\n const parts = filters.map((filter) => JSON.stringify(canonicalizeFilter(filter)));\n parts.sort();\n return `[${parts.join(\",\")}]`;\n}\n"],"mappings":"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"}
@@ -1,6 +1,6 @@
1
1
  import { d as nowSeconds, l as normalizeRelayUrls, u as normalizeURL } from "./util-DMF9AIO0.mjs";
2
- import { t as Kind } from "./kind-Cxwhhkx8.mjs";
3
- import { a as isReplaceableWinner } from "./event-CHf47dPM.mjs";
2
+ import { t as Kind } from "./kind-D8fENiiL.mjs";
3
+ import { a as isReplaceableWinner } from "./event-C2eLiPpV.mjs";
4
4
  import { parseRelayList } from "./nips/nip65.mjs";
5
5
  import { i as trimOldest, r as touchKey } from "./collections-DtwMc1NU.mjs";
6
6
  import { parseDmRelayList } from "./nips/nip17.mjs";
@@ -225,4 +225,4 @@ var Gossip = class {
225
225
  //#endregion
226
226
  export { Gossip as t };
227
227
 
228
- //# sourceMappingURL=gossip-DFxIBlsr.mjs.map
228
+ //# sourceMappingURL=gossip-5ezg0Quo.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gossip-5ezg0Quo.mjs","names":[],"sources":["../src/gossip/gossip.ts"],"sourcesContent":["import { touchKey, trimOldest } from \"../core/collections.ts\";\nimport type { Event } from \"../core/event.ts\";\nimport { isReplaceableWinner } from \"../core/event.ts\";\nimport type { Filter } from \"../core/filter.ts\";\nimport { Kind } from \"../core/kind.ts\";\nimport { normalizeRelayUrls, normalizeURL, nowSeconds } from \"../core/util.ts\";\nimport { parseDmRelayList } from \"../nips/nip17.ts\";\nimport { parseRelayList } from \"../nips/nip65.ts\";\nimport type { RelayListItem } from \"../nips/nip65.ts\";\n\n/** Relay routing state for one pubkey: NIP-65 outbox/inbox plus NIP-17 DM relays. */\nexport type PubkeyRoutes = {\n /** Relays the user writes to (outbox). NIP-65. */\n readonly write: ReadonlyArray<string>;\n /** Relays the user reads from (inbox). NIP-65. */\n readonly read: ReadonlyArray<string>;\n /** Relays for NIP-17 gift-wrap delivery. Kind 10050. */\n readonly dm: ReadonlyArray<string>;\n /** `created_at` of the last accepted kind:10002 list. */\n readonly updatedAt: number;\n /** `created_at` of the last accepted kind:10050 list. */\n readonly dmUpdatedAt: number;\n /** Event id of the last accepted kind:10002 (NIP-01 equal-timestamp tie-break). */\n readonly relayListId?: string | undefined;\n /** Event id of the last accepted kind:10050. */\n readonly dmListId?: string | undefined;\n};\n\n/** A filter split by gossip routes: per-relay narrowed filters plus the unrouted remainder. */\nexport type RoutedFilter = {\n /** Url → already-narrowed filter. Empty when nothing routed. */\n readonly perRelay: ReadonlyMap<string, Filter>;\n /**\n * Unrouted work for the caller:\n *\n * - No authors and no #p: original filter (\"generic\")\n * - Authors/#p all unrouted: original filter (\"orphan\")\n * - Mixed: narrowed leftover (\"fallback\")\n * - All routed: undefined\n */\n readonly remainder?: Filter | undefined;\n};\n\nexport type GossipOptions = {\n /**\n * Max relays kept per direction; the first N in list order win (NIP-65 defines no ranking).\n * Default 4.\n */\n maxRelaysPerPubkey?: number | undefined;\n /**\n * Max pubkeys with tracked routes; the map is LRU — writes and lookups refresh recency, and\n * inserting beyond the cap drops the oldest entry. Default 10_000.\n */\n maxPubkeys?: number | undefined;\n};\n\nfunction emptyRoutes(): PubkeyRoutes {\n return {\n write: [],\n read: [],\n dm: [],\n updatedAt: 0,\n dmUpdatedAt: 0,\n };\n}\n\n/**\n * Routing table for NIP-65 (10002) and NIP-17 DM relays (10050). Ingest replaceable list events,\n * then route filters into per-relay REQs.\n */\nexport class Gossip {\n readonly #routes = new Map<string, PubkeyRoutes>();\n readonly #maxRelays: number;\n readonly #maxPubkeys: number;\n\n constructor(opts: GossipOptions = {}) {\n this.#maxRelays = opts.maxRelaysPerPubkey ?? 4;\n this.#maxPubkeys = opts.maxPubkeys ?? 10_000;\n }\n\n /**\n * Ingest a routing list event.\n *\n * - Kind:10002 → write/read (NIP-65)\n * - Kind:10050 → dm (NIP-17)\n *\n * Returns true if routes for that list type were updated.\n */\n ingest(event: Event): boolean {\n if (event.kind === Kind.RelayList) {\n let items: RelayListItem[];\n try {\n items = parseRelayList(event);\n } catch {\n return false;\n }\n return this.setRoutes(event.pubkey, items, event.created_at, event.id);\n }\n if (event.kind === Kind.DirectMessageRelaysList) {\n let relays: string[];\n try {\n relays = parseDmRelayList(event);\n } catch {\n return false;\n }\n return this.setDmRoutes(event.pubkey, relays, event.created_at, event.id);\n }\n return false;\n }\n\n setRoutes(\n pubkey: string,\n items: ReadonlyArray<RelayListItem>,\n updatedAt: number = nowSeconds(),\n eventId?: string,\n ): boolean {\n const pk = pubkey.toLowerCase();\n const prev = this.#lookup(pk) ?? emptyRoutes();\n if (prev.updatedAt > updatedAt) {\n return false;\n }\n if (\n eventId !== undefined &&\n prev.relayListId !== undefined &&\n prev.updatedAt === updatedAt &&\n !isReplaceableWinner(\n { created_at: updatedAt, id: eventId },\n { created_at: prev.updatedAt, id: prev.relayListId },\n )\n ) {\n return false;\n }\n\n const write: string[] = [];\n const read: string[] = [];\n for (const item of items) {\n let url: string;\n try {\n url = normalizeURL(item.url);\n } catch {\n continue;\n }\n if (item.marker !== \"read\" && !write.includes(url)) {\n write.push(url);\n }\n if (item.marker !== \"write\" && !read.includes(url)) {\n read.push(url);\n }\n }\n\n this.#put(pk, {\n write: write.slice(0, this.#maxRelays),\n read: read.slice(0, this.#maxRelays),\n dm: prev.dm,\n updatedAt,\n dmUpdatedAt: prev.dmUpdatedAt,\n relayListId: eventId ?? prev.relayListId,\n dmListId: prev.dmListId,\n });\n return true;\n }\n\n setDmRoutes(\n pubkey: string,\n relays: ReadonlyArray<string>,\n updatedAt: number = nowSeconds(),\n eventId?: string,\n ): boolean {\n const pk = pubkey.toLowerCase();\n const prev = this.#lookup(pk) ?? emptyRoutes();\n if (prev.dmUpdatedAt > updatedAt) {\n return false;\n }\n if (\n eventId !== undefined &&\n prev.dmListId !== undefined &&\n prev.dmUpdatedAt === updatedAt &&\n !isReplaceableWinner(\n { created_at: updatedAt, id: eventId },\n { created_at: prev.dmUpdatedAt, id: prev.dmListId },\n )\n ) {\n return false;\n }\n\n const dm = normalizeRelayUrls(relays);\n\n this.#put(pk, {\n write: prev.write,\n read: prev.read,\n dm: dm.slice(0, this.#maxRelays),\n updatedAt: prev.updatedAt,\n dmUpdatedAt: updatedAt,\n relayListId: prev.relayListId,\n dmListId: eventId ?? prev.dmListId,\n });\n return true;\n }\n\n getRoutes(pubkey: string): Readonly<PubkeyRoutes> | undefined {\n return this.#lookup(pubkey.toLowerCase());\n }\n\n outboxRelays(pubkey: string): ReadonlyArray<string> {\n return this.#lookup(pubkey.toLowerCase())?.write ?? [];\n }\n\n inboxRelays(pubkey: string): ReadonlyArray<string> {\n return this.#lookup(pubkey.toLowerCase())?.read ?? [];\n }\n\n /** NIP-17 kind:10050 delivery relays for gift-wraps. */\n dmRelays(pubkey: string): ReadonlyArray<string> {\n return this.#lookup(pubkey.toLowerCase())?.dm ?? [];\n }\n\n clear(pubkey?: string): void {\n if (pubkey !== undefined && pubkey !== \"\") {\n this.#routes.delete(pubkey.toLowerCase());\n } else {\n this.#routes.clear();\n }\n }\n\n get size(): number {\n return this.#routes.size;\n }\n\n /**\n * Route a user-facing filter into per-relay sub-filters plus leftover.\n *\n * - Authors → outbox relays, filter narrowed per relay's authors\n * - #p only → inbox relays of those pubkeys\n * - Neither / all unrouted → remainder is the original filter\n * - Mixed → remainder is the narrowed leftover; all routed → no remainder\n */\n route(filter: Filter): RoutedFilter {\n const authors = filter.authors?.map((a) => a.toLowerCase());\n const pTags = filter[\"#p\"]?.map((p) => p.toLowerCase());\n\n if ((!authors || authors.length === 0) && (!pTags || pTags.length === 0)) {\n return { perRelay: new Map(), remainder: filter };\n }\n\n if (authors && authors.length > 0 && (!pTags || pTags.length === 0)) {\n return this.#breakAuthors(filter, authors, \"write\");\n }\n\n if (pTags && pTags.length > 0 && (!authors || authors.length === 0)) {\n const { authors: _authors, ...base } = filter;\n return this.#breakAuthors(base, pTags, \"read\", (b, pubkeys) => ({ ...b, \"#p\": pubkeys }));\n }\n\n // both authors and #p: send full filter to union of routes\n const unionKeys = new Set([...(authors ?? []), ...(pTags ?? [])]);\n const relays = new Set<string>();\n let anyUnrouted = false;\n for (const pk of unionKeys) {\n const r = this.#lookup(pk);\n const urls = r ? [...r.write, ...r.read] : [];\n if (urls.length === 0) {\n anyUnrouted = true;\n continue;\n }\n for (const u of urls) {\n relays.add(u);\n }\n }\n if (relays.size === 0) {\n return { perRelay: new Map(), remainder: filter };\n }\n const map = new Map<string, Filter>();\n for (const url of relays) {\n map.set(url, { ...filter });\n }\n return anyUnrouted ? { perRelay: map, remainder: filter } : { perRelay: map };\n }\n\n #breakAuthors(\n filter: Filter,\n pubkeys: string[],\n direction: \"read\" | \"write\",\n narrow: (base: Filter, pubkeys: string[]) => Filter = (base, pks) => ({\n ...base,\n authors: pks,\n }),\n ): RoutedFilter {\n const perRelay = new Map<string, string[]>();\n const unrouted: string[] = [];\n let anyRoute = false;\n\n for (const pk of pubkeys) {\n const routes = this.#lookup(pk);\n const urls = direction === \"write\" ? routes?.write : routes?.read;\n if (!urls || urls.length === 0) {\n unrouted.push(pk);\n continue;\n }\n anyRoute = true;\n for (const url of urls) {\n const list = perRelay.get(url) ?? [];\n list.push(pk);\n perRelay.set(url, list);\n }\n }\n\n if (!anyRoute) {\n return { perRelay: new Map(), remainder: filter };\n }\n\n const map = new Map<string, Filter>();\n for (const [url, pks] of perRelay) {\n map.set(url, narrow(filter, pks));\n }\n return unrouted.length > 0\n ? { perRelay: map, remainder: narrow(filter, unrouted) }\n : { perRelay: map };\n }\n\n /** Read that refreshes LRU recency. */\n #lookup(pk: string): PubkeyRoutes | undefined {\n const routes = this.#routes.get(pk);\n if (routes !== undefined) {\n touchKey(this.#routes, pk, routes);\n }\n return routes;\n }\n\n /** Write at the newest LRU end, then trim the oldest beyond the cap. */\n #put(pk: string, routes: PubkeyRoutes): void {\n touchKey(this.#routes, pk, routes);\n trimOldest(this.#routes, this.#maxPubkeys);\n }\n}\n"],"mappings":"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"}
@@ -1,6 +1,6 @@
1
- import { t as Event } from "./event-DJeb_DIL.mjs";
2
- import { t as Filter } from "./filter-jI_9htF7.mjs";
3
- import { t as RelayListItem } from "./nip65-D1fbmhOg.mjs";
1
+ import { t as Event } from "./event-j3BwI5dF.mjs";
2
+ import { t as Filter } from "./filter-CfEgQBXt.mjs";
3
+ import { t as RelayListItem } from "./nip65-BL79HI8N.mjs";
4
4
  //#region src/gossip/gossip.d.ts
5
5
  /** Relay routing state for one pubkey: NIP-65 outbox/inbox plus NIP-17 DM relays. */
6
6
  type PubkeyRoutes = {
@@ -34,7 +34,10 @@ type RoutedFilter = {
34
34
  readonly remainder?: Filter | undefined;
35
35
  };
36
36
  type GossipOptions = {
37
- /** Max relays to keep per direction when ranking. Default 4. */
37
+ /**
38
+ * Max relays kept per direction; the first N in list order win (NIP-65 defines no ranking).
39
+ * Default 4.
40
+ */
38
41
  maxRelaysPerPubkey?: number | undefined;
39
42
  /**
40
43
  * Max pubkeys with tracked routes; the map is LRU — writes and lookups refresh recency, and
@@ -79,4 +82,4 @@ declare class Gossip {
79
82
  }
80
83
  //#endregion
81
84
  export { RoutedFilter as i, GossipOptions as n, PubkeyRoutes as r, Gossip as t };
82
- //# sourceMappingURL=gossip-OOeeFzG5.d.mts.map
85
+ //# sourceMappingURL=gossip-BWb9HmfK.d.mts.map
package/dist/gossip.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { i as RoutedFilter, n as GossipOptions, r as PubkeyRoutes, t as Gossip } from "./gossip-OOeeFzG5.mjs";
1
+ import { i as RoutedFilter, n as GossipOptions, r as PubkeyRoutes, t as Gossip } from "./gossip-BWb9HmfK.mjs";
2
2
  import "./index-CaxrMD1A.mjs";
3
3
  export { Gossip, type GossipOptions, type PubkeyRoutes, type RoutedFilter };
package/dist/gossip.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { t as Gossip } from "./gossip-DFxIBlsr.mjs";
1
+ import { t as Gossip } from "./gossip-5ezg0Quo.mjs";
2
2
  export { Gossip };
@@ -1 +1 @@
1
- {"version":3,"file":"http-CuazNRIP.mjs","names":[],"sources":["../src/nips/http.ts"],"sourcesContent":["/**\n * Shared nips HTTP primitive. Not a pack entry (core has zero network). Callers never pass\n * `redirect`; sendManual always sets `\"manual\"`.\n */\n\nexport type ManualFetch = (\n url: string,\n init?: {\n method?: string;\n headers?: Record<string, string>;\n // oxlint-disable-next-line no-restricted-types -- mirrors RequestInit.body, which is nullable\n body?: Blob | FormData | string | null;\n signal?: AbortSignal | undefined;\n },\n) => Promise<{\n ok: boolean;\n status: number;\n // oxlint-disable-next-line no-restricted-types -- mirrors Headers.get, which returns null\n headers: { get: (name: string) => string | null };\n json: () => Promise<unknown>;\n arrayBuffer: () => Promise<ArrayBuffer>;\n}>;\n\ntype ManualInit = NonNullable<Parameters<ManualFetch>[1]>;\n\nexport function requireGlobalFetch(missing: () => Error): ManualFetch {\n if (typeof globalThis.fetch !== \"function\") {\n throw missing();\n }\n const fetchImpl = globalThis.fetch.bind(globalThis);\n // RequestInit.signal is AbortSignal | null and rejects explicit undefined under\n // exactOptionalPropertyTypes; normalize it for the real fetch.\n return async (url, init) =>\n fetchImpl(url, init === undefined ? init : { ...init, signal: init.signal ?? null });\n}\n\n/** Always sets redirect:manual. Shared by fetchManual and headStatus. */\nexport async function sendManual(\n fetchImpl: ManualFetch,\n url: string,\n init: ManualInit,\n): Promise<Awaited<ReturnType<ManualFetch>>> {\n return fetchImpl(url, { ...init, redirect: \"manual\" } as Parameters<ManualFetch>[1]);\n}\n\nexport async function fetchManual(\n fetchImpl: ManualFetch,\n url: string,\n init: ManualInit,\n wrapNetwork: (err: unknown) => Error,\n): Promise<Awaited<ReturnType<ManualFetch>>> {\n try {\n return await sendManual(fetchImpl, url, init);\n } catch (error) {\n if (error instanceof Error && error.name === \"AbortError\") {\n throw error;\n }\n throw wrapNetwork(error);\n }\n}\n"],"mappings":";AAyBA,SAAgB,mBAAmB,SAAmC;CACpE,IAAI,OAAO,WAAW,UAAU,YAC9B,MAAM,QAAQ;CAEhB,MAAM,YAAY,WAAW,MAAM,KAAK,UAAU;CAGlD,OAAO,OAAO,KAAK,SACjB,UAAU,KAAK,SAAS,KAAA,IAAY,OAAO;EAAE,GAAG;EAAM,QAAQ,KAAK,UAAU;CAAK,CAAC;AACvF;;AAGA,eAAsB,WACpB,WACA,KACA,MAC2C;CAC3C,OAAO,UAAU,KAAK;EAAE,GAAG;EAAM,UAAU;CAAS,CAA+B;AACrF;AAEA,eAAsB,YACpB,WACA,KACA,MACA,aAC2C;CAC3C,IAAI;EACF,OAAO,MAAM,WAAW,WAAW,KAAK,IAAI;CAC9C,SAAS,OAAO;EACd,IAAI,iBAAiB,SAAS,MAAM,SAAS,cAC3C,MAAM;EAER,MAAM,YAAY,KAAK;CACzB;AACF"}
1
+ {"version":3,"file":"http-CuazNRIP.mjs","names":[],"sources":["../src/nips/http.ts"],"sourcesContent":["/**\n * Shared nips HTTP primitive. Not a pack entry (core has zero network). Callers never pass\n * `redirect`; sendManual always sets `\"manual\"`.\n */\n\nexport type ManualFetchInit = {\n method?: string;\n headers?: Record<string, string>;\n // oxlint-disable-next-line no-restricted-types -- mirrors RequestInit.body, which is nullable\n body?: Blob | FormData | string | null;\n signal?: AbortSignal | undefined;\n /**\n * Always `\"manual\"`: NIP-05, NIP-11 and Blossom responses must never be followed through\n * redirects. Adapters must forward this to their underlying fetch implementation.\n */\n redirect: \"manual\";\n};\n\nexport type ManualFetch = (\n url: string,\n init?: ManualFetchInit,\n) => Promise<{\n ok: boolean;\n status: number;\n // oxlint-disable-next-line no-restricted-types -- mirrors Headers.get, which returns null\n headers: { get: (name: string) => string | null };\n json: () => Promise<unknown>;\n arrayBuffer: () => Promise<ArrayBuffer>;\n}>;\n\ntype ManualInit = Omit<ManualFetchInit, \"redirect\">;\n\nexport function requireGlobalFetch(missing: () => Error): ManualFetch {\n if (typeof globalThis.fetch !== \"function\") {\n throw missing();\n }\n const fetchImpl = globalThis.fetch.bind(globalThis);\n // RequestInit.signal is AbortSignal | null and rejects explicit undefined under\n // exactOptionalPropertyTypes; normalize it for the real fetch.\n return async (url, init) =>\n fetchImpl(url, init === undefined ? init : { ...init, signal: init.signal ?? null });\n}\n\n/** Always sets redirect:manual. Shared by fetchManual and headStatus. */\nexport async function sendManual(\n fetchImpl: ManualFetch,\n url: string,\n init: ManualInit,\n): Promise<Awaited<ReturnType<ManualFetch>>> {\n return fetchImpl(url, { ...init, redirect: \"manual\" });\n}\n\nexport async function fetchManual(\n fetchImpl: ManualFetch,\n url: string,\n init: ManualInit,\n wrapNetwork: (err: unknown) => Error,\n): Promise<Awaited<ReturnType<ManualFetch>>> {\n try {\n return await sendManual(fetchImpl, url, init);\n } catch (error) {\n if (error instanceof Error && error.name === \"AbortError\") {\n throw error;\n }\n throw wrapNetwork(error);\n }\n}\n"],"mappings":";AAgCA,SAAgB,mBAAmB,SAAmC;CACpE,IAAI,OAAO,WAAW,UAAU,YAC9B,MAAM,QAAQ;CAEhB,MAAM,YAAY,WAAW,MAAM,KAAK,UAAU;CAGlD,OAAO,OAAO,KAAK,SACjB,UAAU,KAAK,SAAS,KAAA,IAAY,OAAO;EAAE,GAAG;EAAM,QAAQ,KAAK,UAAU;CAAK,CAAC;AACvF;;AAGA,eAAsB,WACpB,WACA,KACA,MAC2C;CAC3C,OAAO,UAAU,KAAK;EAAE,GAAG;EAAM,UAAU;CAAS,CAAC;AACvD;AAEA,eAAsB,YACpB,WACA,KACA,MACA,aAC2C;CAC3C,IAAI;EACF,OAAO,MAAM,WAAW,WAAW,KAAK,IAAI;CAC9C,SAAS,OAAO;EACd,IAAI,iBAAiB,SAAS,MAAM,SAAS,cAC3C,MAAM;EAER,MAAM,YAAY,KAAK;CACzB;AACF"}
@@ -3,12 +3,18 @@
3
3
  * Shared nips HTTP primitive. Not a pack entry (core has zero network). Callers never pass
4
4
  * `redirect`; sendManual always sets `"manual"`.
5
5
  */
6
- type ManualFetch = (url: string, init?: {
6
+ type ManualFetchInit = {
7
7
  method?: string;
8
8
  headers?: Record<string, string>;
9
9
  body?: Blob | FormData | string | null;
10
10
  signal?: AbortSignal | undefined;
11
- }) => Promise<{
11
+ /**
12
+ * Always `"manual"`: NIP-05, NIP-11 and Blossom responses must never be followed through
13
+ * redirects. Adapters must forward this to their underlying fetch implementation.
14
+ */
15
+ redirect: "manual";
16
+ };
17
+ type ManualFetch = (url: string, init?: ManualFetchInit) => Promise<{
12
18
  ok: boolean;
13
19
  status: number;
14
20
  headers: {
@@ -19,4 +25,4 @@ type ManualFetch = (url: string, init?: {
19
25
  }>;
20
26
  //#endregion
21
27
  export { ManualFetch as t };
22
- //# sourceMappingURL=http-C4HwIu4B.d.mts.map
28
+ //# sourceMappingURL=http-kwWG-V1X.d.mts.map
@@ -1,8 +1,8 @@
1
- import { n as EventTemplate, r as UnsignedEvent, t as Event } from "./event-DJeb_DIL.mjs";
2
- import { i as SecretKeyInput, t as Keys } from "./key-D_5OgGT7.mjs";
3
- import { t as Filter } from "./filter-jI_9htF7.mjs";
1
+ import { n as EventTemplate, r as UnsignedEvent, t as Event } from "./event-j3BwI5dF.mjs";
2
+ import { i as SecretKeyInput, t as Keys } from "./key-CyKN1RTi.mjs";
3
+ import { t as Filter } from "./filter-CfEgQBXt.mjs";
4
4
  import { a as NostrError } from "./error-BquXDmIN.mjs";
5
- import { t as NostrSigner } from "./types-DNmiscfd.mjs";
5
+ import { t as NostrSigner } from "./types-BJ4wZ7JJ.mjs";
6
6
  import { n as ClientMetadata, t as BunkerPointer } from "./nip46-BHaxC9TZ.mjs";
7
7
  //#region src/signer/error.d.ts
8
8
  /**
@@ -74,7 +74,7 @@ type Nip46SubscribeOptions = {
74
74
  };
75
75
  /**
76
76
  * Structural relay transport for NIP-46 RPC. Satisfied by {@link import("../relay/pool.ts").Pool};
77
- * constructed above the signer layer so `signer` never imports `relay` (ADR-0001).
77
+ * constructed above the signer layer so `signer` never imports `relay` (see AGENTS.md).
78
78
  */
79
79
  type Nip46Transport = {
80
80
  subscribe: (relays: ReadonlyArray<string>, filters: ReadonlyArray<Filter>, opts?: Nip46SubscribeOptions) => {
@@ -174,4 +174,4 @@ declare class Nip46Signer implements NostrSigner {
174
174
  }
175
175
  //#endregion
176
176
  export { Nip07Signer as a, isNip07Available as c, Nip46Transport as i, KeysSigner as l, Nip46SignerOptions as n, WindowNostr as o, Nip46SubscribeOptions as r, getWindowNostr as s, Nip46Signer as t, NoSignerError as u };
177
- //# sourceMappingURL=index-C_w2WfVz.d.mts.map
177
+ //# sourceMappingURL=index-C0mFpelb.d.mts.map
@@ -1,15 +1,15 @@
1
- import { n as EventTemplate, r as UnsignedEvent, t as Event } from "./event-DJeb_DIL.mjs";
2
- import { t as EventBuilder } from "./builder-CTwkB2zM.mjs";
3
- import { t as Filter } from "./filter-jI_9htF7.mjs";
4
- import { t as Gossip } from "./gossip-OOeeFzG5.mjs";
1
+ import { n as EventTemplate, r as UnsignedEvent, t as Event } from "./event-j3BwI5dF.mjs";
2
+ import { t as EventBuilder } from "./builder-GBddxj8i.mjs";
3
+ import { t as Filter } from "./filter-CfEgQBXt.mjs";
4
+ import { t as Gossip } from "./gossip-BWb9HmfK.mjs";
5
5
  import { a as NostrError } from "./error-BquXDmIN.mjs";
6
- import { _ as Closer, a as PoolFetchResult, n as Pool, o as PoolOptions, s as PoolPublishResult } from "./pool-CqQvUnsq.mjs";
7
- import { t as EventStore } from "./types-BacwnDtU.mjs";
8
- import { t as ReactiveEventStore } from "./reactive-gGqUrzW8.mjs";
9
- import { a as OutboxFeed, n as Loaders } from "./index-CPVEyzNX.mjs";
10
- import { a as Rumor } from "./nip59-C-RWFQIv.mjs";
11
- import { i as ReplyTo, r as Recipient } from "./nip17-B5WgW4C4.mjs";
12
- import { t as NostrSigner } from "./types-DNmiscfd.mjs";
6
+ import { _ as Closer, a as PoolFetchResult, n as Pool, o as PoolOptions, s as PoolPublishResult } from "./pool-BDI_u03Q.mjs";
7
+ import { t as EventStore } from "./types-Ccox7-5v.mjs";
8
+ import { t as ReactiveEventStore } from "./reactive-X4p6nABy.mjs";
9
+ import { a as OutboxFeed, n as Loaders } from "./index-D0M3kjY2.mjs";
10
+ import { a as Rumor } from "./nip59-CdDoJptA.mjs";
11
+ import { i as ReplyTo, r as Recipient } from "./nip17-B7MI82Iq.mjs";
12
+ import { t as NostrSigner } from "./types-BJ4wZ7JJ.mjs";
13
13
  import { t as StorageError } from "./error-BD_0QFKT.mjs";
14
14
  //#region src/client/types.d.ts
15
15
  /** Direction of a {@link Client.sync} run: upload, download, or both. */
@@ -215,9 +215,17 @@ declare class Client {
215
215
  * function.
216
216
  */
217
217
  on<K extends keyof ClientEventMap>(type: K, listener: (err: ClientEventMap[K]) => void): () => void;
218
- /** Ingest one inbound event: index (with relay URL) → meta → persistence. */
218
+ /**
219
+ * Ingest one inbound event: index (with relay URL) → meta → persistence. The event must carry a
220
+ * valid signature; {@link EventValidationError} is thrown otherwise. Events delivered by relay
221
+ * subscriptions are already verified, so this is a WeakSet cache hit on those paths.
222
+ */
219
223
  observe(event: Event, relayUrl?: string): void;
220
- /** Ingest many events (deduped by id, order preserved) as one persist batch. */
224
+ /**
225
+ * Ingest many events (deduped by id, order preserved) as one persist batch. Every event must
226
+ * carry a valid signature — all are verified before anything is ingested, so a batch is
227
+ * all-or-nothing.
228
+ */
221
229
  observeAll(events: ReadonlyArray<Event>): void;
222
230
  /**
223
231
  * Explicitly load kind:10002 and kind:10050 lists for pubkeys and feed gossip. Does not
@@ -282,4 +290,4 @@ declare class Client {
282
290
  }
283
291
  //#endregion
284
292
  export { SyncSummary as _, FetchEachOptions as a, PrivateMessageSendResult as c, SendPrivateMessageOptions as d, SubscribeOptions as f, SyncOptions as g, SyncDirectionName as h, ClientOptions as i, PublishOptions as l, SyncDirection as m, ClientError as n, FetchEventsOptions as o, SubscribePrivateMessagesOptions as p, ClientEventMap as r, FetchPrivateMessagesOptions as s, Client as t, ReceivedPrivateMessage as u };
285
- //# sourceMappingURL=index-Cl_1XdYP.d.mts.map
293
+ //# sourceMappingURL=index-C1m5cHpd.d.mts.map
@@ -1,6 +1,6 @@
1
- import { t as Event } from "./event-DJeb_DIL.mjs";
2
- import { t as Filter } from "./filter-jI_9htF7.mjs";
3
- import { i as PutResult, n as NegentropyItem, r as OutboxBound, t as EventStore } from "./types-BacwnDtU.mjs";
1
+ import { t as Event } from "./event-j3BwI5dF.mjs";
2
+ import { t as Filter } from "./filter-CfEgQBXt.mjs";
3
+ import { i as PutResult, n as NegentropyItem, r as OutboxBound, t as EventStore } from "./types-Ccox7-5v.mjs";
4
4
  //#region src/storage/memory-index.d.ts
5
5
  type MemoryIndexOptions = {
6
6
  /**
@@ -124,6 +124,9 @@ type SqlValue = string | number | null | Uint8Array;
124
124
  * start before the previous one settles, inside or outside a transaction — so drivers need not
125
125
  * support overlapping statements on one connection.
126
126
  *
127
+ * The store does not rely on per-connection PRAGMAs: tag rows are deleted explicitly, so `PRAGMA
128
+ * foreign_keys` may be off on any connection (including transaction connections).
129
+ *
127
130
  * `expo-sqlite` maps onto this interface without changes to query code. Note that
128
131
  * `withExclusiveTransactionAsync` resolves `void` and statements inside the exclusive transaction
129
132
  * must run on the `txn` connection passed to its callback, not on `db` — the result is captured
@@ -185,4 +188,4 @@ declare class SqliteEventStore implements EventStore {
185
188
  }
186
189
  //#endregion
187
190
  export { IndexedDbEventStoreOptions as a, MemoryIndexOptions as c, IndexedDbEventStore as i, SqlValue as n, MemoryEventStore as o, SqliteEventStore as r, MemoryIndex as s, SqlDriver as t };
188
- //# sourceMappingURL=index-BxCBX-8R.d.mts.map
191
+ //# sourceMappingURL=index-CoX7SnO7.d.mts.map
@@ -1,13 +1,13 @@
1
- import { t as Event } from "./event-DJeb_DIL.mjs";
2
- import { n as ProfileMetadata } from "./builder-CTwkB2zM.mjs";
3
- import { t as RelayListItem } from "./nip65-D1fbmhOg.mjs";
4
- import { t as Gossip } from "./gossip-OOeeFzG5.mjs";
1
+ import { t as Event } from "./event-j3BwI5dF.mjs";
2
+ import { n as ProfileMetadata } from "./builder-GBddxj8i.mjs";
3
+ import { t as RelayListItem } from "./nip65-BL79HI8N.mjs";
4
+ import { t as Gossip } from "./gossip-BWb9HmfK.mjs";
5
5
  import { a as NostrError } from "./error-BquXDmIN.mjs";
6
- import { _ as Closer, n as Pool } from "./pool-CqQvUnsq.mjs";
7
- import { r as OutboxBound, t as EventStore } from "./types-BacwnDtU.mjs";
8
- import { t as ReactiveEventStore } from "./reactive-gGqUrzW8.mjs";
6
+ import { _ as Closer, n as Pool } from "./pool-BDI_u03Q.mjs";
7
+ import { r as OutboxBound, t as EventStore } from "./types-Ccox7-5v.mjs";
8
+ import { t as ReactiveEventStore } from "./reactive-X4p6nABy.mjs";
9
9
  import { i as EventPointer, t as AddressPointer } from "./nip19-DpPN17bY.mjs";
10
- import { t as MuteItem } from "./nip51-CR0Q8eym.mjs";
10
+ import { t as MuteItem } from "./nip51-O_vhOiK2.mjs";
11
11
  //#region src/loaders/event.d.ts
12
12
  type EventRef = string | EventPointer | AddressPointer;
13
13
  /**
@@ -186,4 +186,4 @@ type CreateLoadersOptions = {
186
186
  declare function createLoaders(opts: CreateLoadersOptions): Loaders;
187
187
  //#endregion
188
188
  export { EventRef as _, OutboxFeed as a, NostrUser as c, ListLoaders as d, ListResult as f, EventLoader as g, ReplaceableLoader as h, OutboxError as i, ProfileLoader as l, ReplaceableLoadResult as m, Loaders as n, OutboxFeedOptions as o, LoadStyle as p, createLoaders as r, groupAuthorsByOutboxRelay as s, CreateLoadersOptions as t, bareNostrUser as u };
189
- //# sourceMappingURL=index-CPVEyzNX.d.mts.map
189
+ //# sourceMappingURL=index-D0M3kjY2.d.mts.map
@@ -36,7 +36,10 @@ declare function normalizeURL(url: string): string;
36
36
  declare function normalizeRelayUrls(urls: Iterable<string>): string[];
37
37
  //#endregion
38
38
  //#region src/core/kind.d.ts
39
- /** NIP-01 regular: stored by relays. */
39
+ /**
40
+ * NIP-01 regular ranges verbatim; kinds outside every defined range are still stored like regular
41
+ * events (see {@link classifyKind}).
42
+ */
40
43
  declare function isRegularKind(kind: number): boolean;
41
44
  /** Replaceable: latest per (pubkey, kind) wins. */
42
45
  declare function isReplaceableKind(kind: number): boolean;
@@ -45,8 +48,12 @@ declare function isEphemeralKind(kind: number): boolean;
45
48
  /** Addressable (parameterized replaceable): latest per (pubkey, kind, d-tag) wins. */
46
49
  declare function isAddressableKind(kind: number): boolean;
47
50
  /** NIP-01 kind classes: regular / replaceable / ephemeral / addressable. */
48
- type KindClassification = "regular" | "replaceable" | "ephemeral" | "addressable" | "unknown";
49
- /** Classify a kind number into its NIP-01 storage class (`"unknown"` outside all ranges). */
51
+ type KindClassification = "regular" | "replaceable" | "ephemeral" | "addressable";
52
+ /**
53
+ * Classify a kind number into its NIP-01 storage class. NIP-01 leaves kinds 45–999 and 40000+
54
+ * undefined (rather than forbidden); relays store them like regular events, so they classify
55
+ * `"regular"` here even though {@link isRegularKind} returns false for them.
56
+ */
50
57
  declare function classifyKind(kind: number): KindClassification;
51
58
  /** Kind numbers used by this package. */
52
59
  declare const Kind: {
@@ -85,4 +92,4 @@ type KindName = keyof typeof Kind;
85
92
  type KnownKind = (typeof Kind)[KindName];
86
93
  //#endregion
87
94
  export { SUBSCRIPTION_ID_MAX_CHARS as S, normalizeURL as _, classifyKind as a, SECRET_KEY_BYTES as b, isRegularKind as c, assertSecretKeyBytes as d, bytesToHex as f, normalizeRelayUrls as g, isHex64 as h, KnownKind as i, isReplaceableKind as l, isHex32 as m, KindClassification as n, isAddressableKind as o, hexToBytes as p, KindName as r, isEphemeralKind as s, Kind as t, assertHex32 as u, EVENT_ID_BYTES as v, SIGNATURE_BYTES as x, PUBLIC_KEY_BYTES as y };
88
- //# sourceMappingURL=index-DU9tRFTZ.d.mts.map
95
+ //# sourceMappingURL=index-Hp26bgYG.d.mts.map
@@ -1,7 +1,7 @@
1
- import { t as Event } from "./event-DJeb_DIL.mjs";
2
- import { t as Filter } from "./filter-jI_9htF7.mjs";
1
+ import { t as Event } from "./event-j3BwI5dF.mjs";
2
+ import { t as Filter } from "./filter-CfEgQBXt.mjs";
3
3
  import { a as NostrError } from "./error-BquXDmIN.mjs";
4
- import { _ as Closer, n as Pool } from "./pool-CqQvUnsq.mjs";
4
+ import { _ as Closer, n as Pool } from "./pool-BDI_u03Q.mjs";
5
5
  //#region src/relay/error.d.ts
6
6
  /** Base class for relay errors; carries the relay URL when known. */
7
7
  declare class RelayError extends NostrError {
@@ -79,4 +79,4 @@ declare function fetchRouted(pool: Pool, jobs: ReadonlyArray<RoutedJob>, opts?:
79
79
  }): Promise<Event[]>;
80
80
  //#endregion
81
81
  export { isInsecureRelayUrl as a, RelayError as c, RelayTimeoutError as d, fetchRouted as i, RelayPublishError as l, RoutedJob as n, RelayClosedError as o, fanIn as r, RelayConnectionError as s, FanInOptions as t, RelaySuspendedError as u };
82
- //# sourceMappingURL=index-DyKwQnbt.d.mts.map
82
+ //# sourceMappingURL=index-JD1O7m2v.d.mts.map
package/dist/index.d.mts CHANGED
@@ -1,26 +1,26 @@
1
- import { C as isTag, E as tagValue, S as getDTag, T as tagName, _ as Tag, d as signedMatchesUnsigned, f as sortEvents, g as EventAddress, h as validateSignedEvent, i as getEventHash, m as validateEvent, n as EventTemplate, o as isReplaceableWinner, p as sortedEvents, r as UnsignedEvent, s as itemCompare, t as Event, u as serializeEvent, v as TagInput, w as parseEventAddress, x as formatEventAddress, y as eventAddress } from "./event-DJeb_DIL.mjs";
2
- import { a as SigningBackend, c as publicKeyFromHex, i as SecretKeyInput, l as signEvent, n as PublicKey, o as finalizeEvent, r as SecretKey, s as getPublicKey, t as Keys, u as toSecretKey } from "./key-D_5OgGT7.mjs";
3
- import { n as ProfileMetadata, t as EventBuilder } from "./builder-CTwkB2zM.mjs";
4
- import { a as getFilterLimit, c as mergeFilters, i as filterFingerprint, n as canonicalizeFilter, o as matchFilter, r as canonicalizeFilters, s as matchFilters, t as Filter } from "./filter-jI_9htF7.mjs";
5
- import { a as relayListEventBuilder, i as readRelays, n as RelayMarker, o as relayListToTags, r as parseRelayList, s as writeRelays, t as RelayListItem } from "./nip65-D1fbmhOg.mjs";
6
- import { i as RoutedFilter, r as PubkeyRoutes, t as Gossip } from "./gossip-OOeeFzG5.mjs";
7
- import { a as assertSubscriptionId, c as encodeRelayMessage, d as parseRelayMessage, i as SubscriptionId, l as mergeCountHll, n as CountResult, o as createSubscriptionId, r as RelayMessage, s as encodeClientMessage, t as ClientMessage, u as parseClientMessage } from "./message-tclYCVNc.mjs";
8
- import { i as verifyEvent, n as SerializedEventVerifier, r as createEventVerifier, t as EventVerifier } from "./verifier-CgTFpgsC.mjs";
1
+ import { C as tagName, S as parseEventAddress, _ as eventAddress, b as getDTag, c as serializeEvent, d as sortedEvents, f as validateEvent, g as TagInput, h as Tag, i as getEventHash, l as signedMatchesUnsigned, m as EventAddress, n as EventTemplate, o as isReplaceableWinner, p as validateSignedEvent, r as UnsignedEvent, s as itemCompare, t as Event, u as sortEvents, w as tagValue, x as isTag, y as formatEventAddress } from "./event-j3BwI5dF.mjs";
2
+ import { a as SigningBackend, c as publicKeyFromHex, i as SecretKeyInput, l as signEvent, n as PublicKey, o as finalizeEvent, r as SecretKey, s as getPublicKey, t as Keys, u as toSecretKey } from "./key-CyKN1RTi.mjs";
3
+ import { n as ProfileMetadata, t as EventBuilder } from "./builder-GBddxj8i.mjs";
4
+ import { a as getFilterLimit, i as filterFingerprint, n as canonicalizeFilter, o as matchFilter, r as canonicalizeFilters, s as matchFilters, t as Filter } from "./filter-CfEgQBXt.mjs";
5
+ import { a as relayListEventBuilder, i as readRelays, n as RelayMarker, o as relayListToTags, r as parseRelayList, s as writeRelays, t as RelayListItem } from "./nip65-BL79HI8N.mjs";
6
+ import { i as RoutedFilter, r as PubkeyRoutes, t as Gossip } from "./gossip-BWb9HmfK.mjs";
7
+ import { a as assertSubscriptionId, c as encodeRelayMessage, d as parseRelayMessage, i as SubscriptionId, l as mergeCountHll, n as CountResult, o as createSubscriptionId, r as RelayMessage, s as encodeClientMessage, t as ClientMessage, u as parseClientMessage } from "./message-CcUz22qh.mjs";
8
+ import { i as verifyEvent, n as SerializedEventVerifier, r as createEventVerifier, t as EventVerifier } from "./verifier-BjL2M0ka.mjs";
9
9
  import { a as NostrError, i as MessageError, n as EventValidationError, o as UrlError, r as HexError, s as WasmPoisonedError, t as CryptoError } from "./error-BquXDmIN.mjs";
10
- import { _ as Closer, a as PoolFetchResult, c as PoolSubscribeOptions, d as RelayOptions, f as RelayStatus, g as RelayFetchResult, h as RelayFetchEnd, i as PoolEventMap, l as Relay, m as PublishResult, n as Pool, o as PoolOptions, p as RelayStatusName, r as PoolCountResult, s as PoolPublishResult, t as InvalidEventPolicy, u as RelayEventMap, v as RelaySubscription, y as SubscribeOptions } from "./pool-CqQvUnsq.mjs";
10
+ import { _ as Closer, a as PoolFetchResult, c as PoolSubscribeOptions, d as RelayOptions, f as RelayStatus, g as RelayFetchResult, h as RelayFetchEnd, i as PoolEventMap, l as Relay, m as PublishResult, n as Pool, o as PoolOptions, p as RelayStatusName, r as PoolCountResult, s as PoolPublishResult, t as InvalidEventPolicy, u as RelayEventMap, v as RelaySubscription, y as SubscribeOptions } from "./pool-BDI_u03Q.mjs";
11
11
  import { i as useWebSocketImplementation } from "./websocket-CmeqvAkp.mjs";
12
- import { i as PutResult, n as NegentropyItem, r as OutboxBound, t as EventStore } from "./types-BacwnDtU.mjs";
13
- import { i as Watch, n as ReactiveEventStoreEventMap, r as ReactiveEventStoreOptions, t as ReactiveEventStore } from "./reactive-gGqUrzW8.mjs";
12
+ import { i as PutResult, n as NegentropyItem, r as OutboxBound, t as EventStore } from "./types-Ccox7-5v.mjs";
13
+ import { i as Watch, n as ReactiveEventStoreEventMap, r as ReactiveEventStoreOptions, t as ReactiveEventStore } from "./reactive-X4p6nABy.mjs";
14
14
  import { _ as noteEncode, a as NAddr, b as nsecEncode, c as NPub, d as Note, f as ProfilePointer, g as neventEncode, h as naddrEncode, i as EventPointer, l as NSec, n as Bech32MaxSize, o as NEvent, p as decode, r as DecodedResult, s as NProfile, t as AddressPointer, u as Nip19Error, v as nprofileEncode, y as npubEncode } from "./nip19-DpPN17bY.mjs";
15
- import { a as OutboxFeed, c as NostrUser, f as ListResult, h as ReplaceableLoader, i as OutboxError, m as ReplaceableLoadResult, n as Loaders, o as OutboxFeedOptions, p as LoadStyle, r as createLoaders, s as groupAuthorsByOutboxRelay, u as bareNostrUser } from "./index-CPVEyzNX.mjs";
16
- import { t as NostrSigner } from "./types-DNmiscfd.mjs";
15
+ import { a as OutboxFeed, c as NostrUser, f as ListResult, h as ReplaceableLoader, i as OutboxError, m as ReplaceableLoadResult, n as Loaders, o as OutboxFeedOptions, p as LoadStyle, r as createLoaders, s as groupAuthorsByOutboxRelay, u as bareNostrUser } from "./index-D0M3kjY2.mjs";
16
+ import { t as NostrSigner } from "./types-BJ4wZ7JJ.mjs";
17
17
  import { t as StorageError } from "./error-BD_0QFKT.mjs";
18
- import { _ as SyncSummary, c as PrivateMessageSendResult, d as SendPrivateMessageOptions, g as SyncOptions, h as SyncDirectionName, i as ClientOptions, m as SyncDirection, n as ClientError, p as SubscribePrivateMessagesOptions, r as ClientEventMap, s as FetchPrivateMessagesOptions, t as Client, u as ReceivedPrivateMessage } from "./index-Cl_1XdYP.mjs";
19
- import { S as SUBSCRIPTION_ID_MAX_CHARS, _ as normalizeURL, a as classifyKind, b as SECRET_KEY_BYTES, c as isRegularKind, f as bytesToHex, h as isHex64, i as KnownKind, l as isReplaceableKind, m as isHex32, n as KindClassification, o as isAddressableKind, p as hexToBytes, r as KindName, s as isEphemeralKind, t as Kind, v as EVENT_ID_BYTES, x as SIGNATURE_BYTES, y as PUBLIC_KEY_BYTES } from "./index-DU9tRFTZ.mjs";
20
- import { a as Nip07Signer, c as isNip07Available, i as Nip46Transport, l as KeysSigner, n as Nip46SignerOptions, o as WindowNostr, r as Nip46SubscribeOptions, s as getWindowNostr, t as Nip46Signer, u as NoSignerError } from "./index-C_w2WfVz.mjs";
18
+ import { _ as SyncSummary, c as PrivateMessageSendResult, d as SendPrivateMessageOptions, g as SyncOptions, h as SyncDirectionName, i as ClientOptions, m as SyncDirection, n as ClientError, p as SubscribePrivateMessagesOptions, r as ClientEventMap, s as FetchPrivateMessagesOptions, t as Client, u as ReceivedPrivateMessage } from "./index-C1m5cHpd.mjs";
19
+ import { S as SUBSCRIPTION_ID_MAX_CHARS, _ as normalizeURL, a as classifyKind, b as SECRET_KEY_BYTES, c as isRegularKind, f as bytesToHex, h as isHex64, i as KnownKind, l as isReplaceableKind, m as isHex32, n as KindClassification, o as isAddressableKind, p as hexToBytes, r as KindName, s as isEphemeralKind, t as Kind, v as EVENT_ID_BYTES, x as SIGNATURE_BYTES, y as PUBLIC_KEY_BYTES } from "./index-Hp26bgYG.mjs";
20
+ import { a as Nip07Signer, c as isNip07Available, i as Nip46Transport, l as KeysSigner, n as Nip46SignerOptions, o as WindowNostr, r as Nip46SubscribeOptions, s as getWindowNostr, t as Nip46Signer, u as NoSignerError } from "./index-C0mFpelb.mjs";
21
21
  import { Nip21Error, NostrURI, isNostrURI, parseNostrURI } from "./nips/nip21.mjs";
22
22
  import { ReplyTagsOptions, ThreadReferences, buildReplyTags, parseThreadTags, replyTo } from "./nips/nip10.mjs";
23
23
  import { isAuthRequired, makeAuthEvent } from "./nips/nip42.mjs";
24
- import { a as isInsecureRelayUrl, c as RelayError, d as RelayTimeoutError, l as RelayPublishError, o as RelayClosedError, s as RelayConnectionError, u as RelaySuspendedError } from "./index-DyKwQnbt.mjs";
25
- import { a as IndexedDbEventStoreOptions, i as IndexedDbEventStore, n as SqlValue, o as MemoryEventStore, r as SqliteEventStore, t as SqlDriver } from "./index-BxCBX-8R.mjs";
26
- export { type AddressPointer, Bech32MaxSize, Client, ClientError, type ClientEventMap, type ClientMessage, type ClientOptions, type Closer, type CountResult, CryptoError, type DecodedResult, EVENT_ID_BYTES, type Event, type EventAddress, EventBuilder, type EventPointer, type EventStore, type EventTemplate, EventValidationError, type EventVerifier, type FetchPrivateMessagesOptions, type Filter, Gossip, HexError, IndexedDbEventStore, type IndexedDbEventStoreOptions, type InvalidEventPolicy, Keys, KeysSigner, Kind, type KindClassification, type KindName, type KnownKind, type ListResult, type LoadStyle, type Loaders, MemoryEventStore, MessageError, type NAddr, type NEvent, type NProfile, type NPub, type NSec, type NegentropyItem, Nip07Signer, Nip19Error, Nip21Error, Nip46Signer, type Nip46SignerOptions, type Nip46SubscribeOptions, type Nip46Transport, NoSignerError, NostrError, type NostrSigner, type NostrURI, type NostrUser, type Note, type OutboxBound, OutboxError, OutboxFeed, type OutboxFeedOptions, PUBLIC_KEY_BYTES, Pool, type PoolCountResult, type PoolEventMap, type PoolFetchResult, type PoolOptions, type PoolPublishResult, type PoolSubscribeOptions, type PrivateMessageSendResult, type ProfileMetadata, type ProfilePointer, type PubkeyRoutes, type PublicKey, type PublishResult, type PutResult, ReactiveEventStore, type ReactiveEventStoreEventMap, type ReactiveEventStoreOptions, type ReceivedPrivateMessage, Relay, RelayClosedError, RelayConnectionError, RelayError, type RelayEventMap, type RelayFetchEnd, type RelayFetchResult, type RelayListItem, type RelayMarker, type RelayMessage, type RelayOptions, RelayPublishError, RelayStatus, type RelayStatusName, type RelaySubscription, RelaySuspendedError, RelayTimeoutError, type ReplaceableLoadResult, type ReplaceableLoader, type ReplyTagsOptions, type RoutedFilter, SECRET_KEY_BYTES, SIGNATURE_BYTES, SUBSCRIPTION_ID_MAX_CHARS, SecretKey, type SecretKeyInput, type SendPrivateMessageOptions, type SerializedEventVerifier, type SigningBackend, type SqlDriver, type SqlValue, SqliteEventStore, StorageError, type SubscribeOptions, type SubscribePrivateMessagesOptions, type SubscriptionId, SyncDirection, type SyncDirectionName, type SyncOptions, type SyncSummary, Tag, type TagInput, type ThreadReferences, type UnsignedEvent, UrlError, WasmPoisonedError, type Watch, type WindowNostr, assertSubscriptionId, bareNostrUser, buildReplyTags, bytesToHex, canonicalizeFilter, canonicalizeFilters, classifyKind, createEventVerifier, createLoaders, createSubscriptionId, encodeClientMessage, encodeRelayMessage, eventAddress, filterFingerprint, finalizeEvent, formatEventAddress, getDTag, getEventHash, getFilterLimit, getPublicKey, getWindowNostr, groupAuthorsByOutboxRelay, hexToBytes, isAddressableKind, isAuthRequired, isEphemeralKind, isHex32, isHex64, isInsecureRelayUrl, isNip07Available, isNostrURI, isRegularKind, isReplaceableKind, isReplaceableWinner, isTag, itemCompare, makeAuthEvent, matchFilter, matchFilters, mergeCountHll, mergeFilters, naddrEncode, neventEncode, decode as nip19Decode, normalizeURL, noteEncode, nprofileEncode, npubEncode, nsecEncode, parseClientMessage, parseEventAddress, parseNostrURI, parseRelayList, parseRelayMessage, parseThreadTags, publicKeyFromHex, readRelays, relayListEventBuilder, relayListToTags, replyTo, serializeEvent, signEvent, signedMatchesUnsigned, sortEvents, sortedEvents, tagName, tagValue, toSecretKey, useWebSocketImplementation, validateEvent, validateSignedEvent, verifyEvent, writeRelays };
24
+ import { a as isInsecureRelayUrl, c as RelayError, d as RelayTimeoutError, l as RelayPublishError, o as RelayClosedError, s as RelayConnectionError, u as RelaySuspendedError } from "./index-JD1O7m2v.mjs";
25
+ import { a as IndexedDbEventStoreOptions, i as IndexedDbEventStore, n as SqlValue, o as MemoryEventStore, r as SqliteEventStore, t as SqlDriver } from "./index-CoX7SnO7.mjs";
26
+ export { type AddressPointer, Bech32MaxSize, Client, ClientError, type ClientEventMap, type ClientMessage, type ClientOptions, type Closer, type CountResult, CryptoError, type DecodedResult, EVENT_ID_BYTES, type Event, type EventAddress, EventBuilder, type EventPointer, type EventStore, type EventTemplate, EventValidationError, type EventVerifier, type FetchPrivateMessagesOptions, type Filter, Gossip, HexError, IndexedDbEventStore, type IndexedDbEventStoreOptions, type InvalidEventPolicy, Keys, KeysSigner, Kind, type KindClassification, type KindName, type KnownKind, type ListResult, type LoadStyle, type Loaders, MemoryEventStore, MessageError, type NAddr, type NEvent, type NProfile, type NPub, type NSec, type NegentropyItem, Nip07Signer, Nip19Error, Nip21Error, Nip46Signer, type Nip46SignerOptions, type Nip46SubscribeOptions, type Nip46Transport, NoSignerError, NostrError, type NostrSigner, type NostrURI, type NostrUser, type Note, type OutboxBound, OutboxError, OutboxFeed, type OutboxFeedOptions, PUBLIC_KEY_BYTES, Pool, type PoolCountResult, type PoolEventMap, type PoolFetchResult, type PoolOptions, type PoolPublishResult, type PoolSubscribeOptions, type PrivateMessageSendResult, type ProfileMetadata, type ProfilePointer, type PubkeyRoutes, type PublicKey, type PublishResult, type PutResult, ReactiveEventStore, type ReactiveEventStoreEventMap, type ReactiveEventStoreOptions, type ReceivedPrivateMessage, Relay, RelayClosedError, RelayConnectionError, RelayError, type RelayEventMap, type RelayFetchEnd, type RelayFetchResult, type RelayListItem, type RelayMarker, type RelayMessage, type RelayOptions, RelayPublishError, RelayStatus, type RelayStatusName, type RelaySubscription, RelaySuspendedError, RelayTimeoutError, type ReplaceableLoadResult, type ReplaceableLoader, type ReplyTagsOptions, type RoutedFilter, SECRET_KEY_BYTES, SIGNATURE_BYTES, SUBSCRIPTION_ID_MAX_CHARS, SecretKey, type SecretKeyInput, type SendPrivateMessageOptions, type SerializedEventVerifier, type SigningBackend, type SqlDriver, type SqlValue, SqliteEventStore, StorageError, type SubscribeOptions, type SubscribePrivateMessagesOptions, type SubscriptionId, SyncDirection, type SyncDirectionName, type SyncOptions, type SyncSummary, Tag, type TagInput, type ThreadReferences, type UnsignedEvent, UrlError, WasmPoisonedError, type Watch, type WindowNostr, assertSubscriptionId, bareNostrUser, buildReplyTags, bytesToHex, canonicalizeFilter, canonicalizeFilters, classifyKind, createEventVerifier, createLoaders, createSubscriptionId, encodeClientMessage, encodeRelayMessage, eventAddress, filterFingerprint, finalizeEvent, formatEventAddress, getDTag, getEventHash, getFilterLimit, getPublicKey, getWindowNostr, groupAuthorsByOutboxRelay, hexToBytes, isAddressableKind, isAuthRequired, isEphemeralKind, isHex32, isHex64, isInsecureRelayUrl, isNip07Available, isNostrURI, isRegularKind, isReplaceableKind, isReplaceableWinner, isTag, itemCompare, makeAuthEvent, matchFilter, matchFilters, mergeCountHll, naddrEncode, neventEncode, decode as nip19Decode, normalizeURL, noteEncode, nprofileEncode, npubEncode, nsecEncode, parseClientMessage, parseEventAddress, parseNostrURI, parseRelayList, parseRelayMessage, parseThreadTags, publicKeyFromHex, readRelays, relayListEventBuilder, relayListToTags, replyTo, serializeEvent, signEvent, signedMatchesUnsigned, sortEvents, sortedEvents, tagName, tagValue, toSecretKey, useWebSocketImplementation, validateEvent, validateSignedEvent, verifyEvent, writeRelays };
package/dist/index.mjs CHANGED
@@ -1,27 +1,27 @@
1
1
  import { C as EVENT_ID_BYTES, D as SUBSCRIPTION_ID_MAX_CHARS, E as SIGNATURE_BYTES, T as SECRET_KEY_BYTES, _ as MessageError, a as hexToBytes, b as WasmPoisonedError, g as HexError, h as EventValidationError, i as bytesToHex, m as CryptoError, o as isHex32, s as isHex64, u as normalizeURL, v as NostrError, w as PUBLIC_KEY_BYTES, y as UrlError } from "./util-DMF9AIO0.mjs";
2
- import { a as isRegularKind, i as isEphemeralKind, n as classifyKind, o as isReplaceableKind, r as isAddressableKind, t as Kind } from "./kind-Cxwhhkx8.mjs";
3
- import { C as tagValue, S as tagName, a as isReplaceableWinner, b as isTag, d as sortEvents, f as sortedEvents, g as eventAddress, h as Tag, l as serializeEvent, m as validateSignedEvent, n as getEventHash, o as itemCompare, p as validateEvent, u as signedMatchesUnsigned, v as formatEventAddress, x as parseEventAddress, y as getDTag } from "./event-CHf47dPM.mjs";
4
- import { a as publicKeyFromHex, i as getPublicKey, n as SecretKey, o as signEvent, r as finalizeEvent, s as toSecretKey, t as Keys } from "./key-DnVpchl6.mjs";
5
- import { n as verifyEvent, t as createEventVerifier } from "./verifier-B51Wkt5H.mjs";
6
- import { t as EventBuilder } from "./builder-aNU2gGFP.mjs";
7
- import { a as matchFilter, i as getFilterLimit, n as canonicalizeFilters, o as matchFilters, r as filterFingerprint, s as mergeFilters, t as canonicalizeFilter } from "./filter-BQl3GlHt.mjs";
8
- import { a as mergeCountHll, i as encodeRelayMessage, n as createSubscriptionId, o as parseClientMessage, r as encodeClientMessage, s as parseRelayMessage, t as assertSubscriptionId } from "./message-oNr7t0SJ.mjs";
2
+ import { a as isRegularKind, i as isEphemeralKind, n as classifyKind, o as isReplaceableKind, r as isAddressableKind, t as Kind } from "./kind-D8fENiiL.mjs";
3
+ import { C as tagName, S as parseEventAddress, _ as eventAddress, a as isReplaceableWinner, b as getDTag, d as signedMatchesUnsigned, f as sortEvents, g as Tag, h as validateSignedEvent, l as serializeEvent, m as validateEvent, n as getEventHash, o as itemCompare, p as sortedEvents, w as tagValue, x as isTag, y as formatEventAddress } from "./event-C2eLiPpV.mjs";
4
+ import { a as publicKeyFromHex, i as getPublicKey, n as SecretKey, o as signEvent, r as finalizeEvent, s as toSecretKey, t as Keys } from "./key-DY_HEIpY.mjs";
5
+ import { n as verifyEvent, t as createEventVerifier } from "./verifier-uC_jd-Nw.mjs";
6
+ import { t as EventBuilder } from "./builder-CVRmUeNm.mjs";
7
+ import { a as matchFilter, i as getFilterLimit, n as canonicalizeFilters, o as matchFilters, r as filterFingerprint, t as canonicalizeFilter } from "./filter-TrF2LEoy.mjs";
8
+ import { a as mergeCountHll, i as encodeRelayMessage, n as createSubscriptionId, o as parseClientMessage, r as encodeClientMessage, s as parseRelayMessage, t as assertSubscriptionId } from "./message-Rd5Z_17h.mjs";
9
9
  import { t as NoSignerError } from "./error-DlhGW4mJ.mjs";
10
- import { a as KeysSigner, i as isNip07Available, n as Nip07Signer, r as getWindowNostr, t as Nip46Signer } from "./signer-poTGe6Er.mjs";
10
+ import { a as KeysSigner, i as isNip07Available, n as Nip07Signer, r as getWindowNostr, t as Nip46Signer } from "./signer-D7PtVvQn.mjs";
11
11
  import { Bech32MaxSize, Nip19Error, decode, naddrEncode, neventEncode, noteEncode, nprofileEncode, npubEncode, nsecEncode } from "./nips/nip19.mjs";
12
12
  import { Nip21Error, isNostrURI, parseNostrURI } from "./nips/nip21.mjs";
13
13
  import { buildReplyTags, parseThreadTags, replyTo } from "./nips/nip10.mjs";
14
14
  import { isAuthRequired, makeAuthEvent } from "./nips/nip42.mjs";
15
15
  import { parseRelayList, readRelays, relayListEventBuilder, relayListToTags, writeRelays } from "./nips/nip65.mjs";
16
- import { c as RelayConnectionError, d as RelaySuspendedError, f as RelayTimeoutError, l as RelayError, n as Relay, o as useWebSocketImplementation, r as RelayStatus, s as RelayClosedError, u as RelayPublishError } from "./relay-quCs7MHD.mjs";
17
- import { i as isInsecureRelayUrl, t as Pool } from "./pool-vlw74C4t.mjs";
16
+ import { c as RelayConnectionError, d as RelaySuspendedError, f as RelayTimeoutError, l as RelayError, n as Relay, o as useWebSocketImplementation, r as RelayStatus, s as RelayClosedError, u as RelayPublishError } from "./relay-__QtO33h.mjs";
17
+ import { i as isInsecureRelayUrl, t as Pool } from "./pool-jok2-iBJ.mjs";
18
18
  import "./relay.mjs";
19
- import { t as Gossip } from "./gossip-DFxIBlsr.mjs";
20
- import { a as bareNostrUser, i as groupAuthorsByOutboxRelay, n as OutboxError, r as OutboxFeed, t as createLoaders } from "./loaders-BmPkQfzI.mjs";
19
+ import { t as Gossip } from "./gossip-5ezg0Quo.mjs";
20
+ import { a as bareNostrUser, i as groupAuthorsByOutboxRelay, n as OutboxError, r as OutboxFeed, t as createLoaders } from "./loaders-DifimjJ7.mjs";
21
21
  import { t as StorageError } from "./error-BILMe3Gr.mjs";
22
- import { t as MemoryEventStore } from "./memory-CdJ07kub.mjs";
23
- import { t as ReactiveEventStore } from "./reactive-Tz0otDIP.mjs";
24
- import { n as ClientError, r as SyncDirection, t as Client } from "./client-Cj2lUaVh.mjs";
25
- import { n as IndexedDbEventStore, t as SqliteEventStore } from "./storage-B5IXTVuS.mjs";
22
+ import { t as MemoryEventStore } from "./memory-DENGQ_f6.mjs";
23
+ import { t as ReactiveEventStore } from "./reactive-6Wn9qf_d.mjs";
24
+ import { n as ClientError, r as SyncDirection, t as Client } from "./client-CeyDLoyO.mjs";
25
+ import { n as IndexedDbEventStore, t as SqliteEventStore } from "./storage-oihjE0_x.mjs";
26
26
  import "./store.mjs";
27
- export { Bech32MaxSize, Client, ClientError, CryptoError, EVENT_ID_BYTES, EventBuilder, EventValidationError, Gossip, HexError, IndexedDbEventStore, Keys, KeysSigner, Kind, MemoryEventStore, MessageError, Nip07Signer, Nip19Error, Nip21Error, Nip46Signer, NoSignerError, NostrError, OutboxError, OutboxFeed, PUBLIC_KEY_BYTES, Pool, ReactiveEventStore, Relay, RelayClosedError, RelayConnectionError, RelayError, RelayPublishError, RelayStatus, RelaySuspendedError, RelayTimeoutError, SECRET_KEY_BYTES, SIGNATURE_BYTES, SUBSCRIPTION_ID_MAX_CHARS, SecretKey, SqliteEventStore, StorageError, SyncDirection, Tag, UrlError, WasmPoisonedError, assertSubscriptionId, bareNostrUser, buildReplyTags, bytesToHex, canonicalizeFilter, canonicalizeFilters, classifyKind, createEventVerifier, createLoaders, createSubscriptionId, encodeClientMessage, encodeRelayMessage, eventAddress, filterFingerprint, finalizeEvent, formatEventAddress, getDTag, getEventHash, getFilterLimit, getPublicKey, getWindowNostr, groupAuthorsByOutboxRelay, hexToBytes, isAddressableKind, isAuthRequired, isEphemeralKind, isHex32, isHex64, isInsecureRelayUrl, isNip07Available, isNostrURI, isRegularKind, isReplaceableKind, isReplaceableWinner, isTag, itemCompare, makeAuthEvent, matchFilter, matchFilters, mergeCountHll, mergeFilters, naddrEncode, neventEncode, decode as nip19Decode, normalizeURL, noteEncode, nprofileEncode, npubEncode, nsecEncode, parseClientMessage, parseEventAddress, parseNostrURI, parseRelayList, parseRelayMessage, parseThreadTags, publicKeyFromHex, readRelays, relayListEventBuilder, relayListToTags, replyTo, serializeEvent, signEvent, signedMatchesUnsigned, sortEvents, sortedEvents, tagName, tagValue, toSecretKey, useWebSocketImplementation, validateEvent, validateSignedEvent, verifyEvent, writeRelays };
27
+ export { Bech32MaxSize, Client, ClientError, CryptoError, EVENT_ID_BYTES, EventBuilder, EventValidationError, Gossip, HexError, IndexedDbEventStore, Keys, KeysSigner, Kind, MemoryEventStore, MessageError, Nip07Signer, Nip19Error, Nip21Error, Nip46Signer, NoSignerError, NostrError, OutboxError, OutboxFeed, PUBLIC_KEY_BYTES, Pool, ReactiveEventStore, Relay, RelayClosedError, RelayConnectionError, RelayError, RelayPublishError, RelayStatus, RelaySuspendedError, RelayTimeoutError, SECRET_KEY_BYTES, SIGNATURE_BYTES, SUBSCRIPTION_ID_MAX_CHARS, SecretKey, SqliteEventStore, StorageError, SyncDirection, Tag, UrlError, WasmPoisonedError, assertSubscriptionId, bareNostrUser, buildReplyTags, bytesToHex, canonicalizeFilter, canonicalizeFilters, classifyKind, createEventVerifier, createLoaders, createSubscriptionId, encodeClientMessage, encodeRelayMessage, eventAddress, filterFingerprint, finalizeEvent, formatEventAddress, getDTag, getEventHash, getFilterLimit, getPublicKey, getWindowNostr, groupAuthorsByOutboxRelay, hexToBytes, isAddressableKind, isAuthRequired, isEphemeralKind, isHex32, isHex64, isInsecureRelayUrl, isNip07Available, isNostrURI, isRegularKind, isReplaceableKind, isReplaceableWinner, isTag, itemCompare, makeAuthEvent, matchFilter, matchFilters, mergeCountHll, naddrEncode, neventEncode, decode as nip19Decode, normalizeURL, noteEncode, nprofileEncode, npubEncode, nsecEncode, parseClientMessage, parseEventAddress, parseNostrURI, parseRelayList, parseRelayMessage, parseThreadTags, publicKeyFromHex, readRelays, relayListEventBuilder, relayListToTags, replyTo, serializeEvent, signEvent, signedMatchesUnsigned, sortEvents, sortedEvents, tagName, tagValue, toSecretKey, useWebSocketImplementation, validateEvent, validateSignedEvent, verifyEvent, writeRelays };
@@ -1,5 +1,5 @@
1
1
  import { b as WasmPoisonedError, m as CryptoError } from "./util-DMF9AIO0.mjs";
2
- import { t as createEventVerifier } from "./verifier-B51Wkt5H.mjs";
2
+ import { t as createEventVerifier } from "./verifier-uC_jd-Nw.mjs";
3
3
  //#region src/wasm/abi.ts
4
4
  /** Imports 0.2.122 may request. Instantiation fails if anything else appears. */
5
5
  const ALLOWED_WASM_IMPORTS = [{
@@ -217,4 +217,4 @@ function createNostrWasmLoader(wasmBytes) {
217
217
  //#endregion
218
218
  export { fetchWasmUrl as n, isWasmBytes as r, createNostrWasmLoader as t };
219
219
 
220
- //# sourceMappingURL=instance-C62w3cEt.mjs.map
220
+ //# sourceMappingURL=instance-CI_IaZpf.mjs.map