@qntx/nostr 0.1.0 → 0.2.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 (185) hide show
  1. package/dist/abort-Ba8tDrOI.mjs +38 -0
  2. package/dist/abort-Ba8tDrOI.mjs.map +1 -0
  3. package/dist/{builder-BphJa-Y-.d.mts → builder-BWn55Paf.d.mts} +20 -14
  4. package/dist/{builder-q0VsvnYE.mjs → builder-CyrGKRVP.mjs} +32 -16
  5. package/dist/builder-CyrGKRVP.mjs.map +1 -0
  6. package/dist/{client-Bd8B1mYm.mjs → client-BWsX9Cv1.mjs} +354 -195
  7. package/dist/client-BWsX9Cv1.mjs.map +1 -0
  8. package/dist/client.d.mts +1 -1
  9. package/dist/client.mjs +1 -1
  10. package/dist/core.d.mts +8 -8
  11. package/dist/core.mjs +8 -9
  12. package/dist/error-BW7re1UN.d.mts +9 -0
  13. package/dist/error-B__OMBRY.mjs +14 -0
  14. package/dist/error-B__OMBRY.mjs.map +1 -0
  15. package/dist/{error-WEFS-R-4.d.mts → error-CR8Urc84.d.mts} +20 -8
  16. package/dist/{error-CwBxle6N.mjs → error-DrEIM7FO.mjs} +5 -3
  17. package/dist/error-DrEIM7FO.mjs.map +1 -0
  18. package/dist/{event-CzoQEFMF.mjs → event-D8Nfoh4K.mjs} +40 -32
  19. package/dist/event-D8Nfoh4K.mjs.map +1 -0
  20. package/dist/{event-B5D2jxt_.d.mts → event-fU3Y01PR.d.mts} +23 -20
  21. package/dist/{filter-BxwjEkZp.mjs → filter-BQl3GlHt.mjs} +42 -35
  22. package/dist/filter-BQl3GlHt.mjs.map +1 -0
  23. package/dist/filter-C0IMByE3.d.mts +37 -0
  24. package/dist/{gossip-C5RVB1UB.d.mts → gossip-BRQwIM_q.d.mts} +25 -23
  25. package/dist/{gossip-3xkRRCm_.mjs → gossip-oloDMWEj.mjs} +52 -34
  26. package/dist/gossip-oloDMWEj.mjs.map +1 -0
  27. package/dist/gossip.d.mts +1 -1
  28. package/dist/gossip.mjs +1 -1
  29. package/dist/{http-6vevbBlu.d.mts → http-C4HwIu4B.d.mts} +7 -7
  30. package/dist/{http-D2rhokZo.mjs → http-CuazNRIP.mjs} +10 -6
  31. package/dist/http-CuazNRIP.mjs.map +1 -0
  32. package/dist/index-B425CAcQ.d.mts +328 -0
  33. package/dist/index-BVyfUBuG.d.mts +181 -0
  34. package/dist/{index-BYMnhRIC.d.mts → index-Ba7bJ7DD.d.mts} +68 -50
  35. package/dist/{index-DaRyjo7O.d.mts → index-Boe8FshM.d.mts} +13 -7
  36. package/dist/index-CUIvFQdE.d.mts +73 -0
  37. package/dist/index-JdaS_uce.d.mts +207 -0
  38. package/dist/index.d.mts +22 -20
  39. package/dist/index.mjs +19 -18
  40. package/dist/{key-Dn-aX4x4.mjs → key-Bbtys6o7.mjs} +22 -14
  41. package/dist/key-Bbtys6o7.mjs.map +1 -0
  42. package/dist/{key-BiGxGLhg.d.mts → key-BlsYhN1V.d.mts} +9 -6
  43. package/dist/{kind-BLl4cLOc.mjs → kind-Cxwhhkx8.mjs} +2 -1
  44. package/dist/kind-Cxwhhkx8.mjs.map +1 -0
  45. package/dist/{loaders-BNQszDAn.mjs → loaders-o6YXB_Ri.mjs} +329 -305
  46. package/dist/loaders-o6YXB_Ri.mjs.map +1 -0
  47. package/dist/loaders.d.mts +3 -3
  48. package/dist/loaders.mjs +2 -2
  49. package/dist/memory-C2EVx0_O.mjs +46 -0
  50. package/dist/memory-C2EVx0_O.mjs.map +1 -0
  51. package/dist/{memory-BCmhZPek.mjs → memory-index-Do1mz0WF.mjs} +212 -82
  52. package/dist/memory-index-Do1mz0WF.mjs.map +1 -0
  53. package/dist/{message-C_Uj-Y-c.mjs → message-DcY6Fi9o.mjs} +38 -24
  54. package/dist/message-DcY6Fi9o.mjs.map +1 -0
  55. package/dist/{message-DJC-Jz6T.d.mts → message-iGPIqnn0.d.mts} +15 -8
  56. package/dist/{nip17-BWq-Kfq5.d.mts → nip17-DNEkz8rM.d.mts} +18 -17
  57. package/dist/{nip19-D7905oIv.d.mts → nip19-BevCJZsp.d.mts} +23 -3
  58. package/dist/{nip46-C_DoxiS_.d.mts → nip46-DDV4dC56.d.mts} +13 -12
  59. package/dist/{nip59-DljW_sYh.d.mts → nip59-zQgdLcEr.d.mts} +28 -25
  60. package/dist/{nip65-Di5hZRuV.d.mts → nip65-DBfh2smt.d.mts} +8 -3
  61. package/dist/{nip77-ByxlgoQO.d.mts → nip77-DH4RhS5r.d.mts} +9 -8
  62. package/dist/nips/blossom.d.mts +37 -37
  63. package/dist/nips/blossom.mjs +67 -52
  64. package/dist/nips/blossom.mjs.map +1 -1
  65. package/dist/nips/nip04.d.mts +2 -3
  66. package/dist/nips/nip04.mjs +6 -10
  67. package/dist/nips/nip04.mjs.map +1 -1
  68. package/dist/nips/nip05.d.mts +37 -43
  69. package/dist/nips/nip05.mjs +57 -57
  70. package/dist/nips/nip05.mjs.map +1 -1
  71. package/dist/nips/nip10.d.mts +18 -19
  72. package/dist/nips/nip10.mjs +76 -61
  73. package/dist/nips/nip10.mjs.map +1 -1
  74. package/dist/nips/nip11.d.mts +9 -8
  75. package/dist/nips/nip11.mjs +14 -11
  76. package/dist/nips/nip11.mjs.map +1 -1
  77. package/dist/nips/nip13.d.mts +9 -9
  78. package/dist/nips/nip13.mjs +15 -17
  79. package/dist/nips/nip13.mjs.map +1 -1
  80. package/dist/nips/nip17.d.mts +1 -1
  81. package/dist/nips/nip17.mjs +17 -12
  82. package/dist/nips/nip17.mjs.map +1 -1
  83. package/dist/nips/nip19.d.mts +1 -1
  84. package/dist/nips/nip19.mjs +52 -29
  85. package/dist/nips/nip19.mjs.map +1 -1
  86. package/dist/nips/nip21.d.mts +5 -6
  87. package/dist/nips/nip21.mjs +8 -7
  88. package/dist/nips/nip21.mjs.map +1 -1
  89. package/dist/nips/nip27.d.mts +7 -8
  90. package/dist/nips/nip27.mjs +26 -25
  91. package/dist/nips/nip27.mjs.map +1 -1
  92. package/dist/nips/nip42.d.mts +5 -6
  93. package/dist/nips/nip42.mjs +3 -3
  94. package/dist/nips/nip42.mjs.map +1 -1
  95. package/dist/nips/nip44.d.mts +24 -7
  96. package/dist/nips/nip44.mjs +25 -15
  97. package/dist/nips/nip44.mjs.map +1 -1
  98. package/dist/nips/nip46.d.mts +1 -1
  99. package/dist/nips/nip46.mjs +52 -49
  100. package/dist/nips/nip46.mjs.map +1 -1
  101. package/dist/nips/nip49.d.mts +8 -7
  102. package/dist/nips/nip49.mjs +16 -12
  103. package/dist/nips/nip49.mjs.map +1 -1
  104. package/dist/nips/nip51.d.mts +25 -27
  105. package/dist/nips/nip51.mjs +47 -36
  106. package/dist/nips/nip51.mjs.map +1 -1
  107. package/dist/nips/nip57.d.mts +12 -13
  108. package/dist/nips/nip57.mjs +35 -38
  109. package/dist/nips/nip57.mjs.map +1 -1
  110. package/dist/nips/nip59.d.mts +1 -1
  111. package/dist/nips/nip59.mjs +14 -18
  112. package/dist/nips/nip59.mjs.map +1 -1
  113. package/dist/nips/nip65.d.mts +1 -1
  114. package/dist/nips/nip65.mjs +11 -8
  115. package/dist/nips/nip65.mjs.map +1 -1
  116. package/dist/nips/nip77.d.mts +1 -1
  117. package/dist/nips/nip77.mjs +56 -34
  118. package/dist/nips/nip77.mjs.map +1 -1
  119. package/dist/nips/nip96.d.mts +21 -12
  120. package/dist/nips/nip96.mjs +59 -36
  121. package/dist/nips/nip96.mjs.map +1 -1
  122. package/dist/nips/nip98.d.mts +12 -12
  123. package/dist/nips/nip98.mjs +18 -19
  124. package/dist/nips/nip98.mjs.map +1 -1
  125. package/dist/{pool-C_j1OmBB.mjs → pool-XmAGaufS.mjs} +611 -487
  126. package/dist/pool-XmAGaufS.mjs.map +1 -0
  127. package/dist/pool-tEr7c5bG.d.mts +302 -0
  128. package/dist/reactive-DDlThDSZ.mjs +324 -0
  129. package/dist/reactive-DDlThDSZ.mjs.map +1 -0
  130. package/dist/reactive-DFpqtIf_.d.mts +66 -0
  131. package/dist/relay.d.mts +5 -4
  132. package/dist/relay.mjs +2 -2
  133. package/dist/report-CHld4uWj.mjs +32 -0
  134. package/dist/report-CHld4uWj.mjs.map +1 -0
  135. package/dist/{signer-CZ6K6FUc.mjs → signer-CKR9EHce.mjs} +107 -72
  136. package/dist/signer-CKR9EHce.mjs.map +1 -0
  137. package/dist/signer.d.mts +3 -3
  138. package/dist/signer.mjs +3 -2
  139. package/dist/storage-xXxLGCVb.mjs +1376 -0
  140. package/dist/storage-xXxLGCVb.mjs.map +1 -0
  141. package/dist/storage.d.mts +4 -4
  142. package/dist/storage.mjs +5 -4
  143. package/dist/store.d.mts +2 -0
  144. package/dist/store.mjs +2 -0
  145. package/dist/testing.d.mts +125 -0
  146. package/dist/testing.mjs +957 -0
  147. package/dist/testing.mjs.map +1 -0
  148. package/dist/types-2pCUprRU.d.mts +47 -0
  149. package/dist/types-CRQEk0Oi.d.mts +19 -0
  150. package/dist/util-LfQirgDk.mjs +113 -0
  151. package/dist/util-LfQirgDk.mjs.map +1 -0
  152. package/dist/wasm.d.mts +4 -4
  153. package/dist/wasm.mjs +54 -55
  154. package/dist/wasm.mjs.map +1 -1
  155. package/dist/websocket-CmeqvAkp.d.mts +27 -0
  156. package/package.json +31 -9
  157. package/dist/builder-q0VsvnYE.mjs.map +0 -1
  158. package/dist/client-Bd8B1mYm.mjs.map +0 -1
  159. package/dist/error-B49rbDzT.d.mts +0 -7
  160. package/dist/error-CwBxle6N.mjs.map +0 -1
  161. package/dist/error-DZEs5OuZ.mjs +0 -24
  162. package/dist/error-DZEs5OuZ.mjs.map +0 -1
  163. package/dist/event-CzoQEFMF.mjs.map +0 -1
  164. package/dist/filter-BxwjEkZp.mjs.map +0 -1
  165. package/dist/filter-DUEKP3q1.d.mts +0 -40
  166. package/dist/gossip-3xkRRCm_.mjs.map +0 -1
  167. package/dist/http-D2rhokZo.mjs.map +0 -1
  168. package/dist/index-C0C4e-Gn.d.mts +0 -55
  169. package/dist/index-DgOugrpF.d.mts +0 -275
  170. package/dist/index-EwL6fHLo.d.mts +0 -267
  171. package/dist/index-k2YhCgsh.d.mts +0 -57
  172. package/dist/key-Dn-aX4x4.mjs.map +0 -1
  173. package/dist/kind-BLl4cLOc.mjs.map +0 -1
  174. package/dist/loaders-BNQszDAn.mjs.map +0 -1
  175. package/dist/memory-BCmhZPek.mjs.map +0 -1
  176. package/dist/message-C_Uj-Y-c.mjs.map +0 -1
  177. package/dist/pool-C_j1OmBB.mjs.map +0 -1
  178. package/dist/pool-DhRi7l-b.d.mts +0 -297
  179. package/dist/signer-CZ6K6FUc.mjs.map +0 -1
  180. package/dist/storage-DOy0iLRE.mjs +0 -870
  181. package/dist/storage-DOy0iLRE.mjs.map +0 -1
  182. package/dist/types-BzyADqnw.d.mts +0 -19
  183. package/dist/types-Dn24TPFs.d.mts +0 -43
  184. package/dist/util-6tfLQ9JF.mjs +0 -73
  185. package/dist/util-6tfLQ9JF.mjs.map +0 -1
