@qntx/nostr 0.7.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/{builder-DgkqDylK.d.mts → builder-CTwkB2zM.d.mts} +10 -10
- package/dist/{builder-CdLE4J6O.mjs → builder-aNU2gGFP.mjs} +4 -4
- package/dist/builder-aNU2gGFP.mjs.map +1 -0
- package/dist/{client-CILhdfsF.mjs → client-Cj2lUaVh.mjs} +70 -72
- package/dist/client-Cj2lUaVh.mjs.map +1 -0
- package/dist/client.d.mts +1 -1
- package/dist/client.mjs +1 -1
- package/dist/core.d.mts +2 -2
- package/dist/core.mjs +6 -6
- package/dist/emitter-DkCY6NkU.mjs +32 -0
- package/dist/emitter-DkCY6NkU.mjs.map +1 -0
- package/dist/{error-L_QdmSnV.mjs → error-BILMe3Gr.mjs} +2 -2
- package/dist/{error-L_QdmSnV.mjs.map → error-BILMe3Gr.mjs.map} +1 -1
- package/dist/{error-gtJvV6YS.mjs → error-DlhGW4mJ.mjs} +2 -2
- package/dist/{error-gtJvV6YS.mjs.map → error-DlhGW4mJ.mjs.map} +1 -1
- package/dist/{event-DinQMmJ1.mjs → event-CHf47dPM.mjs} +2 -2
- package/dist/{event-DinQMmJ1.mjs.map → event-CHf47dPM.mjs.map} +1 -1
- package/dist/{gossip-CcTp9VpU.mjs → gossip-DFxIBlsr.mjs} +3 -3
- package/dist/gossip-DFxIBlsr.mjs.map +1 -0
- package/dist/{gossip-C7HLW5kI.d.mts → gossip-OOeeFzG5.d.mts} +4 -4
- package/dist/gossip.d.mts +1 -1
- package/dist/gossip.mjs +1 -1
- package/dist/{index-InQZpHyQ.d.mts → index-BxCBX-8R.d.mts} +2 -2
- package/dist/{index-iLT8UzY3.d.mts → index-CPVEyzNX.d.mts} +22 -22
- package/dist/{index-Tx15HGAD.d.mts → index-C_w2WfVz.d.mts} +4 -4
- package/dist/{index-DocgD9K0.d.mts → index-Cl_1XdYP.d.mts} +29 -23
- package/dist/{index-DiXwNn2M.d.mts → index-DyKwQnbt.d.mts} +2 -2
- package/dist/index.d.mts +14 -14
- package/dist/index.mjs +17 -17
- package/dist/{instance-BcKzxHIP.mjs → instance-C62w3cEt.mjs} +3 -3
- package/dist/{instance-BcKzxHIP.mjs.map → instance-C62w3cEt.mjs.map} +1 -1
- package/dist/{key-bshqfmZL.mjs → key-DnVpchl6.mjs} +3 -3
- package/dist/{key-bshqfmZL.mjs.map → key-DnVpchl6.mjs.map} +1 -1
- package/dist/{loaders-DD0XAGzw.mjs → loaders-BmPkQfzI.mjs} +6 -6
- package/dist/loaders-BmPkQfzI.mjs.map +1 -0
- package/dist/loaders.d.mts +2 -2
- package/dist/loaders.mjs +1 -1
- package/dist/{memory-D_-5-T31.mjs → memory-CdJ07kub.mjs} +2 -2
- package/dist/memory-CdJ07kub.mjs.map +1 -0
- package/dist/{memory-index-C6rujtoc.mjs → memory-index-Cbc83vOZ.mjs} +3 -3
- package/dist/{memory-index-C6rujtoc.mjs.map → memory-index-Cbc83vOZ.mjs.map} +1 -1
- package/dist/{message-CWLcFTQ1.mjs → message-oNr7t0SJ.mjs} +3 -3
- package/dist/message-oNr7t0SJ.mjs.map +1 -0
- package/dist/{message-CbBZOhq3.d.mts → message-tclYCVNc.d.mts} +4 -4
- package/dist/{nip17-cTDFfFVt.d.mts → nip17-B5WgW4C4.d.mts} +4 -4
- package/dist/{nip19-D1OnJ192.d.mts → nip19-DpPN17bY.d.mts} +23 -23
- package/dist/{nip46-DrsPI8EX.d.mts → nip46-BHaxC9TZ.d.mts} +17 -17
- package/dist/{nip51-DoPUvQ--.d.mts → nip51-CR0Q8eym.d.mts} +10 -10
- package/dist/{nip59-BFIihLYY.d.mts → nip59-C-RWFQIv.d.mts} +9 -2
- package/dist/{nip65-52HiwiyD.d.mts → nip65-D1fbmhOg.d.mts} +2 -2
- package/dist/{nip77-C9QcZn7b.d.mts → nip77-DzUwUxHq.d.mts} +6 -6
- package/dist/nips/blossom.d.mts +6 -6
- package/dist/nips/blossom.mjs +2 -2
- package/dist/nips/blossom.mjs.map +1 -1
- package/dist/nips/nip04.mjs +1 -1
- package/dist/nips/nip05.d.mts +8 -8
- package/dist/nips/nip05.mjs +1 -1
- package/dist/nips/nip05.mjs.map +1 -1
- package/dist/nips/nip10.d.mts +7 -7
- package/dist/nips/nip10.mjs +34 -32
- package/dist/nips/nip10.mjs.map +1 -1
- package/dist/nips/nip11.d.mts +27 -27
- package/dist/nips/nip11.mjs +1 -1
- package/dist/nips/nip11.mjs.map +1 -1
- package/dist/nips/nip13.mjs +1 -1
- package/dist/nips/nip17.d.mts +1 -1
- package/dist/nips/nip17.mjs +6 -4
- package/dist/nips/nip17.mjs.map +1 -1
- package/dist/nips/nip19.d.mts +1 -1
- package/dist/nips/nip19.mjs +1 -1
- package/dist/nips/nip19.mjs.map +1 -1
- package/dist/nips/nip21.d.mts +4 -4
- package/dist/nips/nip21.mjs +1 -1
- package/dist/nips/nip21.mjs.map +1 -1
- package/dist/nips/nip27.d.mts +19 -19
- package/dist/nips/nip27.mjs +2 -2
- package/dist/nips/nip27.mjs.map +1 -1
- package/dist/nips/nip42.mjs +1 -1
- package/dist/nips/nip44.mjs +2 -2
- package/dist/nips/nip44.mjs.map +1 -1
- package/dist/nips/nip46.d.mts +1 -1
- package/dist/nips/nip46.mjs +1 -1
- package/dist/nips/nip46.mjs.map +1 -1
- package/dist/nips/nip49.d.mts +4 -4
- package/dist/nips/nip49.mjs +1 -1
- package/dist/nips/nip49.mjs.map +1 -1
- package/dist/nips/nip51.d.mts +1 -1
- package/dist/nips/nip51.mjs +3 -3
- package/dist/nips/nip51.mjs.map +1 -1
- package/dist/nips/nip57.d.mts +18 -18
- package/dist/nips/nip57.mjs +3 -3
- package/dist/nips/nip57.mjs.map +1 -1
- package/dist/nips/nip59.d.mts +1 -1
- package/dist/nips/nip59.mjs +15 -7
- package/dist/nips/nip59.mjs.map +1 -1
- package/dist/nips/nip65.d.mts +1 -1
- package/dist/nips/nip65.mjs +2 -2
- package/dist/nips/nip77.d.mts +1 -1
- package/dist/nips/nip77.mjs +1 -1
- package/dist/nips/nip77.mjs.map +1 -1
- package/dist/nips/nip98.mjs +3 -3
- package/dist/{pool-SzJKPIa3.d.mts → pool-CqQvUnsq.d.mts} +43 -24
- package/dist/{pool-YHRZgcQ3.mjs → pool-vlw74C4t.mjs} +39 -29
- package/dist/pool-vlw74C4t.mjs.map +1 -0
- package/dist/{put-DS0yzVJx.mjs → put-w13ci3sC.mjs} +3 -3
- package/dist/put-w13ci3sC.mjs.map +1 -0
- package/dist/{reactive-BJRoVHxU.mjs → reactive-Tz0otDIP.mjs} +49 -27
- package/dist/reactive-Tz0otDIP.mjs.map +1 -0
- package/dist/{reactive-BJ1ggn4d.d.mts → reactive-gGqUrzW8.d.mts} +16 -7
- package/dist/{relay-CvxPiQ_m.mjs → relay-quCs7MHD.mjs} +1049 -861
- package/dist/relay-quCs7MHD.mjs.map +1 -0
- package/dist/relay.d.mts +4 -4
- package/dist/relay.mjs +2 -2
- package/dist/{signer-yW3slDC2.mjs → signer-poTGe6Er.mjs} +6 -6
- package/dist/signer-poTGe6Er.mjs.map +1 -0
- package/dist/signer.d.mts +1 -1
- package/dist/signer.mjs +2 -2
- package/dist/{storage-CZ52ifcQ.mjs → storage-B5IXTVuS.mjs} +16 -14
- package/dist/storage-B5IXTVuS.mjs.map +1 -0
- package/dist/storage.d.mts +2 -2
- package/dist/storage.mjs +4 -4
- package/dist/store.d.mts +2 -2
- package/dist/store.mjs +1 -1
- package/dist/testing.d.mts +3 -3
- package/dist/testing.mjs +6 -6
- package/dist/testing.mjs.map +1 -1
- package/dist/{types-Cm-XMgtH.d.mts → types-BacwnDtU.d.mts} +5 -5
- package/dist/{util-yFYzlbrm.mjs → util-DMF9AIO0.mjs} +6 -2
- package/dist/util-DMF9AIO0.mjs.map +1 -0
- package/dist/{verifier-BTLOpo1n.mjs → verifier-B51Wkt5H.mjs} +3 -3
- package/dist/{verifier-BTLOpo1n.mjs.map → verifier-B51Wkt5H.mjs.map} +1 -1
- package/dist/wasm.browser.mjs +2 -2
- package/dist/wasm.mjs +2 -2
- package/package.json +1 -1
- package/dist/builder-CdLE4J6O.mjs.map +0 -1
- package/dist/client-CILhdfsF.mjs.map +0 -1
- package/dist/gossip-CcTp9VpU.mjs.map +0 -1
- package/dist/loaders-DD0XAGzw.mjs.map +0 -1
- package/dist/memory-D_-5-T31.mjs.map +0 -1
- package/dist/message-CWLcFTQ1.mjs.map +0 -1
- package/dist/pool-YHRZgcQ3.mjs.map +0 -1
- package/dist/put-DS0yzVJx.mjs.map +0 -1
- package/dist/reactive-BJRoVHxU.mjs.map +0 -1
- package/dist/relay-CvxPiQ_m.mjs.map +0 -1
- package/dist/signer-yW3slDC2.mjs.map +0 -1
- package/dist/storage-CZ52ifcQ.mjs.map +0 -1
- package/dist/util-yFYzlbrm.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as NostrError } from "./util-
|
|
1
|
+
import { v as NostrError } from "./util-DMF9AIO0.mjs";
|
|
2
2
|
//#region src/signer/error.ts
|
|
3
3
|
/**
|
|
4
4
|
* Thrown by a lazy NIP-42 AUTH sign function when no signer is configured at challenge time.
|
|
@@ -11,4 +11,4 @@ var NoSignerError = class extends NostrError {
|
|
|
11
11
|
//#endregion
|
|
12
12
|
export { NoSignerError as t };
|
|
13
13
|
|
|
14
|
-
//# sourceMappingURL=error-
|
|
14
|
+
//# sourceMappingURL=error-DlhGW4mJ.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-
|
|
1
|
+
{"version":3,"file":"error-DlhGW4mJ.mjs","names":[],"sources":["../src/signer/error.ts"],"sourcesContent":["import { NostrError } from \"../core/error.ts\";\n\n/**\n * Thrown by a lazy NIP-42 AUTH sign function when no signer is configured at challenge time.\n * {@link import(\"../relay/relay.ts\").Relay} catches it and ignores the challenge: no AUTH frame is\n * sent and the connection stays open.\n */\nexport class NoSignerError extends NostrError {\n override name = \"NoSignerError\";\n}\n"],"mappings":";;;;;;;AAOA,IAAa,gBAAb,cAAmC,WAAW;CAC5C,OAAgB;AAClB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as isRecord, h as EventValidationError, i as bytesToHex, o as isHex32, p as utf8Encoder, s as isHex64 } from "./util-
|
|
1
|
+
import { c as isRecord, h as EventValidationError, i as bytesToHex, o as isHex32, p as utf8Encoder, s as isHex64 } from "./util-DMF9AIO0.mjs";
|
|
2
2
|
import { o as isReplaceableKind, r as isAddressableKind } from "./kind-Cxwhhkx8.mjs";
|
|
3
3
|
import { sha256 } from "@noble/hashes/sha2.js";
|
|
4
4
|
//#region src/core/tag.ts
|
|
@@ -199,4 +199,4 @@ function signedMatchesUnsigned(signed, unsigned) {
|
|
|
199
199
|
//#endregion
|
|
200
200
|
export { tagValue as C, tagName as S, firstTagValue as _, isReplaceableWinner as a, isTag as b, markVerified as c, sortEvents as d, sortedEvents as f, eventAddress as g, Tag as h, isMarkedVerified as i, serializeEvent as l, validateSignedEvent as m, getEventHash as n, itemCompare as o, validateEvent as p, isMarkedFailed as r, markUnverified as s, compareEventsDesc as t, signedMatchesUnsigned as u, formatEventAddress as v, parseEventAddress as x, getDTag as y };
|
|
201
201
|
|
|
202
|
-
//# sourceMappingURL=event-
|
|
202
|
+
//# sourceMappingURL=event-CHf47dPM.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-DinQMmJ1.mjs","names":[],"sources":["../src/core/tag.ts","../src/core/event.ts"],"sourcesContent":["import { isAddressableKind, isReplaceableKind } from \"./kind.ts\";\nimport { isHex32 } from \"./util.ts\";\n\n/** A NIP-01 tag: first element is the name, rest are values. */\nexport type Tag = ReadonlyArray<string>;\n\n/** Mutable tag builder input. */\nexport type TagInput = string[];\n\n/** Type guard: a non-empty array of strings. */\nexport function isTag(value: unknown): value is Tag {\n if (!Array.isArray(value) || value.length === 0) {\n return false;\n }\n for (const item of value) {\n if (typeof item !== \"string\") {\n return false;\n }\n }\n return true;\n}\n\n/** First element of a tag (its name). */\nexport function tagName(tag: Tag): string {\n return tag[0] ?? \"\";\n}\n\n/** Second element of a tag (its primary value), or undefined for a bare name tag. */\nexport function tagValue(tag: Tag): string | undefined {\n return tag[1];\n}\n\n/** Construct common tags. */\nexport const Tag = {\n e(id: string, relay?: string, marker?: string, pubkey?: string): Tag {\n const t: string[] = [\"e\", id.toLowerCase()];\n if (relay !== undefined) {\n t.push(relay);\n }\n if (marker !== undefined) {\n t.push(marker);\n }\n if (pubkey !== undefined) {\n t.push(pubkey.toLowerCase());\n }\n return t;\n },\n p(pubkey: string, relay?: string, petname?: string): Tag {\n const t: string[] = [\"p\", pubkey.toLowerCase()];\n if (relay !== undefined) {\n t.push(relay);\n }\n if (petname !== undefined) {\n t.push(petname);\n }\n return t;\n },\n a(coordinate: string, relay?: string): Tag {\n const t: string[] = [\"a\", coordinate];\n if (relay !== undefined) {\n t.push(relay);\n }\n return t;\n },\n d(identifier: string): Tag {\n return [\"d\", identifier];\n },\n t(hashtag: string): Tag {\n return [\"t\", hashtag];\n },\n r(url: string, marker?: string): Tag {\n const t: string[] = [\"r\", url];\n if (marker !== undefined) {\n t.push(marker);\n }\n return t;\n },\n k(kind: number | string): Tag {\n return [\"k\", String(kind)];\n },\n} as const;\n\n/** First tag value with the given name, or undefined when no such tag has a value. */\nexport function firstTagValue(tags: ReadonlyArray<Tag>, name: string): string | undefined {\n for (const tag of tags) {\n if (tag[0] === name && tag[1] !== undefined) {\n return tag[1];\n }\n }\n return undefined;\n}\n\n/** First `d` tag value on an event, if any. */\nexport function getDTag(tags: ReadonlyArray<Tag>): string | undefined {\n return firstTagValue(tags, \"d\");\n}\n\n/** NIP-01 `a` tag: `kind:pubkey:identifier` (identifier may be empty and may contain extra colons). */\nexport type EventAddress = {\n kind: number;\n pubkey: string;\n identifier: string;\n};\n\n/** Parse a NIP-01 addressable/replaceable coordinate. */\nexport function parseEventAddress(value: string): EventAddress | undefined {\n const first = value.indexOf(\":\");\n if (first <= 0) {\n return undefined;\n }\n const second = value.indexOf(\":\", first + 1);\n if (second === -1) {\n return undefined;\n }\n const kind = Number(value.slice(0, first));\n if (!Number.isInteger(kind) || kind < 0 || kind > 65535) {\n return undefined;\n }\n const pubkey = value.slice(first + 1, second).toLowerCase();\n if (!isHex32(pubkey)) {\n return undefined;\n }\n return { kind, pubkey, identifier: value.slice(second + 1) };\n}\n\n/** Format an address as a `kind:pubkey:dTag` coordinate string. */\nexport function formatEventAddress(kind: number, pubkey: string, identifier = \"\"): string {\n return `${kind}:${pubkey.toLowerCase()}:${identifier}`;\n}\n\n/**\n * Coordinate for replaceable (`kind:pubkey:`) and addressable (`kind:pubkey:d`) events. Undefined\n * for regular/ephemeral kinds.\n */\nexport function eventAddress(event: {\n kind: number;\n pubkey: string;\n tags: ReadonlyArray<Tag>;\n}): string | undefined {\n if (isAddressableKind(event.kind)) {\n return formatEventAddress(event.kind, event.pubkey, getDTag(event.tags) ?? \"\");\n }\n if (isReplaceableKind(event.kind)) {\n return formatEventAddress(event.kind, event.pubkey, \"\");\n }\n return undefined;\n}\n","import { sha256 } from \"@noble/hashes/sha2.js\";\n\nimport { EventValidationError } from \"./error.ts\";\nimport type { Tag } from \"./tag.ts\";\nimport { isTag } from \"./tag.ts\";\nimport { isHex32, isHex64, isRecord, utf8Encoder, bytesToHex } from \"./util.ts\";\n\n/** Wire event template before pubkey/id/sig. */\nexport type EventTemplate = {\n readonly kind: number;\n readonly tags: ReadonlyArray<Tag>;\n readonly content: string;\n readonly created_at: number;\n};\n\n/** Event with pubkey, ready to hash and sign. */\nexport type UnsignedEvent = EventTemplate & {\n readonly pubkey: string;\n};\n\n/**\n * Fully formed NIP-01 event (JSON-friendly plain object). Fields are readonly at the type level;\n * wire interop remains plain JSON.\n */\nexport type Event = UnsignedEvent & {\n readonly id: string;\n readonly sig: string;\n};\n\n/** Cache of events whose signatures have been verified successfully. */\nconst verifiedEvents = new WeakSet<Event>();\n\n/** Cache of events known to fail verification. */\nconst failedEvents = new WeakSet<Event>();\n\nexport function markVerified(event: Event): void {\n verifiedEvents.add(event);\n failedEvents.delete(event);\n}\n\nexport function markUnverified(event: Event): void {\n failedEvents.add(event);\n verifiedEvents.delete(event);\n}\n\nexport function isMarkedVerified(event: Event): boolean {\n return verifiedEvents.has(event);\n}\n\nexport function isMarkedFailed(event: Event): boolean {\n return failedEvents.has(event);\n}\n\n/** Structural validation of an unsigned event (no crypto). */\nexport function validateEvent(event: unknown): event is UnsignedEvent {\n if (!isRecord(event)) {\n return false;\n }\n if (\n typeof event[\"kind\"] !== \"number\" ||\n !Number.isInteger(event[\"kind\"]) ||\n event[\"kind\"] < 0 ||\n event[\"kind\"] > 65535\n ) {\n return false;\n }\n if (typeof event[\"content\"] !== \"string\") {\n return false;\n }\n if (typeof event[\"created_at\"] !== \"number\" || !Number.isInteger(event[\"created_at\"])) {\n return false;\n }\n if (typeof event[\"pubkey\"] !== \"string\" || !isHex32(event[\"pubkey\"])) {\n return false;\n }\n if (!Array.isArray(event[\"tags\"])) {\n return false;\n }\n for (const tag of event[\"tags\"]) {\n if (!isTag(tag)) {\n return false;\n }\n }\n return true;\n}\n\n/** Structural validation of a full event including id and sig hex shape. */\nexport function validateSignedEvent(event: unknown): event is Event {\n if (!validateEvent(event)) {\n return false;\n }\n const e = event as Record<string, unknown>;\n if (typeof e[\"id\"] !== \"string\" || !isHex32(e[\"id\"])) {\n return false;\n }\n if (typeof e[\"sig\"] !== \"string\" || !isHex64(e[\"sig\"])) {\n return false;\n }\n return true;\n}\n\n/**\n * Canonical NIP-01 serialization used for hashing: JSON array `[0, pubkey, created_at, kind, tags,\n * content]` with no extra whitespace.\n */\nexport function serializeEvent(event: UnsignedEvent): string {\n if (!validateEvent(event)) {\n throw new EventValidationError(\"cannot serialize event with invalid shape\");\n }\n return JSON.stringify([0, event.pubkey, event.created_at, event.kind, event.tags, event.content]);\n}\n\n/** SHA-256 of the canonical serialization, lowercase hex. */\nexport function getEventHash(event: UnsignedEvent): string {\n const serialized = serializeEvent(event);\n return bytesToHex(sha256(utf8Encoder.encode(serialized)));\n}\n\n/** Id tie-break: plain code-unit order (ids are canonical lowercase hex, so `<` is lexical). */\nfunction compareIds(a: { id: string }, b: { id: string }): number {\n if (a.id < b.id) {\n return -1;\n }\n if (a.id > b.id) {\n return 1;\n }\n return 0;\n}\n\n/**\n * NIP-01 newest-first order: `created_at` descending, then `id` in plain code-unit order (ids are\n * canonical lowercase hex, so `<` is lexical order).\n */\nexport function compareEventsDesc(\n a: { id: string; created_at: number },\n b: { id: string; created_at: number },\n): number {\n if (a.created_at !== b.created_at) {\n return b.created_at - a.created_at;\n }\n return compareIds(a, b);\n}\n\n/**\n * Sort events reverse-chronologically by `created_at`, then by `id` lexicographically. Mutates and\n * returns the array.\n */\nexport function sortEvents(events: Event[]): Event[] {\n return events.sort(compareEventsDesc);\n}\n\n/** Non-mutating sort; returns a new array. */\nexport function sortedEvents(events: ReadonlyArray<Event>): Event[] {\n return [...events].sort(compareEventsDesc);\n}\n\n/**\n * Negentropy item order: `created_at` ascending, then `id` lexicographic (`<`/`>`). Time axis is\n * opposite {@link sortEvents}; id tie-break is the same direction.\n */\nexport function itemCompare(\n a: { id: string; created_at: number },\n b: { id: string; created_at: number },\n): number {\n if (a.created_at !== b.created_at) {\n return a.created_at - b.created_at;\n }\n return compareIds(a, b);\n}\n\n/**\n * NIP-01 replaceable/addressable winner: higher `created_at`, or equal timestamp and\n * lexicographically lower `id`.\n */\nexport function isReplaceableWinner(\n candidate: { created_at: number; id: string },\n incumbent: { created_at: number; id: string },\n): boolean {\n if (candidate.created_at !== incumbent.created_at) {\n return candidate.created_at > incumbent.created_at;\n }\n return candidate.id < incumbent.id;\n}\n\n/** True when a signed event is the signed form of `unsigned` (kind/tags/content/time/pubkey). */\nexport function signedMatchesUnsigned(signed: Event, unsigned: UnsignedEvent): boolean {\n if (signed.kind !== unsigned.kind) {\n return false;\n }\n if (signed.content !== unsigned.content) {\n return false;\n }\n if (signed.created_at !== unsigned.created_at) {\n return false;\n }\n if (JSON.stringify(signed.tags) !== JSON.stringify(unsigned.tags)) {\n return false;\n }\n if (unsigned.pubkey && signed.pubkey.toLowerCase() !== unsigned.pubkey.toLowerCase()) {\n return false;\n }\n return true;\n}\n"],"mappings":";;;;;AAUA,SAAgB,MAAM,OAA8B;CAClD,IAAI,CAAC,MAAM,QAAQ,KAAK,KAAK,MAAM,WAAW,GAC5C,OAAO;CAET,KAAK,MAAM,QAAQ,OACjB,IAAI,OAAO,SAAS,UAClB,OAAO;CAGX,OAAO;AACT;;AAGA,SAAgB,QAAQ,KAAkB;CACxC,OAAO,IAAI,MAAM;AACnB;;AAGA,SAAgB,SAAS,KAA8B;CACrD,OAAO,IAAI;AACb;;AAGA,MAAa,MAAM;CACjB,EAAE,IAAY,OAAgB,QAAiB,QAAsB;EACnE,MAAM,IAAc,CAAC,KAAK,GAAG,YAAY,CAAC;EAC1C,IAAI,UAAU,KAAA,GACZ,EAAE,KAAK,KAAK;EAEd,IAAI,WAAW,KAAA,GACb,EAAE,KAAK,MAAM;EAEf,IAAI,WAAW,KAAA,GACb,EAAE,KAAK,OAAO,YAAY,CAAC;EAE7B,OAAO;CACT;CACA,EAAE,QAAgB,OAAgB,SAAuB;EACvD,MAAM,IAAc,CAAC,KAAK,OAAO,YAAY,CAAC;EAC9C,IAAI,UAAU,KAAA,GACZ,EAAE,KAAK,KAAK;EAEd,IAAI,YAAY,KAAA,GACd,EAAE,KAAK,OAAO;EAEhB,OAAO;CACT;CACA,EAAE,YAAoB,OAAqB;EACzC,MAAM,IAAc,CAAC,KAAK,UAAU;EACpC,IAAI,UAAU,KAAA,GACZ,EAAE,KAAK,KAAK;EAEd,OAAO;CACT;CACA,EAAE,YAAyB;EACzB,OAAO,CAAC,KAAK,UAAU;CACzB;CACA,EAAE,SAAsB;EACtB,OAAO,CAAC,KAAK,OAAO;CACtB;CACA,EAAE,KAAa,QAAsB;EACnC,MAAM,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[],"sources":["../src/core/tag.ts","../src/core/event.ts"],"sourcesContent":["import { isAddressableKind, isReplaceableKind } from \"./kind.ts\";\nimport { isHex32 } from \"./util.ts\";\n\n/** A NIP-01 tag: first element is the name, rest are values. */\nexport type Tag = ReadonlyArray<string>;\n\n/** Mutable tag builder input. */\nexport type TagInput = string[];\n\n/** Type guard: a non-empty array of strings. */\nexport function isTag(value: unknown): value is Tag {\n if (!Array.isArray(value) || value.length === 0) {\n return false;\n }\n for (const item of value) {\n if (typeof item !== \"string\") {\n return false;\n }\n }\n return true;\n}\n\n/** First element of a tag (its name). */\nexport function tagName(tag: Tag): string {\n return tag[0] ?? \"\";\n}\n\n/** Second element of a tag (its primary value), or undefined for a bare name tag. */\nexport function tagValue(tag: Tag): string | undefined {\n return tag[1];\n}\n\n/** Construct common tags. */\nexport const Tag = {\n e(id: string, relay?: string, marker?: string, pubkey?: string): Tag {\n const t: string[] = [\"e\", id.toLowerCase()];\n if (relay !== undefined) {\n t.push(relay);\n }\n if (marker !== undefined) {\n t.push(marker);\n }\n if (pubkey !== undefined) {\n t.push(pubkey.toLowerCase());\n }\n return t;\n },\n p(pubkey: string, relay?: string, petname?: string): Tag {\n const t: string[] = [\"p\", pubkey.toLowerCase()];\n if (relay !== undefined) {\n t.push(relay);\n }\n if (petname !== undefined) {\n t.push(petname);\n }\n return t;\n },\n a(coordinate: string, relay?: string): Tag {\n const t: string[] = [\"a\", coordinate];\n if (relay !== undefined) {\n t.push(relay);\n }\n return t;\n },\n d(identifier: string): Tag {\n return [\"d\", identifier];\n },\n t(hashtag: string): Tag {\n return [\"t\", hashtag];\n },\n r(url: string, marker?: string): Tag {\n const t: string[] = [\"r\", url];\n if (marker !== undefined) {\n t.push(marker);\n }\n return t;\n },\n k(kind: number | string): Tag {\n return [\"k\", String(kind)];\n },\n} as const;\n\n/** First tag value with the given name, or undefined when no such tag has a value. */\nexport function firstTagValue(tags: ReadonlyArray<Tag>, name: string): string | undefined {\n for (const tag of tags) {\n if (tag[0] === name && tag[1] !== undefined) {\n return tag[1];\n }\n }\n return undefined;\n}\n\n/** First `d` tag value on an event, if any. */\nexport function getDTag(tags: ReadonlyArray<Tag>): string | undefined {\n return firstTagValue(tags, \"d\");\n}\n\n/** NIP-01 `a` tag: `kind:pubkey:identifier` (identifier may be empty and may contain extra colons). */\nexport type EventAddress = {\n kind: number;\n pubkey: string;\n identifier: string;\n};\n\n/** Parse a NIP-01 addressable/replaceable coordinate. */\nexport function parseEventAddress(value: string): EventAddress | undefined {\n const first = value.indexOf(\":\");\n if (first <= 0) {\n return undefined;\n }\n const second = value.indexOf(\":\", first + 1);\n if (second === -1) {\n return undefined;\n }\n const kind = Number(value.slice(0, first));\n if (!Number.isInteger(kind) || kind < 0 || kind > 65535) {\n return undefined;\n }\n const pubkey = value.slice(first + 1, second).toLowerCase();\n if (!isHex32(pubkey)) {\n return undefined;\n }\n return { kind, pubkey, identifier: value.slice(second + 1) };\n}\n\n/** Format an address as a `kind:pubkey:dTag` coordinate string. */\nexport function formatEventAddress(kind: number, pubkey: string, identifier = \"\"): string {\n return `${kind}:${pubkey.toLowerCase()}:${identifier}`;\n}\n\n/**\n * Coordinate for replaceable (`kind:pubkey:`) and addressable (`kind:pubkey:d`) events. Undefined\n * for regular/ephemeral kinds.\n */\nexport function eventAddress(event: {\n kind: number;\n pubkey: string;\n tags: ReadonlyArray<Tag>;\n}): string | undefined {\n if (isAddressableKind(event.kind)) {\n return formatEventAddress(event.kind, event.pubkey, getDTag(event.tags) ?? \"\");\n }\n if (isReplaceableKind(event.kind)) {\n return formatEventAddress(event.kind, event.pubkey, \"\");\n }\n return undefined;\n}\n","import { sha256 } from \"@noble/hashes/sha2.js\";\n\nimport { EventValidationError } from \"./error.ts\";\nimport type { Tag } from \"./tag.ts\";\nimport { isTag } from \"./tag.ts\";\nimport { isHex32, isHex64, isRecord, utf8Encoder, bytesToHex } from \"./util.ts\";\n\n/** Wire event template before pubkey/id/sig. */\nexport type EventTemplate = {\n readonly kind: number;\n readonly tags: ReadonlyArray<Tag>;\n readonly content: string;\n readonly created_at: number;\n};\n\n/** Event with pubkey, ready to hash and sign. */\nexport type UnsignedEvent = EventTemplate & {\n readonly pubkey: string;\n};\n\n/**\n * Fully formed NIP-01 event (JSON-friendly plain object). Fields are readonly at the type level;\n * wire interop remains plain JSON.\n */\nexport type Event = UnsignedEvent & {\n readonly id: string;\n readonly sig: string;\n};\n\n/** Cache of events whose signatures have been verified successfully. */\nconst verifiedEvents = new WeakSet<Event>();\n\n/** Cache of events known to fail verification. */\nconst failedEvents = new WeakSet<Event>();\n\nexport function markVerified(event: Event): void {\n verifiedEvents.add(event);\n failedEvents.delete(event);\n}\n\nexport function markUnverified(event: Event): void {\n failedEvents.add(event);\n verifiedEvents.delete(event);\n}\n\nexport function isMarkedVerified(event: Event): boolean {\n return verifiedEvents.has(event);\n}\n\nexport function isMarkedFailed(event: Event): boolean {\n return failedEvents.has(event);\n}\n\n/** Structural validation of an unsigned event (no crypto). */\nexport function validateEvent(event: unknown): event is UnsignedEvent {\n if (!isRecord(event)) {\n return false;\n }\n if (\n typeof event[\"kind\"] !== \"number\" ||\n !Number.isInteger(event[\"kind\"]) ||\n event[\"kind\"] < 0 ||\n event[\"kind\"] > 65535\n ) {\n return false;\n }\n if (typeof event[\"content\"] !== \"string\") {\n return false;\n }\n if (typeof event[\"created_at\"] !== \"number\" || !Number.isInteger(event[\"created_at\"])) {\n return false;\n }\n if (typeof event[\"pubkey\"] !== \"string\" || !isHex32(event[\"pubkey\"])) {\n return false;\n }\n if (!Array.isArray(event[\"tags\"])) {\n return false;\n }\n for (const tag of event[\"tags\"]) {\n if (!isTag(tag)) {\n return false;\n }\n }\n return true;\n}\n\n/** Structural validation of a full event including id and sig hex shape. */\nexport function validateSignedEvent(event: unknown): event is Event {\n if (!validateEvent(event)) {\n return false;\n }\n const e = event as Record<string, unknown>;\n if (typeof e[\"id\"] !== \"string\" || !isHex32(e[\"id\"])) {\n return false;\n }\n if (typeof e[\"sig\"] !== \"string\" || !isHex64(e[\"sig\"])) {\n return false;\n }\n return true;\n}\n\n/**\n * Canonical NIP-01 serialization used for hashing: JSON array `[0, pubkey, created_at, kind, tags,\n * content]` with no extra whitespace.\n */\nexport function serializeEvent(event: UnsignedEvent): string {\n if (!validateEvent(event)) {\n throw new EventValidationError(\"cannot serialize event with invalid shape\");\n }\n return JSON.stringify([0, event.pubkey, event.created_at, event.kind, event.tags, event.content]);\n}\n\n/** SHA-256 of the canonical serialization, lowercase hex. */\nexport function getEventHash(event: UnsignedEvent): string {\n const serialized = serializeEvent(event);\n return bytesToHex(sha256(utf8Encoder.encode(serialized)));\n}\n\n/** Id tie-break: plain code-unit order (ids are canonical lowercase hex, so `<` is lexical). */\nfunction compareIds(a: { id: string }, b: { id: string }): number {\n if (a.id < b.id) {\n return -1;\n }\n if (a.id > b.id) {\n return 1;\n }\n return 0;\n}\n\n/**\n * NIP-01 newest-first order: `created_at` descending, then `id` in plain code-unit order (ids are\n * canonical lowercase hex, so `<` is lexical order).\n */\nexport function compareEventsDesc(\n a: { id: string; created_at: number },\n b: { id: string; created_at: number },\n): number {\n if (a.created_at !== b.created_at) {\n return b.created_at - a.created_at;\n }\n return compareIds(a, b);\n}\n\n/**\n * Sort events reverse-chronologically by `created_at`, then by `id` lexicographically. Mutates and\n * returns the array.\n */\nexport function sortEvents(events: Event[]): Event[] {\n return events.sort(compareEventsDesc);\n}\n\n/** Non-mutating sort; returns a new array. */\nexport function sortedEvents(events: ReadonlyArray<Event>): Event[] {\n return [...events].sort(compareEventsDesc);\n}\n\n/**\n * Negentropy item order: `created_at` ascending, then `id` lexicographic (`<`/`>`). Time axis is\n * opposite {@link sortEvents}; id tie-break is the same direction.\n */\nexport function itemCompare(\n a: { id: string; created_at: number },\n b: { id: string; created_at: number },\n): number {\n if (a.created_at !== b.created_at) {\n return a.created_at - b.created_at;\n }\n return compareIds(a, b);\n}\n\n/**\n * NIP-01 replaceable/addressable winner: higher `created_at`, or equal timestamp and\n * lexicographically lower `id`.\n */\nexport function isReplaceableWinner(\n candidate: { created_at: number; id: string },\n incumbent: { created_at: number; id: string },\n): boolean {\n if (candidate.created_at !== incumbent.created_at) {\n return candidate.created_at > incumbent.created_at;\n }\n return candidate.id < incumbent.id;\n}\n\n/** True when a signed event is the signed form of `unsigned` (kind/tags/content/time/pubkey). */\nexport function signedMatchesUnsigned(signed: Event, unsigned: UnsignedEvent): boolean {\n if (signed.kind !== unsigned.kind) {\n return false;\n }\n if (signed.content !== unsigned.content) {\n return false;\n }\n if (signed.created_at !== unsigned.created_at) {\n return false;\n }\n if (JSON.stringify(signed.tags) !== JSON.stringify(unsigned.tags)) {\n return false;\n }\n if (unsigned.pubkey && signed.pubkey.toLowerCase() !== unsigned.pubkey.toLowerCase()) {\n return false;\n }\n return true;\n}\n"],"mappings":";;;;;AAUA,SAAgB,MAAM,OAA8B;CAClD,IAAI,CAAC,MAAM,QAAQ,KAAK,KAAK,MAAM,WAAW,GAC5C,OAAO;CAET,KAAK,MAAM,QAAQ,OACjB,IAAI,OAAO,SAAS,UAClB,OAAO;CAGX,OAAO;AACT;;AAGA,SAAgB,QAAQ,KAAkB;CACxC,OAAO,IAAI,MAAM;AACnB;;AAGA,SAAgB,SAAS,KAA8B;CACrD,OAAO,IAAI;AACb;;AAGA,MAAa,MAAM;CACjB,EAAE,IAAY,OAAgB,QAAiB,QAAsB;EACnE,MAAM,IAAc,CAAC,KAAK,GAAG,YAAY,CAAC;EAC1C,IAAI,UAAU,KAAA,GACZ,EAAE,KAAK,KAAK;EAEd,IAAI,WAAW,KAAA,GACb,EAAE,KAAK,MAAM;EAEf,IAAI,WAAW,KAAA,GACb,EAAE,KAAK,OAAO,YAAY,CAAC;EAE7B,OAAO;CACT;CACA,EAAE,QAAgB,OAAgB,SAAuB;EACvD,MAAM,IAAc,CAAC,KAAK,OAAO,YAAY,CAAC;EAC9C,IAAI,UAAU,KAAA,GACZ,EAAE,KAAK,KAAK;EAEd,IAAI,YAAY,KAAA,GACd,EA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AAO;CAET,IAAI,OAAO,YAAY,SAAS,SAC9B,OAAO;CAET,IAAI,OAAO,eAAe,SAAS,YACjC,OAAO;CAET,IAAI,KAAK,UAAU,OAAO,IAAI,MAAM,KAAK,UAAU,SAAS,IAAI,GAC9D,OAAO;CAET,IAAI,SAAS,UAAU,OAAO,OAAO,YAAY,MAAM,SAAS,OAAO,YAAY,GACjF,OAAO;CAET,OAAO;AACT"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as nowSeconds, l as normalizeRelayUrls, u as normalizeURL } from "./util-
|
|
1
|
+
import { d as nowSeconds, l as normalizeRelayUrls, u as normalizeURL } from "./util-DMF9AIO0.mjs";
|
|
2
2
|
import { t as Kind } from "./kind-Cxwhhkx8.mjs";
|
|
3
|
-
import { a as isReplaceableWinner } from "./event-
|
|
3
|
+
import { a as isReplaceableWinner } from "./event-CHf47dPM.mjs";
|
|
4
4
|
import { parseRelayList } from "./nips/nip65.mjs";
|
|
5
5
|
import { i as trimOldest, r as touchKey } from "./collections-DtwMc1NU.mjs";
|
|
6
6
|
import { parseDmRelayList } from "./nips/nip17.mjs";
|
|
@@ -225,4 +225,4 @@ var Gossip = class {
|
|
|
225
225
|
//#endregion
|
|
226
226
|
export { Gossip as t };
|
|
227
227
|
|
|
228
|
-
//# sourceMappingURL=gossip-
|
|
228
|
+
//# sourceMappingURL=gossip-DFxIBlsr.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gossip-DFxIBlsr.mjs","names":[],"sources":["../src/gossip/gossip.ts"],"sourcesContent":["import { touchKey, trimOldest } from \"../core/collections.ts\";\nimport type { Event } from \"../core/event.ts\";\nimport { isReplaceableWinner } from \"../core/event.ts\";\nimport type { Filter } from \"../core/filter.ts\";\nimport { Kind } from \"../core/kind.ts\";\nimport { normalizeRelayUrls, normalizeURL, nowSeconds } from \"../core/util.ts\";\nimport { parseDmRelayList } from \"../nips/nip17.ts\";\nimport { parseRelayList } from \"../nips/nip65.ts\";\nimport type { RelayListItem } from \"../nips/nip65.ts\";\n\n/** Relay routing state for one pubkey: NIP-65 outbox/inbox plus NIP-17 DM relays. */\nexport type PubkeyRoutes = {\n /** Relays the user writes to (outbox). NIP-65. */\n readonly write: ReadonlyArray<string>;\n /** Relays the user reads from (inbox). NIP-65. */\n readonly read: ReadonlyArray<string>;\n /** Relays for NIP-17 gift-wrap delivery. Kind 10050. */\n readonly dm: ReadonlyArray<string>;\n /** `created_at` of the last accepted kind:10002 list. */\n readonly updatedAt: number;\n /** `created_at` of the last accepted kind:10050 list. */\n readonly dmUpdatedAt: number;\n /** Event id of the last accepted kind:10002 (NIP-01 equal-timestamp tie-break). */\n readonly relayListId?: string | undefined;\n /** Event id of the last accepted kind:10050. */\n readonly dmListId?: string | undefined;\n};\n\n/** A filter split by gossip routes: per-relay narrowed filters plus the unrouted remainder. */\nexport type RoutedFilter = {\n /** Url → already-narrowed filter. Empty when nothing routed. */\n readonly perRelay: ReadonlyMap<string, Filter>;\n /**\n * Unrouted work for the caller:\n *\n * - No authors and no #p: original filter (\"generic\")\n * - Authors/#p all unrouted: original filter (\"orphan\")\n * - Mixed: narrowed leftover (\"fallback\")\n * - All routed: undefined\n */\n readonly remainder?: Filter | undefined;\n};\n\nexport type GossipOptions = {\n /** Max relays to keep per direction when ranking. Default 4. */\n maxRelaysPerPubkey?: number | undefined;\n /**\n * Max pubkeys with tracked routes; the map is LRU — writes and lookups refresh recency, and\n * inserting beyond the cap drops the oldest entry. Default 10_000.\n */\n maxPubkeys?: number | undefined;\n};\n\nfunction emptyRoutes(): PubkeyRoutes {\n return {\n write: [],\n read: [],\n dm: [],\n updatedAt: 0,\n dmUpdatedAt: 0,\n };\n}\n\n/**\n * Routing table for NIP-65 (10002) and NIP-17 DM relays (10050). Ingest replaceable list events,\n * then route filters into per-relay REQs.\n */\nexport class Gossip {\n readonly #routes = new Map<string, PubkeyRoutes>();\n readonly #maxRelays: number;\n readonly #maxPubkeys: number;\n\n constructor(opts: GossipOptions = {}) {\n this.#maxRelays = opts.maxRelaysPerPubkey ?? 4;\n this.#maxPubkeys = opts.maxPubkeys ?? 10_000;\n }\n\n /**\n * Ingest a routing list event.\n *\n * - Kind:10002 → write/read (NIP-65)\n * - Kind:10050 → dm (NIP-17)\n *\n * Returns true if routes for that list type were updated.\n */\n ingest(event: Event): boolean {\n if (event.kind === Kind.RelayList) {\n let items: RelayListItem[];\n try {\n items = parseRelayList(event);\n } catch {\n return false;\n }\n return this.setRoutes(event.pubkey, items, event.created_at, event.id);\n }\n if (event.kind === Kind.DirectMessageRelaysList) {\n let relays: string[];\n try {\n relays = parseDmRelayList(event);\n } catch {\n return false;\n }\n return this.setDmRoutes(event.pubkey, relays, event.created_at, event.id);\n }\n return false;\n }\n\n setRoutes(\n pubkey: string,\n items: ReadonlyArray<RelayListItem>,\n updatedAt: number = nowSeconds(),\n eventId?: string,\n ): boolean {\n const pk = pubkey.toLowerCase();\n const prev = this.#lookup(pk) ?? emptyRoutes();\n if (prev.updatedAt > updatedAt) {\n return false;\n }\n if (\n eventId !== undefined &&\n prev.relayListId !== undefined &&\n prev.updatedAt === updatedAt &&\n !isReplaceableWinner(\n { created_at: updatedAt, id: eventId },\n { created_at: prev.updatedAt, id: prev.relayListId },\n )\n ) {\n return false;\n }\n\n const write: string[] = [];\n const read: string[] = [];\n for (const item of items) {\n let url: string;\n try {\n url = normalizeURL(item.url);\n } catch {\n continue;\n }\n if (item.marker !== \"read\" && !write.includes(url)) {\n write.push(url);\n }\n if (item.marker !== \"write\" && !read.includes(url)) {\n read.push(url);\n }\n }\n\n this.#put(pk, {\n write: write.slice(0, this.#maxRelays),\n read: read.slice(0, this.#maxRelays),\n dm: prev.dm,\n updatedAt,\n dmUpdatedAt: prev.dmUpdatedAt,\n relayListId: eventId ?? prev.relayListId,\n dmListId: prev.dmListId,\n });\n return true;\n }\n\n setDmRoutes(\n pubkey: string,\n relays: ReadonlyArray<string>,\n updatedAt: number = nowSeconds(),\n eventId?: string,\n ): boolean {\n const pk = pubkey.toLowerCase();\n const prev = this.#lookup(pk) ?? emptyRoutes();\n if (prev.dmUpdatedAt > updatedAt) {\n return false;\n }\n if (\n eventId !== undefined &&\n prev.dmListId !== undefined &&\n prev.dmUpdatedAt === updatedAt &&\n !isReplaceableWinner(\n { created_at: updatedAt, id: eventId },\n { created_at: prev.dmUpdatedAt, id: prev.dmListId },\n )\n ) {\n return false;\n }\n\n const dm = normalizeRelayUrls(relays);\n\n this.#put(pk, {\n write: prev.write,\n read: prev.read,\n dm: dm.slice(0, this.#maxRelays),\n updatedAt: prev.updatedAt,\n dmUpdatedAt: updatedAt,\n relayListId: prev.relayListId,\n dmListId: eventId ?? prev.dmListId,\n });\n return true;\n }\n\n getRoutes(pubkey: string): Readonly<PubkeyRoutes> | undefined {\n return this.#lookup(pubkey.toLowerCase());\n }\n\n outboxRelays(pubkey: string): ReadonlyArray<string> {\n return this.#lookup(pubkey.toLowerCase())?.write ?? [];\n }\n\n inboxRelays(pubkey: string): ReadonlyArray<string> {\n return this.#lookup(pubkey.toLowerCase())?.read ?? [];\n }\n\n /** NIP-17 kind:10050 delivery relays for gift-wraps. */\n dmRelays(pubkey: string): ReadonlyArray<string> {\n return this.#lookup(pubkey.toLowerCase())?.dm ?? [];\n }\n\n clear(pubkey?: string): void {\n if (pubkey !== undefined && pubkey !== \"\") {\n this.#routes.delete(pubkey.toLowerCase());\n } else {\n this.#routes.clear();\n }\n }\n\n get size(): number {\n return this.#routes.size;\n }\n\n /**\n * Route a user-facing filter into per-relay sub-filters plus leftover.\n *\n * - Authors → outbox relays, filter narrowed per relay's authors\n * - #p only → inbox relays of those pubkeys\n * - Neither / all unrouted → remainder is the original filter\n * - Mixed → remainder is the narrowed leftover; all routed → no remainder\n */\n route(filter: Filter): RoutedFilter {\n const authors = filter.authors?.map((a) => a.toLowerCase());\n const pTags = filter[\"#p\"]?.map((p) => p.toLowerCase());\n\n if ((!authors || authors.length === 0) && (!pTags || pTags.length === 0)) {\n return { perRelay: new Map(), remainder: filter };\n }\n\n if (authors && authors.length > 0 && (!pTags || pTags.length === 0)) {\n return this.#breakAuthors(filter, authors, \"write\");\n }\n\n if (pTags && pTags.length > 0 && (!authors || authors.length === 0)) {\n const { authors: _authors, ...base } = filter;\n return this.#breakAuthors(base, pTags, \"read\", (b, pubkeys) => ({ ...b, \"#p\": pubkeys }));\n }\n\n // both authors and #p: send full filter to union of routes\n const unionKeys = new Set([...(authors ?? []), ...(pTags ?? [])]);\n const relays = new Set<string>();\n let anyUnrouted = false;\n for (const pk of unionKeys) {\n const r = this.#lookup(pk);\n const urls = r ? [...r.write, ...r.read] : [];\n if (urls.length === 0) {\n anyUnrouted = true;\n continue;\n }\n for (const u of urls) {\n relays.add(u);\n }\n }\n if (relays.size === 0) {\n return { perRelay: new Map(), remainder: filter };\n }\n const map = new Map<string, Filter>();\n for (const url of relays) {\n map.set(url, { ...filter });\n }\n return anyUnrouted ? { perRelay: map, remainder: filter } : { perRelay: map };\n }\n\n #breakAuthors(\n filter: Filter,\n pubkeys: string[],\n direction: \"read\" | \"write\",\n narrow: (base: Filter, pubkeys: string[]) => Filter = (base, pks) => ({\n ...base,\n authors: pks,\n }),\n ): RoutedFilter {\n const perRelay = new Map<string, string[]>();\n const unrouted: string[] = [];\n let anyRoute = false;\n\n for (const pk of pubkeys) {\n const routes = this.#lookup(pk);\n const urls = direction === \"write\" ? routes?.write : routes?.read;\n if (!urls || urls.length === 0) {\n unrouted.push(pk);\n continue;\n }\n anyRoute = true;\n for (const url of urls) {\n const list = perRelay.get(url) ?? [];\n list.push(pk);\n perRelay.set(url, list);\n }\n }\n\n if (!anyRoute) {\n return { perRelay: new Map(), remainder: filter };\n }\n\n const map = new Map<string, Filter>();\n for (const [url, pks] of perRelay) {\n map.set(url, narrow(filter, pks));\n }\n return unrouted.length > 0\n ? { perRelay: map, remainder: narrow(filter, unrouted) }\n : { perRelay: map };\n }\n\n /** Read that refreshes LRU recency. */\n #lookup(pk: string): PubkeyRoutes | undefined {\n const routes = this.#routes.get(pk);\n if (routes !== undefined) {\n touchKey(this.#routes, pk, routes);\n }\n return routes;\n }\n\n /** Write at the newest LRU end, then trim the oldest beyond the cap. */\n #put(pk: string, routes: PubkeyRoutes): void {\n touchKey(this.#routes, pk, routes);\n trimOldest(this.#routes, this.#maxPubkeys);\n }\n}\n"],"mappings":";;;;;;;AAqDA,SAAS,cAA4B;CACnC,OAAO;EACL,OAAO,CAAC;EACR,MAAM,CAAC;EACP,IAAI,CAAC;EACL,WAAW;EACX,aAAa;CACf;AACF;;;;;AAMA,IAAa,SAAb,MAAoB;CAClB,0BAAmB,IAAI,IAA0B;CACjD;CACA;CAEA,YAAY,OAAsB,CAAC,GAAG;EACpC,KAAK,aAAa,KAAK,sBAAsB;EAC7C,KAAK,cAAc,KAAK,cAAc;CACxC;;;;;;;;;CAUA,OAAO,OAAuB;EAC5B,IAAI,MAAM,SAAS,KAAK,WAAW;GACjC,IAAI;GACJ,IAAI;IACF,QAAQ,eAAe,KAAK;GAC9B,QAAQ;IACN,OAAO;GACT;GACA,OAAO,KAAK,UAAU,MAAM,QAAQ,OAAO,MAAM,YAAY,MAAM,EAAE;EACvE;EACA,IAAI,MAAM,SAAS,KAAK,yBAAyB;GAC/C,IAAI;GACJ,IAAI;IACF,SAAS,iBAAiB,KAAK;GACjC,QAAQ;IACN,OAAO;GACT;GACA,OAAO,KAAK,YAAY,MAAM,QAAQ,QAAQ,MAAM,YAAY,MAAM,EAAE;EAC1E;EACA,OAAO;CACT;CAEA,UACE,QACA,OACA,YAAoB,WAAW,GAC/B,SACS;EACT,MAAM,KAAK,OAAO,YAAY;EAC9B,MAAM,OAAO,KAAK,QAAQ,EAAE,KAAK,YAAY;EAC7C,IAAI,KAAK,YAAY,WACnB,OAAO;EAET,IACE,YAAY,KAAA,KACZ,KAAK,gBAAgB,KAAA,KACrB,KAAK,cAAc,aACnB,CAAC,oBACC;GAAE,YAAY;GAAW,IAAI;EAAQ,GACrC;GAAE,YAAY,KAAK;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U;GAAK,WAAW,OAAO,QAAQ,QAAQ;EAAE,IACrD,EAAE,UAAU,IAAI;CACtB;;CAGA,QAAQ,IAAsC;EAC5C,MAAM,SAAS,KAAK,QAAQ,IAAI,EAAE;EAClC,IAAI,WAAW,KAAA,GACb,SAAS,KAAK,SAAS,IAAI,MAAM;EAEnC,OAAO;CACT;;CAGA,KAAK,IAAY,QAA4B;EAC3C,SAAS,KAAK,SAAS,IAAI,MAAM;EACjC,WAAW,KAAK,SAAS,KAAK,WAAW;CAC3C;AACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as Event } from "./event-DJeb_DIL.mjs";
|
|
2
2
|
import { t as Filter } from "./filter-jI_9htF7.mjs";
|
|
3
|
-
import { t as RelayListItem } from "./nip65-
|
|
3
|
+
import { t as RelayListItem } from "./nip65-D1fbmhOg.mjs";
|
|
4
4
|
//#region src/gossip/gossip.d.ts
|
|
5
5
|
/** Relay routing state for one pubkey: NIP-65 outbox/inbox plus NIP-17 DM relays. */
|
|
6
6
|
type PubkeyRoutes = {
|
|
@@ -22,7 +22,7 @@ type PubkeyRoutes = {
|
|
|
22
22
|
/** A filter split by gossip routes: per-relay narrowed filters plus the unrouted remainder. */
|
|
23
23
|
type RoutedFilter = {
|
|
24
24
|
/** Url → already-narrowed filter. Empty when nothing routed. */
|
|
25
|
-
perRelay:
|
|
25
|
+
readonly perRelay: ReadonlyMap<string, Filter>;
|
|
26
26
|
/**
|
|
27
27
|
* Unrouted work for the caller:
|
|
28
28
|
*
|
|
@@ -31,7 +31,7 @@ type RoutedFilter = {
|
|
|
31
31
|
* - Mixed: narrowed leftover ("fallback")
|
|
32
32
|
* - All routed: undefined
|
|
33
33
|
*/
|
|
34
|
-
remainder?: Filter;
|
|
34
|
+
readonly remainder?: Filter | undefined;
|
|
35
35
|
};
|
|
36
36
|
type GossipOptions = {
|
|
37
37
|
/** Max relays to keep per direction when ranking. Default 4. */
|
|
@@ -79,4 +79,4 @@ declare class Gossip {
|
|
|
79
79
|
}
|
|
80
80
|
//#endregion
|
|
81
81
|
export { RoutedFilter as i, GossipOptions as n, PubkeyRoutes as r, Gossip as t };
|
|
82
|
-
//# sourceMappingURL=gossip-
|
|
82
|
+
//# sourceMappingURL=gossip-OOeeFzG5.d.mts.map
|
package/dist/gossip.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as RoutedFilter, n as GossipOptions, r as PubkeyRoutes, t as Gossip } from "./gossip-
|
|
1
|
+
import { i as RoutedFilter, n as GossipOptions, r as PubkeyRoutes, t as Gossip } from "./gossip-OOeeFzG5.mjs";
|
|
2
2
|
import "./index-CaxrMD1A.mjs";
|
|
3
3
|
export { Gossip, type GossipOptions, type PubkeyRoutes, type RoutedFilter };
|
package/dist/gossip.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Gossip } from "./gossip-
|
|
1
|
+
import { t as Gossip } from "./gossip-DFxIBlsr.mjs";
|
|
2
2
|
export { Gossip };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as Event } from "./event-DJeb_DIL.mjs";
|
|
2
2
|
import { t as Filter } from "./filter-jI_9htF7.mjs";
|
|
3
|
-
import { i as PutResult, n as NegentropyItem, r as OutboxBound, t as EventStore } from "./types-
|
|
3
|
+
import { i as PutResult, n as NegentropyItem, r as OutboxBound, t as EventStore } from "./types-BacwnDtU.mjs";
|
|
4
4
|
//#region src/storage/memory-index.d.ts
|
|
5
5
|
type MemoryIndexOptions = {
|
|
6
6
|
/**
|
|
@@ -185,4 +185,4 @@ declare class SqliteEventStore implements EventStore {
|
|
|
185
185
|
}
|
|
186
186
|
//#endregion
|
|
187
187
|
export { IndexedDbEventStoreOptions as a, MemoryIndexOptions as c, IndexedDbEventStore as i, SqlValue as n, MemoryEventStore as o, SqliteEventStore as r, MemoryIndex as s, SqlDriver as t };
|
|
188
|
-
//# sourceMappingURL=index-
|
|
188
|
+
//# sourceMappingURL=index-BxCBX-8R.d.mts.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as Event } from "./event-DJeb_DIL.mjs";
|
|
2
|
-
import { n as ProfileMetadata } from "./builder-
|
|
3
|
-
import { t as RelayListItem } from "./nip65-
|
|
4
|
-
import { t as Gossip } from "./gossip-
|
|
2
|
+
import { n as ProfileMetadata } from "./builder-CTwkB2zM.mjs";
|
|
3
|
+
import { t as RelayListItem } from "./nip65-D1fbmhOg.mjs";
|
|
4
|
+
import { t as Gossip } from "./gossip-OOeeFzG5.mjs";
|
|
5
5
|
import { a as NostrError } from "./error-BquXDmIN.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import { r as OutboxBound, t as EventStore } from "./types-
|
|
8
|
-
import { t as ReactiveEventStore } from "./reactive-
|
|
9
|
-
import { i as EventPointer, t as AddressPointer } from "./nip19-
|
|
10
|
-
import { t as MuteItem } from "./nip51-
|
|
6
|
+
import { _ as Closer, n as Pool } from "./pool-CqQvUnsq.mjs";
|
|
7
|
+
import { r as OutboxBound, t as EventStore } from "./types-BacwnDtU.mjs";
|
|
8
|
+
import { t as ReactiveEventStore } from "./reactive-gGqUrzW8.mjs";
|
|
9
|
+
import { i as EventPointer, t as AddressPointer } from "./nip19-DpPN17bY.mjs";
|
|
10
|
+
import { t as MuteItem } from "./nip51-CR0Q8eym.mjs";
|
|
11
11
|
//#region src/loaders/event.d.ts
|
|
12
12
|
type EventRef = string | EventPointer | AddressPointer;
|
|
13
13
|
/**
|
|
@@ -22,8 +22,8 @@ type EventLoader = {
|
|
|
22
22
|
//#region src/loaders/replaceable.d.ts
|
|
23
23
|
/** Result of a replaceable load: the winning event (or none) and freshness. */
|
|
24
24
|
type ReplaceableLoadResult = {
|
|
25
|
-
event: Event | undefined;
|
|
26
|
-
fresh: boolean;
|
|
25
|
+
readonly event: Event | undefined;
|
|
26
|
+
readonly fresh: boolean;
|
|
27
27
|
};
|
|
28
28
|
/** `default`: fetch when stale or unfetched; `force`: always fetch; `cache-only`: index only. */
|
|
29
29
|
type LoadStyle = "default" | "force" | "cache-only";
|
|
@@ -36,9 +36,9 @@ type ReplaceableLoader = (pubkey: string, opts?: {
|
|
|
36
36
|
//#region src/loaders/lists.d.ts
|
|
37
37
|
/** Result of a list loader: the source event, its decoded items, and freshness. */
|
|
38
38
|
type ListResult<T> = {
|
|
39
|
-
event: Event | undefined;
|
|
40
|
-
items: T
|
|
41
|
-
fresh: boolean;
|
|
39
|
+
readonly event: Event | undefined;
|
|
40
|
+
readonly items: ReadonlyArray<T>;
|
|
41
|
+
readonly fresh: boolean;
|
|
42
42
|
};
|
|
43
43
|
type ListLoaderOpts = {
|
|
44
44
|
hints?: string[] | undefined;
|
|
@@ -54,14 +54,14 @@ type ListLoaders = {
|
|
|
54
54
|
//#region src/loaders/profile.d.ts
|
|
55
55
|
/** A profile-card view of a pubkey: identity fields plus the kind:0 event. */
|
|
56
56
|
type NostrUser = {
|
|
57
|
-
pubkey: string;
|
|
58
|
-
npub: string;
|
|
59
|
-
shortName: string;
|
|
60
|
-
image?: string;
|
|
61
|
-
metadata: ProfileMetadata;
|
|
62
|
-
lastUpdated: number;
|
|
63
|
-
event: Event | undefined;
|
|
64
|
-
fresh: boolean;
|
|
57
|
+
readonly pubkey: string;
|
|
58
|
+
readonly npub: string;
|
|
59
|
+
readonly shortName: string;
|
|
60
|
+
readonly image?: string | undefined;
|
|
61
|
+
readonly metadata: ProfileMetadata;
|
|
62
|
+
readonly lastUpdated: number;
|
|
63
|
+
readonly event: Event | undefined;
|
|
64
|
+
readonly fresh: boolean;
|
|
65
65
|
};
|
|
66
66
|
/** A {@link NostrUser} with no metadata — used when no kind:0 event exists. */
|
|
67
67
|
declare function bareNostrUser(pubkey: string): NostrUser;
|
|
@@ -186,4 +186,4 @@ type CreateLoadersOptions = {
|
|
|
186
186
|
declare function createLoaders(opts: CreateLoadersOptions): Loaders;
|
|
187
187
|
//#endregion
|
|
188
188
|
export { EventRef as _, OutboxFeed as a, NostrUser as c, ListLoaders as d, ListResult as f, EventLoader as g, ReplaceableLoader as h, OutboxError as i, ProfileLoader as l, ReplaceableLoadResult as m, Loaders as n, OutboxFeedOptions as o, LoadStyle as p, createLoaders as r, groupAuthorsByOutboxRelay as s, CreateLoadersOptions as t, bareNostrUser as u };
|
|
189
|
-
//# sourceMappingURL=index-
|
|
189
|
+
//# sourceMappingURL=index-CPVEyzNX.d.mts.map
|
|
@@ -3,7 +3,7 @@ import { i as SecretKeyInput, t as Keys } from "./key-D_5OgGT7.mjs";
|
|
|
3
3
|
import { t as Filter } from "./filter-jI_9htF7.mjs";
|
|
4
4
|
import { a as NostrError } from "./error-BquXDmIN.mjs";
|
|
5
5
|
import { t as NostrSigner } from "./types-DNmiscfd.mjs";
|
|
6
|
-
import { n as ClientMetadata, t as BunkerPointer } from "./nip46-
|
|
6
|
+
import { n as ClientMetadata, t as BunkerPointer } from "./nip46-BHaxC9TZ.mjs";
|
|
7
7
|
//#region src/signer/error.d.ts
|
|
8
8
|
/**
|
|
9
9
|
* Thrown by a lazy NIP-42 AUTH sign function when no signer is configured at challenge time.
|
|
@@ -83,9 +83,9 @@ type Nip46Transport = {
|
|
|
83
83
|
publish: (relays: ReadonlyArray<string>, event: Event) => Promise<ReadonlyArray<{
|
|
84
84
|
readonly status: "ok" | "rejected" | "failed";
|
|
85
85
|
readonly message?: string;
|
|
86
|
-
readonly error?:
|
|
86
|
+
readonly error?: Error;
|
|
87
87
|
}>>;
|
|
88
|
-
close: (
|
|
88
|
+
close: () => void;
|
|
89
89
|
};
|
|
90
90
|
/** Options for {@link Nip46Signer}: transport, timeouts, and relay hints. */
|
|
91
91
|
type Nip46SignerOptions = {
|
|
@@ -174,4 +174,4 @@ declare class Nip46Signer implements NostrSigner {
|
|
|
174
174
|
}
|
|
175
175
|
//#endregion
|
|
176
176
|
export { Nip07Signer as a, isNip07Available as c, Nip46Transport as i, KeysSigner as l, Nip46SignerOptions as n, WindowNostr as o, Nip46SubscribeOptions as r, getWindowNostr as s, Nip46Signer as t, NoSignerError as u };
|
|
177
|
-
//# sourceMappingURL=index-
|
|
177
|
+
//# sourceMappingURL=index-C_w2WfVz.d.mts.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { n as EventTemplate, r as UnsignedEvent, t as Event } from "./event-DJeb_DIL.mjs";
|
|
2
|
-
import { t as EventBuilder } from "./builder-
|
|
2
|
+
import { t as EventBuilder } from "./builder-CTwkB2zM.mjs";
|
|
3
3
|
import { t as Filter } from "./filter-jI_9htF7.mjs";
|
|
4
|
-
import { t as Gossip } from "./gossip-
|
|
4
|
+
import { t as Gossip } from "./gossip-OOeeFzG5.mjs";
|
|
5
5
|
import { a as NostrError } from "./error-BquXDmIN.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import { t as EventStore } from "./types-
|
|
8
|
-
import { t as ReactiveEventStore } from "./reactive-
|
|
9
|
-
import { a as OutboxFeed, n as Loaders } from "./index-
|
|
10
|
-
import { a as Rumor } from "./nip59-
|
|
11
|
-
import { i as ReplyTo, r as Recipient } from "./nip17-
|
|
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
12
|
import { t as NostrSigner } from "./types-DNmiscfd.mjs";
|
|
13
13
|
import { t as StorageError } from "./error-BD_0QFKT.mjs";
|
|
14
14
|
//#region src/client/types.d.ts
|
|
@@ -37,12 +37,14 @@ type SyncOptions = {
|
|
|
37
37
|
};
|
|
38
38
|
/** Outcome of a {@link Client.sync} run: ids compared, sent, received, and failures. */
|
|
39
39
|
type SyncSummary = {
|
|
40
|
-
local: string
|
|
41
|
-
remote: string
|
|
42
|
-
sent: string
|
|
43
|
-
received: string
|
|
44
|
-
|
|
45
|
-
|
|
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>>;
|
|
46
48
|
};
|
|
47
49
|
/**
|
|
48
50
|
* Options for the {@link Client} constructor. Pool fields are forwarded to {@link Pool}; the
|
|
@@ -142,22 +144,26 @@ type SendPrivateMessageOptions = {
|
|
|
142
144
|
readonly created_at?: number | undefined;
|
|
143
145
|
readonly timeoutMs?: number | undefined;
|
|
144
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;
|
|
145
151
|
};
|
|
146
152
|
/** Result of sending a NIP-17 DM: the rumor plus per-recipient wrap publish results. */
|
|
147
153
|
type PrivateMessageSendResult = {
|
|
148
|
-
rumor: Rumor;
|
|
149
|
-
wraps: ReadonlyArray<{
|
|
150
|
-
recipient: string;
|
|
151
|
-
wrap: Event;
|
|
152
|
-
results: PoolPublishResult
|
|
154
|
+
readonly rumor: Rumor;
|
|
155
|
+
readonly wraps: ReadonlyArray<{
|
|
156
|
+
readonly recipient: string;
|
|
157
|
+
readonly wrap: Event;
|
|
158
|
+
readonly results: ReadonlyArray<PoolPublishResult>;
|
|
153
159
|
}>;
|
|
154
160
|
};
|
|
155
161
|
/** An unwrapped NIP-17 private message: the received gift wrap and its inner rumor. */
|
|
156
162
|
type ReceivedPrivateMessage = {
|
|
157
|
-
wrap: Event;
|
|
158
|
-
rumor: Rumor;
|
|
163
|
+
readonly wrap: Event;
|
|
164
|
+
readonly rumor: Rumor;
|
|
159
165
|
/** Normalized URL of the relay that delivered the wrap, when known. */
|
|
160
|
-
relayUrl?: string | undefined;
|
|
166
|
+
readonly relayUrl?: string | undefined;
|
|
161
167
|
};
|
|
162
168
|
/** Options for fetching NIP-17 private-message history. */
|
|
163
169
|
type FetchPrivateMessagesOptions = {
|
|
@@ -276,4 +282,4 @@ declare class Client {
|
|
|
276
282
|
}
|
|
277
283
|
//#endregion
|
|
278
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 };
|
|
279
|
-
//# sourceMappingURL=index-
|
|
285
|
+
//# sourceMappingURL=index-Cl_1XdYP.d.mts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as Event } from "./event-DJeb_DIL.mjs";
|
|
2
2
|
import { t as Filter } from "./filter-jI_9htF7.mjs";
|
|
3
3
|
import { a as NostrError } from "./error-BquXDmIN.mjs";
|
|
4
|
-
import {
|
|
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 {
|
|
@@ -79,4 +79,4 @@ declare function fetchRouted(pool: Pool, jobs: ReadonlyArray<RoutedJob>, opts?:
|
|
|
79
79
|
}): Promise<Event[]>;
|
|
80
80
|
//#endregion
|
|
81
81
|
export { isInsecureRelayUrl as a, RelayError as c, RelayTimeoutError as d, fetchRouted as i, RelayPublishError as l, RoutedJob as n, RelayClosedError as o, fanIn as r, RelayConnectionError as s, FanInOptions as t, RelaySuspendedError as u };
|
|
82
|
-
//# sourceMappingURL=index-
|
|
82
|
+
//# sourceMappingURL=index-DyKwQnbt.d.mts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
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
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-
|
|
3
|
+
import { n as ProfileMetadata, t as EventBuilder } from "./builder-CTwkB2zM.mjs";
|
|
4
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-
|
|
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-
|
|
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
8
|
import { i as verifyEvent, n as SerializedEventVerifier, r as createEventVerifier, t as EventVerifier } from "./verifier-CgTFpgsC.mjs";
|
|
9
9
|
import { a as NostrError, i as MessageError, n as EventValidationError, o as UrlError, r as HexError, s as WasmPoisonedError, t as CryptoError } from "./error-BquXDmIN.mjs";
|
|
10
|
-
import { _ as
|
|
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";
|
|
11
11
|
import { i as useWebSocketImplementation } from "./websocket-CmeqvAkp.mjs";
|
|
12
|
-
import { i as PutResult, n as NegentropyItem, r as OutboxBound, t as EventStore } from "./types-
|
|
13
|
-
import { n as
|
|
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-
|
|
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-
|
|
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
16
|
import { t as NostrSigner } from "./types-DNmiscfd.mjs";
|
|
17
17
|
import { t as StorageError } from "./error-BD_0QFKT.mjs";
|
|
18
|
-
import { _ as SyncSummary, c as PrivateMessageSendResult, d as SendPrivateMessageOptions, g as SyncOptions, h as SyncDirectionName, i as ClientOptions, m as SyncDirection, n as ClientError, p as SubscribePrivateMessagesOptions, r as ClientEventMap, s as FetchPrivateMessagesOptions, t as Client, u as ReceivedPrivateMessage } from "./index-
|
|
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
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-
|
|
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
21
|
import { Nip21Error, NostrURI, isNostrURI, parseNostrURI } from "./nips/nip21.mjs";
|
|
22
22
|
import { ReplyTagsOptions, ThreadReferences, buildReplyTags, parseThreadTags, replyTo } from "./nips/nip10.mjs";
|
|
23
23
|
import { isAuthRequired, makeAuthEvent } from "./nips/nip42.mjs";
|
|
24
|
-
import { a as isInsecureRelayUrl, c as RelayError, d as RelayTimeoutError, l as RelayPublishError, o as RelayClosedError, s as RelayConnectionError, u as RelaySuspendedError } from "./index-
|
|
25
|
-
import { a as IndexedDbEventStoreOptions, i as IndexedDbEventStore, n as SqlValue, o as MemoryEventStore, r as SqliteEventStore, t as SqlDriver } from "./index-
|
|
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 PoolFetchResult, 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 RelayEventMap, type RelayFetchEnd, type RelayFetchResult, type RelayListItem, type RelayMarker, type RelayMessage, type RelayOptions, RelayPublishError, RelayStatus, type RelayStatusName, type RelaySubscription, RelaySuspendedError, RelayTimeoutError, type ReplaceableLoadResult, type ReplaceableLoader, type ReplyTagsOptions, type RoutedFilter, SECRET_KEY_BYTES, SIGNATURE_BYTES, SUBSCRIPTION_ID_MAX_CHARS, SecretKey, type SecretKeyInput, type SendPrivateMessageOptions, type SerializedEventVerifier, type SigningBackend, type SqlDriver, type SqlValue, SqliteEventStore, StorageError, type SubscribeOptions, type SubscribePrivateMessagesOptions, type SubscriptionId, SyncDirection, type SyncDirectionName, type SyncOptions, type SyncSummary, Tag, type TagInput, type ThreadReferences, type UnsignedEvent, UrlError, WasmPoisonedError, type Watch, type WindowNostr, assertSubscriptionId, bareNostrUser, buildReplyTags, bytesToHex, canonicalizeFilter, canonicalizeFilters, classifyKind, createEventVerifier, createLoaders, createSubscriptionId, encodeClientMessage, encodeRelayMessage, eventAddress, filterFingerprint, finalizeEvent, formatEventAddress, getDTag, getEventHash, getFilterLimit, getPublicKey, getWindowNostr, groupAuthorsByOutboxRelay, hexToBytes, isAddressableKind, isAuthRequired, isEphemeralKind, isHex32, isHex64, isInsecureRelayUrl, isNip07Available, isNostrURI, isRegularKind, isReplaceableKind, isReplaceableWinner, isTag, itemCompare, makeAuthEvent, matchFilter, matchFilters, mergeCountHll, mergeFilters, naddrEncode, neventEncode, decode as nip19Decode, normalizeURL, noteEncode, nprofileEncode, npubEncode, nsecEncode, parseClientMessage, parseEventAddress, parseNostrURI, parseRelayList, parseRelayMessage, parseThreadTags, publicKeyFromHex, readRelays, relayListEventBuilder, relayListToTags, replyTo, serializeEvent, signEvent, signedMatchesUnsigned, sortEvents, sortedEvents, tagName, tagValue, toSecretKey, useWebSocketImplementation, validateEvent, validateSignedEvent, verifyEvent, writeRelays };
|
|
24
|
+
import { a as isInsecureRelayUrl, c as RelayError, d as RelayTimeoutError, l as RelayPublishError, o as RelayClosedError, s as RelayConnectionError, u as RelaySuspendedError } from "./index-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 };
|
package/dist/index.mjs
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { C as
|
|
1
|
+
import { C as EVENT_ID_BYTES, D as SUBSCRIPTION_ID_MAX_CHARS, E as SIGNATURE_BYTES, T as SECRET_KEY_BYTES, _ as MessageError, a as hexToBytes, b as WasmPoisonedError, g as HexError, h as EventValidationError, i as bytesToHex, m as CryptoError, o as isHex32, s as isHex64, u as normalizeURL, v as NostrError, w as PUBLIC_KEY_BYTES, y as UrlError } from "./util-DMF9AIO0.mjs";
|
|
2
2
|
import { a as isRegularKind, i as isEphemeralKind, n as classifyKind, o as isReplaceableKind, r as isAddressableKind, t as Kind } from "./kind-Cxwhhkx8.mjs";
|
|
3
|
-
import { C as tagValue, S as tagName, a as isReplaceableWinner, b as isTag, d as sortEvents, f as sortedEvents, g as eventAddress, h as Tag, l as serializeEvent, m as validateSignedEvent, n as getEventHash, o as itemCompare, p as validateEvent, u as signedMatchesUnsigned, v as formatEventAddress, x as parseEventAddress, y as getDTag } from "./event-
|
|
4
|
-
import { a as publicKeyFromHex, i as getPublicKey, n as SecretKey, o as signEvent, r as finalizeEvent, s as toSecretKey, t as Keys } from "./key-
|
|
5
|
-
import { n as verifyEvent, t as createEventVerifier } from "./verifier-
|
|
6
|
-
import { t as EventBuilder } from "./builder-
|
|
3
|
+
import { C as tagValue, S as tagName, a as isReplaceableWinner, b as isTag, d as sortEvents, f as sortedEvents, g as eventAddress, h as Tag, l as serializeEvent, m as validateSignedEvent, n as getEventHash, o as itemCompare, p as validateEvent, u as signedMatchesUnsigned, v as formatEventAddress, x as parseEventAddress, y as getDTag } from "./event-CHf47dPM.mjs";
|
|
4
|
+
import { a as publicKeyFromHex, i as getPublicKey, n as SecretKey, o as signEvent, r as finalizeEvent, s as toSecretKey, t as Keys } from "./key-DnVpchl6.mjs";
|
|
5
|
+
import { n as verifyEvent, t as createEventVerifier } from "./verifier-B51Wkt5H.mjs";
|
|
6
|
+
import { t as EventBuilder } from "./builder-aNU2gGFP.mjs";
|
|
7
7
|
import { a as matchFilter, i as getFilterLimit, n as canonicalizeFilters, o as matchFilters, r as filterFingerprint, s as mergeFilters, t as canonicalizeFilter } from "./filter-BQl3GlHt.mjs";
|
|
8
|
-
import { a as mergeCountHll, i as encodeRelayMessage, n as createSubscriptionId, o as parseClientMessage, r as encodeClientMessage, s as parseRelayMessage, t as assertSubscriptionId } from "./message-
|
|
9
|
-
import { t as NoSignerError } from "./error-
|
|
10
|
-
import { a as KeysSigner, i as isNip07Available, n as Nip07Signer, r as getWindowNostr, t as Nip46Signer } from "./signer-
|
|
8
|
+
import { a as mergeCountHll, i as encodeRelayMessage, n as createSubscriptionId, o as parseClientMessage, r as encodeClientMessage, s as parseRelayMessage, t as assertSubscriptionId } from "./message-oNr7t0SJ.mjs";
|
|
9
|
+
import { t as NoSignerError } from "./error-DlhGW4mJ.mjs";
|
|
10
|
+
import { a as KeysSigner, i as isNip07Available, n as Nip07Signer, r as getWindowNostr, t as Nip46Signer } from "./signer-poTGe6Er.mjs";
|
|
11
11
|
import { Bech32MaxSize, Nip19Error, decode, naddrEncode, neventEncode, noteEncode, nprofileEncode, npubEncode, nsecEncode } from "./nips/nip19.mjs";
|
|
12
12
|
import { Nip21Error, isNostrURI, parseNostrURI } from "./nips/nip21.mjs";
|
|
13
13
|
import { buildReplyTags, parseThreadTags, replyTo } from "./nips/nip10.mjs";
|
|
14
14
|
import { isAuthRequired, makeAuthEvent } from "./nips/nip42.mjs";
|
|
15
15
|
import { parseRelayList, readRelays, relayListEventBuilder, relayListToTags, writeRelays } from "./nips/nip65.mjs";
|
|
16
|
-
import { c as RelayConnectionError, d as RelaySuspendedError, f as RelayTimeoutError, l as RelayError, n as Relay, o as useWebSocketImplementation, r as RelayStatus, s as RelayClosedError, u as RelayPublishError } from "./relay-
|
|
17
|
-
import { i as isInsecureRelayUrl, t as Pool } from "./pool-
|
|
16
|
+
import { c as RelayConnectionError, d as RelaySuspendedError, f as RelayTimeoutError, l as RelayError, n as Relay, o as useWebSocketImplementation, r as RelayStatus, s as RelayClosedError, u as RelayPublishError } from "./relay-quCs7MHD.mjs";
|
|
17
|
+
import { i as isInsecureRelayUrl, t as Pool } from "./pool-vlw74C4t.mjs";
|
|
18
18
|
import "./relay.mjs";
|
|
19
|
-
import { t as Gossip } from "./gossip-
|
|
20
|
-
import { a as bareNostrUser, i as groupAuthorsByOutboxRelay, n as OutboxError, r as OutboxFeed, t as createLoaders } from "./loaders-
|
|
21
|
-
import { t as StorageError } from "./error-
|
|
22
|
-
import { t as MemoryEventStore } from "./memory-
|
|
23
|
-
import { t as ReactiveEventStore } from "./reactive-
|
|
24
|
-
import { n as ClientError, r as SyncDirection, t as Client } from "./client-
|
|
25
|
-
import { n as IndexedDbEventStore, t as SqliteEventStore } from "./storage-
|
|
19
|
+
import { t as Gossip } from "./gossip-DFxIBlsr.mjs";
|
|
20
|
+
import { a as bareNostrUser, i as groupAuthorsByOutboxRelay, n as OutboxError, r as OutboxFeed, t as createLoaders } from "./loaders-BmPkQfzI.mjs";
|
|
21
|
+
import { t as StorageError } from "./error-BILMe3Gr.mjs";
|
|
22
|
+
import { t as MemoryEventStore } from "./memory-CdJ07kub.mjs";
|
|
23
|
+
import { t as ReactiveEventStore } from "./reactive-Tz0otDIP.mjs";
|
|
24
|
+
import { n as ClientError, r as SyncDirection, t as Client } from "./client-Cj2lUaVh.mjs";
|
|
25
|
+
import { n as IndexedDbEventStore, t as SqliteEventStore } from "./storage-B5IXTVuS.mjs";
|
|
26
26
|
import "./store.mjs";
|
|
27
27
|
export { Bech32MaxSize, Client, ClientError, CryptoError, EVENT_ID_BYTES, EventBuilder, EventValidationError, Gossip, HexError, IndexedDbEventStore, Keys, KeysSigner, Kind, MemoryEventStore, MessageError, Nip07Signer, Nip19Error, Nip21Error, Nip46Signer, NoSignerError, NostrError, OutboxError, OutboxFeed, PUBLIC_KEY_BYTES, Pool, ReactiveEventStore, Relay, RelayClosedError, RelayConnectionError, RelayError, RelayPublishError, RelayStatus, RelaySuspendedError, RelayTimeoutError, SECRET_KEY_BYTES, SIGNATURE_BYTES, SUBSCRIPTION_ID_MAX_CHARS, SecretKey, SqliteEventStore, StorageError, SyncDirection, Tag, UrlError, WasmPoisonedError, assertSubscriptionId, bareNostrUser, buildReplyTags, bytesToHex, canonicalizeFilter, canonicalizeFilters, classifyKind, createEventVerifier, createLoaders, createSubscriptionId, encodeClientMessage, encodeRelayMessage, eventAddress, filterFingerprint, finalizeEvent, formatEventAddress, getDTag, getEventHash, getFilterLimit, getPublicKey, getWindowNostr, groupAuthorsByOutboxRelay, hexToBytes, isAddressableKind, isAuthRequired, isEphemeralKind, isHex32, isHex64, isInsecureRelayUrl, isNip07Available, isNostrURI, isRegularKind, isReplaceableKind, isReplaceableWinner, isTag, itemCompare, makeAuthEvent, matchFilter, matchFilters, mergeCountHll, mergeFilters, naddrEncode, neventEncode, decode as nip19Decode, normalizeURL, noteEncode, nprofileEncode, npubEncode, nsecEncode, parseClientMessage, parseEventAddress, parseNostrURI, parseRelayList, parseRelayMessage, parseThreadTags, publicKeyFromHex, readRelays, relayListEventBuilder, relayListToTags, replyTo, serializeEvent, signEvent, signedMatchesUnsigned, sortEvents, sortedEvents, tagName, tagValue, toSecretKey, useWebSocketImplementation, validateEvent, validateSignedEvent, verifyEvent, writeRelays };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as WasmPoisonedError, m as CryptoError } from "./util-
|
|
2
|
-
import { t as createEventVerifier } from "./verifier-
|
|
1
|
+
import { b as WasmPoisonedError, m as CryptoError } from "./util-DMF9AIO0.mjs";
|
|
2
|
+
import { t as createEventVerifier } from "./verifier-B51Wkt5H.mjs";
|
|
3
3
|
//#region src/wasm/abi.ts
|
|
4
4
|
/** Imports 0.2.122 may request. Instantiation fails if anything else appears. */
|
|
5
5
|
const ALLOWED_WASM_IMPORTS = [{
|
|
@@ -217,4 +217,4 @@ function createNostrWasmLoader(wasmBytes) {
|
|
|
217
217
|
//#endregion
|
|
218
218
|
export { fetchWasmUrl as n, isWasmBytes as r, createNostrWasmLoader as t };
|
|
219
219
|
|
|
220
|
-
//# sourceMappingURL=instance-
|
|
220
|
+
//# sourceMappingURL=instance-C62w3cEt.mjs.map
|