@qntx/nostr 0.6.0 → 0.8.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.
- package/dist/{abort-Ba8tDrOI.mjs → abort-DBq2STPj.mjs} +13 -6
- package/dist/abort-DBq2STPj.mjs.map +1 -0
- package/dist/{builder-sSflu6nB.d.mts → builder-CTwkB2zM.d.mts} +14 -15
- package/dist/{builder-9tjI6WQ3.mjs → builder-aNU2gGFP.mjs} +11 -17
- package/dist/builder-aNU2gGFP.mjs.map +1 -0
- package/dist/{client-CadO5fAX.mjs → client-Cj2lUaVh.mjs} +141 -353
- package/dist/client-Cj2lUaVh.mjs.map +1 -0
- package/dist/client.d.mts +2 -2
- package/dist/client.mjs +2 -2
- package/dist/collections-DtwMc1NU.mjs +33 -0
- package/dist/collections-DtwMc1NU.mjs.map +1 -0
- package/dist/core.d.mts +9 -8
- package/dist/core.mjs +7 -7
- package/dist/emitter-DkCY6NkU.mjs +32 -0
- package/dist/emitter-DkCY6NkU.mjs.map +1 -0
- package/dist/{error-BW7re1UN.d.mts → error-BD_0QFKT.d.mts} +2 -2
- package/dist/{error-DrEIM7FO.mjs → error-BILMe3Gr.mjs} +2 -2
- package/dist/{error-DrEIM7FO.mjs.map → error-BILMe3Gr.mjs.map} +1 -1
- package/dist/{error-CR8Urc84.d.mts → error-BquXDmIN.d.mts} +4 -4
- package/dist/{error-B__OMBRY.mjs → error-DlhGW4mJ.mjs} +2 -2
- package/dist/{error-B__OMBRY.mjs.map → error-DlhGW4mJ.mjs.map} +1 -1
- package/dist/{event-D8Nfoh4K.mjs → event-CHf47dPM.mjs} +16 -10
- package/dist/event-CHf47dPM.mjs.map +1 -0
- package/dist/{event-fU3Y01PR.d.mts → event-DJeb_DIL.d.mts} +4 -2
- package/dist/{filter-C0IMByE3.d.mts → filter-jI_9htF7.d.mts} +2 -2
- package/dist/{gossip-oloDMWEj.mjs → gossip-DFxIBlsr.mjs} +23 -33
- package/dist/gossip-DFxIBlsr.mjs.map +1 -0
- package/dist/{gossip-DpIvkBuj.d.mts → gossip-OOeeFzG5.d.mts} +37 -28
- package/dist/gossip.d.mts +1 -1
- package/dist/gossip.mjs +1 -1
- package/dist/{index-D1bqFHKB.d.mts → index-BxCBX-8R.d.mts} +18 -18
- package/dist/{index-lvXeER5t.d.mts → index-CPVEyzNX.d.mts} +32 -50
- package/dist/{index-MxC28S4P.d.mts → index-C_w2WfVz.d.mts} +27 -29
- package/dist/{index-CNl2q67H.d.mts → index-Cl_1XdYP.d.mts} +111 -180
- package/dist/{index-CvkvqB16.d.mts → index-DU9tRFTZ.d.mts} +7 -20
- package/dist/{index-q4MDce_r.d.mts → index-DyKwQnbt.d.mts} +6 -8
- package/dist/index.d.mts +23 -21
- package/dist/index.mjs +21 -19
- package/dist/{instance-DQE8BoWt.mjs → instance-C62w3cEt.mjs} +26 -27
- package/dist/instance-C62w3cEt.mjs.map +1 -0
- package/dist/{instance-CIca-ynn.d.mts → instance-DjsL8h84.d.mts} +5 -5
- package/dist/{key-Cv4_pN3x.d.mts → key-D_5OgGT7.d.mts} +11 -7
- package/dist/{key-Bps-LqX7.mjs → key-DnVpchl6.mjs} +13 -9
- package/dist/key-DnVpchl6.mjs.map +1 -0
- package/dist/{loaders-o6YXB_Ri.mjs → loaders-BmPkQfzI.mjs} +73 -82
- package/dist/loaders-BmPkQfzI.mjs.map +1 -0
- package/dist/loaders.d.mts +3 -3
- package/dist/loaders.mjs +2 -2
- package/dist/{memory-C2EVx0_O.mjs → memory-CdJ07kub.mjs} +2 -2
- package/dist/memory-CdJ07kub.mjs.map +1 -0
- package/dist/{memory-index-Do1mz0WF.mjs → memory-index-Cbc83vOZ.mjs} +30 -247
- package/dist/memory-index-Cbc83vOZ.mjs.map +1 -0
- package/dist/message-oNr7t0SJ.mjs +194 -0
- package/dist/message-oNr7t0SJ.mjs.map +1 -0
- package/dist/{message-iGPIqnn0.d.mts → message-tclYCVNc.d.mts} +6 -6
- package/dist/{nip17-CKIufV98.d.mts → nip17-B5WgW4C4.d.mts} +6 -7
- package/dist/{nip19-BevCJZsp.d.mts → nip19-DpPN17bY.d.mts} +25 -31
- package/dist/{nip46-DDV4dC56.d.mts → nip46-BHaxC9TZ.d.mts} +19 -21
- package/dist/nip51-CR0Q8eym.d.mts +87 -0
- package/dist/{nip59-zQgdLcEr.d.mts → nip59-C-RWFQIv.d.mts} +11 -5
- package/dist/nip65-D1fbmhOg.d.mts +23 -0
- package/dist/{nip77-DH4RhS5r.d.mts → nip77-DzUwUxHq.d.mts} +8 -9
- package/dist/nips/blossom.d.mts +17 -13
- package/dist/nips/blossom.mjs +30 -9
- package/dist/nips/blossom.mjs.map +1 -1
- package/dist/nips/nip04.mjs +17 -7
- package/dist/nips/nip04.mjs.map +1 -1
- package/dist/nips/nip05.d.mts +9 -10
- package/dist/nips/nip05.mjs +1 -4
- package/dist/nips/nip05.mjs.map +1 -1
- package/dist/nips/nip10.d.mts +8 -8
- package/dist/nips/nip10.mjs +34 -32
- package/dist/nips/nip10.mjs.map +1 -1
- package/dist/nips/nip11.d.mts +28 -28
- package/dist/nips/nip11.mjs +4 -4
- package/dist/nips/nip11.mjs.map +1 -1
- package/dist/nips/nip13.d.mts +7 -7
- package/dist/nips/nip13.mjs +32 -10
- package/dist/nips/nip13.mjs.map +1 -1
- package/dist/nips/nip17.d.mts +1 -1
- package/dist/nips/nip17.mjs +16 -34
- package/dist/nips/nip17.mjs.map +1 -1
- package/dist/nips/nip19.d.mts +2 -2
- package/dist/nips/nip19.mjs +16 -28
- package/dist/nips/nip19.mjs.map +1 -1
- package/dist/nips/nip21.d.mts +9 -4
- package/dist/nips/nip21.mjs +15 -5
- package/dist/nips/nip21.mjs.map +1 -1
- package/dist/nips/nip27.d.mts +22 -22
- package/dist/nips/nip27.mjs +2 -2
- package/dist/nips/nip27.mjs.map +1 -1
- package/dist/nips/nip42.d.mts +1 -1
- package/dist/nips/nip42.mjs +2 -1
- package/dist/nips/nip42.mjs.map +1 -1
- package/dist/nips/nip44.mjs +2 -2
- package/dist/nips/nip44.mjs.map +1 -1
- package/dist/nips/nip46.d.mts +2 -2
- package/dist/nips/nip46.mjs +15 -19
- package/dist/nips/nip46.mjs.map +1 -1
- package/dist/nips/nip49.d.mts +9 -9
- package/dist/nips/nip49.mjs +4 -4
- package/dist/nips/nip49.mjs.map +1 -1
- package/dist/nips/nip51.d.mts +2 -86
- package/dist/nips/nip51.mjs +7 -23
- package/dist/nips/nip51.mjs.map +1 -1
- package/dist/nips/nip57.d.mts +25 -23
- package/dist/nips/nip57.mjs +12 -17
- package/dist/nips/nip57.mjs.map +1 -1
- package/dist/nips/nip59.d.mts +1 -1
- package/dist/nips/nip59.mjs +27 -19
- package/dist/nips/nip59.mjs.map +1 -1
- package/dist/nips/nip65.d.mts +2 -2
- package/dist/nips/nip65.mjs +14 -37
- package/dist/nips/nip65.mjs.map +1 -1
- package/dist/nips/nip77.d.mts +1 -1
- package/dist/nips/nip77.mjs +33 -32
- package/dist/nips/nip77.mjs.map +1 -1
- package/dist/nips/nip98.d.mts +5 -5
- package/dist/nips/nip98.mjs +8 -8
- package/dist/nips/nip98.mjs.map +1 -1
- package/dist/{pool-DBIYMtwy.d.mts → pool-CqQvUnsq.d.mts} +132 -108
- package/dist/pool-vlw74C4t.mjs +606 -0
- package/dist/pool-vlw74C4t.mjs.map +1 -0
- package/dist/put-w13ci3sC.mjs +187 -0
- package/dist/put-w13ci3sC.mjs.map +1 -0
- package/dist/{reactive-BfhPp9a3.mjs → reactive-Tz0otDIP.mjs} +125 -88
- package/dist/reactive-Tz0otDIP.mjs.map +1 -0
- package/dist/{reactive-7aqeip4A.d.mts → reactive-gGqUrzW8.d.mts} +20 -26
- package/dist/relay-quCs7MHD.mjs +1811 -0
- package/dist/relay-quCs7MHD.mjs.map +1 -0
- package/dist/relay.d.mts +4 -4
- package/dist/relay.mjs +3 -2
- package/dist/serial-Bzpw-xz3.mjs +21 -0
- package/dist/serial-Bzpw-xz3.mjs.map +1 -0
- package/dist/{signer-CYQutDzD.mjs → signer-poTGe6Er.mjs} +12 -14
- package/dist/signer-poTGe6Er.mjs.map +1 -0
- package/dist/signer.d.mts +2 -2
- package/dist/signer.mjs +2 -2
- package/dist/{storage-Dky3wuoH.mjs → storage-B5IXTVuS.mjs} +28 -51
- package/dist/storage-B5IXTVuS.mjs.map +1 -0
- package/dist/storage.d.mts +3 -3
- package/dist/storage.mjs +4 -4
- package/dist/store.d.mts +2 -2
- package/dist/store.mjs +1 -1
- package/dist/testing.d.mts +19 -19
- package/dist/testing.mjs +9 -9
- package/dist/testing.mjs.map +1 -1
- package/dist/{types-2pCUprRU.d.mts → types-BacwnDtU.d.mts} +10 -10
- package/dist/{types-CRQEk0Oi.d.mts → types-DNmiscfd.d.mts} +2 -2
- package/dist/{util-LfQirgDk.mjs → util-DMF9AIO0.mjs} +33 -7
- package/dist/util-DMF9AIO0.mjs.map +1 -0
- package/dist/{verifier-t5WoWbtY.mjs → verifier-B51Wkt5H.mjs} +3 -3
- package/dist/verifier-B51Wkt5H.mjs.map +1 -0
- package/dist/verifier-CgTFpgsC.d.mts +22 -0
- package/dist/wasm.browser.d.mts +3 -3
- package/dist/wasm.browser.mjs +3 -3
- package/dist/wasm.d.mts +3 -3
- package/dist/wasm.mjs +3 -3
- package/dist/wasm.mjs.map +1 -1
- package/package.json +5 -9
- package/dist/abort-Ba8tDrOI.mjs.map +0 -1
- package/dist/builder-9tjI6WQ3.mjs.map +0 -1
- package/dist/client-CadO5fAX.mjs.map +0 -1
- package/dist/event-D8Nfoh4K.mjs.map +0 -1
- package/dist/gossip-oloDMWEj.mjs.map +0 -1
- package/dist/instance-DQE8BoWt.mjs.map +0 -1
- package/dist/key-Bps-LqX7.mjs.map +0 -1
- package/dist/loaders-o6YXB_Ri.mjs.map +0 -1
- package/dist/memory-C2EVx0_O.mjs.map +0 -1
- package/dist/memory-index-Do1mz0WF.mjs.map +0 -1
- package/dist/message-DcY6Fi9o.mjs +0 -193
- package/dist/message-DcY6Fi9o.mjs.map +0 -1
- package/dist/nip65-CjgmdpPB.d.mts +0 -26
- package/dist/nips/nip96.d.mts +0 -40
- package/dist/nips/nip96.mjs +0 -118
- package/dist/nips/nip96.mjs.map +0 -1
- package/dist/pool-As20OGxB.mjs +0 -2166
- package/dist/pool-As20OGxB.mjs.map +0 -1
- package/dist/reactive-BfhPp9a3.mjs.map +0 -1
- package/dist/signer-CYQutDzD.mjs.map +0 -1
- package/dist/storage-Dky3wuoH.mjs.map +0 -1
- package/dist/util-LfQirgDk.mjs.map +0 -1
- package/dist/verifier-t5WoWbtY.mjs.map +0 -1
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { n as EventTemplate, r as UnsignedEvent, t as Event } from "./event-
|
|
2
|
-
import { t as EventBuilder } from "./builder-
|
|
3
|
-
import { t as Filter } from "./filter-
|
|
4
|
-
import { t as Gossip } from "./gossip-
|
|
5
|
-
import { a as NostrError } from "./error-
|
|
6
|
-
import {
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import {
|
|
10
|
-
import { a as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { t as
|
|
14
|
-
import { t as StorageError } from "./error-BW7re1UN.mjs";
|
|
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";
|
|
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";
|
|
13
|
+
import { t as StorageError } from "./error-BD_0QFKT.mjs";
|
|
15
14
|
//#region src/client/types.d.ts
|
|
16
15
|
/** Direction of a {@link Client.sync} run: upload, download, or both. */
|
|
17
16
|
declare const SyncDirection: {
|
|
@@ -23,240 +22,172 @@ declare const SyncDirection: {
|
|
|
23
22
|
type SyncDirectionName = (typeof SyncDirection)[keyof typeof SyncDirection];
|
|
24
23
|
/** Options for {@link Client.sync} (NIP-77 set reconciliation). */
|
|
25
24
|
type SyncOptions = {
|
|
26
|
-
relays?: ReadonlyArray<string
|
|
27
|
-
direction?: SyncDirectionName;
|
|
25
|
+
relays?: ReadonlyArray<string> | undefined;
|
|
26
|
+
direction?: SyncDirectionName | undefined;
|
|
28
27
|
/**
|
|
29
28
|
* Wall-clock deadline for the Negentropy reconciliation session (`NEG-OPEN` through `NEG-CLOSE`),
|
|
30
29
|
* in milliseconds. One clock for the whole session — not reset per `NEG-MSG`. Default: the relay
|
|
31
30
|
* `publishTimeoutMs`. Upload/download phases reuse this value as their per-call timeout.
|
|
32
31
|
*/
|
|
33
|
-
timeoutMs?: number;
|
|
34
|
-
signal?: AbortSignal;
|
|
35
|
-
dryRun?: boolean;
|
|
32
|
+
timeoutMs?: number | undefined;
|
|
33
|
+
signal?: AbortSignal | undefined;
|
|
34
|
+
dryRun?: boolean | undefined;
|
|
36
35
|
/** When false, skip observe/storage on downloaded events. Default true. */
|
|
37
|
-
observe?: boolean;
|
|
36
|
+
observe?: boolean | undefined;
|
|
38
37
|
};
|
|
39
38
|
/** Outcome of a {@link Client.sync} run: ids compared, sent, received, and failures. */
|
|
40
39
|
type SyncSummary = {
|
|
41
|
-
local: string
|
|
42
|
-
remote: string
|
|
43
|
-
sent: string
|
|
44
|
-
received: string
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
readonly local: ReadonlyArray<string>;
|
|
41
|
+
readonly remote: ReadonlyArray<string>;
|
|
42
|
+
readonly sent: ReadonlyArray<string>;
|
|
43
|
+
readonly received: ReadonlyArray<string>;
|
|
44
|
+
/** Publish failures by event id: relay messages or thrown-error text. */
|
|
45
|
+
readonly sendFailures: Readonly<Record<string, string>>;
|
|
46
|
+
/** PutMany throws by event id. */
|
|
47
|
+
readonly persistFailures: Readonly<Record<string, Error>>;
|
|
47
48
|
};
|
|
48
|
-
/**
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
connectTimeoutMs?: number;
|
|
56
|
-
publishTimeoutMs?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Options for the {@link Client} constructor. Pool fields are forwarded to {@link Pool}; the
|
|
51
|
+
* client-only fields are documented here.
|
|
52
|
+
*/
|
|
53
|
+
type ClientOptions = Omit<PoolOptions, "automaticallyAuth"> & {
|
|
54
|
+
signer?: NostrSigner | undefined;
|
|
55
|
+
relays?: ReadonlyArray<string> | undefined;
|
|
57
56
|
/**
|
|
58
57
|
* When true (default), answer NIP-42 AUTH automatically. The signer is read at challenge time, so
|
|
59
58
|
* `setSigner()` applies to live connections; challenges received while no signer is set are
|
|
60
59
|
* ignored.
|
|
61
60
|
*/
|
|
62
|
-
automaticAuth?: boolean;
|
|
63
|
-
|
|
64
|
-
enableReconnect?: boolean;
|
|
65
|
-
/** Keepalive ping. Default false. */
|
|
66
|
-
enablePing?: boolean;
|
|
67
|
-
pingIntervalMs?: number;
|
|
68
|
-
pingTimeoutMs?: number;
|
|
69
|
-
/** Forwarded to the pool: when false (default), `ws://` relays are rejected. */
|
|
70
|
-
allowInsecure?: boolean;
|
|
71
|
-
/** Forwarded to the pool: `ws://` URLs allowed despite `allowInsecure`. */
|
|
72
|
-
trustedInsecureUrls?: ReadonlyArray<string>;
|
|
73
|
-
/** Forwarded to the pool: close idle relays after this many ms. */
|
|
74
|
-
idleTimeoutMs?: number;
|
|
75
|
-
/** Forwarded to the pool: soft cap on connected non-pinned relays. */
|
|
76
|
-
maxRelays?: number;
|
|
77
|
-
/** Forwarded to the pool: relays never closed by idle cleanup or `maxRelays`. */
|
|
78
|
-
pinnedUrls?: ReadonlyArray<string>;
|
|
79
|
-
/**
|
|
80
|
-
* Forwarded to the pool: a relay exceeding `limit` verification failures inside `windowMs` is
|
|
81
|
-
* disconnected and suspended for `cooldownMs`.
|
|
82
|
-
*/
|
|
83
|
-
invalidEventPolicy?: InvalidEventPolicy;
|
|
84
|
-
/** Forwarded to the pool: fired once when a relay is suspended, with the lift time. */
|
|
85
|
-
onRelaySuspended?: (url: string, until: number) => void;
|
|
86
|
-
gossip?: Gossip;
|
|
61
|
+
automaticAuth?: boolean | undefined;
|
|
62
|
+
gossip?: Gossip | undefined;
|
|
87
63
|
/**
|
|
88
64
|
* Local event store. Defaults to {@link MemoryEventStore}. Browser apps that want persistence must
|
|
89
65
|
* pass {@link IndexedDbEventStore} and `await open()`.
|
|
90
66
|
*/
|
|
91
|
-
storage?: EventStore;
|
|
67
|
+
storage?: EventStore | undefined;
|
|
92
68
|
/**
|
|
93
69
|
* Synchronous reactive index that mirrors every ingested event before callbacks and persistence.
|
|
94
70
|
* Defaults to a new {@link ReactiveEventStore}.
|
|
95
71
|
*/
|
|
96
|
-
index?: ReactiveEventStore;
|
|
72
|
+
index?: ReactiveEventStore | undefined;
|
|
97
73
|
/**
|
|
98
74
|
* When true (default), every ingested event is written to storage. Set false to disable automatic
|
|
99
75
|
* persistence while keeping the store for manual use.
|
|
100
76
|
*/
|
|
101
|
-
persistEvents?: boolean;
|
|
77
|
+
persistEvents?: boolean | undefined;
|
|
78
|
+
};
|
|
79
|
+
/** Typed event payloads for {@link Client.on}. */
|
|
80
|
+
type ClientEventMap = {
|
|
102
81
|
/**
|
|
103
82
|
* Storage I/O failures: live `putMany` flush and `fetchEvents({ localFirst: true })` query. Those
|
|
104
83
|
* paths do not throw.
|
|
105
84
|
*/
|
|
106
|
-
|
|
85
|
+
storageerror: StorageError;
|
|
107
86
|
};
|
|
108
87
|
type FetchEventsOptions = {
|
|
109
|
-
relays?: string
|
|
110
|
-
timeoutMs?: number;
|
|
111
|
-
signal?: AbortSignal;
|
|
112
|
-
gossip?: boolean;
|
|
88
|
+
relays?: ReadonlyArray<string> | undefined;
|
|
89
|
+
timeoutMs?: number | undefined;
|
|
90
|
+
signal?: AbortSignal | undefined;
|
|
91
|
+
gossip?: boolean | undefined;
|
|
113
92
|
/** When true, query local storage first and merge with network results. Defaults to false. */
|
|
114
|
-
localFirst?: boolean;
|
|
93
|
+
localFirst?: boolean | undefined;
|
|
115
94
|
/** When false, skip writing fetched events to storage/observe. Default true. */
|
|
116
|
-
observe?: boolean;
|
|
95
|
+
observe?: boolean | undefined;
|
|
117
96
|
/**
|
|
118
97
|
* Every event of every relay batch, including duplicates across relays. `relayUrl` is the
|
|
119
98
|
* normalized URL of the relay that delivered it.
|
|
120
99
|
*/
|
|
121
|
-
onevent?: (event: Event, relayUrl: string) => void;
|
|
100
|
+
onevent?: ((event: Event, relayUrl: string) => void) | undefined;
|
|
122
101
|
};
|
|
123
102
|
/** Options for {@link Client.fetchEach}: one-shot per-relay fetch, no gossip routing. */
|
|
124
103
|
type FetchEachOptions = {
|
|
125
|
-
relays?: string
|
|
126
|
-
timeoutMs?: number;
|
|
127
|
-
signal?: AbortSignal;
|
|
104
|
+
relays?: ReadonlyArray<string> | undefined;
|
|
105
|
+
timeoutMs?: number | undefined;
|
|
106
|
+
signal?: AbortSignal | undefined;
|
|
128
107
|
/** When false, skip writing fetched events to storage/observe. Default true. */
|
|
129
|
-
observe?: boolean;
|
|
108
|
+
observe?: boolean | undefined;
|
|
130
109
|
};
|
|
131
110
|
type SubscribeOptions = {
|
|
132
|
-
relays?: string
|
|
111
|
+
relays?: ReadonlyArray<string> | undefined;
|
|
133
112
|
/**
|
|
134
113
|
* First receipt of each event only (deduped across relays). `relayUrl` is the normalized URL of
|
|
135
114
|
* the relay that delivered it first.
|
|
136
115
|
*/
|
|
137
|
-
onevent?: (event: Event, relayUrl: string) => void;
|
|
116
|
+
onevent?: ((event: Event, relayUrl: string) => void) | undefined;
|
|
138
117
|
/** Every receipt from every relay, including duplicates skipped by dedupe. */
|
|
139
|
-
receivedEvent?: (id: string, relayUrl: string) => void;
|
|
140
|
-
oneose?: () => void;
|
|
141
|
-
onclose?: (reason: string) => void;
|
|
142
|
-
signal?: AbortSignal;
|
|
143
|
-
id?: string;
|
|
118
|
+
receivedEvent?: ((id: string, relayUrl: string) => void) | undefined;
|
|
119
|
+
oneose?: (() => void) | undefined;
|
|
120
|
+
onclose?: ((reason: string) => void) | undefined;
|
|
121
|
+
signal?: AbortSignal | undefined;
|
|
122
|
+
id?: string | undefined;
|
|
144
123
|
/**
|
|
145
124
|
* If set, fire `oneose` once after this many ms if not all relays have EOSEd. Does not close the
|
|
146
125
|
* subscription.
|
|
147
126
|
*/
|
|
148
|
-
eoseTimeoutMs?: number;
|
|
127
|
+
eoseTimeoutMs?: number | undefined;
|
|
149
128
|
/** Fan out REQs via NIP-65 gossip routes when available. */
|
|
150
|
-
gossip?: boolean;
|
|
129
|
+
gossip?: boolean | undefined;
|
|
151
130
|
/** When false, skip writing received events to storage/observe. Default true. */
|
|
152
|
-
observe?: boolean;
|
|
131
|
+
observe?: boolean | undefined;
|
|
153
132
|
};
|
|
154
133
|
type PublishOptions = {
|
|
155
|
-
relays?: string
|
|
156
|
-
timeoutMs?: number;
|
|
157
|
-
gossip?: boolean;
|
|
134
|
+
relays?: ReadonlyArray<string> | undefined;
|
|
135
|
+
timeoutMs?: number | undefined;
|
|
136
|
+
gossip?: boolean | undefined;
|
|
158
137
|
/** When false, skip writing the published event to storage/observe. Default true. */
|
|
159
|
-
observe?: boolean;
|
|
138
|
+
observe?: boolean | undefined;
|
|
160
139
|
};
|
|
161
140
|
/** Options for sending a NIP-17 private message. */
|
|
162
141
|
type SendPrivateMessageOptions = {
|
|
163
|
-
readonly subject?: string;
|
|
164
|
-
readonly replyTo?: ReplyTo;
|
|
165
|
-
readonly created_at?: number;
|
|
166
|
-
readonly timeoutMs?: number;
|
|
167
|
-
readonly observe?: boolean;
|
|
142
|
+
readonly subject?: string | undefined;
|
|
143
|
+
readonly replyTo?: ReplyTo | undefined;
|
|
144
|
+
readonly created_at?: number | undefined;
|
|
145
|
+
readonly timeoutMs?: number | undefined;
|
|
146
|
+
readonly observe?: boolean | undefined;
|
|
147
|
+
/** NIP-17 disappearing-message expiry (unix seconds) on the seal and the gift wrap. */
|
|
148
|
+
readonly expiration?: number | undefined;
|
|
149
|
+
/** Wrap in the ephemeral kind 21059 (relays MUST NOT store). */
|
|
150
|
+
readonly ephemeral?: boolean | undefined;
|
|
168
151
|
};
|
|
169
152
|
/** Result of sending a NIP-17 DM: the rumor plus per-recipient wrap publish results. */
|
|
170
153
|
type PrivateMessageSendResult = {
|
|
171
|
-
rumor: Rumor;
|
|
172
|
-
wraps: ReadonlyArray<{
|
|
173
|
-
recipient: string;
|
|
174
|
-
wrap: Event;
|
|
175
|
-
results: PoolPublishResult
|
|
154
|
+
readonly rumor: Rumor;
|
|
155
|
+
readonly wraps: ReadonlyArray<{
|
|
156
|
+
readonly recipient: string;
|
|
157
|
+
readonly wrap: Event;
|
|
158
|
+
readonly results: ReadonlyArray<PoolPublishResult>;
|
|
176
159
|
}>;
|
|
177
160
|
};
|
|
178
161
|
/** An unwrapped NIP-17 private message: the received gift wrap and its inner rumor. */
|
|
179
162
|
type ReceivedPrivateMessage = {
|
|
180
|
-
wrap: Event;
|
|
181
|
-
rumor: Rumor;
|
|
163
|
+
readonly wrap: Event;
|
|
164
|
+
readonly rumor: Rumor;
|
|
182
165
|
/** Normalized URL of the relay that delivered the wrap, when known. */
|
|
183
|
-
relayUrl?: string;
|
|
166
|
+
readonly relayUrl?: string | undefined;
|
|
184
167
|
};
|
|
185
168
|
/** Options for fetching NIP-17 private-message history. */
|
|
186
169
|
type FetchPrivateMessagesOptions = {
|
|
187
|
-
readonly since?: number;
|
|
188
|
-
readonly until?: number;
|
|
189
|
-
readonly timeoutMs?: number;
|
|
190
|
-
readonly signal?: AbortSignal;
|
|
191
|
-
readonly observe?: boolean;
|
|
170
|
+
readonly since?: number | undefined;
|
|
171
|
+
readonly until?: number | undefined;
|
|
172
|
+
readonly timeoutMs?: number | undefined;
|
|
173
|
+
readonly signal?: AbortSignal | undefined;
|
|
174
|
+
readonly observe?: boolean | undefined;
|
|
192
175
|
};
|
|
193
176
|
/** Options for a live NIP-17 private-message subscription. */
|
|
194
177
|
type SubscribePrivateMessagesOptions = {
|
|
195
|
-
readonly since?: number;
|
|
196
|
-
readonly onevent?: (msg: ReceivedPrivateMessage) => void;
|
|
197
|
-
readonly oneose?: () => void;
|
|
198
|
-
readonly onclose?: (reason: string) => void;
|
|
199
|
-
readonly signal?: AbortSignal;
|
|
200
|
-
readonly eoseTimeoutMs?: number;
|
|
201
|
-
readonly observe?: boolean;
|
|
178
|
+
readonly since?: number | undefined;
|
|
179
|
+
readonly onevent?: ((msg: ReceivedPrivateMessage) => void) | undefined;
|
|
180
|
+
readonly oneose?: (() => void) | undefined;
|
|
181
|
+
readonly onclose?: ((reason: string) => void) | undefined;
|
|
182
|
+
readonly signal?: AbortSignal | undefined;
|
|
183
|
+
readonly eoseTimeoutMs?: number | undefined;
|
|
184
|
+
readonly observe?: boolean | undefined;
|
|
202
185
|
};
|
|
203
186
|
/** Client lifecycle, configuration, or abort failure (not cryptographic). */
|
|
204
187
|
declare class ClientError extends NostrError {
|
|
205
188
|
name: string;
|
|
206
189
|
}
|
|
207
190
|
//#endregion
|
|
208
|
-
//#region src/client/builder.d.ts
|
|
209
|
-
/**
|
|
210
|
-
* Fluent constructor for {@link Client}. The constructor is supplied by {@link Client.builder} so
|
|
211
|
-
* this module never imports the `Client` value, keeping the client/builder dependency
|
|
212
|
-
* one-directional.
|
|
213
|
-
*/
|
|
214
|
-
declare class ClientBuilder {
|
|
215
|
-
#private;
|
|
216
|
-
constructor(newClient: (opts: ClientOptions) => Client);
|
|
217
|
-
signer(signer: NostrSigner): this;
|
|
218
|
-
relays(urls: ReadonlyArray<string>): this;
|
|
219
|
-
addRelay(url: string): this;
|
|
220
|
-
websocketImplementation(impl: WebSocketConstructor): this;
|
|
221
|
-
verifyEvent(fn: (event: Event) => boolean): this;
|
|
222
|
-
connectTimeoutMs(ms: number): this;
|
|
223
|
-
publishTimeoutMs(ms: number): this;
|
|
224
|
-
automaticAuth(enabled: boolean): this;
|
|
225
|
-
/** Allow `ws://` relays. Default false. */
|
|
226
|
-
allowInsecure(allow: boolean): this;
|
|
227
|
-
/** `ws://` URLs allowed despite `allowInsecure` being off. */
|
|
228
|
-
trustedInsecureUrls(urls: ReadonlyArray<string>): this;
|
|
229
|
-
/** Close idle relays after this many ms. Unset = disabled. */
|
|
230
|
-
idleTimeoutMs(ms: number): this;
|
|
231
|
-
/** Soft cap on connected non-pinned relays. */
|
|
232
|
-
maxRelays(n: number): this;
|
|
233
|
-
/** Relays never closed by idle cleanup or `maxRelays` eviction. */
|
|
234
|
-
pinnedUrls(urls: ReadonlyArray<string>): this;
|
|
235
|
-
/** Forwarded to the pool: suspend a relay delivering too many invalid events. */
|
|
236
|
-
invalidEventPolicy(policy: InvalidEventPolicy): this;
|
|
237
|
-
/** Forwarded to the pool: fired once when a relay is suspended, with the lift time. */
|
|
238
|
-
onRelaySuspended(cb: (url: string, until: number) => void): this;
|
|
239
|
-
enableReconnect(enabled: boolean): this;
|
|
240
|
-
enablePing(enabled: boolean): this;
|
|
241
|
-
pingIntervalMs(ms: number): this;
|
|
242
|
-
pingTimeoutMs(ms: number): this;
|
|
243
|
-
/**
|
|
244
|
-
* Local event store. Defaults to {@link MemoryEventStore}. Browser apps that want persistence must
|
|
245
|
-
* pass {@link IndexedDbEventStore} and `await open()`.
|
|
246
|
-
*/
|
|
247
|
-
storage(store: EventStore): this;
|
|
248
|
-
/**
|
|
249
|
-
* Synchronous reactive index mirroring ingested events. Defaults to a new
|
|
250
|
-
* {@link ReactiveEventStore}.
|
|
251
|
-
*/
|
|
252
|
-
index(index: ReactiveEventStore): this;
|
|
253
|
-
/** When false, Client will not auto-write events to storage. Default true. */
|
|
254
|
-
persistEvents(enabled: boolean): this;
|
|
255
|
-
gossip(gossip: Gossip): this;
|
|
256
|
-
onstorageerror(fn: (err: StorageError) => void): this;
|
|
257
|
-
build(): Client;
|
|
258
|
-
}
|
|
259
|
-
//#endregion
|
|
260
191
|
//#region src/client/client.d.ts
|
|
261
192
|
/** Layer-5 facade: signer + default relays + pool + loaders + gossip + event store. */
|
|
262
193
|
declare class Client {
|
|
@@ -266,9 +197,7 @@ declare class Client {
|
|
|
266
197
|
readonly gossip: Gossip;
|
|
267
198
|
readonly storage: EventStore;
|
|
268
199
|
readonly index: ReactiveEventStore;
|
|
269
|
-
onstorageerror: ((err: StorageError) => void) | undefined;
|
|
270
200
|
constructor(opts?: ClientOptions);
|
|
271
|
-
static builder(): ClientBuilder;
|
|
272
201
|
get signer(): NostrSigner | undefined;
|
|
273
202
|
get relays(): ReadonlyArray<string>;
|
|
274
203
|
get isShutdown(): boolean;
|
|
@@ -277,9 +206,15 @@ declare class Client {
|
|
|
277
206
|
removeRelay(url: string): void;
|
|
278
207
|
/** Connect all configured relays (best-effort; failures are ignored). */
|
|
279
208
|
connect(opts?: {
|
|
280
|
-
signal?: AbortSignal;
|
|
209
|
+
signal?: AbortSignal | undefined;
|
|
281
210
|
}): Promise<void>;
|
|
282
211
|
shutdown(): Promise<void>;
|
|
212
|
+
/**
|
|
213
|
+
* Listen for a client event. Multiple listeners per type are allowed and fire in registration
|
|
214
|
+
* order; a throwing listener is reported and does not break the dispatch. Returns an unsubscribe
|
|
215
|
+
* function.
|
|
216
|
+
*/
|
|
217
|
+
on<K extends keyof ClientEventMap>(type: K, listener: (err: ClientEventMap[K]) => void): () => void;
|
|
283
218
|
/** Ingest one inbound event: index (with relay URL) → meta → persistence. */
|
|
284
219
|
observe(event: Event, relayUrl?: string): void;
|
|
285
220
|
/** Ingest many events (deduped by id, order preserved) as one persist batch. */
|
|
@@ -316,26 +251,22 @@ declare class Client {
|
|
|
316
251
|
* Fetch events. With `gossip: true`, routes filters by NIP-65 when possible. With `localFirst:
|
|
317
252
|
* true`, merges storage hits with network results.
|
|
318
253
|
*/
|
|
319
|
-
fetchEvents(filter: Filter | Filter
|
|
254
|
+
fetchEvents(filter: Filter | ReadonlyArray<Filter>, opts?: FetchEventsOptions): Promise<Event[]>;
|
|
320
255
|
/**
|
|
321
256
|
* One-shot fetch with per-relay results: each entry reports its events and end reason (`eose`,
|
|
322
257
|
* `closed`, `timeout`, or `failed` when the relay could not be reached). Events are ingested into
|
|
323
258
|
* the index with each relay's URL in `seenOn` and persisted exactly like {@link fetchEvents}
|
|
324
259
|
* (`observe` defaults to true). No gossip routing and no local merge.
|
|
325
260
|
*/
|
|
326
|
-
fetchEach(filter: Filter | Filter
|
|
261
|
+
fetchEach(filter: Filter | ReadonlyArray<Filter>, opts?: FetchEachOptions): Promise<PoolFetchResult[]>;
|
|
327
262
|
/** Query local storage only (no network). */
|
|
328
|
-
queryLocal(filter: Filter | Filter
|
|
329
|
-
subscribe(filter: Filter | Filter
|
|
330
|
-
close: (reason?: string) => void;
|
|
331
|
-
};
|
|
263
|
+
queryLocal(filter: Filter | ReadonlyArray<Filter>): Promise<Event[]>;
|
|
264
|
+
subscribe(filter: Filter | ReadonlyArray<Filter>, opts?: SubscribeOptions): Closer;
|
|
332
265
|
/** Publish a kind:10050 NIP-17 DM relay list (`relay` tags). Not kind 10002. */
|
|
333
266
|
setDmRelays(relays: ReadonlyArray<string>, opts?: PublishOptions): Promise<PoolPublishResult[]>;
|
|
334
267
|
sendPrivateMessage(recipients: string | Recipient | ReadonlyArray<string | Recipient>, content: string, opts?: SendPrivateMessageOptions): Promise<PrivateMessageSendResult>;
|
|
335
268
|
fetchPrivateMessages(opts?: FetchPrivateMessagesOptions): Promise<ReceivedPrivateMessage[]>;
|
|
336
|
-
subscribePrivateMessages(opts?: SubscribePrivateMessagesOptions): Promise<
|
|
337
|
-
close: (reason?: string) => void;
|
|
338
|
-
}>;
|
|
269
|
+
subscribePrivateMessages(opts?: SubscribePrivateMessagesOptions): Promise<Closer>;
|
|
339
270
|
/**
|
|
340
271
|
* NIP-77 sync against one relay: reconcile, then optionally upload local-only events and/or
|
|
341
272
|
* download remote-only events. `observe: false` skips putMany and ingest; received ids are still
|
|
@@ -350,5 +281,5 @@ declare class Client {
|
|
|
350
281
|
sync(filter: Filter, opts?: SyncOptions): Promise<SyncSummary>;
|
|
351
282
|
}
|
|
352
283
|
//#endregion
|
|
353
|
-
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,
|
|
354
|
-
//# sourceMappingURL=index-
|
|
284
|
+
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
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { t as Event } from "./event-fU3Y01PR.mjs";
|
|
2
1
|
//#region src/core/limits.d.ts
|
|
3
2
|
/** NIP-01 event id length in bytes. */
|
|
4
3
|
declare const EVENT_ID_BYTES = 32;
|
|
@@ -30,6 +29,11 @@ declare function assertSecretKeyBytes(bytes: Uint8Array): void;
|
|
|
30
29
|
* serialization keeps a trailing `/` on the root path (`wss://a.example/`).
|
|
31
30
|
*/
|
|
32
31
|
declare function normalizeURL(url: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* Normalize each entry like {@link normalizeURL}; empty or invalid entries are skipped and the
|
|
34
|
+
* results are deduplicated in first-seen order.
|
|
35
|
+
*/
|
|
36
|
+
declare function normalizeRelayUrls(urls: Iterable<string>): string[];
|
|
33
37
|
//#endregion
|
|
34
38
|
//#region src/core/kind.d.ts
|
|
35
39
|
/** NIP-01 regular: stored by relays. */
|
|
@@ -80,22 +84,5 @@ type KindName = keyof typeof Kind;
|
|
|
80
84
|
/** Union of the numeric kind values on {@link Kind}. */
|
|
81
85
|
type KnownKind = (typeof Kind)[KindName];
|
|
82
86
|
//#endregion
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
* Verification backend: return true iff `sha256(serializedUtf8)` equals `id` and `sig` is a valid
|
|
86
|
-
* BIP-340 signature of `id` by the x-only `pubkey`. Inputs are raw bytes (`id`/`pubkey` 32, `sig`
|
|
87
|
-
* 64). Exceptions propagate through the built verifier unmarked — a throwing backend is broken and
|
|
88
|
-
* must surface.
|
|
89
|
-
*/
|
|
90
|
-
type SerializedEventVerifier = (serializedUtf8: Uint8Array, id: Uint8Array, pubkey: Uint8Array, sig: Uint8Array) => boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Build an event verifier with exactly the semantics of {@link verifyEvent}, delegating the hash and
|
|
93
|
-
* signature check to `backend`. Verified/failed results share `verifyEvent`'s WeakSet caches, so
|
|
94
|
-
* verifiers built this way and `verifyEvent` agree on (and reuse) each other's results.
|
|
95
|
-
*/
|
|
96
|
-
declare function createEventVerifier(backend: SerializedEventVerifier): (event: Event) => boolean;
|
|
97
|
-
/** Verify event id and BIP-340 signature. Uses WeakSet cache (does not mutate the event). */
|
|
98
|
-
declare const verifyEvent: (event: Event) => boolean;
|
|
99
|
-
//#endregion
|
|
100
|
-
export { SIGNATURE_BYTES as C, SECRET_KEY_BYTES as S, isHex32 as _, KindClassification as a, EVENT_ID_BYTES as b, classifyKind as c, isRegularKind as d, isReplaceableKind as f, hexToBytes as g, bytesToHex as h, Kind as i, isAddressableKind as l, assertSecretKeyBytes as m, createEventVerifier as n, KindName as o, assertHex32 as p, verifyEvent as r, KnownKind as s, SerializedEventVerifier as t, isEphemeralKind as u, isHex64 as v, SUBSCRIPTION_ID_MAX_CHARS as w, PUBLIC_KEY_BYTES as x, normalizeURL as y };
|
|
101
|
-
//# sourceMappingURL=index-CvkvqB16.d.mts.map
|
|
87
|
+
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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as Event } from "./event-
|
|
2
|
-
import { t as Filter } from "./filter-
|
|
3
|
-
import { a as NostrError } from "./error-
|
|
4
|
-
import { n as Pool } from "./pool-
|
|
1
|
+
import { t as Event } from "./event-DJeb_DIL.mjs";
|
|
2
|
+
import { t as Filter } from "./filter-jI_9htF7.mjs";
|
|
3
|
+
import { a as NostrError } from "./error-BquXDmIN.mjs";
|
|
4
|
+
import { _ as Closer, n as Pool } from "./pool-CqQvUnsq.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 {
|
|
@@ -69,9 +69,7 @@ type FanInOptions = {
|
|
|
69
69
|
* Aggregate EOSE/close across routed jobs. One `seen` set. `pending` counts URL list entries
|
|
70
70
|
* (duplicates included). `pendingEose` counts unique `jobIndex:url` keys.
|
|
71
71
|
*/
|
|
72
|
-
declare function fanIn(pool: Pool, jobs: ReadonlyArray<RoutedJob>, opts?: FanInOptions):
|
|
73
|
-
close: (reason?: string) => void;
|
|
74
|
-
};
|
|
72
|
+
declare function fanIn(pool: Pool, jobs: ReadonlyArray<RoutedJob>, opts?: FanInOptions): Closer;
|
|
75
73
|
declare function fetchRouted(pool: Pool, jobs: ReadonlyArray<RoutedJob>, opts?: {
|
|
76
74
|
timeoutMs?: number | undefined;
|
|
77
75
|
signal?: AbortSignal | undefined;
|
|
@@ -81,4 +79,4 @@ declare function fetchRouted(pool: Pool, jobs: ReadonlyArray<RoutedJob>, opts?:
|
|
|
81
79
|
}): Promise<Event[]>;
|
|
82
80
|
//#endregion
|
|
83
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 };
|
|
84
|
-
//# sourceMappingURL=index-
|
|
82
|
+
//# sourceMappingURL=index-DyKwQnbt.d.mts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { a as
|
|
3
|
-
import { n as ProfileMetadata, t as EventBuilder } from "./builder-
|
|
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-
|
|
5
|
-
import { a as
|
|
6
|
-
import { i as RoutedFilter, r as PubkeyRoutes, t as Gossip } from "./gossip-
|
|
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-
|
|
8
|
-
import {
|
|
9
|
-
import { a as
|
|
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";
|
|
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
11
|
import { i as useWebSocketImplementation } from "./websocket-CmeqvAkp.mjs";
|
|
11
|
-
import { i as PutResult, n as NegentropyItem, r as OutboxBound, t as EventStore } from "./types-
|
|
12
|
-
import { n as
|
|
13
|
-
import { _ as
|
|
14
|
-
import {
|
|
15
|
-
import { t as NostrSigner } from "./types-
|
|
16
|
-
import { t as StorageError } from "./error-
|
|
17
|
-
import { _ as SyncSummary, c as PrivateMessageSendResult, d as SendPrivateMessageOptions, g as SyncOptions, h as SyncDirectionName, i as ClientOptions, m as SyncDirection, n as
|
|
18
|
-
import {
|
|
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-
|
|
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";
|
|
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";
|
|
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";
|
|
21
|
+
import { Nip21Error, NostrURI, isNostrURI, parseNostrURI } from "./nips/nip21.mjs";
|
|
20
22
|
import { ReplyTagsOptions, ThreadReferences, buildReplyTags, parseThreadTags, replyTo } from "./nips/nip10.mjs";
|
|
21
23
|
import { isAuthRequired, makeAuthEvent } from "./nips/nip42.mjs";
|
|
22
|
-
import { a as isInsecureRelayUrl, c as RelayError, d as RelayTimeoutError, l as RelayPublishError, o as RelayClosedError, s as RelayConnectionError, u as RelaySuspendedError } from "./index-
|
|
23
|
-
import { a as IndexedDbEventStoreOptions, i as IndexedDbEventStore, n as SqlValue, o as MemoryEventStore, r as SqliteEventStore, t as SqlDriver } from "./index-
|
|
24
|
-
export { type AddressPointer, Bech32MaxSize, Client,
|
|
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 };
|