@@ -1,8 +1,19 @@
1
- import { n as EventTemplate, r as UnsignedEvent, t as Event } from "./event-B5D2jxt_.mjs";
2
- import { r as SecretKey, t as Keys } from "./key-BiGxGLhg.mjs";
3
- import { t as Filter } from "./filter-DUEKP3q1.mjs";
4
- import { t as NostrSigner } from "./types-BzyADqnw.mjs";
5
- import { n as BunkerPointer, r as ClientMetadata } from "./nip46-C_DoxiS_.mjs";
1
+ import { n as EventTemplate, r as UnsignedEvent, t as Event } from "./event-fU3Y01PR.mjs";
2
+ import { r as SecretKey, t as Keys } from "./key-BlsYhN1V.mjs";
3
+ import { t as Filter } from "./filter-C0IMByE3.mjs";
4
+ import { a as NostrError } from "./error-CR8Urc84.mjs";
5
+ import { t as NostrSigner } from "./types-CRQEk0Oi.mjs";
6
+ import { n as BunkerPointer, r as ClientMetadata } from "./nip46-DDV4dC56.mjs";
7
+ //#region src/signer/error.d.ts
8
+ /**
9
+ * Thrown by a lazy NIP-42 AUTH sign function when no signer is configured at challenge time.
10
+ * {@link import("../relay/relay.ts").Relay} catches it and ignores the challenge: no AUTH frame is
11
+ * sent and the connection stays open.
12
+ */
13
+ declare class NoSignerError extends NostrError {
14
+ name: string;
15
+ }
16
+ //#endregion
6
17
  //#region src/signer/keys.d.ts
7
18
  /** Local secret-key signer with NIP-04 (legacy) and NIP-44 support. */
8
19
  declare class KeysSigner implements NostrSigner {
@@ -20,18 +31,19 @@ declare class KeysSigner implements NostrSigner {
20
31
  //#region src/signer/nip07.d.ts
21
32
  /**
22
33
  * Minimal NIP-07 provider surface (browser extension `window.nostr`).
34
+ *
23
35
  * @see https://github.com/nostr-protocol/nips/blob/master/07.md
24
36
  */
25
37
  type WindowNostr = {
26
- getPublicKey(): Promise<string>;
27
- signEvent(event: EventTemplate): Promise<Event>;
38
+ getPublicKey: () => Promise<string>;
39
+ signEvent: (event: EventTemplate) => Promise<Event>;
28
40
  nip04?: {
29
- encrypt(pubkey: string, plaintext: string): Promise<string>;
30
- decrypt(pubkey: string, ciphertext: string): Promise<string>;
41
+ encrypt: (pubkey: string, plaintext: string) => Promise<string>;
42
+ decrypt: (pubkey: string, ciphertext: string) => Promise<string>;
31
43
  };
32
44
  nip44?: {
33
- encrypt(pubkey: string, plaintext: string): Promise<string>;
34
- decrypt(pubkey: string, ciphertext: string): Promise<string>;
45
+ encrypt: (pubkey: string, plaintext: string) => Promise<string>;
46
+ decrypt: (pubkey: string, ciphertext: string) => Promise<string>;
35
47
  };
36
48
  };
37
49
  /** Resolve `window.nostr` / `globalThis.nostr` when present. */
@@ -39,8 +51,8 @@ declare function getWindowNostr(): WindowNostr | undefined;
39
51
  /** True when a NIP-07 provider is injected in the current environment. */
40
52
  declare function isNip07Available(): boolean;
41
53
  /**
42
- * Signer backed by a NIP-07 browser extension (or any injected provider).
43
- * Never holds secret keys in-process.
54
+ * Signer backed by a NIP-07 browser extension (or any injected provider). Never holds secret keys
55
+ * in-process.
44
56
  */
45
57
  declare class Nip07Signer implements NostrSigner {
46
58
  #private;
@@ -56,56 +68,62 @@ declare class Nip07Signer implements NostrSigner {
56
68
  //#region src/signer/nip46.d.ts
57
69
  /** Subscribe options used by NIP-46 transport (structural subset of Pool). */
58
70
  type Nip46SubscribeOptions = {
59
- signal?: AbortSignal;
60
- onevent?: (event: Event) => void;
61
- onclose?: (reason: string) => void;
71
+ signal?: AbortSignal | undefined;
72
+ onevent?: ((event: Event) => void) | undefined;
73
+ onclose?: ((reason: string) => void) | undefined;
62
74
  };
63
75
  /**
64
- * Structural relay transport for NIP-46 RPC.
65
- * Satisfied by {@link import("../relay/pool.ts").Pool}; constructed above the signer layer
66
- * so `signer` never imports `relay` (ADR-0001).
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).
67
78
  */
68
79
  type Nip46Transport = {
69
- subscribe(relays: string[], filters: Filter[], opts?: Nip46SubscribeOptions): {
80
+ subscribe: (relays: string[], filters: Filter[], opts?: Nip46SubscribeOptions) => {
70
81
  close: (reason?: string) => void;
71
82
  };
72
- publish(relays: string[], event: Event): Promise<unknown>;
73
- close(urls?: string[]): void;
83
+ publish: (relays: string[], event: Event) => Promise<ReadonlyArray<{
84
+ result?: {
85
+ ok: boolean;
86
+ message: string;
87
+ };
88
+ error?: string;
89
+ }>>;
90
+ close: (urls?: string[]) => void;
74
91
  };
92
+ /** Options for {@link Nip46Signer}: transport, timeouts, and relay hints. */
75
93
  type Nip46SignerOptions = {
76
- /**
77
- * Shared transport. When set, the signer does not close it on {@link Nip46Signer.close}.
78
- */
94
+ /** Shared transport. When set, the signer does not close it on {@link Nip46Signer.close}. */
79
95
  pool?: Nip46Transport;
80
96
  /**
81
- * Factory for a private transport when `pool` is omitted.
82
- * Typical: `() => new Pool({ websocketImplementation, enableReconnect: true })`.
97
+ * Factory for a private transport when `pool` is omitted. Typical: `() => new Pool({
98
+ * websocketImplementation, enableReconnect: true })`.
83
99
  */
84
100
  createPool?: () => Nip46Transport;
85
101
  /**
86
- * Relays used when the bunker pointer has none, and merged uniquely onto a
87
- * nonempty pointer (pointer first).
102
+ * Relays used when the bunker pointer has none, and merged uniquely onto a nonempty pointer
103
+ * (pointer first).
88
104
  */
89
105
  relays?: string[];
90
- /**
91
- * Bunker connection secret when the pointer or bunker:// URL has none.
92
- */
93
- secret?: string | null;
106
+ /** Bunker connection secret when the pointer or bunker:// URL has none. */
107
+ secret?: string | undefined;
94
108
  /** Local client key used to encrypt RPC (not the remote user key). */
95
109
  clientSecretKey?: SecretKey | Uint8Array | string;
96
110
  /** Called when bunker returns `auth_url` for a pending request. */
97
111
  onAuthUrl?: (url: string) => void;
98
112
  /** Per-request timeout in ms. Default 30s. */
99
113
  timeoutMs?: number;
114
+ /**
115
+ * Timeout in ms applied after the bunker replies `auth_url`: the request keeps waiting for the
116
+ * real response until this elapses. Default 300s.
117
+ */
118
+ authTimeoutMs?: number;
100
119
  /** Requested permissions sent with `connect` (`method[:kind]` list). */
101
120
  perms?: string[];
102
121
  /** Client metadata sent with bunker-initiated `connect`. */
103
122
  metadata?: ClientMetadata;
104
123
  };
105
124
  /**
106
- * NIP-46 remote signer (bunker / nostrconnect).
107
- * Implements {@link NostrSigner}; never holds the remote user's secret key.
108
- * Network I/O is injected via {@link Nip46Transport} (no relay import).
125
+ * NIP-46 remote signer (bunker / nostrconnect). Implements {@link NostrSigner}; never holds the
126
+ * remote user's secret key. Network I/O is injected via {@link Nip46Transport} (no relay import).
109
127
  */
110
128
  declare class Nip46Signer implements NostrSigner {
111
129
  #private;
@@ -113,23 +131,23 @@ declare class Nip46Signer implements NostrSigner {
113
131
  get bunker(): Readonly<BunkerPointer>;
114
132
  get clientPublicKey(): string;
115
133
  /**
116
- * Subscribe to an already-known bunker pointer. Does not send the `connect` RPC
117
- * (reconnect without a new handshake).
118
- * Requires `clientSecretKey` — reconnect must reuse the original client identity.
134
+ * Subscribe to an already-known bunker pointer. Does not send the `connect` RPC (reconnect
135
+ * without a new handshake). Requires `clientSecretKey` — reconnect must reuse the original client
136
+ * identity.
119
137
  */
120
138
  static fromBunker(pointer: BunkerPointer, opts: Nip46SignerOptions & {
121
139
  clientSecretKey: SecretKey | Uint8Array | string;
122
140
  }): Nip46Signer;
123
141
  /**
124
- * Connect using a `bunker://` URL or pre-parsed pointer.
125
- * Invalid strings throw. A NIP-05 identifier is not a bunker pointer.
126
- * When both pointer and `opts.relays` are nonempty, unique `opts.relays` are appended.
142
+ * Connect using a `bunker://` URL or pre-parsed pointer. Invalid strings throw. A NIP-05
143
+ * identifier is not a bunker pointer. When both pointer and `opts.relays` are nonempty, unique
144
+ * `opts.relays` are appended.
127
145
  */
128
146
  static connect(input: string | BunkerPointer, opts?: Nip46SignerOptions): Promise<Nip46Signer>;
129
147
  /**
130
- * Wait for a bunker to complete a client-initiated `nostrconnect://` handshake.
131
- * Requires `clientSecretKey` whose pubkey matches the URI client pubkey
132
- * (build the URI with {@link createNostrConnectURI} after generating keys).
148
+ * Wait for a bunker to complete a client-initiated `nostrconnect://` handshake. Requires
149
+ * `clientSecretKey` whose pubkey matches the URI client pubkey (build the URI with
150
+ * {@link createNostrConnectURI} after generating keys).
133
151
  */
134
152
  static fromNostrConnectURI(connectionURI: string, opts: Nip46SignerOptions & {
135
153
  clientSecretKey: SecretKey | Uint8Array | string;
@@ -141,10 +159,10 @@ declare class Nip46Signer implements NostrSigner {
141
159
  perms?: string[];
142
160
  }): Promise<void>;
143
161
  /**
144
- * Ask the bunker for its preferred relay list and resubscribe when it changes.
145
- * Spec result is a JSON array of URLs, or `null` when nothing changes.
162
+ * Ask the bunker for its preferred relay list and resubscribe when it changes. Spec result is a
163
+ * JSON array of URLs, or `null` when nothing changes.
146
164
  */
147
- switchRelays(): Promise<string[] | null>;
165
+ switchRelays(): Promise<string[] | undefined>;
148
166
  /** Courtesy session teardown. Always closes the local signer afterwards. */
149
167
  logout(): Promise<void>;
150
168
  ping(): Promise<void>;
@@ -157,5 +175,5 @@ declare class Nip46Signer implements NostrSigner {
157
175
  close(): Promise<void>;
158
176
  }
159
177
  //#endregion
160
- 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 };
161
- //# sourceMappingURL=index-BYMnhRIC.d.mts.map
178
+ 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 };
179
+ //# sourceMappingURL=index-Ba7bJ7DD.d.mts.map
@@ -11,20 +11,22 @@ declare const SECRET_KEY_BYTES = 32;
11
11
  declare const SUBSCRIPTION_ID_MAX_CHARS = 64;
12
12
  //#endregion
13
13
  //#region src/core/util.d.ts
14
- declare const utf8Encoder: import("node:util").TextEncoder;
15
- declare const utf8Decoder: import("node:util").TextDecoder;
16
14
  /** Lowercase hex encode. */
17
15
  declare function bytesToHex(bytes: Uint8Array): string;
18
16
  /** Decode lowercase or mixed-case hex to bytes. */
19
17
  declare function hexToBytes(hex: string): Uint8Array;
20
- /** True when value is a 64-char hex string (any case) — 32 bytes. */
18
+ /** True when value is canonical NIP-01 lowercase hex of 32 bytes (64 chars). */
21
19
  declare function isHex32(value: string): boolean;
22
- /** True when value is a 128-char hex string (any case) — 64 bytes. */
20
+ /** True when value is canonical NIP-01 lowercase hex of 64 bytes (128 chars). */
23
21
  declare function isHex64(value: string): boolean;
22
+ /** Caller input of any case: lowercases first, then requires canonical hex shape. */
24
23
  declare function assertHex32(value: string, label: string): string;
25
24
  declare function assertSecretKeyBytes(bytes: Uint8Array): void;
26
25
  /**
27
- * Normalize a relay URL to a stable form (wss preferred, no trailing slash, sorted query).
26
+ * Normalize a relay URL to a stable form: `http:`/`https:` are rewritten to `ws:`/`wss:` (a bare
27
+ * host gets `wss://`), any other scheme throws UrlError. The result has a lowercased host, the
28
+ * default port removed, duplicate path slashes collapsed, a sorted query, and no fragment. `URL`
29
+ * serialization keeps a trailing `/` on the root path (`wss://a.example/`).
28
30
  */
29
31
  declare function normalizeURL(url: string): string;
30
32
  //#endregion
@@ -37,7 +39,9 @@ declare function isReplaceableKind(kind: number): boolean;
37
39
  declare function isEphemeralKind(kind: number): boolean;
38
40
  /** Addressable (parameterized replaceable): latest per (pubkey, kind, d-tag) wins. */
39
41
  declare function isAddressableKind(kind: number): boolean;
42
+ /** NIP-01 kind classes: regular / replaceable / ephemeral / addressable. */
40
43
  type KindClassification = "regular" | "replaceable" | "ephemeral" | "addressable" | "unknown";
44
+ /** Classify a kind number into its NIP-01 storage class (`"unknown"` outside all ranges). */
41
45
  declare function classifyKind(kind: number): KindClassification;
42
46
  /** Kind numbers used by this package. */
43
47
  declare const Kind: {
@@ -70,8 +74,10 @@ declare const Kind: {
70
74
  readonly EmojiSet: 30030;
71
75
  readonly StarterPack: 39089;
72
76
  };
77
+ /** Name of a kind constant on {@link Kind}. */
73
78
  type KindName = keyof typeof Kind;
79
+ /** Union of the numeric kind values on {@link Kind}. */
74
80
  type KnownKind = (typeof Kind)[KindName];
75
81
  //#endregion
76
- export { SUBSCRIPTION_ID_MAX_CHARS as C, SIGNATURE_BYTES as S, utf8Decoder as _, classifyKind as a, PUBLIC_KEY_BYTES as b, isRegularKind as c, assertSecretKeyBytes as d, bytesToHex as f, normalizeURL 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, utf8Encoder as v, SECRET_KEY_BYTES as x, EVENT_ID_BYTES as y };
77
- //# sourceMappingURL=index-DaRyjo7O.d.mts.map
82
+ export { EVENT_ID_BYTES as _, classifyKind as a, SIGNATURE_BYTES as b, isRegularKind as c, assertSecretKeyBytes as d, bytesToHex as f, normalizeURL 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, PUBLIC_KEY_BYTES as v, SUBSCRIPTION_ID_MAX_CHARS as x, SECRET_KEY_BYTES as y };
83
+ //# sourceMappingURL=index-Boe8FshM.d.mts.map
@@ -0,0 +1,73 @@
1
+ import { t as Event } from "./event-fU3Y01PR.mjs";
2
+ import { t as Filter } from "./filter-C0IMByE3.mjs";
3
+ import { a as NostrError } from "./error-CR8Urc84.mjs";
4
+ import { t as Pool } from "./pool-tEr7c5bG.mjs";
5
+ //#region src/relay/error.d.ts
6
+ /** Base class for relay errors; carries the relay URL when known. */
7
+ declare class RelayError extends NostrError {
8
+ name: string;
9
+ readonly url: string | undefined;
10
+ constructor(message: string, url?: string, options?: ErrorOptions);
11
+ }
12
+ /** A relay connection attempt or socket failed. */
13
+ declare class RelayConnectionError extends RelayError {
14
+ name: string;
15
+ }
16
+ /** A relay answered an EVENT with `ok: false`. */
17
+ declare class RelayPublishError extends RelayError {
18
+ name: string;
19
+ }
20
+ /** A subscription was closed by the relay (`CLOSED`) or the socket dropped. */
21
+ declare class RelayClosedError extends RelayError {
22
+ name: string;
23
+ }
24
+ /** A relay operation exceeded its deadline. */
25
+ declare class RelayTimeoutError extends RelayError {
26
+ name: string;
27
+ }
28
+ //#endregion
29
+ //#region src/relay/url.d.ts
30
+ /**
31
+ * True for `ws:` / `http:` URLs that are not `.onion`. Local-network `ws://` is still insecure;
32
+ * allow those via a trusted set.
33
+ */
34
+ declare function isInsecureRelayUrl(url: string): boolean;
35
+ //#endregion
36
+ //#region src/relay/fan-in.d.ts
37
+ type RoutedJob = {
38
+ urls: ReadonlyArray<string>;
39
+ filters: ReadonlyArray<Filter>;
40
+ id?: string | undefined;
41
+ };
42
+ type FanInOptions = {
43
+ /** First receipt only (deduped across jobs). `relayUrl` is the normalized relay URL. */
44
+ onevent?: ((event: Event, relayUrl: string) => void) | undefined;
45
+ oneose?: (() => void) | undefined;
46
+ onclose?: ((reason: string) => void) | undefined;
47
+ signal?: AbortSignal | undefined;
48
+ /** Armed at fan-in only. Never forwarded to relay.subscribe. */
49
+ eoseTimeoutMs?: number | undefined;
50
+ alreadyHaveEvent?: ((id: string) => boolean) | undefined;
51
+ /** Every receipt from every relay, including skipped duplicates. */
52
+ receivedEvent?: ((id: string, relayUrl: string) => void) | undefined;
53
+ closeOnEose?: boolean | undefined;
54
+ /** Optional. ensureRelay uses Pool.#opts.connectTimeoutMs when omitted. */
55
+ connectTimeoutMs?: number | undefined;
56
+ };
57
+ /**
58
+ * Aggregate EOSE/close across routed jobs. One `seen` set. `pending` counts URL list entries
59
+ * (duplicates included). `pendingEose` counts unique `jobIndex:url` keys.
60
+ */
61
+ declare function fanIn(pool: Pool, jobs: ReadonlyArray<RoutedJob>, opts?: FanInOptions): {
62
+ close: (reason?: string) => void;
63
+ };
64
+ declare function fetchRouted(pool: Pool, jobs: ReadonlyArray<RoutedJob>, opts?: {
65
+ timeoutMs?: number | undefined;
66
+ signal?: AbortSignal | undefined;
67
+ connectTimeoutMs?: number | undefined;
68
+ /** Every event of every relay batch, including cross-relay duplicates. */
69
+ onevent?: ((event: Event, relayUrl: string) => void) | undefined;
70
+ }): Promise<Event[]>;
71
+ //#endregion
72
+ export { isInsecureRelayUrl as a, RelayError as c, fetchRouted as i, RelayPublishError as l, RoutedJob as n, RelayClosedError as o, fanIn as r, RelayConnectionError as s, FanInOptions as t, RelayTimeoutError as u };
73
+ //# sourceMappingURL=index-CUIvFQdE.d.mts.map
@@ -0,0 +1,207 @@
1
+ import { t as Event } from "./event-fU3Y01PR.mjs";
2
+ import { n as ProfileMetadata } from "./builder-BWn55Paf.mjs";
3
+ import { t as RelayListItem } from "./nip65-DBfh2smt.mjs";
4
+ import { t as Gossip } from "./gossip-BRQwIM_q.mjs";
5
+ import { a as NostrError } from "./error-CR8Urc84.mjs";
6
+ import { t as Pool } from "./pool-tEr7c5bG.mjs";
7
+ import { r as OutboxBound, t as EventStore } from "./types-2pCUprRU.mjs";
8
+ import { t as ReactiveEventStore } from "./reactive-DFpqtIf_.mjs";
9
+ import { i as EventPointer, t as AddressPointer } from "./nip19-BevCJZsp.mjs";
10
+ //#region src/loaders/event.d.ts
11
+ type EventRef = string | EventPointer | AddressPointer;
12
+ /**
13
+ * Resolve an event reference (hex id, note, nevent, naddr, or pointer object) through the reactive
14
+ * index, fetching from relays on a miss. The index is the durable store — the loader keeps only
15
+ * in-flight coalescing, so a miss never blocks a later retry.
16
+ */
17
+ type EventLoader = {
18
+ load: (ref: EventRef) => Promise<Event | undefined>;
19
+ };
20
+ //#endregion
21
+ //#region src/loaders/replaceable.d.ts
22
+ /** Result of a replaceable load: the winning event (or none) and freshness. */
23
+ type ReplaceableLoadResult = {
24
+ event: Event | undefined;
25
+ fresh: boolean;
26
+ };
27
+ /** `default`: fetch when stale or unfetched; `force`: always fetch; `cache-only`: index only. */
28
+ type LoadStyle = "default" | "force" | "cache-only";
29
+ /** Loads the winning replaceable/addressable event of one kind for a pubkey. */
30
+ type ReplaceableLoader = (pubkey: string, opts?: {
31
+ hints?: string[] | undefined;
32
+ style?: LoadStyle | undefined;
33
+ }) => Promise<ReplaceableLoadResult>;
34
+ //#endregion
35
+ //#region src/loaders/lists.d.ts
36
+ /** Result of a list loader: the source event, its decoded items, and freshness. */
37
+ type ListResult<T> = {
38
+ event: Event | undefined;
39
+ items: T[];
40
+ fresh: boolean;
41
+ };
42
+ /** One muted entity decoded from a kind:10000 mute list. */
43
+ type MutedEntity = {
44
+ label: "pubkey";
45
+ value: string;
46
+ } | {
47
+ label: "thread";
48
+ value: string;
49
+ } | {
50
+ label: "hashtag";
51
+ value: string;
52
+ } | {
53
+ label: "word";
54
+ value: string;
55
+ };
56
+ type ListLoaderOpts = {
57
+ hints?: string[] | undefined;
58
+ style?: LoadStyle | undefined;
59
+ };
60
+ type ListLoaders = {
61
+ follows: (pubkey: string, opts?: ListLoaderOpts) => Promise<ListResult<string>>;
62
+ muteList: (pubkey: string, opts?: ListLoaderOpts) => Promise<ListResult<MutedEntity>>;
63
+ relayList: (pubkey: string, opts?: ListLoaderOpts) => Promise<ListResult<RelayListItem>>;
64
+ dmRelayList: (pubkey: string, opts?: ListLoaderOpts) => Promise<ListResult<string>>;
65
+ };
66
+ //#endregion
67
+ //#region src/loaders/profile.d.ts
68
+ /** A profile-card view of a pubkey: identity fields plus the kind:0 event. */
69
+ type NostrUser = {
70
+ pubkey: string;
71
+ npub: string;
72
+ shortName: string;
73
+ image?: string;
74
+ metadata: ProfileMetadata;
75
+ lastUpdated: number;
76
+ event: Event | undefined;
77
+ fresh: boolean;
78
+ };
79
+ /** A {@link NostrUser} with no metadata — used when no kind:0 event exists. */
80
+ declare function bareNostrUser(pubkey: string): NostrUser;
81
+ type ProfileLoader = {
82
+ load: (pubkey: string, opts?: {
83
+ hints?: string[] | undefined;
84
+ style?: LoadStyle | undefined;
85
+ }) => Promise<NostrUser>;
86
+ };
87
+ //#endregion
88
+ //#region src/loaders/outbox.d.ts
89
+ /** Outbox feed lifecycle error (e.g. use after close). */
90
+ declare class OutboxError extends NostrError {
91
+ name: string;
92
+ }
93
+ /** Options for {@link createOutboxFeed}. */
94
+ type OutboxFeedOptions = {
95
+ pool: Pool;
96
+ gossip: Gossip;
97
+ storage: EventStore;
98
+ /** Fallback relays when an author has no known outbox routes. */
99
+ discoveryRelays: ReadonlyArray<string>;
100
+ authors: ReadonlyArray<string>;
101
+ /** Event kinds to fetch. Default `[Kind.TextNote]`. */
102
+ kinds?: ReadonlyArray<number> | undefined;
103
+ /** Max write-relays to use per author. Default 3. */
104
+ maxRelaysPerAuthor?: number | undefined;
105
+ fetchTimeoutMs?: number | undefined;
106
+ /** Called for live events after observe, and for sync events returned by applySync. */
107
+ onEvent?: ((event: Event) => void) | undefined;
108
+ /** Live ingest (e.g. `client.observe`) with the source relay URL. StartLive never putManys. */
109
+ observe?: ((event: Event, relayUrl: string) => void) | undefined;
110
+ /**
111
+ * Every receipt from every relay — live (including duplicates the feed's own dedupe skips) and
112
+ * sync fetch batches — for seenOn bookkeeping.
113
+ */
114
+ seen?: ((event: Event, relayUrl: string) => void) | undefined;
115
+ /**
116
+ * Sync path only. Awaited. Return events that should advance bounds. Throw → sync throws, bounds
117
+ * unchanged.
118
+ */
119
+ applySync?: ((events: ReadonlyArray<Event>) => Promise<ReadonlyArray<Event>>) | undefined;
120
+ /** Load kind:10002 for authors before sync when routes are missing. Requires a relay-list loader. */
121
+ hydrate?: ((pubkeys: ReadonlyArray<string>) => Promise<void>) | undefined;
122
+ };
123
+ /**
124
+ * Group authors by outbox relay (discovery fallback). `prefer` reorders existing candidates only;
125
+ * it never appends a URL that is not already in the author's outbox or discovery list. Returns
126
+ * Map<relayUrl, authors[]>.
127
+ */
128
+ declare function groupAuthorsByOutboxRelay(authors: ReadonlyArray<string>, gossip: Gossip, discoveryRelays: ReadonlyArray<string>, maxRelaysPerAuthor?: number, prefer?: ReadonlyArray<string>): Map<string, string[]>;
129
+ /**
130
+ * Outbox-model feed: history sync + live subscription for a set of authors, routed via NIP-65 write
131
+ * relays (with discovery fallback).
132
+ */
133
+ declare class OutboxFeed {
134
+ #private;
135
+ constructor(opts: OutboxFeedOptions);
136
+ get authors(): ReadonlyArray<string>;
137
+ get kinds(): ReadonlyArray<number>;
138
+ /** Replace the author set (does not auto-restart live). */
139
+ setAuthors(authors: ReadonlyArray<string>): void;
140
+ getBound(pubkey: string, kind: number): OutboxBound | undefined;
141
+ /** Load NIP-65 relay lists for authors that have no outbox routes yet. */
142
+ hydrate(): Promise<void>;
143
+ /** One-shot history pull. Persistence is `applySync`; bounds move only for events it returns. */
144
+ sync(opts?: {
145
+ limit?: number | undefined;
146
+ since?: number | undefined;
147
+ until?: number | undefined;
148
+ signal?: AbortSignal | undefined;
149
+ /** Skip hydrate() even if provided. */
150
+ skipHydrate?: boolean | undefined;
151
+ }): Promise<Event[]>;
152
+ /**
153
+ * Start a live subscription across outbox relays for the current authors. Closes any previous
154
+ * live subscription.
155
+ */
156
+ startLive(opts?: {
157
+ signal?: AbortSignal | undefined;
158
+ since?: number | undefined;
159
+ }): {
160
+ close: (reason?: string) => void;
161
+ };
162
+ /** Convenience: hydrate + sync + startLive. */
163
+ start(opts?: {
164
+ limit?: number | undefined;
165
+ signal?: AbortSignal | undefined;
166
+ }): Promise<{
167
+ close: (reason?: string) => void;
168
+ events: Event[];
169
+ }>;
170
+ close(): void;
171
+ }
172
+ /** Factory matching other loaders helpers. */
173
+ declare function createOutboxFeed(opts: OutboxFeedOptions): OutboxFeed;
174
+ //#endregion
175
+ //#region src/loaders/index.d.ts
176
+ /** The loader surface returned by {@link createLoaders}. */
177
+ type Loaders = {
178
+ follows: ListLoaders["follows"];
179
+ muteList: ListLoaders["muteList"];
180
+ relayList: ListLoaders["relayList"];
181
+ dmRelayList: ListLoaders["dmRelayList"];
182
+ profile: ProfileLoader["load"];
183
+ event: EventLoader["load"];
184
+ /** Generic replaceable loader for any kind; memoized per kind. */
185
+ replaceable: (kind: number) => ReplaceableLoader;
186
+ addRelay: (url: string) => void;
187
+ removeRelay: (url: string) => void;
188
+ };
189
+ /** Options for {@link createLoaders}. */
190
+ type CreateLoadersOptions = {
191
+ pool: Pool;
192
+ relays: ReadonlyArray<string>;
193
+ /** The reactive index loaders read from and feed fetched events into. */
194
+ index: ReactiveEventStore;
195
+ /**
196
+ * Inbound-event sink for fetched events; defaults to `index.add`. Client wires its single ingest
197
+ * path so loader fetches get gossip meta and persistence like every other inbound event.
198
+ */
199
+ ingest?: (event: Event, relayUrl: string) => void;
200
+ staleAfterSec?: number;
201
+ fetchTimeoutMs?: number;
202
+ };
203
+ /** Build an instance-scoped loader suite (no module globals). */
204
+ declare function createLoaders(opts: CreateLoadersOptions): Loaders;
205
+ //#endregion
206
+ export { ReplaceableLoader as _, OutboxFeed as a, groupAuthorsByOutboxRelay as c, bareNostrUser as d, ListLoaders as f, ReplaceableLoadResult as g, LoadStyle as h, OutboxError as i, NostrUser as l, MutedEntity as m, Loaders as n, OutboxFeedOptions as o, ListResult as p, createLoaders as r, createOutboxFeed as s, CreateLoadersOptions as t, ProfileLoader as u, EventLoader as v, EventRef as y };
207
+ //# sourceMappingURL=index-JdaS_uce.d.mts.map
package/dist/index.d.mts CHANGED
@@ -1,22 +1,24 @@
1
- import { C as isTag, E as tagValue, S as getDTag, T as tagName, _ as EventAddress, b as eventAddress, c as itemCompare, d as serializeEvent, f as signedMatchesUnsigned, g as validateSignedEvent, h as validateEvent, i as getEventHash, m as sortedEvents, n as EventTemplate, o as isMarkedVerified, p as sortEvents, r as UnsignedEvent, s as isReplaceableWinner, t as Event, v as Tag, w as parseEventAddress, x as formatEventAddress, y as TagInput } from "./event-B5D2jxt_.mjs";
2
- import { a as getPublicKey, c as verifyEvent, i as finalizeEvent, n as PublicKey, o as publicKeyFromHex, r as SecretKey, s as signEvent, t as Keys } from "./key-BiGxGLhg.mjs";
3
- import { n as ProfileMetadata, t as EventBuilder } from "./builder-BphJa-Y-.mjs";
4
- import { a as filterFingerprint, c as matchFilters, i as cloneFilter, l as mergeFilters, n as canonicalizeFilter, o as getFilterLimit, r as canonicalizeFilters, s as matchFilter, t as Filter } from "./filter-DUEKP3q1.mjs";
5
- import { a as readRelays, c as writeRelays, i as parseRelayList, n as RelayMarker, o as relayListEventBuilder, r as markerOf, s as relayListToTags, t as RelayListItem } from "./nip65-Di5hZRuV.mjs";
6
- import { i as RoutedFilter, r as PubkeyRoutes, t as Gossip } from "./gossip-C5RVB1UB.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-DJC-Jz6T.mjs";
8
- import { a as NostrError, i as MessageError, n as EventValidationError, o as UrlError, r as HexError, s as WasmVerifyPoisonedError, t as CryptoError } from "./error-WEFS-R-4.mjs";
9
- import { a as PublishResult, c as RelayStatus, i as PoolPublishResult, l as RelayStatusName, m as SubscribeOptions, n as PoolCountResult, o as Relay, p as useWebSocketImplementation, r as PoolOptions, s as RelayOptions, t as Pool } from "./pool-DhRi7l-b.mjs";
10
- import { C as DataLoader, D as ReplaceableCache, T as LoaderContext, _ as ListResult, a as OutboxFeed, b as LoadStyle, c as groupAuthorsByOutboxRelay, f as NostrUser, i as OutboxError, m as bareNostrUser, n as Loaders, o as OutboxFeedOptions, r as createLoaders, s as createOutboxFeed, v as MutedEntity, w as LoaderError } from "./index-EwL6fHLo.mjs";
11
- import { _ as neventEncode, a as NAddr, b as npubEncode, c as NPub, d as Note, f as ProfilePointer, g as naddrEncode, i as EventPointer, l as NSec, m as decodeNostrURI, n as Bech32MaxSize, o as NEvent, p as decode, r as DecodedResult, s as NProfile, t as AddressPointer, u as Nip19Error, v as noteEncode, x as nsecEncode, y as nprofileEncode } from "./nip19-D7905oIv.mjs";
12
- import { i as PutResult, n as NegentropyItem, r as OutboxBound, t as EventStore } from "./types-Dn24TPFs.mjs";
13
- import { t as NostrSigner } from "./types-BzyADqnw.mjs";
14
- import { t as StorageError } from "./error-B49rbDzT.mjs";
15
- import { a as FetchPrivateMessagesOptions, c as ReceivedPrivateMessage, d as SubscribePrivateMessagesOptions, f as SyncDirection, g as ClientBuilder, h as SyncSummary, l as SendPrivateMessageOptions, m as SyncOptions, n as ClientError, o as PrivateMessageSendResult, p as SyncDirectionName, r as ClientOptions, t as Client } from "./index-DgOugrpF.mjs";
16
- import { C as SUBSCRIPTION_ID_MAX_CHARS, S as SIGNATURE_BYTES, _ as utf8Decoder, a as classifyKind, b as PUBLIC_KEY_BYTES, c as isRegularKind, f as bytesToHex, g as normalizeURL, 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 utf8Encoder, x as SECRET_KEY_BYTES, y as EVENT_ID_BYTES } from "./index-DaRyjo7O.mjs";
17
- 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 } from "./index-BYMnhRIC.mjs";
1
+ import { C as parseEventAddress, S as isTag, T as tagValue, _ as Tag, b as formatEventAddress, 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 tagName, x as getDTag, y as eventAddress } from "./event-fU3Y01PR.mjs";
2
+ import { a as getPublicKey, c as verifyEvent, i as finalizeEvent, n as PublicKey, o as publicKeyFromHex, r as SecretKey, s as signEvent, t as Keys } from "./key-BlsYhN1V.mjs";
3
+ import { n as ProfileMetadata, t as EventBuilder } from "./builder-BWn55Paf.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-C0IMByE3.mjs";
5
+ import { a as readRelays, c as writeRelays, i as parseRelayList, n as RelayMarker, o as relayListEventBuilder, r as markerOf, s as relayListToTags, t as RelayListItem } from "./nip65-DBfh2smt.mjs";
6
+ import { i as RoutedFilter, r as PubkeyRoutes, t as Gossip } from "./gossip-BRQwIM_q.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-iGPIqnn0.mjs";
8
+ import { a as NostrError, i as MessageError, n as EventValidationError, o as UrlError, r as HexError, s as WasmVerifyPoisonedError, t as CryptoError } from "./error-CR8Urc84.mjs";
9
+ import { a as PoolSubscribeOptions, c as RelayOptions, d as SubscribeOptions, i as PoolPublishResult, l as RelayStatus, n as PoolCountResult, o as PublishResult, r as PoolOptions, s as Relay, t as Pool, u as RelayStatusName } from "./pool-tEr7c5bG.mjs";
10
+ import { i as useWebSocketImplementation } from "./websocket-CmeqvAkp.mjs";
11
+ import { i as PutResult, n as NegentropyItem, r as OutboxBound, t as EventStore } from "./types-2pCUprRU.mjs";
12
+ import { n as ReactiveEventStoreOptions, r as Watch, t as ReactiveEventStore } from "./reactive-DFpqtIf_.mjs";
13
+ import { _ as neventEncode, a as NAddr, b as npubEncode, c as NPub, d as Note, f as ProfilePointer, g as naddrEncode, i as EventPointer, l as NSec, m as decodeNostrURI, n as Bech32MaxSize, o as NEvent, p as decode, r as DecodedResult, s as NProfile, t as AddressPointer, u as Nip19Error, v as noteEncode, x as nsecEncode, y as nprofileEncode } from "./nip19-BevCJZsp.mjs";
14
+ import { _ as ReplaceableLoader, a as OutboxFeed, c as groupAuthorsByOutboxRelay, d as bareNostrUser, g as ReplaceableLoadResult, h as LoadStyle, i as OutboxError, l as NostrUser, m as MutedEntity, n as Loaders, o as OutboxFeedOptions, p as ListResult, r as createLoaders, s as createOutboxFeed } from "./index-JdaS_uce.mjs";
15
+ import { t as NostrSigner } from "./types-CRQEk0Oi.mjs";
16
+ import { t as StorageError } from "./error-BW7re1UN.mjs";
17
+ import { f as SubscribePrivateMessagesOptions, g as SyncSummary, h as SyncOptions, i as ClientOptions, l as ReceivedPrivateMessage, m as SyncDirectionName, n as ClientBuilder, o as FetchPrivateMessagesOptions, p as SyncDirection, r as ClientError, s as PrivateMessageSendResult, t as Client, u as SendPrivateMessageOptions } from "./index-B425CAcQ.mjs";
18
+ import { _ as EVENT_ID_BYTES, a as classifyKind, b as SIGNATURE_BYTES, c as isRegularKind, f as bytesToHex, g as normalizeURL, 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 PUBLIC_KEY_BYTES, x as SUBSCRIPTION_ID_MAX_CHARS, y as SECRET_KEY_BYTES } from "./index-Boe8FshM.mjs";
19
+ 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-Ba7bJ7DD.mjs";
18
20
  import { ReplyTagsOptions, ThreadReferences, buildReplyTags, parseThreadTags, replyTo } from "./nips/nip10.mjs";
19
21
  import { isAuthRequired, makeAuthEvent } from "./nips/nip42.mjs";
20
- import { a as isInsecureRelayUrl, c as RelayError, l as RelayPublishError, o as RelayClosedError, s as RelayConnectionError } from "./index-C0C4e-Gn.mjs";
21
- import { n as IndexedDbEventStoreOptions, r as MemoryEventStore, t as IndexedDbEventStore } from "./index-k2YhCgsh.mjs";
22
- export { type AddressPointer, Bech32MaxSize, Client, ClientBuilder, ClientError, type ClientMessage, type ClientOptions, type CountResult, CryptoError, DataLoader, type DecodedResult, EVENT_ID_BYTES, type Event, type EventAddress, EventBuilder, type EventPointer, type EventStore, type EventTemplate, EventValidationError, type FetchPrivateMessagesOptions, type Filter, Gossip, HexError, IndexedDbEventStore, type IndexedDbEventStoreOptions, Keys, KeysSigner, Kind, type KindClassification, type KindName, type KnownKind, type ListResult, type LoadStyle, LoaderContext, LoaderError, type Loaders, MemoryEventStore, MessageError, type MutedEntity, type NAddr, type NEvent, type NProfile, type NPub, type NSec, type NegentropyItem, Nip07Signer, Nip19Error, Nip46Signer, type Nip46SignerOptions, type Nip46SubscribeOptions, type Nip46Transport, NostrError, type NostrSigner, type NostrUser, type Note, type OutboxBound, OutboxError, OutboxFeed, type OutboxFeedOptions, PUBLIC_KEY_BYTES, Pool, type PoolCountResult, type PoolOptions, type PoolPublishResult, type PrivateMessageSendResult, type ProfileMetadata, type ProfilePointer, type PubkeyRoutes, type PublicKey, type PublishResult, type PutResult, type ReceivedPrivateMessage, Relay, RelayClosedError, RelayConnectionError, RelayError, type RelayListItem, type RelayMarker, type RelayMessage, type RelayOptions, RelayPublishError, RelayStatus, type RelayStatusName, ReplaceableCache, type ReplyTagsOptions, type RoutedFilter, SECRET_KEY_BYTES, SIGNATURE_BYTES, SUBSCRIPTION_ID_MAX_CHARS, SecretKey, type SendPrivateMessageOptions, StorageError, type SubscribeOptions, type SubscribePrivateMessagesOptions, type SubscriptionId, SyncDirection, type SyncDirectionName, type SyncOptions, type SyncSummary, Tag, type TagInput, type ThreadReferences, type UnsignedEvent, UrlError, WasmVerifyPoisonedError, type WindowNostr, assertSubscriptionId, bareNostrUser, buildReplyTags, bytesToHex, canonicalizeFilter, canonicalizeFilters, classifyKind, cloneFilter, createLoaders, createOutboxFeed, createSubscriptionId, decodeNostrURI, encodeClientMessage, encodeRelayMessage, eventAddress, filterFingerprint, finalizeEvent, formatEventAddress, getDTag, getEventHash, getFilterLimit, getPublicKey, getWindowNostr, groupAuthorsByOutboxRelay, hexToBytes, isAddressableKind, isAuthRequired, isEphemeralKind, isHex32, isHex64, isInsecureRelayUrl, isMarkedVerified, isNip07Available, isRegularKind, isReplaceableKind, isReplaceableWinner, isTag, itemCompare, makeAuthEvent, markerOf, matchFilter, matchFilters, mergeCountHll, mergeFilters, naddrEncode, neventEncode, decode as nip19Decode, normalizeURL, noteEncode, nprofileEncode, npubEncode, nsecEncode, parseClientMessage, parseEventAddress, parseRelayList, parseRelayMessage, parseThreadTags, publicKeyFromHex, readRelays, relayListEventBuilder, relayListToTags, replyTo, serializeEvent, signEvent, signedMatchesUnsigned, sortEvents, sortedEvents, tagName, tagValue, useWebSocketImplementation, utf8Decoder, utf8Encoder, validateEvent, validateSignedEvent, verifyEvent, writeRelays };
22
+ import { a as isInsecureRelayUrl, c as RelayError, l as RelayPublishError, o as RelayClosedError, s as RelayConnectionError, u as RelayTimeoutError } from "./index-CUIvFQdE.mjs";
23
+ import { a as IndexedDbEventStoreOptions, i as IndexedDbEventStore, n as SqlValue, o as MemoryEventStore, r as SqliteEventStore, t as SqlDriver } from "./index-BVyfUBuG.mjs";
24
+ export { type AddressPointer, Bech32MaxSize, Client, ClientBuilder, ClientError, type ClientMessage, type ClientOptions, type CountResult, CryptoError, type DecodedResult, EVENT_ID_BYTES, type Event, type EventAddress, EventBuilder, type EventPointer, type EventStore, type EventTemplate, EventValidationError, type FetchPrivateMessagesOptions, type Filter, Gossip, HexError, IndexedDbEventStore, type IndexedDbEventStoreOptions, Keys, KeysSigner, Kind, type KindClassification, type KindName, type KnownKind, type ListResult, type LoadStyle, type Loaders, MemoryEventStore, MessageError, type MutedEntity, type NAddr, type NEvent, type NProfile, type NPub, type NSec, type NegentropyItem, Nip07Signer, Nip19Error, Nip46Signer, type Nip46SignerOptions, type Nip46SubscribeOptions, type Nip46Transport, NoSignerError, NostrError, type NostrSigner, type NostrUser, type Note, type OutboxBound, OutboxError, OutboxFeed, type OutboxFeedOptions, PUBLIC_KEY_BYTES, Pool, type PoolCountResult, type PoolOptions, type PoolPublishResult, type PoolSubscribeOptions, type PrivateMessageSendResult, type ProfileMetadata, type ProfilePointer, type PubkeyRoutes, type PublicKey, type PublishResult, type PutResult, ReactiveEventStore, type ReactiveEventStoreOptions, type ReceivedPrivateMessage, Relay, RelayClosedError, RelayConnectionError, RelayError, type RelayListItem, type RelayMarker, type RelayMessage, type RelayOptions, RelayPublishError, RelayStatus, type RelayStatusName, RelayTimeoutError, type ReplaceableLoadResult, type ReplaceableLoader, type ReplyTagsOptions, type RoutedFilter, SECRET_KEY_BYTES, SIGNATURE_BYTES, SUBSCRIPTION_ID_MAX_CHARS, SecretKey, type SendPrivateMessageOptions, 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, WasmVerifyPoisonedError, type Watch, type WindowNostr, assertSubscriptionId, bareNostrUser, buildReplyTags, bytesToHex, canonicalizeFilter, canonicalizeFilters, classifyKind, createLoaders, createOutboxFeed, createSubscriptionId, decodeNostrURI, encodeClientMessage, encodeRelayMessage, eventAddress, filterFingerprint, finalizeEvent, formatEventAddress, getDTag, getEventHash, getFilterLimit, getPublicKey, getWindowNostr, groupAuthorsByOutboxRelay, hexToBytes, isAddressableKind, isAuthRequired, isEphemeralKind, isHex32, isHex64, isInsecureRelayUrl, isNip07Available, isRegularKind, isReplaceableKind, isReplaceableWinner, isTag, itemCompare, makeAuthEvent, markerOf, matchFilter, matchFilters, mergeCountHll, mergeFilters, naddrEncode, neventEncode, decode as nip19Decode, normalizeURL, noteEncode, nprofileEncode, npubEncode, nsecEncode, parseClientMessage, parseEventAddress, parseRelayList, parseRelayMessage, parseThreadTags, publicKeyFromHex, readRelays, relayListEventBuilder, relayListToTags, replyTo, serializeEvent, signEvent, signedMatchesUnsigned, sortEvents, sortedEvents, tagName, tagValue, useWebSocketImplementation, validateEvent, validateSignedEvent, verifyEvent, writeRelays };