nostr-tools 2.23.11 → 2.23.12

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/lib/cjs/nipb0.js CHANGED
@@ -804,7 +804,10 @@ function getHashFromURL(url) {
804
804
  async function uploadBlob(server, blob, opts) {
805
805
  const url = new URL("/upload", server).toString();
806
806
  const sha2562 = await computeBlobSha256(blob);
807
- const headers = { "X-SHA-256": sha2562 };
807
+ const headers = {
808
+ "X-SHA-256": sha2562,
809
+ "Content-Type": getBlobType(blob) || "application/octet-stream"
810
+ };
808
811
  if (opts?.auth) {
809
812
  const authEvent = typeof opts.auth === "boolean" ? await opts.onAuth?.(server, sha2562) : opts.auth;
810
813
  if (authEvent)
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../nipb0.ts", "../../core.ts", "../../kinds.ts"],
4
- "sourcesContent": ["import { sha256 } from '@noble/hashes/sha2.js'\nimport { bytesToHex } from '@noble/hashes/utils.js'\nimport type { EventTemplate } from './core.ts'\nimport type { Signer } from './signer.ts'\nimport { kinds } from './index.ts'\n\nexport type BlobDescriptor = {\n url: string\n sha256: string\n size: number\n type: string\n uploaded: number\n}\n\nexport type UploadType = Blob | File | Buffer\n\nexport type SignedEvent = EventTemplate & {\n id: string\n sig: string\n pubkey: string\n}\n\nexport type AuthEventOptions = {\n blobs?: string | string[]\n servers?: string | string[]\n message?: string\n expiration?: number\n}\n\nexport function isSha256(str: string): boolean {\n return /^[0-9a-f]{64}$/i.test(str)\n}\n\nexport function getBlobSize(blob: UploadType): number {\n if ((typeof File !== 'undefined' && blob instanceof File) || blob instanceof Blob) {\n return blob.size\n }\n return (blob as Buffer).length\n}\n\nexport function getBlobType(blob: UploadType): string | undefined {\n if ((typeof File !== 'undefined' && blob instanceof File) || blob instanceof Blob) {\n return blob.type || undefined\n }\n return undefined\n}\n\nexport async function computeBlobSha256(blob: UploadType): Promise<string> {\n let buffer: ArrayBuffer | Uint8Array\n\n if ((typeof File !== 'undefined' && blob instanceof File) || blob instanceof Blob) {\n buffer = await blob.arrayBuffer()\n } else {\n buffer = blob\n }\n\n const hash = sha256.create().update(new Uint8Array(buffer)).digest()\n return bytesToHex(hash)\n}\n\n// auth\n\nexport function encodeAuthorizationHeader(event: SignedEvent): string {\n const json = JSON.stringify(event)\n const bytes = new TextEncoder().encode(json)\n let binary = ''\n for (const byte of bytes) binary += String.fromCharCode(byte)\n return 'Nostr ' + btoa(binary).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/g, '')\n}\n\nexport function now(): number {\n return Math.floor(Date.now() / 1000)\n}\n\nexport function oneHour(): number {\n return now() + 3600\n}\n\nexport function getAuthTagValues(auth: SignedEvent, tagName: string): string[] {\n return auth.tags.filter(tag => tag[0] === tagName).map(tag => tag[1])\n}\n\nexport function getAuthExpiration(auth: SignedEvent): number | undefined {\n const expiration = auth.tags.find(tag => tag[0] === 'expiration')?.[1]\n if (!expiration) return undefined\n const timestamp = Number(expiration)\n if (!Number.isFinite(timestamp)) return undefined\n return timestamp\n}\n\nexport function isAuthExpired(auth: SignedEvent, timestamp: number = now()): boolean {\n const expiration = getAuthExpiration(auth)\n return expiration !== undefined && expiration <= timestamp\n}\n\nexport function normalizeServerTag(server: string | URL): string {\n if (server instanceof URL) return server.hostname.toLowerCase()\n if (URL.canParse(server)) return new URL(server).hostname.toLowerCase()\n return server.toLowerCase()\n}\n\nexport function areServersEqual(a: string | URL, b: string | URL): boolean {\n return normalizeServerTag(a) === normalizeServerTag(b)\n}\n\nfunction normalizeServers(servers: string | string[]): string[] {\n const values = Array.isArray(servers) ? servers : [servers]\n return [...new Set(values.map(normalizeServerTag))]\n}\n\nexport async function createAuthEvent(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n type: 'upload' | 'list' | 'delete' | 'get' | 'media',\n options?: AuthEventOptions,\n): Promise<SignedEvent> {\n const draft: EventTemplate = {\n created_at: now(),\n kind: kinds.BlobsAuth,\n content: options?.message ?? '',\n tags: [\n ['t', type],\n ['expiration', String(options?.expiration ?? oneHour())],\n ],\n }\n\n if (options?.blobs) {\n const blobList = Array.isArray(options.blobs) ? options.blobs : [options.blobs]\n const seen = new Set<string>()\n for (const blob of blobList) {\n const hash = typeof blob === 'string' ? blob : await computeBlobSha256(blob)\n if (!seen.has(hash)) {\n draft.tags.push(['x', hash])\n seen.add(hash)\n }\n }\n }\n\n if (options?.servers) {\n for (const server of normalizeServers(options.servers)) {\n draft.tags.push(['server', server])\n }\n }\n\n return signer(draft)\n}\n\nexport type UploadAuthOptions = Omit<AuthEventOptions, 'blobs'> & { type?: 'upload' | 'media' }\n\nexport async function createUploadAuth(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n blobs: string | string[],\n options?: UploadAuthOptions,\n): Promise<SignedEvent> {\n return createAuthEvent(signer, options?.type ?? 'upload', { message: 'Upload Blob', ...options, blobs })\n}\n\nexport type DownloadAuthOptions = Omit<AuthEventOptions, 'blobs' | 'servers'>\n\nexport async function createDownloadAuth(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n hash: string,\n options?: DownloadAuthOptions,\n): Promise<SignedEvent> {\n return createAuthEvent(signer, 'get', { message: 'Download Blob', ...options, blobs: [hash] })\n}\n\nexport type MirrorAuthOptions = Omit<AuthEventOptions, 'blobs'>\n\nexport async function createMirrorAuth(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n hash: string,\n options?: MirrorAuthOptions,\n): Promise<SignedEvent> {\n return createAuthEvent(signer, 'upload', { message: 'Mirror Blob', ...options, blobs: [hash] })\n}\n\nexport type ListAuthOptions = Omit<AuthEventOptions, 'blobs'>\n\nexport async function createListAuth(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n options?: ListAuthOptions,\n): Promise<SignedEvent> {\n return createAuthEvent(signer, 'list', { message: 'List Blobs', ...options })\n}\n\nexport type DeleteAuthOptions = Omit<AuthEventOptions, 'blobs'>\n\nexport async function createDeleteAuth(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n hash: string,\n options?: DeleteAuthOptions,\n): Promise<SignedEvent> {\n return createAuthEvent(signer, 'delete', { message: 'Delete Blob', ...options, blobs: [hash] })\n}\n\n// blossom URI\n\nexport type BlossomURI = {\n sha256: string\n ext: string\n servers: string[]\n authors: string[]\n size?: number\n}\n\nexport function parseBlossomURI(uri: string): BlossomURI {\n if (!uri.startsWith('blossom:')) throw new Error('Invalid blossom URI: missing blossom: scheme')\n const body = uri.slice('blossom:'.length)\n const queryIndex = body.indexOf('?')\n const path = queryIndex === -1 ? body : body.slice(0, queryIndex)\n const query = queryIndex === -1 ? '' : body.slice(queryIndex + 1)\n const dotIndex = path.indexOf('.')\n if (dotIndex === -1) throw new Error('Invalid blossom URI: missing file extension')\n const sha256 = path.slice(0, dotIndex)\n const ext = path.slice(dotIndex + 1)\n if (!isSha256(sha256)) throw new Error('Invalid blossom URI: invalid sha256 hash')\n if (!ext) throw new Error('Invalid blossom URI: empty file extension')\n const params = new URLSearchParams(query)\n const servers = params.getAll('xs')\n const authors = params.getAll('as')\n const szValue = params.get('sz')\n let size: number | undefined\n if (szValue !== null) {\n size = Number(szValue)\n if (!Number.isFinite(size) || size <= 0 || Math.floor(size) !== size) {\n throw new Error('Invalid blossom URI: sz must be a positive integer')\n }\n }\n return { sha256, ext, servers, authors, size }\n}\n\nexport function buildBlossomURI(options: BlossomURI): string {\n const params = new URLSearchParams()\n for (const server of options.servers) params.append('xs', server)\n for (const author of options.authors) params.append('as', author)\n if (options.size !== undefined) params.append('sz', String(options.size))\n const query = params.toString()\n return `blossom:${options.sha256}.${options.ext}${query ? '?' + query : ''}`\n}\n\nexport function blossomURIToURL(uri: string | BlossomURI): URL {\n const str = typeof uri === 'string' ? uri : buildBlossomURI(uri)\n return new URL(str)\n}\n\nexport function blossomURIFromURL(url: URL): BlossomURI {\n if (url.protocol !== 'blossom:') throw new Error('Invalid blossom URL: expected blossom: protocol')\n const path = url.pathname\n const dotIndex = path.indexOf('.')\n if (dotIndex === -1) throw new Error('Invalid blossom URL: missing file extension')\n const sha256 = path.slice(0, dotIndex)\n const ext = path.slice(dotIndex + 1)\n if (!isSha256(sha256)) throw new Error('Invalid blossom URL: invalid sha256 hash')\n if (!ext) throw new Error('Invalid blossom URL: empty file extension')\n const servers = url.searchParams.getAll('xs')\n const authors = url.searchParams.getAll('as')\n const szValue = url.searchParams.get('sz')\n let size: number | undefined\n if (szValue !== null) {\n size = Number(szValue)\n if (!Number.isFinite(size) || size <= 0 || Math.floor(size) !== size) {\n throw new Error('Invalid blossom URL: sz must be a positive integer')\n }\n }\n return { sha256, ext, servers, authors, size }\n}\n\nconst commonMimeExtensions: Record<string, string> = {\n 'application/json': '.json',\n 'application/pdf': '.pdf',\n 'application/vnd.android.package-archive': '.apk',\n 'application/vnd.sqlite3': '.sqlite3',\n 'application/xml': '.xml',\n 'audio/aac': '.aac',\n 'audio/flac': '.flac',\n 'audio/midi': '.midi',\n 'audio/mp3': '.mp3',\n 'audio/mpeg': '.mp3',\n 'audio/mp4': '.m4a',\n 'audio/ogg': '.ogg',\n 'audio/wav': '.wav',\n 'audio/webm': '.weba',\n 'audio/x-aiff': '.aiff',\n 'audio/x-m4a': '.m4a',\n 'image/avif': '.avif',\n 'image/gif': '.gif',\n 'image/jpeg': '.jpg',\n 'image/png': '.png',\n 'image/svg+xml': '.svg',\n 'image/webp': '.webp',\n 'text/css': '.css',\n 'text/csv': '.csv',\n 'text/html': '.html',\n 'text/javascript': '.js',\n 'text/markdown': '.md',\n 'text/plain': '.txt',\n 'text/xml': '.xml',\n 'video/mp2t': '.ts',\n 'video/mp4': '.mp4',\n 'video/ogg': '.ogv',\n 'video/quicktime': '.mov',\n 'video/webm': '.webm',\n 'video/x-matroska': '.mkv',\n}\n\nconst commonExtensionMimes: Record<string, string> = {\n '.aac': 'audio/aac',\n '.aiff': 'audio/x-aiff',\n '.apk': 'application/vnd.android.package-archive',\n '.avif': 'image/avif',\n '.css': 'text/css; charset=utf-8',\n '.csv': 'text/csv; charset=utf-8',\n '.flac': 'audio/flac',\n '.gif': 'image/gif',\n '.html': 'text/html; charset=utf-8',\n '.jpeg': 'image/jpeg',\n '.jpg': 'image/jpeg',\n '.js': 'text/javascript; charset=utf-8',\n '.json': 'application/json',\n '.m4a': 'audio/mp4',\n '.md': 'text/markdown; charset=utf-8',\n '.midi': 'audio/midi',\n '.mkv': 'video/x-matroska',\n '.mov': 'video/quicktime',\n '.mp3': 'audio/mpeg',\n '.mp4': 'video/mp4',\n '.oga': 'audio/ogg',\n '.ogg': 'audio/ogg',\n '.ogv': 'video/ogg',\n '.pdf': 'application/pdf',\n '.png': 'image/png',\n '.sqlite3': 'application/vnd.sqlite3',\n '.svg': 'image/svg+xml',\n '.ts': 'video/mp2t',\n '.txt': 'text/plain; charset=utf-8',\n '.wav': 'audio/wav',\n '.weba': 'audio/webm',\n '.webm': 'video/webm',\n '.webp': 'image/webp',\n '.xml': 'application/xml',\n}\n\nfunction normalizeMIMEType(mimetype: string): string {\n const idx = mimetype.indexOf(';')\n return idx >= 0 ? mimetype.slice(0, idx).trim().toLowerCase() : mimetype.trim().toLowerCase()\n}\n\nexport function getExtension(mimetype: string): string {\n const normalized = normalizeMIMEType(mimetype)\n if (!normalized) return ''\n return commonMimeExtensions[normalized] ?? ''\n}\n\nexport function getMIMEType(ext: string): string {\n if (!ext) return ''\n ext = ext.trim().toLowerCase()\n if (ext[0] !== '.') ext = '.' + ext\n return commonExtensionMimes[ext] ?? ''\n}\n\nexport function getServersFromServerListEvent(event: { tags: string[][] }): URL[] {\n const servers: URL[] = []\n for (const tag of event.tags) {\n if (tag[0] === 'server' && tag[1]) {\n try {\n const url = new URL(tag[1])\n url.pathname = '/'\n servers.push(url)\n } catch {}\n }\n }\n return servers\n}\n\nexport function getHashFromURL(url: string | URL): string | null {\n try {\n if (typeof url === 'string') url = new URL(url)\n const hashes = Array.from(url.pathname.matchAll(/[0-9a-f]{64}/gi))\n return hashes.length > 0 ? hashes[hashes.length - 1][0] : null\n } catch (_err) {\n return null\n }\n}\n\nexport type UploadOptions = {\n signal?: AbortSignal\n auth?: SignedEvent | boolean\n timeout?: number\n onAuth?: (server: string, sha256: string) => Promise<SignedEvent>\n}\n\nexport async function uploadBlob(server: string, blob: Blob | File, opts?: UploadOptions): Promise<BlobDescriptor> {\n const url = new URL('/upload', server).toString()\n const sha256 = await computeBlobSha256(blob)\n\n const headers: Record<string, string> = { 'X-SHA-256': sha256 }\n\n if (opts?.auth) {\n const authEvent = typeof opts.auth === 'boolean' ? await opts.onAuth?.(server, sha256) : opts.auth\n if (authEvent) headers['Authorization'] = encodeAuthorizationHeader(authEvent)\n }\n\n const res = await fetch(url, {\n method: 'PUT',\n body: blob,\n headers,\n signal: opts?.signal,\n })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`upload returned error (${res.status}): ${reason}`)\n }\n\n return res.json()\n}\n\nexport type DownloadOptions = {\n signal?: AbortSignal\n auth?: SignedEvent | boolean\n timeout?: number\n onAuth?: (server: string, sha256: string) => Promise<SignedEvent>\n}\n\nexport async function downloadBlob(server: string, hash: string, opts?: DownloadOptions): Promise<Response> {\n const url = new URL('/' + hash, server).toString()\n const headers: Record<string, string> = {}\n\n if (opts?.auth) {\n const authEvent = typeof opts.auth === 'boolean' ? await opts.onAuth?.(server, hash) : opts.auth\n if (authEvent) headers['Authorization'] = encodeAuthorizationHeader(authEvent)\n }\n\n const res = await fetch(url, { headers, signal: opts?.signal })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`${hash} download error (${res.status}): ${reason}`)\n }\n\n return res\n}\n\nexport type ListOptions = {\n signal?: AbortSignal\n auth?: SignedEvent | boolean\n timeout?: number\n onAuth?: (server: string) => Promise<SignedEvent>\n cursor?: string\n limit?: number\n since?: number\n until?: number\n}\n\nexport async function listBlobs(server: string, pubkey: string, opts?: ListOptions): Promise<BlobDescriptor[]> {\n const url = new URL('/list/' + pubkey, server)\n if (opts?.cursor) url.searchParams.append('cursor', opts.cursor)\n if (opts?.limit) url.searchParams.append('limit', String(opts.limit))\n if (opts?.since) url.searchParams.append('since', String(opts.since))\n if (opts?.until) url.searchParams.append('until', String(opts.until))\n\n const headers: Record<string, string> = {}\n\n if (opts?.auth) {\n const authEvent = typeof opts.auth === 'boolean' ? await opts.onAuth?.(server) : opts.auth\n if (authEvent) headers['Authorization'] = encodeAuthorizationHeader(authEvent)\n }\n\n const res = await fetch(url.toString(), { headers, signal: opts?.signal })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`list error (${res.status}): ${reason}`)\n }\n\n return res.json()\n}\n\nexport async function* iterateBlobs(\n server: string,\n pubkey: string,\n opts?: ListOptions,\n): AsyncGenerator<BlobDescriptor[], void, void> {\n let cursor = opts?.cursor\n while (true) {\n const page = await listBlobs(server, pubkey, { ...opts, cursor })\n if (page.length === 0) return\n yield page\n if (opts?.limit && page.length < opts.limit) return\n cursor = page[page.length - 1]?.sha256\n if (!cursor) return\n }\n}\n\nexport type DeleteOptions = {\n signal?: AbortSignal\n auth?: SignedEvent | boolean\n timeout?: number\n onAuth?: (server: string, sha256: string) => Promise<SignedEvent>\n}\n\nexport async function deleteBlob(server: string, hash: string, opts?: DeleteOptions): Promise<boolean> {\n const url = new URL('/' + hash, server).toString()\n const headers: Record<string, string> = {}\n\n if (opts?.auth) {\n const authEvent = typeof opts.auth === 'boolean' ? await opts.onAuth?.(server, hash) : opts.auth\n if (authEvent) headers['Authorization'] = encodeAuthorizationHeader(authEvent)\n }\n\n const res = await fetch(url, { method: 'DELETE', headers, signal: opts?.signal })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`delete error (${res.status}): ${reason}`)\n }\n\n return res.ok\n}\n\nexport type HasBlobOptions = {\n signal?: AbortSignal\n timeout?: number\n}\n\nexport async function hasBlob(server: string, hash: string, opts?: HasBlobOptions): Promise<boolean> {\n const url = new URL('/' + hash, server)\n try {\n const res = await fetch(url.toString(), { method: 'HEAD', signal: opts?.signal })\n return res.status !== 404\n } catch {\n return false\n }\n}\n\nexport type MirrorOptions = {\n signal?: AbortSignal\n auth?: SignedEvent | boolean\n timeout?: number\n onAuth?: (server: string, sha256: string) => Promise<SignedEvent>\n}\n\nexport async function mirrorBlob(server: string, blob: BlobDescriptor, opts?: MirrorOptions): Promise<BlobDescriptor> {\n const url = new URL('/mirror', server).toString()\n\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n 'X-SHA-256': blob.sha256,\n }\n\n if (opts?.auth) {\n const authEvent = typeof opts.auth === 'boolean' ? await opts.onAuth?.(server, blob.sha256) : opts.auth\n if (authEvent) headers['Authorization'] = encodeAuthorizationHeader(authEvent)\n }\n\n const res = await fetch(url, {\n method: 'PUT',\n body: JSON.stringify({ url: blob.url }),\n headers,\n signal: opts?.signal,\n })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`mirror error (${res.status}): ${reason}`)\n }\n\n return res.json()\n}\n\nexport type ReportOptions = {\n signal?: AbortSignal\n timeout?: number\n onError?: (server: string, error: Error) => void\n}\n\nexport async function reportBlobs(\n servers: Iterable<string>,\n report: SignedEvent,\n opts?: ReportOptions,\n): Promise<Map<string, boolean>> {\n if (report.kind !== 1984 || !report.tags.some(tag => tag[0] === 'x' && !!tag[1])) {\n throw new Error('Invalid blob report event: must be kind 1984 with x tag')\n }\n\n const results = new Map<string, boolean>()\n const body = JSON.stringify(report)\n\n for (const server of servers) {\n try {\n const res = await fetch(new URL('/report', server).toString(), {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body,\n signal: opts?.signal,\n })\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`report error (${res.status}): ${reason}`)\n }\n results.set(server, true)\n } catch (error) {\n if (opts?.onError && error instanceof Error) opts.onError(server, error)\n }\n }\n\n return results\n}\n\nexport class BlossomClient {\n private mediaserver: string\n\n constructor(\n mediaserver: string,\n private signer: Signer,\n ) {\n if (!mediaserver.startsWith('http')) {\n mediaserver = 'https://' + mediaserver\n }\n this.mediaserver = mediaserver.replace(/\\/$/, '') + '/'\n }\n\n getMediaServer(): string {\n return this.mediaserver\n }\n\n private async authorizationHeader(modify?: (event: EventTemplate) => void): Promise<string> {\n const event = {\n created_at: now(),\n kind: kinds.BlobsAuth,\n content: 'blossom stuff',\n tags: [['expiration', String(now() + 60)]],\n }\n\n modify?.(event)\n\n try {\n const signedEvent = await this.signer.signEvent(event)\n const json = JSON.stringify(signedEvent)\n return 'Nostr ' + btoa(json)\n } catch {\n return ''\n }\n }\n\n private async httpCall(\n method: string,\n url: string,\n contentType?: string,\n addAuthorization?: () => Promise<string>,\n body?: File | Blob | string,\n ): Promise<any> {\n const headers: Record<string, string> = {}\n\n if (contentType) headers['Content-Type'] = contentType\n if (addAuthorization) {\n const auth = await addAuthorization()\n if (auth) headers['Authorization'] = auth\n }\n\n const res = await fetch(this.mediaserver + url, { method, headers, body })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`${url} returned error (${res.status}): ${reason}`)\n }\n\n if (res.headers.get('content-type')?.includes('application/json')) {\n return res.json()\n }\n\n return res\n }\n\n async uploadBlob(file: Blob | File, contentType?: string): Promise<BlobDescriptor> {\n const hash = bytesToHex(sha256(new Uint8Array(await file.arrayBuffer())))\n const actualContentType = contentType || getBlobType(file) || 'application/octet-stream'\n\n return this.httpCall(\n 'PUT',\n 'upload',\n actualContentType,\n () =>\n this.authorizationHeader(evt => {\n evt.tags.push(['t', 'upload'], ['x', hash])\n }),\n file,\n )\n }\n\n async download(hash: string): Promise<ArrayBuffer> {\n const authHeader = await this.authorizationHeader(evt => {\n evt.tags.push(['t', 'get'], ['x', hash])\n })\n\n const res = await fetch(this.mediaserver + hash, {\n method: 'GET',\n headers: { Authorization: authHeader },\n })\n\n if (res.status >= 300) {\n throw new Error(`${hash} not present on ${this.mediaserver}: ${res.status}`)\n }\n\n return res.arrayBuffer()\n }\n\n async downloadAsBlob(hash: string): Promise<Blob> {\n return new Blob([await this.download(hash)])\n }\n\n async list(): Promise<BlobDescriptor[]> {\n const pubkey = await this.signer.getPublicKey()\n return this.httpCall('GET', `list/${pubkey}`, undefined, () =>\n this.authorizationHeader(evt => {\n evt.tags.push(['t', 'list'])\n }),\n )\n }\n\n async delete(hash: string): Promise<void> {\n await this.httpCall('DELETE', hash, undefined, () =>\n this.authorizationHeader(evt => {\n evt.tags.push(['t', 'delete'], ['x', hash])\n }),\n )\n }\n\n async check(hash: string): Promise<void> {\n if (!isSha256(hash)) throw new Error(`${hash} is not valid 32-byte hex`)\n await this.httpCall('HEAD', hash)\n }\n\n async mirror(remoteBlobURL: string): Promise<BlobDescriptor> {\n const hash = remoteBlobURL.split('/').pop()?.split('.')[0] || ''\n return this.httpCall(\n 'PUT',\n 'mirror',\n 'application/json',\n () =>\n this.authorizationHeader(evt => {\n evt.tags.push(['t', 'upload'], ['x', hash])\n }),\n JSON.stringify({ url: remoteBlobURL }),\n )\n }\n}\n", "export interface Nostr {\n generateSecretKey(): Uint8Array\n getPublicKey(secretKey: Uint8Array): string\n finalizeEvent(event: EventTemplate, secretKey: Uint8Array): VerifiedEvent\n verifyEvent(event: Event): event is VerifiedEvent\n}\n\n/** Designates a verified event signature. */\nexport const verifiedSymbol = Symbol('verified')\n\nexport type NostrEvent = {\n kind: number\n tags: string[][]\n content: string\n created_at: number\n pubkey: string\n id: string\n sig: string\n [verifiedSymbol]?: boolean\n}\n\nexport type Event = NostrEvent\nexport type EventTemplate = Pick<Event, 'kind' | 'tags' | 'content' | 'created_at'>\nexport type UnsignedEvent = Pick<Event, 'kind' | 'tags' | 'content' | 'created_at' | 'pubkey'>\n\n/** An event whose signature has been verified. */\nexport interface VerifiedEvent extends Event {\n [verifiedSymbol]: true\n}\n\nconst isRecord = (obj: unknown): obj is Record<string, unknown> => obj instanceof Object\n\nexport function validateEvent<T>(event: T): event is T & UnsignedEvent {\n if (!isRecord(event)) return false\n if (typeof event.kind !== 'number') return false\n if (typeof event.content !== 'string') return false\n if (typeof event.created_at !== 'number') return false\n if (typeof event.pubkey !== 'string') return false\n if (!event.pubkey.match(/^[a-f0-9]{64}$/)) return false\n\n if (!Array.isArray(event.tags)) return false\n for (let i = 0; i < event.tags.length; i++) {\n let tag = event.tags[i]\n if (!Array.isArray(tag)) return false\n for (let j = 0; j < tag.length; j++) {\n if (typeof tag[j] !== 'string') return false\n }\n }\n\n return true\n}\n\n/**\n * Sort events in reverse-chronological order by the `created_at` timestamp,\n * and then by the event `id` (lexicographically) in case of ties.\n * This mutates the array.\n */\nexport function sortEvents(events: Event[]): Event[] {\n return events.sort((a: NostrEvent, b: NostrEvent): number => {\n if (a.created_at !== b.created_at) {\n return b.created_at - a.created_at\n }\n return a.id.localeCompare(b.id)\n })\n}\n", "import { NostrEvent, validateEvent } from './pure.ts'\n\n/** Events are **regular**, which means they're all expected to be stored by relays. */\nexport function isRegularKind(kind: number): boolean {\n return kind < 10000 && kind !== 0 && kind !== 3\n}\n\n/** Events are **replaceable**, which means that, for each combination of `pubkey` and `kind`, only the latest event is expected to (SHOULD) be stored by relays, older versions are expected to be discarded. */\nexport function isReplaceableKind(kind: number): boolean {\n return kind === 0 || kind === 3 || (10000 <= kind && kind < 20000)\n}\n\n/** Events are **ephemeral**, which means they are not expected to be stored by relays. */\nexport function isEphemeralKind(kind: number): boolean {\n return 20000 <= kind && kind < 30000\n}\n\n/** Events are **addressable**, which means that, for each combination of `pubkey`, `kind` and the `d` tag, only the latest event is expected to be stored by relays, older versions are expected to be discarded. */\nexport function isAddressableKind(kind: number): boolean {\n return 30000 <= kind && kind < 40000\n}\n\n/** Classification of the event kind. */\nexport type KindClassification = 'regular' | 'replaceable' | 'ephemeral' | 'parameterized' | 'unknown'\n\n/** Determine the classification of this kind of event if known, or `unknown`. */\nexport function classifyKind(kind: number): KindClassification {\n if (isRegularKind(kind)) return 'regular'\n if (isReplaceableKind(kind)) return 'replaceable'\n if (isEphemeralKind(kind)) return 'ephemeral'\n if (isAddressableKind(kind)) return 'parameterized'\n return 'unknown'\n}\n\nexport function isKind<T extends number>(event: unknown, kind: T | Array<T>): event is NostrEvent & { kind: T } {\n const kindAsArray: number[] = kind instanceof Array ? kind : [kind]\n return (validateEvent(event) && kindAsArray.includes(event.kind)) || false\n}\n\nexport const Metadata = 0\nexport type Metadata = typeof Metadata\nexport const ShortTextNote = 1\nexport type ShortTextNote = typeof ShortTextNote\nexport const RecommendRelay = 2\nexport type RecommendRelay = typeof RecommendRelay\nexport const Contacts = 3\nexport type Contacts = typeof Contacts\nexport const EncryptedDirectMessage = 4\nexport type EncryptedDirectMessage = typeof EncryptedDirectMessage\nexport const EventDeletion = 5\nexport type EventDeletion = typeof EventDeletion\nexport const Repost = 6\nexport type Repost = typeof Repost\nexport const Reaction = 7\nexport type Reaction = typeof Reaction\nexport const BadgeAward = 8\nexport type BadgeAward = typeof BadgeAward\nexport const ChatMessage = 9\nexport type ChatMessage = typeof ChatMessage\nexport const SimpleGroupThreadedReply = 10\nexport type SimpleGroupThreadedReply = typeof SimpleGroupThreadedReply\nexport const ForumThread = 11\nexport type ForumThread = typeof ForumThread\nexport const SimpleGroupReply = 12\nexport type SimpleGroupReply = typeof SimpleGroupReply\nexport const Seal = 13\nexport type Seal = typeof Seal\nexport const PrivateDirectMessage = 14\nexport type PrivateDirectMessage = typeof PrivateDirectMessage\nexport const FileMessage = 15\nexport type FileMessage = typeof FileMessage\nexport const GenericRepost = 16\nexport type GenericRepost = typeof GenericRepost\nexport const ReactionToWebsite = 17\nexport type ReactionToWebsite = typeof ReactionToWebsite\nexport const Photo = 20\nexport type Photo = typeof Photo\nexport const NormalVideo = 21\nexport type NormalVideo = typeof NormalVideo\nexport const ShortVideo = 22\nexport type ShortVideo = typeof ShortVideo\nexport const PublicMessage = 24\nexport type PublicMessage = typeof PublicMessage\nexport const ChannelCreation = 40\nexport type ChannelCreation = typeof ChannelCreation\nexport const ChannelMetadata = 41\nexport type ChannelMetadata = typeof ChannelMetadata\nexport const ChannelMessage = 42\nexport type ChannelMessage = typeof ChannelMessage\nexport const ChannelHideMessage = 43\nexport type ChannelHideMessage = typeof ChannelHideMessage\nexport const ChannelMuteUser = 44\nexport type ChannelMuteUser = typeof ChannelMuteUser\nexport const PodcastEpisode = 54\nexport type PodcastEpisode = typeof PodcastEpisode\nexport const Chess = 64\nexport type Chess = typeof Chess\nexport const MergeRequests = 818\nexport type MergeRequests = typeof MergeRequests\nexport const PollResponse = 1018\nexport type PollResponse = typeof PollResponse\nexport const Bid = 1021\nexport type Bid = typeof Bid\nexport const BidConfirmation = 1022\nexport type BidConfirmation = typeof BidConfirmation\nexport const OpenTimestamps = 1040\nexport type OpenTimestamps = typeof OpenTimestamps\nexport const GiftWrap = 1059\nexport type GiftWrap = typeof GiftWrap\nexport const FileMetadata = 1063\nexport type FileMetadata = typeof FileMetadata\nexport const Poll = 1068\nexport type Poll = typeof Poll\nexport const Comment = 1111\nexport type Comment = typeof Comment\nexport const Voice = 1222\nexport type Voice = typeof Voice\nexport const Scroll = 1227\nexport type Scroll = typeof Scroll\nexport const VoiceComment = 1244\nexport type VoiceComment = typeof VoiceComment\nexport const LiveChatMessage = 1311\nexport type LiveChatMessage = typeof LiveChatMessage\nexport const CodeSnippet = 1337\nexport type CodeSnippet = typeof CodeSnippet\nexport const Patch = 1617\nexport type Patch = typeof Patch\nexport const GitPullRequest = 1618\nexport type GitPullRequest = typeof GitPullRequest\nexport const GitPullRequestUpdate = 1619\nexport type GitPullRequestUpdate = typeof GitPullRequestUpdate\nexport const Issue = 1621\nexport type Issue = typeof Issue\nexport const Reply = 1622\nexport type Reply = typeof Reply\nexport const StatusOpen = 1630\nexport type StatusOpen = typeof StatusOpen\nexport const StatusApplied = 1631\nexport type StatusApplied = typeof StatusApplied\nexport const StatusClosed = 1632\nexport type StatusClosed = typeof StatusClosed\nexport const StatusDraft = 1633\nexport type StatusDraft = typeof StatusDraft\nexport const ProblemTracker = 1971\nexport type ProblemTracker = typeof ProblemTracker\nexport const Report = 1984\nexport type Report = typeof Report\nexport const Reporting = 1984\nexport type Reporting = typeof Reporting\nexport const Label = 1985\nexport type Label = typeof Label\nexport const RelayReviews = 1986\nexport type RelayReviews = typeof RelayReviews\nexport const AIEmbeddings = 1987\nexport type AIEmbeddings = typeof AIEmbeddings\nexport const Torrent = 2003\nexport type Torrent = typeof Torrent\nexport const TorrentComment = 2004\nexport type TorrentComment = typeof TorrentComment\nexport const CoinjoinPool = 2022\nexport type CoinjoinPool = typeof CoinjoinPool\nexport const DecoupledKeyClientAnnouncement = 4454\nexport type DecoupledKeyClientAnnouncement = typeof DecoupledKeyClientAnnouncement\nexport const DecoupledEncryptionKeyDistribution = 4455\nexport type DecoupledEncryptionKeyDistribution = typeof DecoupledEncryptionKeyDistribution\nexport const CommunityPostApproval = 4550\nexport type CommunityPostApproval = typeof CommunityPostApproval\nexport const JobRequest = 5999\nexport type JobRequest = typeof JobRequest\nexport const JobResult = 6999\nexport type JobResult = typeof JobResult\nexport const JobFeedback = 7000\nexport type JobFeedback = typeof JobFeedback\nexport const ReservedCashuWalletTokens = 7374\nexport type ReservedCashuWalletTokens = typeof ReservedCashuWalletTokens\nexport const CashuWalletTokens = 7375\nexport type CashuWalletTokens = typeof CashuWalletTokens\nexport const CashuWalletHistory = 7376\nexport type CashuWalletHistory = typeof CashuWalletHistory\nexport const GeocacheLog = 7516\nexport type GeocacheLog = typeof GeocacheLog\nexport const GeocacheProofOfFind = 7517\nexport type GeocacheProofOfFind = typeof GeocacheProofOfFind\nexport const SimpleGroupPutUser = 9000\nexport type SimpleGroupPutUser = typeof SimpleGroupPutUser\nexport const SimpleGroupRemoveUser = 9001\nexport type SimpleGroupRemoveUser = typeof SimpleGroupRemoveUser\nexport const SimpleGroupEditMetadata = 9002\nexport type SimpleGroupEditMetadata = typeof SimpleGroupEditMetadata\nexport const SimpleGroupDeleteEvent = 9005\nexport type SimpleGroupDeleteEvent = typeof SimpleGroupDeleteEvent\nexport const SimpleGroupCreateGroup = 9007\nexport type SimpleGroupCreateGroup = typeof SimpleGroupCreateGroup\nexport const SimpleGroupDeleteGroup = 9008\nexport type SimpleGroupDeleteGroup = typeof SimpleGroupDeleteGroup\nexport const SimpleGroupCreateInvite = 9009\nexport type SimpleGroupCreateInvite = typeof SimpleGroupCreateInvite\nexport const SimpleGroupJoinRequest = 9021\nexport type SimpleGroupJoinRequest = typeof SimpleGroupJoinRequest\nexport const SimpleGroupLeaveRequest = 9022\nexport type SimpleGroupLeaveRequest = typeof SimpleGroupLeaveRequest\nexport const ZapGoal = 9041\nexport type ZapGoal = typeof ZapGoal\nexport const NutZap = 9321\nexport type NutZap = typeof NutZap\nexport const TidalLogin = 9467\nexport type TidalLogin = typeof TidalLogin\nexport const ZapRequest = 9734\nexport type ZapRequest = typeof ZapRequest\nexport const Zap = 9735\nexport type Zap = typeof Zap\nexport const Highlights = 9802\nexport type Highlights = typeof Highlights\nexport const Mutelist = 10000\nexport type Mutelist = typeof Mutelist\nexport const Pinlist = 10001\nexport type Pinlist = typeof Pinlist\nexport const RelayList = 10002\nexport type RelayList = typeof RelayList\nexport const BookmarkList = 10003\nexport type BookmarkList = typeof BookmarkList\nexport const CommunitiesList = 10004\nexport type CommunitiesList = typeof CommunitiesList\nexport const PublicChatsList = 10005\nexport type PublicChatsList = typeof PublicChatsList\nexport const BlockedRelaysList = 10006\nexport type BlockedRelaysList = typeof BlockedRelaysList\nexport const SearchRelaysList = 10007\nexport type SearchRelaysList = typeof SearchRelaysList\nexport const SimpleGroupList = 10009\nexport type SimpleGroupList = typeof SimpleGroupList\nexport const FavoriteRelays = 10012\nexport type FavoriteRelays = typeof FavoriteRelays\nexport const PrivateEventRelayList = 10013\nexport type PrivateEventRelayList = typeof PrivateEventRelayList\nexport const InterestsList = 10015\nexport type InterestsList = typeof InterestsList\nexport const NutZapInfo = 10019\nexport type NutZapInfo = typeof NutZapInfo\nexport const MediaFollows = 10020\nexport type MediaFollows = typeof MediaFollows\nexport const UserEmojiList = 10030\nexport type UserEmojiList = typeof UserEmojiList\nexport const DecoupledKeyAnnouncement = 10044\nexport type DecoupledKeyAnnouncement = typeof DecoupledKeyAnnouncement\nexport const DirectMessageRelaysList = 10050\nexport type DirectMessageRelaysList = typeof DirectMessageRelaysList\nexport const FavoritePodcasts = 10054\nexport type FavoritePodcasts = typeof FavoritePodcasts\nexport const BlossomServerList = 10063\nexport type BlossomServerList = typeof BlossomServerList\nexport const FileServerPreference = 10096\nexport type FileServerPreference = typeof FileServerPreference\nexport const GoodWikiAuthorList = 10101\nexport type GoodWikiAuthorList = typeof GoodWikiAuthorList\nexport const GoodWikiRelayList = 10102\nexport type GoodWikiRelayList = typeof GoodWikiRelayList\nexport const PodcastMetadata = 10154\nexport type PodcastMetadata = typeof PodcastMetadata\nexport const AuthoredPodcasts = 10164\nexport type AuthoredPodcasts = typeof AuthoredPodcasts\nexport const RelayMonitorAnnouncement = 10166\nexport type RelayMonitorAnnouncement = typeof RelayMonitorAnnouncement\nexport const RoomPresence = 10312\nexport type RoomPresence = typeof RoomPresence\nexport const UserGraspList = 10317\nexport type UserGraspList = typeof UserGraspList\nexport const ProxyAnnouncement = 10377\nexport type ProxyAnnouncement = typeof ProxyAnnouncement\nexport const TransportMethodAnnouncement = 11111\nexport type TransportMethodAnnouncement = typeof TransportMethodAnnouncement\nexport const NWCWalletInfo = 13194\nexport type NWCWalletInfo = typeof NWCWalletInfo\nexport const NsiteRoot = 15128\nexport type NsiteRoot = typeof NsiteRoot\nexport const CashuWalletEvent = 17375\nexport type CashuWalletEvent = typeof CashuWalletEvent\nexport const LightningPubRPC = 21000\nexport type LightningPubRPC = typeof LightningPubRPC\nexport const ClientAuth = 22242\nexport type ClientAuth = typeof ClientAuth\nexport const NWCWalletRequest = 23194\nexport type NWCWalletRequest = typeof NWCWalletRequest\nexport const NWCWalletResponse = 23195\nexport type NWCWalletResponse = typeof NWCWalletResponse\nexport const NostrConnect = 24133\nexport type NostrConnect = typeof NostrConnect\nexport const BlobsAuth = 24242\nexport type BlobsAuth = typeof BlobsAuth\nexport const HTTPAuth = 27235\nexport type HTTPAuth = typeof HTTPAuth\nexport const Followsets = 30000\nexport type Followsets = typeof Followsets\nexport const Genericlists = 30001\nexport type Genericlists = typeof Genericlists\nexport const Relaysets = 30002\nexport type Relaysets = typeof Relaysets\nexport const Bookmarksets = 30003\nexport type Bookmarksets = typeof Bookmarksets\nexport const Curationsets = 30004\nexport type Curationsets = typeof Curationsets\nexport const CuratedVideoSets = 30005\nexport type CuratedVideoSets = typeof CuratedVideoSets\nexport const MuteSets = 30007\nexport type MuteSets = typeof MuteSets\nexport const ProfileBadges = 30008\nexport type ProfileBadges = typeof ProfileBadges\nexport const BadgeDefinition = 30009\nexport type BadgeDefinition = typeof BadgeDefinition\nexport const Interestsets = 30015\nexport type Interestsets = typeof Interestsets\nexport const CreateOrUpdateStall = 30017\nexport type CreateOrUpdateStall = typeof CreateOrUpdateStall\nexport const CreateOrUpdateProduct = 30018\nexport type CreateOrUpdateProduct = typeof CreateOrUpdateProduct\nexport const MarketplaceUI = 30019\nexport type MarketplaceUI = typeof MarketplaceUI\nexport const ProductSoldAsAuction = 30020\nexport type ProductSoldAsAuction = typeof ProductSoldAsAuction\nexport const LongFormArticle = 30023\nexport type LongFormArticle = typeof LongFormArticle\nexport const DraftLong = 30024\nexport type DraftLong = typeof DraftLong\nexport const Emojisets = 30030\nexport type Emojisets = typeof Emojisets\nexport const ModularArticleHeader = 30040\nexport type ModularArticleHeader = typeof ModularArticleHeader\nexport const ModularArticleContent = 30041\nexport type ModularArticleContent = typeof ModularArticleContent\nexport const ReleaseArtifactSets = 30063\nexport type ReleaseArtifactSets = typeof ReleaseArtifactSets\nexport const Application = 30078\nexport type Application = typeof Application\nexport const RelayDiscovery = 30166\nexport type RelayDiscovery = typeof RelayDiscovery\nexport const AppCurationSet = 30267\nexport type AppCurationSet = typeof AppCurationSet\nexport const LiveEvent = 30311\nexport type LiveEvent = typeof LiveEvent\nexport const InteractiveRoom = 30312\nexport type InteractiveRoom = typeof InteractiveRoom\nexport const ConferenceEvent = 30313\nexport type ConferenceEvent = typeof ConferenceEvent\nexport const UserStatuses = 30315\nexport type UserStatuses = typeof UserStatuses\nexport const SlideSet = 30388\nexport type SlideSet = typeof SlideSet\nexport const ClassifiedListing = 30402\nexport type ClassifiedListing = typeof ClassifiedListing\nexport const DraftClassifiedListing = 30403\nexport type DraftClassifiedListing = typeof DraftClassifiedListing\nexport const RepositoryAnnouncement = 30617\nexport type RepositoryAnnouncement = typeof RepositoryAnnouncement\nexport const RepositoryState = 30618\nexport type RepositoryState = typeof RepositoryState\nexport const WikiArticle = 30818\nexport type WikiArticle = typeof WikiArticle\nexport const Redirects = 30819\nexport type Redirects = typeof Redirects\nexport const DraftEvent = 31234\nexport type DraftEvent = typeof DraftEvent\nexport const LinkSet = 31388\nexport type LinkSet = typeof LinkSet\nexport const Feed = 31890\nexport type Feed = typeof Feed\nexport const Date = 31922\nexport type Date = typeof Date\nexport const Time = 31923\nexport type Time = typeof Time\nexport const Calendar = 31924\nexport type Calendar = typeof Calendar\nexport const CalendarEventRSVP = 31925\nexport type CalendarEventRSVP = typeof CalendarEventRSVP\nexport const RelayReview = 31987\nexport type RelayReview = typeof RelayReview\nexport const Handlerrecommendation = 31989\nexport type Handlerrecommendation = typeof Handlerrecommendation\nexport const Handlerinformation = 31990\nexport type Handlerinformation = typeof Handlerinformation\nexport const SoftwareApplication = 32267\nexport type SoftwareApplication = typeof SoftwareApplication\nexport const LegacyNsiteFile = 34128\nexport type LegacyNsiteFile = typeof LegacyNsiteFile\nexport const VideoViewEvent = 34237\nexport type VideoViewEvent = typeof VideoViewEvent\nexport const CommunityDefinition = 34550\nexport type CommunityDefinition = typeof CommunityDefinition\nexport const NsiteNamed = 35128\nexport type NsiteNamed = typeof NsiteNamed\nexport const GeocacheListing = 37515\nexport type GeocacheListing = typeof GeocacheListing\nexport const GeocacheLogEntry = 37516\nexport type GeocacheLogEntry = typeof GeocacheLogEntry\nexport const CashuMintAnnouncement = 38172\nexport type CashuMintAnnouncement = typeof CashuMintAnnouncement\nexport const FedimintAnnouncement = 38173\nexport type FedimintAnnouncement = typeof FedimintAnnouncement\nexport const PeerToPeerOrderEvents = 38383\nexport type PeerToPeerOrderEvents = typeof PeerToPeerOrderEvents\nexport const GroupMetadata = 39000\nexport type GroupMetadata = typeof GroupMetadata\nexport const SimpleGroupAdmins = 39001\nexport type SimpleGroupAdmins = typeof SimpleGroupAdmins\nexport const SimpleGroupMembers = 39002\nexport type SimpleGroupMembers = typeof SimpleGroupMembers\nexport const SimpleGroupRoles = 39003\nexport type SimpleGroupRoles = typeof SimpleGroupRoles\nexport const SimpleGroupLiveKitParticipants = 39004\nexport type SimpleGroupLiveKitParticipants = typeof SimpleGroupLiveKitParticipants\nexport const StarterPacks = 39089\nexport type StarterPacks = typeof StarterPacks\nexport const MediaStarterPacks = 39092\nexport type MediaStarterPacks = typeof MediaStarterPacks\nexport const WebBookmarks = 39701\nexport type WebBookmarks = typeof WebBookmarks\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAuB;AACvB,mBAA2B;;;ACOpB,IAAM,iBAAiB,OAAO,UAAU;AAsB/C,IAAM,WAAW,CAAC,QAAiD,eAAe;AAE3E,SAAS,cAAiB,OAAsC;AACrE,MAAI,CAAC,SAAS,KAAK;AAAG,WAAO;AAC7B,MAAI,OAAO,MAAM,SAAS;AAAU,WAAO;AAC3C,MAAI,OAAO,MAAM,YAAY;AAAU,WAAO;AAC9C,MAAI,OAAO,MAAM,eA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AC9C,WAAO,KAAK;AAAA,MAAS;AAAA,MAAO,QAAQ;AAAA,MAAU;AAAA,MAAW,MACvD,KAAK,oBAAoB,SAAO;AAC9B,YAAI,KAAK,KAAK,CAAC,KAAK,MAAM,CAAC;AAAA,MAC7B,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,MAAM,OAAO,MAA6B;AACxC,UAAM,KAAK;AAAA,MAAS;AAAA,MAAU;AAAA,MAAM;AAAA,MAAW,MAC7C,KAAK,oBAAoB,SAAO;AAC9B,YAAI,KAAK,KAAK,CAAC,KAAK,QAAQ,GAAG,CAAC,KAAK,IAAI,CAAC;AAAA,MAC5C,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,MAAM,MAAM,MAA6B;AACvC,QAAI,CAAC,SAAS,IAAI;AAAG,YAAM,IAAI,MAAM,GAAG,+BAA+B;AACvE,UAAM,KAAK,SAAS,QAAQ,IAAI;AAAA,EAClC;AAAA,EAEA,MAAM,OAAO,eAAgD;AAC3D,UAAM,OAAO,cAAc,MAAM,GAAG,EAAE,IAAI,GAAG,MAAM,GAAG,EAAE,MAAM;AAC9D,WAAO,KAAK;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA,MACE,KAAK,oBAAoB,SAAO;AAC9B,YAAI,KAAK,KAAK,CAAC,KAAK,QAAQ,GAAG,CAAC,KAAK,IAAI,CAAC;AAAA,MAC5C,CAAC;AAAA,MACH,KAAK,UAAU,EAAE,KAAK,cAAc,CAAC;AAAA,IACvC;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import { sha256 } from '@noble/hashes/sha2.js'\nimport { bytesToHex } from '@noble/hashes/utils.js'\nimport type { EventTemplate } from './core.ts'\nimport type { Signer } from './signer.ts'\nimport { kinds } from './index.ts'\n\nexport type BlobDescriptor = {\n url: string\n sha256: string\n size: number\n type: string\n uploaded: number\n}\n\nexport type UploadType = Blob | File | Buffer\n\nexport type SignedEvent = EventTemplate & {\n id: string\n sig: string\n pubkey: string\n}\n\nexport type AuthEventOptions = {\n blobs?: string | string[]\n servers?: string | string[]\n message?: string\n expiration?: number\n}\n\nexport function isSha256(str: string): boolean {\n return /^[0-9a-f]{64}$/i.test(str)\n}\n\nexport function getBlobSize(blob: UploadType): number {\n if ((typeof File !== 'undefined' && blob instanceof File) || blob instanceof Blob) {\n return blob.size\n }\n return (blob as Buffer).length\n}\n\nexport function getBlobType(blob: UploadType): string | undefined {\n if ((typeof File !== 'undefined' && blob instanceof File) || blob instanceof Blob) {\n return blob.type || undefined\n }\n return undefined\n}\n\nexport async function computeBlobSha256(blob: UploadType): Promise<string> {\n let buffer: ArrayBuffer | Uint8Array\n\n if ((typeof File !== 'undefined' && blob instanceof File) || blob instanceof Blob) {\n buffer = await blob.arrayBuffer()\n } else {\n buffer = blob\n }\n\n const hash = sha256.create().update(new Uint8Array(buffer)).digest()\n return bytesToHex(hash)\n}\n\n// auth\n\nexport function encodeAuthorizationHeader(event: SignedEvent): string {\n const json = JSON.stringify(event)\n const bytes = new TextEncoder().encode(json)\n let binary = ''\n for (const byte of bytes) binary += String.fromCharCode(byte)\n return 'Nostr ' + btoa(binary).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/g, '')\n}\n\nexport function now(): number {\n return Math.floor(Date.now() / 1000)\n}\n\nexport function oneHour(): number {\n return now() + 3600\n}\n\nexport function getAuthTagValues(auth: SignedEvent, tagName: string): string[] {\n return auth.tags.filter(tag => tag[0] === tagName).map(tag => tag[1])\n}\n\nexport function getAuthExpiration(auth: SignedEvent): number | undefined {\n const expiration = auth.tags.find(tag => tag[0] === 'expiration')?.[1]\n if (!expiration) return undefined\n const timestamp = Number(expiration)\n if (!Number.isFinite(timestamp)) return undefined\n return timestamp\n}\n\nexport function isAuthExpired(auth: SignedEvent, timestamp: number = now()): boolean {\n const expiration = getAuthExpiration(auth)\n return expiration !== undefined && expiration <= timestamp\n}\n\nexport function normalizeServerTag(server: string | URL): string {\n if (server instanceof URL) return server.hostname.toLowerCase()\n if (URL.canParse(server)) return new URL(server).hostname.toLowerCase()\n return server.toLowerCase()\n}\n\nexport function areServersEqual(a: string | URL, b: string | URL): boolean {\n return normalizeServerTag(a) === normalizeServerTag(b)\n}\n\nfunction normalizeServers(servers: string | string[]): string[] {\n const values = Array.isArray(servers) ? servers : [servers]\n return [...new Set(values.map(normalizeServerTag))]\n}\n\nexport async function createAuthEvent(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n type: 'upload' | 'list' | 'delete' | 'get' | 'media',\n options?: AuthEventOptions,\n): Promise<SignedEvent> {\n const draft: EventTemplate = {\n created_at: now(),\n kind: kinds.BlobsAuth,\n content: options?.message ?? '',\n tags: [\n ['t', type],\n ['expiration', String(options?.expiration ?? oneHour())],\n ],\n }\n\n if (options?.blobs) {\n const blobList = Array.isArray(options.blobs) ? options.blobs : [options.blobs]\n const seen = new Set<string>()\n for (const blob of blobList) {\n const hash = typeof blob === 'string' ? blob : await computeBlobSha256(blob)\n if (!seen.has(hash)) {\n draft.tags.push(['x', hash])\n seen.add(hash)\n }\n }\n }\n\n if (options?.servers) {\n for (const server of normalizeServers(options.servers)) {\n draft.tags.push(['server', server])\n }\n }\n\n return signer(draft)\n}\n\nexport type UploadAuthOptions = Omit<AuthEventOptions, 'blobs'> & { type?: 'upload' | 'media' }\n\nexport async function createUploadAuth(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n blobs: string | string[],\n options?: UploadAuthOptions,\n): Promise<SignedEvent> {\n return createAuthEvent(signer, options?.type ?? 'upload', { message: 'Upload Blob', ...options, blobs })\n}\n\nexport type DownloadAuthOptions = Omit<AuthEventOptions, 'blobs' | 'servers'>\n\nexport async function createDownloadAuth(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n hash: string,\n options?: DownloadAuthOptions,\n): Promise<SignedEvent> {\n return createAuthEvent(signer, 'get', { message: 'Download Blob', ...options, blobs: [hash] })\n}\n\nexport type MirrorAuthOptions = Omit<AuthEventOptions, 'blobs'>\n\nexport async function createMirrorAuth(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n hash: string,\n options?: MirrorAuthOptions,\n): Promise<SignedEvent> {\n return createAuthEvent(signer, 'upload', { message: 'Mirror Blob', ...options, blobs: [hash] })\n}\n\nexport type ListAuthOptions = Omit<AuthEventOptions, 'blobs'>\n\nexport async function createListAuth(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n options?: ListAuthOptions,\n): Promise<SignedEvent> {\n return createAuthEvent(signer, 'list', { message: 'List Blobs', ...options })\n}\n\nexport type DeleteAuthOptions = Omit<AuthEventOptions, 'blobs'>\n\nexport async function createDeleteAuth(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n hash: string,\n options?: DeleteAuthOptions,\n): Promise<SignedEvent> {\n return createAuthEvent(signer, 'delete', { message: 'Delete Blob', ...options, blobs: [hash] })\n}\n\n// blossom URI\n\nexport type BlossomURI = {\n sha256: string\n ext: string\n servers: string[]\n authors: string[]\n size?: number\n}\n\nexport function parseBlossomURI(uri: string): BlossomURI {\n if (!uri.startsWith('blossom:')) throw new Error('Invalid blossom URI: missing blossom: scheme')\n const body = uri.slice('blossom:'.length)\n const queryIndex = body.indexOf('?')\n const path = queryIndex === -1 ? body : body.slice(0, queryIndex)\n const query = queryIndex === -1 ? '' : body.slice(queryIndex + 1)\n const dotIndex = path.indexOf('.')\n if (dotIndex === -1) throw new Error('Invalid blossom URI: missing file extension')\n const sha256 = path.slice(0, dotIndex)\n const ext = path.slice(dotIndex + 1)\n if (!isSha256(sha256)) throw new Error('Invalid blossom URI: invalid sha256 hash')\n if (!ext) throw new Error('Invalid blossom URI: empty file extension')\n const params = new URLSearchParams(query)\n const servers = params.getAll('xs')\n const authors = params.getAll('as')\n const szValue = params.get('sz')\n let size: number | undefined\n if (szValue !== null) {\n size = Number(szValue)\n if (!Number.isFinite(size) || size <= 0 || Math.floor(size) !== size) {\n throw new Error('Invalid blossom URI: sz must be a positive integer')\n }\n }\n return { sha256, ext, servers, authors, size }\n}\n\nexport function buildBlossomURI(options: BlossomURI): string {\n const params = new URLSearchParams()\n for (const server of options.servers) params.append('xs', server)\n for (const author of options.authors) params.append('as', author)\n if (options.size !== undefined) params.append('sz', String(options.size))\n const query = params.toString()\n return `blossom:${options.sha256}.${options.ext}${query ? '?' + query : ''}`\n}\n\nexport function blossomURIToURL(uri: string | BlossomURI): URL {\n const str = typeof uri === 'string' ? uri : buildBlossomURI(uri)\n return new URL(str)\n}\n\nexport function blossomURIFromURL(url: URL): BlossomURI {\n if (url.protocol !== 'blossom:') throw new Error('Invalid blossom URL: expected blossom: protocol')\n const path = url.pathname\n const dotIndex = path.indexOf('.')\n if (dotIndex === -1) throw new Error('Invalid blossom URL: missing file extension')\n const sha256 = path.slice(0, dotIndex)\n const ext = path.slice(dotIndex + 1)\n if (!isSha256(sha256)) throw new Error('Invalid blossom URL: invalid sha256 hash')\n if (!ext) throw new Error('Invalid blossom URL: empty file extension')\n const servers = url.searchParams.getAll('xs')\n const authors = url.searchParams.getAll('as')\n const szValue = url.searchParams.get('sz')\n let size: number | undefined\n if (szValue !== null) {\n size = Number(szValue)\n if (!Number.isFinite(size) || size <= 0 || Math.floor(size) !== size) {\n throw new Error('Invalid blossom URL: sz must be a positive integer')\n }\n }\n return { sha256, ext, servers, authors, size }\n}\n\nconst commonMimeExtensions: Record<string, string> = {\n 'application/json': '.json',\n 'application/pdf': '.pdf',\n 'application/vnd.android.package-archive': '.apk',\n 'application/vnd.sqlite3': '.sqlite3',\n 'application/xml': '.xml',\n 'audio/aac': '.aac',\n 'audio/flac': '.flac',\n 'audio/midi': '.midi',\n 'audio/mp3': '.mp3',\n 'audio/mpeg': '.mp3',\n 'audio/mp4': '.m4a',\n 'audio/ogg': '.ogg',\n 'audio/wav': '.wav',\n 'audio/webm': '.weba',\n 'audio/x-aiff': '.aiff',\n 'audio/x-m4a': '.m4a',\n 'image/avif': '.avif',\n 'image/gif': '.gif',\n 'image/jpeg': '.jpg',\n 'image/png': '.png',\n 'image/svg+xml': '.svg',\n 'image/webp': '.webp',\n 'text/css': '.css',\n 'text/csv': '.csv',\n 'text/html': '.html',\n 'text/javascript': '.js',\n 'text/markdown': '.md',\n 'text/plain': '.txt',\n 'text/xml': '.xml',\n 'video/mp2t': '.ts',\n 'video/mp4': '.mp4',\n 'video/ogg': '.ogv',\n 'video/quicktime': '.mov',\n 'video/webm': '.webm',\n 'video/x-matroska': '.mkv',\n}\n\nconst commonExtensionMimes: Record<string, string> = {\n '.aac': 'audio/aac',\n '.aiff': 'audio/x-aiff',\n '.apk': 'application/vnd.android.package-archive',\n '.avif': 'image/avif',\n '.css': 'text/css; charset=utf-8',\n '.csv': 'text/csv; charset=utf-8',\n '.flac': 'audio/flac',\n '.gif': 'image/gif',\n '.html': 'text/html; charset=utf-8',\n '.jpeg': 'image/jpeg',\n '.jpg': 'image/jpeg',\n '.js': 'text/javascript; charset=utf-8',\n '.json': 'application/json',\n '.m4a': 'audio/mp4',\n '.md': 'text/markdown; charset=utf-8',\n '.midi': 'audio/midi',\n '.mkv': 'video/x-matroska',\n '.mov': 'video/quicktime',\n '.mp3': 'audio/mpeg',\n '.mp4': 'video/mp4',\n '.oga': 'audio/ogg',\n '.ogg': 'audio/ogg',\n '.ogv': 'video/ogg',\n '.pdf': 'application/pdf',\n '.png': 'image/png',\n '.sqlite3': 'application/vnd.sqlite3',\n '.svg': 'image/svg+xml',\n '.ts': 'video/mp2t',\n '.txt': 'text/plain; charset=utf-8',\n '.wav': 'audio/wav',\n '.weba': 'audio/webm',\n '.webm': 'video/webm',\n '.webp': 'image/webp',\n '.xml': 'application/xml',\n}\n\nfunction normalizeMIMEType(mimetype: string): string {\n const idx = mimetype.indexOf(';')\n return idx >= 0 ? mimetype.slice(0, idx).trim().toLowerCase() : mimetype.trim().toLowerCase()\n}\n\nexport function getExtension(mimetype: string): string {\n const normalized = normalizeMIMEType(mimetype)\n if (!normalized) return ''\n return commonMimeExtensions[normalized] ?? ''\n}\n\nexport function getMIMEType(ext: string): string {\n if (!ext) return ''\n ext = ext.trim().toLowerCase()\n if (ext[0] !== '.') ext = '.' + ext\n return commonExtensionMimes[ext] ?? ''\n}\n\nexport function getServersFromServerListEvent(event: { tags: string[][] }): URL[] {\n const servers: URL[] = []\n for (const tag of event.tags) {\n if (tag[0] === 'server' && tag[1]) {\n try {\n const url = new URL(tag[1])\n url.pathname = '/'\n servers.push(url)\n } catch {}\n }\n }\n return servers\n}\n\nexport function getHashFromURL(url: string | URL): string | null {\n try {\n if (typeof url === 'string') url = new URL(url)\n const hashes = Array.from(url.pathname.matchAll(/[0-9a-f]{64}/gi))\n return hashes.length > 0 ? hashes[hashes.length - 1][0] : null\n } catch (_err) {\n return null\n }\n}\n\nexport type UploadOptions = {\n signal?: AbortSignal\n auth?: SignedEvent | boolean\n timeout?: number\n onAuth?: (server: string, sha256: string) => Promise<SignedEvent>\n}\n\nexport async function uploadBlob(server: string, blob: Blob | File, opts?: UploadOptions): Promise<BlobDescriptor> {\n const url = new URL('/upload', server).toString()\n const sha256 = await computeBlobSha256(blob)\n\n const headers: Record<string, string> = {\n 'X-SHA-256': sha256,\n 'Content-Type': getBlobType(blob) || 'application/octet-stream',\n }\n\n if (opts?.auth) {\n const authEvent = typeof opts.auth === 'boolean' ? await opts.onAuth?.(server, sha256) : opts.auth\n if (authEvent) headers['Authorization'] = encodeAuthorizationHeader(authEvent)\n }\n\n const res = await fetch(url, {\n method: 'PUT',\n body: blob,\n headers,\n signal: opts?.signal,\n })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`upload returned error (${res.status}): ${reason}`)\n }\n\n return res.json()\n}\n\nexport type DownloadOptions = {\n signal?: AbortSignal\n auth?: SignedEvent | boolean\n timeout?: number\n onAuth?: (server: string, sha256: string) => Promise<SignedEvent>\n}\n\nexport async function downloadBlob(server: string, hash: string, opts?: DownloadOptions): Promise<Response> {\n const url = new URL('/' + hash, server).toString()\n const headers: Record<string, string> = {}\n\n if (opts?.auth) {\n const authEvent = typeof opts.auth === 'boolean' ? await opts.onAuth?.(server, hash) : opts.auth\n if (authEvent) headers['Authorization'] = encodeAuthorizationHeader(authEvent)\n }\n\n const res = await fetch(url, { headers, signal: opts?.signal })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`${hash} download error (${res.status}): ${reason}`)\n }\n\n return res\n}\n\nexport type ListOptions = {\n signal?: AbortSignal\n auth?: SignedEvent | boolean\n timeout?: number\n onAuth?: (server: string) => Promise<SignedEvent>\n cursor?: string\n limit?: number\n since?: number\n until?: number\n}\n\nexport async function listBlobs(server: string, pubkey: string, opts?: ListOptions): Promise<BlobDescriptor[]> {\n const url = new URL('/list/' + pubkey, server)\n if (opts?.cursor) url.searchParams.append('cursor', opts.cursor)\n if (opts?.limit) url.searchParams.append('limit', String(opts.limit))\n if (opts?.since) url.searchParams.append('since', String(opts.since))\n if (opts?.until) url.searchParams.append('until', String(opts.until))\n\n const headers: Record<string, string> = {}\n\n if (opts?.auth) {\n const authEvent = typeof opts.auth === 'boolean' ? await opts.onAuth?.(server) : opts.auth\n if (authEvent) headers['Authorization'] = encodeAuthorizationHeader(authEvent)\n }\n\n const res = await fetch(url.toString(), { headers, signal: opts?.signal })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`list error (${res.status}): ${reason}`)\n }\n\n return res.json()\n}\n\nexport async function* iterateBlobs(\n server: string,\n pubkey: string,\n opts?: ListOptions,\n): AsyncGenerator<BlobDescriptor[], void, void> {\n let cursor = opts?.cursor\n while (true) {\n const page = await listBlobs(server, pubkey, { ...opts, cursor })\n if (page.length === 0) return\n yield page\n if (opts?.limit && page.length < opts.limit) return\n cursor = page[page.length - 1]?.sha256\n if (!cursor) return\n }\n}\n\nexport type DeleteOptions = {\n signal?: AbortSignal\n auth?: SignedEvent | boolean\n timeout?: number\n onAuth?: (server: string, sha256: string) => Promise<SignedEvent>\n}\n\nexport async function deleteBlob(server: string, hash: string, opts?: DeleteOptions): Promise<boolean> {\n const url = new URL('/' + hash, server).toString()\n const headers: Record<string, string> = {}\n\n if (opts?.auth) {\n const authEvent = typeof opts.auth === 'boolean' ? await opts.onAuth?.(server, hash) : opts.auth\n if (authEvent) headers['Authorization'] = encodeAuthorizationHeader(authEvent)\n }\n\n const res = await fetch(url, { method: 'DELETE', headers, signal: opts?.signal })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`delete error (${res.status}): ${reason}`)\n }\n\n return res.ok\n}\n\nexport type HasBlobOptions = {\n signal?: AbortSignal\n timeout?: number\n}\n\nexport async function hasBlob(server: string, hash: string, opts?: HasBlobOptions): Promise<boolean> {\n const url = new URL('/' + hash, server)\n try {\n const res = await fetch(url.toString(), { method: 'HEAD', signal: opts?.signal })\n return res.status !== 404\n } catch {\n return false\n }\n}\n\nexport type MirrorOptions = {\n signal?: AbortSignal\n auth?: SignedEvent | boolean\n timeout?: number\n onAuth?: (server: string, sha256: string) => Promise<SignedEvent>\n}\n\nexport async function mirrorBlob(server: string, blob: BlobDescriptor, opts?: MirrorOptions): Promise<BlobDescriptor> {\n const url = new URL('/mirror', server).toString()\n\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n 'X-SHA-256': blob.sha256,\n }\n\n if (opts?.auth) {\n const authEvent = typeof opts.auth === 'boolean' ? await opts.onAuth?.(server, blob.sha256) : opts.auth\n if (authEvent) headers['Authorization'] = encodeAuthorizationHeader(authEvent)\n }\n\n const res = await fetch(url, {\n method: 'PUT',\n body: JSON.stringify({ url: blob.url }),\n headers,\n signal: opts?.signal,\n })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`mirror error (${res.status}): ${reason}`)\n }\n\n return res.json()\n}\n\nexport type ReportOptions = {\n signal?: AbortSignal\n timeout?: number\n onError?: (server: string, error: Error) => void\n}\n\nexport async function reportBlobs(\n servers: Iterable<string>,\n report: SignedEvent,\n opts?: ReportOptions,\n): Promise<Map<string, boolean>> {\n if (report.kind !== 1984 || !report.tags.some(tag => tag[0] === 'x' && !!tag[1])) {\n throw new Error('Invalid blob report event: must be kind 1984 with x tag')\n }\n\n const results = new Map<string, boolean>()\n const body = JSON.stringify(report)\n\n for (const server of servers) {\n try {\n const res = await fetch(new URL('/report', server).toString(), {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body,\n signal: opts?.signal,\n })\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`report error (${res.status}): ${reason}`)\n }\n results.set(server, true)\n } catch (error) {\n if (opts?.onError && error instanceof Error) opts.onError(server, error)\n }\n }\n\n return results\n}\n\nexport class BlossomClient {\n private mediaserver: string\n\n constructor(\n mediaserver: string,\n private signer: Signer,\n ) {\n if (!mediaserver.startsWith('http')) {\n mediaserver = 'https://' + mediaserver\n }\n this.mediaserver = mediaserver.replace(/\\/$/, '') + '/'\n }\n\n getMediaServer(): string {\n return this.mediaserver\n }\n\n private async authorizationHeader(modify?: (event: EventTemplate) => void): Promise<string> {\n const event = {\n created_at: now(),\n kind: kinds.BlobsAuth,\n content: 'blossom stuff',\n tags: [['expiration', String(now() + 60)]],\n }\n\n modify?.(event)\n\n try {\n const signedEvent = await this.signer.signEvent(event)\n const json = JSON.stringify(signedEvent)\n return 'Nostr ' + btoa(json)\n } catch {\n return ''\n }\n }\n\n private async httpCall(\n method: string,\n url: string,\n contentType?: string,\n addAuthorization?: () => Promise<string>,\n body?: File | Blob | string,\n ): Promise<any> {\n const headers: Record<string, string> = {}\n\n if (contentType) headers['Content-Type'] = contentType\n if (addAuthorization) {\n const auth = await addAuthorization()\n if (auth) headers['Authorization'] = auth\n }\n\n const res = await fetch(this.mediaserver + url, { method, headers, body })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`${url} returned error (${res.status}): ${reason}`)\n }\n\n if (res.headers.get('content-type')?.includes('application/json')) {\n return res.json()\n }\n\n return res\n }\n\n async uploadBlob(file: Blob | File, contentType?: string): Promise<BlobDescriptor> {\n const hash = bytesToHex(sha256(new Uint8Array(await file.arrayBuffer())))\n const actualContentType = contentType || getBlobType(file) || 'application/octet-stream'\n\n return this.httpCall(\n 'PUT',\n 'upload',\n actualContentType,\n () =>\n this.authorizationHeader(evt => {\n evt.tags.push(['t', 'upload'], ['x', hash])\n }),\n file,\n )\n }\n\n async download(hash: string): Promise<ArrayBuffer> {\n const authHeader = await this.authorizationHeader(evt => {\n evt.tags.push(['t', 'get'], ['x', hash])\n })\n\n const res = await fetch(this.mediaserver + hash, {\n method: 'GET',\n headers: { Authorization: authHeader },\n })\n\n if (res.status >= 300) {\n throw new Error(`${hash} not present on ${this.mediaserver}: ${res.status}`)\n }\n\n return res.arrayBuffer()\n }\n\n async downloadAsBlob(hash: string): Promise<Blob> {\n return new Blob([await this.download(hash)])\n }\n\n async list(): Promise<BlobDescriptor[]> {\n const pubkey = await this.signer.getPublicKey()\n return this.httpCall('GET', `list/${pubkey}`, undefined, () =>\n this.authorizationHeader(evt => {\n evt.tags.push(['t', 'list'])\n }),\n )\n }\n\n async delete(hash: string): Promise<void> {\n await this.httpCall('DELETE', hash, undefined, () =>\n this.authorizationHeader(evt => {\n evt.tags.push(['t', 'delete'], ['x', hash])\n }),\n )\n }\n\n async check(hash: string): Promise<void> {\n if (!isSha256(hash)) throw new Error(`${hash} is not valid 32-byte hex`)\n await this.httpCall('HEAD', hash)\n }\n\n async mirror(remoteBlobURL: string): Promise<BlobDescriptor> {\n const hash = remoteBlobURL.split('/').pop()?.split('.')[0] || ''\n return this.httpCall(\n 'PUT',\n 'mirror',\n 'application/json',\n () =>\n this.authorizationHeader(evt => {\n evt.tags.push(['t', 'upload'], ['x', hash])\n }),\n JSON.stringify({ url: remoteBlobURL }),\n )\n }\n}\n", "export interface Nostr {\n generateSecretKey(): Uint8Array\n getPublicKey(secretKey: Uint8Array): string\n finalizeEvent(event: EventTemplate, secretKey: Uint8Array): VerifiedEvent\n verifyEvent(event: Event): event is VerifiedEvent\n}\n\n/** Designates a verified event signature. */\nexport const verifiedSymbol = Symbol('verified')\n\nexport type NostrEvent = {\n kind: number\n tags: string[][]\n content: string\n created_at: number\n pubkey: string\n id: string\n sig: string\n [verifiedSymbol]?: boolean\n}\n\nexport type Event = NostrEvent\nexport type EventTemplate = Pick<Event, 'kind' | 'tags' | 'content' | 'created_at'>\nexport type UnsignedEvent = Pick<Event, 'kind' | 'tags' | 'content' | 'created_at' | 'pubkey'>\n\n/** An event whose signature has been verified. */\nexport interface VerifiedEvent extends Event {\n [verifiedSymbol]: true\n}\n\nconst isRecord = (obj: unknown): obj is Record<string, unknown> => obj instanceof Object\n\nexport function validateEvent<T>(event: T): event is T & UnsignedEvent {\n if (!isRecord(event)) return false\n if (typeof event.kind !== 'number') return false\n if (typeof event.content !== 'string') return false\n if (typeof event.created_at !== 'number') return false\n if (typeof event.pubkey !== 'string') return false\n if (!event.pubkey.match(/^[a-f0-9]{64}$/)) return false\n\n if (!Array.isArray(event.tags)) return false\n for (let i = 0; i < event.tags.length; i++) {\n let tag = event.tags[i]\n if (!Array.isArray(tag)) return false\n for (let j = 0; j < tag.length; j++) {\n if (typeof tag[j] !== 'string') return false\n }\n }\n\n return true\n}\n\n/**\n * Sort events in reverse-chronological order by the `created_at` timestamp,\n * and then by the event `id` (lexicographically) in case of ties.\n * This mutates the array.\n */\nexport function sortEvents(events: Event[]): Event[] {\n return events.sort((a: NostrEvent, b: NostrEvent): number => {\n if (a.created_at !== b.created_at) {\n return b.created_at - a.created_at\n }\n return a.id.localeCompare(b.id)\n })\n}\n", "import { NostrEvent, validateEvent } from './pure.ts'\n\n/** Events are **regular**, which means they're all expected to be stored by relays. */\nexport function isRegularKind(kind: number): boolean {\n return kind < 10000 && kind !== 0 && kind !== 3\n}\n\n/** Events are **replaceable**, which means that, for each combination of `pubkey` and `kind`, only the latest event is expected to (SHOULD) be stored by relays, older versions are expected to be discarded. */\nexport function isReplaceableKind(kind: number): boolean {\n return kind === 0 || kind === 3 || (10000 <= kind && kind < 20000)\n}\n\n/** Events are **ephemeral**, which means they are not expected to be stored by relays. */\nexport function isEphemeralKind(kind: number): boolean {\n return 20000 <= kind && kind < 30000\n}\n\n/** Events are **addressable**, which means that, for each combination of `pubkey`, `kind` and the `d` tag, only the latest event is expected to be stored by relays, older versions are expected to be discarded. */\nexport function isAddressableKind(kind: number): boolean {\n return 30000 <= kind && kind < 40000\n}\n\n/** Classification of the event kind. */\nexport type KindClassification = 'regular' | 'replaceable' | 'ephemeral' | 'parameterized' | 'unknown'\n\n/** Determine the classification of this kind of event if known, or `unknown`. */\nexport function classifyKind(kind: number): KindClassification {\n if (isRegularKind(kind)) return 'regular'\n if (isReplaceableKind(kind)) return 'replaceable'\n if (isEphemeralKind(kind)) return 'ephemeral'\n if (isAddressableKind(kind)) return 'parameterized'\n return 'unknown'\n}\n\nexport function isKind<T extends number>(event: unknown, kind: T | Array<T>): event is NostrEvent & { kind: T } {\n const kindAsArray: number[] = kind instanceof Array ? kind : [kind]\n return (validateEvent(event) && kindAsArray.includes(event.kind)) || false\n}\n\nexport const Metadata = 0\nexport type Metadata = typeof Metadata\nexport const ShortTextNote = 1\nexport type ShortTextNote = typeof ShortTextNote\nexport const RecommendRelay = 2\nexport type RecommendRelay = typeof RecommendRelay\nexport const Contacts = 3\nexport type Contacts = typeof Contacts\nexport const EncryptedDirectMessage = 4\nexport type EncryptedDirectMessage = typeof EncryptedDirectMessage\nexport const EventDeletion = 5\nexport type EventDeletion = typeof EventDeletion\nexport const Repost = 6\nexport type Repost = typeof Repost\nexport const Reaction = 7\nexport type Reaction = typeof Reaction\nexport const BadgeAward = 8\nexport type BadgeAward = typeof BadgeAward\nexport const ChatMessage = 9\nexport type ChatMessage = typeof ChatMessage\nexport const SimpleGroupThreadedReply = 10\nexport type SimpleGroupThreadedReply = typeof SimpleGroupThreadedReply\nexport const ForumThread = 11\nexport type ForumThread = typeof ForumThread\nexport const SimpleGroupReply = 12\nexport type SimpleGroupReply = typeof SimpleGroupReply\nexport const Seal = 13\nexport type Seal = typeof Seal\nexport const PrivateDirectMessage = 14\nexport type PrivateDirectMessage = typeof PrivateDirectMessage\nexport const FileMessage = 15\nexport type FileMessage = typeof FileMessage\nexport const GenericRepost = 16\nexport type GenericRepost = typeof GenericRepost\nexport const ReactionToWebsite = 17\nexport type ReactionToWebsite = typeof ReactionToWebsite\nexport const Photo = 20\nexport type Photo = typeof Photo\nexport const NormalVideo = 21\nexport type NormalVideo = typeof NormalVideo\nexport const ShortVideo = 22\nexport type ShortVideo = typeof ShortVideo\nexport const PublicMessage = 24\nexport type PublicMessage = typeof PublicMessage\nexport const ChannelCreation = 40\nexport type ChannelCreation = typeof ChannelCreation\nexport const ChannelMetadata = 41\nexport type ChannelMetadata = typeof ChannelMetadata\nexport const ChannelMessage = 42\nexport type ChannelMessage = typeof ChannelMessage\nexport const ChannelHideMessage = 43\nexport type ChannelHideMessage = typeof ChannelHideMessage\nexport const ChannelMuteUser = 44\nexport type ChannelMuteUser = typeof ChannelMuteUser\nexport const PodcastEpisode = 54\nexport type PodcastEpisode = typeof PodcastEpisode\nexport const Chess = 64\nexport type Chess = typeof Chess\nexport const MergeRequests = 818\nexport type MergeRequests = typeof MergeRequests\nexport const PollResponse = 1018\nexport type PollResponse = typeof PollResponse\nexport const Bid = 1021\nexport type Bid = typeof Bid\nexport const BidConfirmation = 1022\nexport type BidConfirmation = typeof BidConfirmation\nexport const OpenTimestamps = 1040\nexport type OpenTimestamps = typeof OpenTimestamps\nexport const GiftWrap = 1059\nexport type GiftWrap = typeof GiftWrap\nexport const FileMetadata = 1063\nexport type FileMetadata = typeof FileMetadata\nexport const Poll = 1068\nexport type Poll = typeof Poll\nexport const Comment = 1111\nexport type Comment = typeof Comment\nexport const Voice = 1222\nexport type Voice = typeof Voice\nexport const Scroll = 1227\nexport type Scroll = typeof Scroll\nexport const VoiceComment = 1244\nexport type VoiceComment = typeof VoiceComment\nexport const LiveChatMessage = 1311\nexport type LiveChatMessage = typeof LiveChatMessage\nexport const CodeSnippet = 1337\nexport type CodeSnippet = typeof CodeSnippet\nexport const Patch = 1617\nexport type Patch = typeof Patch\nexport const GitPullRequest = 1618\nexport type GitPullRequest = typeof GitPullRequest\nexport const GitPullRequestUpdate = 1619\nexport type GitPullRequestUpdate = typeof GitPullRequestUpdate\nexport const Issue = 1621\nexport type Issue = typeof Issue\nexport const Reply = 1622\nexport type Reply = typeof Reply\nexport const StatusOpen = 1630\nexport type StatusOpen = typeof StatusOpen\nexport const StatusApplied = 1631\nexport type StatusApplied = typeof StatusApplied\nexport const StatusClosed = 1632\nexport type StatusClosed = typeof StatusClosed\nexport const StatusDraft = 1633\nexport type StatusDraft = typeof StatusDraft\nexport const ProblemTracker = 1971\nexport type ProblemTracker = typeof ProblemTracker\nexport const Report = 1984\nexport type Report = typeof Report\nexport const Reporting = 1984\nexport type Reporting = typeof Reporting\nexport const Label = 1985\nexport type Label = typeof Label\nexport const RelayReviews = 1986\nexport type RelayReviews = typeof RelayReviews\nexport const AIEmbeddings = 1987\nexport type AIEmbeddings = typeof AIEmbeddings\nexport const Torrent = 2003\nexport type Torrent = typeof Torrent\nexport const TorrentComment = 2004\nexport type TorrentComment = typeof TorrentComment\nexport const CoinjoinPool = 2022\nexport type CoinjoinPool = typeof CoinjoinPool\nexport const DecoupledKeyClientAnnouncement = 4454\nexport type DecoupledKeyClientAnnouncement = typeof DecoupledKeyClientAnnouncement\nexport const DecoupledEncryptionKeyDistribution = 4455\nexport type DecoupledEncryptionKeyDistribution = typeof DecoupledEncryptionKeyDistribution\nexport const CommunityPostApproval = 4550\nexport type CommunityPostApproval = typeof CommunityPostApproval\nexport const JobRequest = 5999\nexport type JobRequest = typeof JobRequest\nexport const JobResult = 6999\nexport type JobResult = typeof JobResult\nexport const JobFeedback = 7000\nexport type JobFeedback = typeof JobFeedback\nexport const ReservedCashuWalletTokens = 7374\nexport type ReservedCashuWalletTokens = typeof ReservedCashuWalletTokens\nexport const CashuWalletTokens = 7375\nexport type CashuWalletTokens = typeof CashuWalletTokens\nexport const CashuWalletHistory = 7376\nexport type CashuWalletHistory = typeof CashuWalletHistory\nexport const GeocacheLog = 7516\nexport type GeocacheLog = typeof GeocacheLog\nexport const GeocacheProofOfFind = 7517\nexport type GeocacheProofOfFind = typeof GeocacheProofOfFind\nexport const SimpleGroupPutUser = 9000\nexport type SimpleGroupPutUser = typeof SimpleGroupPutUser\nexport const SimpleGroupRemoveUser = 9001\nexport type SimpleGroupRemoveUser = typeof SimpleGroupRemoveUser\nexport const SimpleGroupEditMetadata = 9002\nexport type SimpleGroupEditMetadata = typeof SimpleGroupEditMetadata\nexport const SimpleGroupDeleteEvent = 9005\nexport type SimpleGroupDeleteEvent = typeof SimpleGroupDeleteEvent\nexport const SimpleGroupCreateGroup = 9007\nexport type SimpleGroupCreateGroup = typeof SimpleGroupCreateGroup\nexport const SimpleGroupDeleteGroup = 9008\nexport type SimpleGroupDeleteGroup = typeof SimpleGroupDeleteGroup\nexport const SimpleGroupCreateInvite = 9009\nexport type SimpleGroupCreateInvite = typeof SimpleGroupCreateInvite\nexport const SimpleGroupJoinRequest = 9021\nexport type SimpleGroupJoinRequest = typeof SimpleGroupJoinRequest\nexport const SimpleGroupLeaveRequest = 9022\nexport type SimpleGroupLeaveRequest = typeof SimpleGroupLeaveRequest\nexport const ZapGoal = 9041\nexport type ZapGoal = typeof ZapGoal\nexport const NutZap = 9321\nexport type NutZap = typeof NutZap\nexport const TidalLogin = 9467\nexport type TidalLogin = typeof TidalLogin\nexport const ZapRequest = 9734\nexport type ZapRequest = typeof ZapRequest\nexport const Zap = 9735\nexport type Zap = typeof Zap\nexport const Highlights = 9802\nexport type Highlights = typeof Highlights\nexport const Mutelist = 10000\nexport type Mutelist = typeof Mutelist\nexport const Pinlist = 10001\nexport type Pinlist = typeof Pinlist\nexport const RelayList = 10002\nexport type RelayList = typeof RelayList\nexport const BookmarkList = 10003\nexport type BookmarkList = typeof BookmarkList\nexport const CommunitiesList = 10004\nexport type CommunitiesList = typeof CommunitiesList\nexport const PublicChatsList = 10005\nexport type PublicChatsList = typeof PublicChatsList\nexport const BlockedRelaysList = 10006\nexport type BlockedRelaysList = typeof BlockedRelaysList\nexport const SearchRelaysList = 10007\nexport type SearchRelaysList = typeof SearchRelaysList\nexport const SimpleGroupList = 10009\nexport type SimpleGroupList = typeof SimpleGroupList\nexport const FavoriteRelays = 10012\nexport type FavoriteRelays = typeof FavoriteRelays\nexport const PrivateEventRelayList = 10013\nexport type PrivateEventRelayList = typeof PrivateEventRelayList\nexport const InterestsList = 10015\nexport type InterestsList = typeof InterestsList\nexport const NutZapInfo = 10019\nexport type NutZapInfo = typeof NutZapInfo\nexport const MediaFollows = 10020\nexport type MediaFollows = typeof MediaFollows\nexport const UserEmojiList = 10030\nexport type UserEmojiList = typeof UserEmojiList\nexport const DecoupledKeyAnnouncement = 10044\nexport type DecoupledKeyAnnouncement = typeof DecoupledKeyAnnouncement\nexport const DirectMessageRelaysList = 10050\nexport type DirectMessageRelaysList = typeof DirectMessageRelaysList\nexport const FavoritePodcasts = 10054\nexport type FavoritePodcasts = typeof FavoritePodcasts\nexport const BlossomServerList = 10063\nexport type BlossomServerList = typeof BlossomServerList\nexport const FileServerPreference = 10096\nexport type FileServerPreference = typeof FileServerPreference\nexport const GoodWikiAuthorList = 10101\nexport type GoodWikiAuthorList = typeof GoodWikiAuthorList\nexport const GoodWikiRelayList = 10102\nexport type GoodWikiRelayList = typeof GoodWikiRelayList\nexport const PodcastMetadata = 10154\nexport type PodcastMetadata = typeof PodcastMetadata\nexport const AuthoredPodcasts = 10164\nexport type AuthoredPodcasts = typeof AuthoredPodcasts\nexport const RelayMonitorAnnouncement = 10166\nexport type RelayMonitorAnnouncement = typeof RelayMonitorAnnouncement\nexport const RoomPresence = 10312\nexport type RoomPresence = typeof RoomPresence\nexport const UserGraspList = 10317\nexport type UserGraspList = typeof UserGraspList\nexport const ProxyAnnouncement = 10377\nexport type ProxyAnnouncement = typeof ProxyAnnouncement\nexport const TransportMethodAnnouncement = 11111\nexport type TransportMethodAnnouncement = typeof TransportMethodAnnouncement\nexport const NWCWalletInfo = 13194\nexport type NWCWalletInfo = typeof NWCWalletInfo\nexport const NsiteRoot = 15128\nexport type NsiteRoot = typeof NsiteRoot\nexport const CashuWalletEvent = 17375\nexport type CashuWalletEvent = typeof CashuWalletEvent\nexport const LightningPubRPC = 21000\nexport type LightningPubRPC = typeof LightningPubRPC\nexport const ClientAuth = 22242\nexport type ClientAuth = typeof ClientAuth\nexport const NWCWalletRequest = 23194\nexport type NWCWalletRequest = typeof NWCWalletRequest\nexport const NWCWalletResponse = 23195\nexport type NWCWalletResponse = typeof NWCWalletResponse\nexport const NostrConnect = 24133\nexport type NostrConnect = typeof NostrConnect\nexport const BlobsAuth = 24242\nexport type BlobsAuth = typeof BlobsAuth\nexport const HTTPAuth = 27235\nexport type HTTPAuth = typeof HTTPAuth\nexport const Followsets = 30000\nexport type Followsets = typeof Followsets\nexport const Genericlists = 30001\nexport type Genericlists = typeof Genericlists\nexport const Relaysets = 30002\nexport type Relaysets = typeof Relaysets\nexport const Bookmarksets = 30003\nexport type Bookmarksets = typeof Bookmarksets\nexport const Curationsets = 30004\nexport type Curationsets = typeof Curationsets\nexport const CuratedVideoSets = 30005\nexport type CuratedVideoSets = typeof CuratedVideoSets\nexport const MuteSets = 30007\nexport type MuteSets = typeof MuteSets\nexport const ProfileBadges = 30008\nexport type ProfileBadges = typeof ProfileBadges\nexport const BadgeDefinition = 30009\nexport type BadgeDefinition = typeof BadgeDefinition\nexport const Interestsets = 30015\nexport type Interestsets = typeof Interestsets\nexport const CreateOrUpdateStall = 30017\nexport type CreateOrUpdateStall = typeof CreateOrUpdateStall\nexport const CreateOrUpdateProduct = 30018\nexport type CreateOrUpdateProduct = typeof CreateOrUpdateProduct\nexport const MarketplaceUI = 30019\nexport type MarketplaceUI = typeof MarketplaceUI\nexport const ProductSoldAsAuction = 30020\nexport type ProductSoldAsAuction = typeof ProductSoldAsAuction\nexport const LongFormArticle = 30023\nexport type LongFormArticle = typeof LongFormArticle\nexport const DraftLong = 30024\nexport type DraftLong = typeof DraftLong\nexport const Emojisets = 30030\nexport type Emojisets = typeof Emojisets\nexport const ModularArticleHeader = 30040\nexport type ModularArticleHeader = typeof ModularArticleHeader\nexport const ModularArticleContent = 30041\nexport type ModularArticleContent = typeof ModularArticleContent\nexport const ReleaseArtifactSets = 30063\nexport type ReleaseArtifactSets = typeof ReleaseArtifactSets\nexport const Application = 30078\nexport type Application = typeof Application\nexport const RelayDiscovery = 30166\nexport type RelayDiscovery = typeof RelayDiscovery\nexport const AppCurationSet = 30267\nexport type AppCurationSet = typeof AppCurationSet\nexport const LiveEvent = 30311\nexport type LiveEvent = typeof LiveEvent\nexport const InteractiveRoom = 30312\nexport type InteractiveRoom = typeof InteractiveRoom\nexport const ConferenceEvent = 30313\nexport type ConferenceEvent = typeof ConferenceEvent\nexport const UserStatuses = 30315\nexport type UserStatuses = typeof UserStatuses\nexport const SlideSet = 30388\nexport type SlideSet = typeof SlideSet\nexport const ClassifiedListing = 30402\nexport type ClassifiedListing = typeof ClassifiedListing\nexport const DraftClassifiedListing = 30403\nexport type DraftClassifiedListing = typeof DraftClassifiedListing\nexport const RepositoryAnnouncement = 30617\nexport type RepositoryAnnouncement = typeof RepositoryAnnouncement\nexport const RepositoryState = 30618\nexport type RepositoryState = typeof RepositoryState\nexport const WikiArticle = 30818\nexport type WikiArticle = typeof WikiArticle\nexport const Redirects = 30819\nexport type Redirects = typeof Redirects\nexport const DraftEvent = 31234\nexport type DraftEvent = typeof DraftEvent\nexport const LinkSet = 31388\nexport type LinkSet = typeof LinkSet\nexport const Feed = 31890\nexport type Feed = typeof Feed\nexport const Date = 31922\nexport type Date = typeof Date\nexport const Time = 31923\nexport type Time = typeof Time\nexport const Calendar = 31924\nexport type Calendar = typeof Calendar\nexport const CalendarEventRSVP = 31925\nexport type CalendarEventRSVP = typeof CalendarEventRSVP\nexport const RelayReview = 31987\nexport type RelayReview = typeof RelayReview\nexport const Handlerrecommendation = 31989\nexport type Handlerrecommendation = typeof Handlerrecommendation\nexport const Handlerinformation = 31990\nexport type Handlerinformation = typeof Handlerinformation\nexport const SoftwareApplication = 32267\nexport type SoftwareApplication = typeof SoftwareApplication\nexport const LegacyNsiteFile = 34128\nexport type LegacyNsiteFile = typeof LegacyNsiteFile\nexport const VideoViewEvent = 34237\nexport type VideoViewEvent = typeof VideoViewEvent\nexport const CommunityDefinition = 34550\nexport type CommunityDefinition = typeof CommunityDefinition\nexport const NsiteNamed = 35128\nexport type NsiteNamed = typeof NsiteNamed\nexport const GeocacheListing = 37515\nexport type GeocacheListing = typeof GeocacheListing\nexport const GeocacheLogEntry = 37516\nexport type GeocacheLogEntry = typeof GeocacheLogEntry\nexport const CashuMintAnnouncement = 38172\nexport type CashuMintAnnouncement = typeof CashuMintAnnouncement\nexport const FedimintAnnouncement = 38173\nexport type FedimintAnnouncement = typeof FedimintAnnouncement\nexport const PeerToPeerOrderEvents = 38383\nexport type PeerToPeerOrderEvents = typeof PeerToPeerOrderEvents\nexport const GroupMetadata = 39000\nexport type GroupMetadata = typeof GroupMetadata\nexport const SimpleGroupAdmins = 39001\nexport type SimpleGroupAdmins = typeof SimpleGroupAdmins\nexport const SimpleGroupMembers = 39002\nexport type SimpleGroupMembers = typeof SimpleGroupMembers\nexport const SimpleGroupRoles = 39003\nexport type SimpleGroupRoles = typeof SimpleGroupRoles\nexport const SimpleGroupLiveKitParticipants = 39004\nexport type SimpleGroupLiveKitParticipants = typeof SimpleGroupLiveKitParticipants\nexport const StarterPacks = 39089\nexport type StarterPacks = typeof StarterPacks\nexport const MediaStarterPacks = 39092\nexport type MediaStarterPacks = typeof MediaStarterPacks\nexport const WebBookmarks = 39701\nexport type WebBookmarks = typeof WebBookmarks\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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AA,MACA,MACE,KAAK,oBAAoB,SAAO;AAC9B,YAAI,KAAK,KAAK,CAAC,KAAK,QAAQ,GAAG,CAAC,KAAK,IAAI,CAAC;AAAA,MAC5C,CAAC;AAAA,MACH,KAAK,UAAU,EAAE,KAAK,cAAc,CAAC;AAAA,IACvC;AAAA,EACF;AACF;",
6
6
  "names": ["Date", "Date", "sha256"]
7
7
  }
package/lib/esm/nipb0.js CHANGED
@@ -752,7 +752,10 @@ function getHashFromURL(url) {
752
752
  async function uploadBlob(server, blob, opts) {
753
753
  const url = new URL("/upload", server).toString();
754
754
  const sha2562 = await computeBlobSha256(blob);
755
- const headers = { "X-SHA-256": sha2562 };
755
+ const headers = {
756
+ "X-SHA-256": sha2562,
757
+ "Content-Type": getBlobType(blob) || "application/octet-stream"
758
+ };
756
759
  if (opts?.auth) {
757
760
  const authEvent = typeof opts.auth === "boolean" ? await opts.onAuth?.(server, sha2562) : opts.auth;
758
761
  if (authEvent)
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../nipb0.ts", "../../core.ts", "../../kinds.ts"],
4
- "sourcesContent": ["import { sha256 } from '@noble/hashes/sha2.js'\nimport { bytesToHex } from '@noble/hashes/utils.js'\nimport type { EventTemplate } from './core.ts'\nimport type { Signer } from './signer.ts'\nimport { kinds } from './index.ts'\n\nexport type BlobDescriptor = {\n url: string\n sha256: string\n size: number\n type: string\n uploaded: number\n}\n\nexport type UploadType = Blob | File | Buffer\n\nexport type SignedEvent = EventTemplate & {\n id: string\n sig: string\n pubkey: string\n}\n\nexport type AuthEventOptions = {\n blobs?: string | string[]\n servers?: string | string[]\n message?: string\n expiration?: number\n}\n\nexport function isSha256(str: string): boolean {\n return /^[0-9a-f]{64}$/i.test(str)\n}\n\nexport function getBlobSize(blob: UploadType): number {\n if ((typeof File !== 'undefined' && blob instanceof File) || blob instanceof Blob) {\n return blob.size\n }\n return (blob as Buffer).length\n}\n\nexport function getBlobType(blob: UploadType): string | undefined {\n if ((typeof File !== 'undefined' && blob instanceof File) || blob instanceof Blob) {\n return blob.type || undefined\n }\n return undefined\n}\n\nexport async function computeBlobSha256(blob: UploadType): Promise<string> {\n let buffer: ArrayBuffer | Uint8Array\n\n if ((typeof File !== 'undefined' && blob instanceof File) || blob instanceof Blob) {\n buffer = await blob.arrayBuffer()\n } else {\n buffer = blob\n }\n\n const hash = sha256.create().update(new Uint8Array(buffer)).digest()\n return bytesToHex(hash)\n}\n\n// auth\n\nexport function encodeAuthorizationHeader(event: SignedEvent): string {\n const json = JSON.stringify(event)\n const bytes = new TextEncoder().encode(json)\n let binary = ''\n for (const byte of bytes) binary += String.fromCharCode(byte)\n return 'Nostr ' + btoa(binary).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/g, '')\n}\n\nexport function now(): number {\n return Math.floor(Date.now() / 1000)\n}\n\nexport function oneHour(): number {\n return now() + 3600\n}\n\nexport function getAuthTagValues(auth: SignedEvent, tagName: string): string[] {\n return auth.tags.filter(tag => tag[0] === tagName).map(tag => tag[1])\n}\n\nexport function getAuthExpiration(auth: SignedEvent): number | undefined {\n const expiration = auth.tags.find(tag => tag[0] === 'expiration')?.[1]\n if (!expiration) return undefined\n const timestamp = Number(expiration)\n if (!Number.isFinite(timestamp)) return undefined\n return timestamp\n}\n\nexport function isAuthExpired(auth: SignedEvent, timestamp: number = now()): boolean {\n const expiration = getAuthExpiration(auth)\n return expiration !== undefined && expiration <= timestamp\n}\n\nexport function normalizeServerTag(server: string | URL): string {\n if (server instanceof URL) return server.hostname.toLowerCase()\n if (URL.canParse(server)) return new URL(server).hostname.toLowerCase()\n return server.toLowerCase()\n}\n\nexport function areServersEqual(a: string | URL, b: string | URL): boolean {\n return normalizeServerTag(a) === normalizeServerTag(b)\n}\n\nfunction normalizeServers(servers: string | string[]): string[] {\n const values = Array.isArray(servers) ? servers : [servers]\n return [...new Set(values.map(normalizeServerTag))]\n}\n\nexport async function createAuthEvent(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n type: 'upload' | 'list' | 'delete' | 'get' | 'media',\n options?: AuthEventOptions,\n): Promise<SignedEvent> {\n const draft: EventTemplate = {\n created_at: now(),\n kind: kinds.BlobsAuth,\n content: options?.message ?? '',\n tags: [\n ['t', type],\n ['expiration', String(options?.expiration ?? oneHour())],\n ],\n }\n\n if (options?.blobs) {\n const blobList = Array.isArray(options.blobs) ? options.blobs : [options.blobs]\n const seen = new Set<string>()\n for (const blob of blobList) {\n const hash = typeof blob === 'string' ? blob : await computeBlobSha256(blob)\n if (!seen.has(hash)) {\n draft.tags.push(['x', hash])\n seen.add(hash)\n }\n }\n }\n\n if (options?.servers) {\n for (const server of normalizeServers(options.servers)) {\n draft.tags.push(['server', server])\n }\n }\n\n return signer(draft)\n}\n\nexport type UploadAuthOptions = Omit<AuthEventOptions, 'blobs'> & { type?: 'upload' | 'media' }\n\nexport async function createUploadAuth(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n blobs: string | string[],\n options?: UploadAuthOptions,\n): Promise<SignedEvent> {\n return createAuthEvent(signer, options?.type ?? 'upload', { message: 'Upload Blob', ...options, blobs })\n}\n\nexport type DownloadAuthOptions = Omit<AuthEventOptions, 'blobs' | 'servers'>\n\nexport async function createDownloadAuth(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n hash: string,\n options?: DownloadAuthOptions,\n): Promise<SignedEvent> {\n return createAuthEvent(signer, 'get', { message: 'Download Blob', ...options, blobs: [hash] })\n}\n\nexport type MirrorAuthOptions = Omit<AuthEventOptions, 'blobs'>\n\nexport async function createMirrorAuth(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n hash: string,\n options?: MirrorAuthOptions,\n): Promise<SignedEvent> {\n return createAuthEvent(signer, 'upload', { message: 'Mirror Blob', ...options, blobs: [hash] })\n}\n\nexport type ListAuthOptions = Omit<AuthEventOptions, 'blobs'>\n\nexport async function createListAuth(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n options?: ListAuthOptions,\n): Promise<SignedEvent> {\n return createAuthEvent(signer, 'list', { message: 'List Blobs', ...options })\n}\n\nexport type DeleteAuthOptions = Omit<AuthEventOptions, 'blobs'>\n\nexport async function createDeleteAuth(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n hash: string,\n options?: DeleteAuthOptions,\n): Promise<SignedEvent> {\n return createAuthEvent(signer, 'delete', { message: 'Delete Blob', ...options, blobs: [hash] })\n}\n\n// blossom URI\n\nexport type BlossomURI = {\n sha256: string\n ext: string\n servers: string[]\n authors: string[]\n size?: number\n}\n\nexport function parseBlossomURI(uri: string): BlossomURI {\n if (!uri.startsWith('blossom:')) throw new Error('Invalid blossom URI: missing blossom: scheme')\n const body = uri.slice('blossom:'.length)\n const queryIndex = body.indexOf('?')\n const path = queryIndex === -1 ? body : body.slice(0, queryIndex)\n const query = queryIndex === -1 ? '' : body.slice(queryIndex + 1)\n const dotIndex = path.indexOf('.')\n if (dotIndex === -1) throw new Error('Invalid blossom URI: missing file extension')\n const sha256 = path.slice(0, dotIndex)\n const ext = path.slice(dotIndex + 1)\n if (!isSha256(sha256)) throw new Error('Invalid blossom URI: invalid sha256 hash')\n if (!ext) throw new Error('Invalid blossom URI: empty file extension')\n const params = new URLSearchParams(query)\n const servers = params.getAll('xs')\n const authors = params.getAll('as')\n const szValue = params.get('sz')\n let size: number | undefined\n if (szValue !== null) {\n size = Number(szValue)\n if (!Number.isFinite(size) || size <= 0 || Math.floor(size) !== size) {\n throw new Error('Invalid blossom URI: sz must be a positive integer')\n }\n }\n return { sha256, ext, servers, authors, size }\n}\n\nexport function buildBlossomURI(options: BlossomURI): string {\n const params = new URLSearchParams()\n for (const server of options.servers) params.append('xs', server)\n for (const author of options.authors) params.append('as', author)\n if (options.size !== undefined) params.append('sz', String(options.size))\n const query = params.toString()\n return `blossom:${options.sha256}.${options.ext}${query ? '?' + query : ''}`\n}\n\nexport function blossomURIToURL(uri: string | BlossomURI): URL {\n const str = typeof uri === 'string' ? uri : buildBlossomURI(uri)\n return new URL(str)\n}\n\nexport function blossomURIFromURL(url: URL): BlossomURI {\n if (url.protocol !== 'blossom:') throw new Error('Invalid blossom URL: expected blossom: protocol')\n const path = url.pathname\n const dotIndex = path.indexOf('.')\n if (dotIndex === -1) throw new Error('Invalid blossom URL: missing file extension')\n const sha256 = path.slice(0, dotIndex)\n const ext = path.slice(dotIndex + 1)\n if (!isSha256(sha256)) throw new Error('Invalid blossom URL: invalid sha256 hash')\n if (!ext) throw new Error('Invalid blossom URL: empty file extension')\n const servers = url.searchParams.getAll('xs')\n const authors = url.searchParams.getAll('as')\n const szValue = url.searchParams.get('sz')\n let size: number | undefined\n if (szValue !== null) {\n size = Number(szValue)\n if (!Number.isFinite(size) || size <= 0 || Math.floor(size) !== size) {\n throw new Error('Invalid blossom URL: sz must be a positive integer')\n }\n }\n return { sha256, ext, servers, authors, size }\n}\n\nconst commonMimeExtensions: Record<string, string> = {\n 'application/json': '.json',\n 'application/pdf': '.pdf',\n 'application/vnd.android.package-archive': '.apk',\n 'application/vnd.sqlite3': '.sqlite3',\n 'application/xml': '.xml',\n 'audio/aac': '.aac',\n 'audio/flac': '.flac',\n 'audio/midi': '.midi',\n 'audio/mp3': '.mp3',\n 'audio/mpeg': '.mp3',\n 'audio/mp4': '.m4a',\n 'audio/ogg': '.ogg',\n 'audio/wav': '.wav',\n 'audio/webm': '.weba',\n 'audio/x-aiff': '.aiff',\n 'audio/x-m4a': '.m4a',\n 'image/avif': '.avif',\n 'image/gif': '.gif',\n 'image/jpeg': '.jpg',\n 'image/png': '.png',\n 'image/svg+xml': '.svg',\n 'image/webp': '.webp',\n 'text/css': '.css',\n 'text/csv': '.csv',\n 'text/html': '.html',\n 'text/javascript': '.js',\n 'text/markdown': '.md',\n 'text/plain': '.txt',\n 'text/xml': '.xml',\n 'video/mp2t': '.ts',\n 'video/mp4': '.mp4',\n 'video/ogg': '.ogv',\n 'video/quicktime': '.mov',\n 'video/webm': '.webm',\n 'video/x-matroska': '.mkv',\n}\n\nconst commonExtensionMimes: Record<string, string> = {\n '.aac': 'audio/aac',\n '.aiff': 'audio/x-aiff',\n '.apk': 'application/vnd.android.package-archive',\n '.avif': 'image/avif',\n '.css': 'text/css; charset=utf-8',\n '.csv': 'text/csv; charset=utf-8',\n '.flac': 'audio/flac',\n '.gif': 'image/gif',\n '.html': 'text/html; charset=utf-8',\n '.jpeg': 'image/jpeg',\n '.jpg': 'image/jpeg',\n '.js': 'text/javascript; charset=utf-8',\n '.json': 'application/json',\n '.m4a': 'audio/mp4',\n '.md': 'text/markdown; charset=utf-8',\n '.midi': 'audio/midi',\n '.mkv': 'video/x-matroska',\n '.mov': 'video/quicktime',\n '.mp3': 'audio/mpeg',\n '.mp4': 'video/mp4',\n '.oga': 'audio/ogg',\n '.ogg': 'audio/ogg',\n '.ogv': 'video/ogg',\n '.pdf': 'application/pdf',\n '.png': 'image/png',\n '.sqlite3': 'application/vnd.sqlite3',\n '.svg': 'image/svg+xml',\n '.ts': 'video/mp2t',\n '.txt': 'text/plain; charset=utf-8',\n '.wav': 'audio/wav',\n '.weba': 'audio/webm',\n '.webm': 'video/webm',\n '.webp': 'image/webp',\n '.xml': 'application/xml',\n}\n\nfunction normalizeMIMEType(mimetype: string): string {\n const idx = mimetype.indexOf(';')\n return idx >= 0 ? mimetype.slice(0, idx).trim().toLowerCase() : mimetype.trim().toLowerCase()\n}\n\nexport function getExtension(mimetype: string): string {\n const normalized = normalizeMIMEType(mimetype)\n if (!normalized) return ''\n return commonMimeExtensions[normalized] ?? ''\n}\n\nexport function getMIMEType(ext: string): string {\n if (!ext) return ''\n ext = ext.trim().toLowerCase()\n if (ext[0] !== '.') ext = '.' + ext\n return commonExtensionMimes[ext] ?? ''\n}\n\nexport function getServersFromServerListEvent(event: { tags: string[][] }): URL[] {\n const servers: URL[] = []\n for (const tag of event.tags) {\n if (tag[0] === 'server' && tag[1]) {\n try {\n const url = new URL(tag[1])\n url.pathname = '/'\n servers.push(url)\n } catch {}\n }\n }\n return servers\n}\n\nexport function getHashFromURL(url: string | URL): string | null {\n try {\n if (typeof url === 'string') url = new URL(url)\n const hashes = Array.from(url.pathname.matchAll(/[0-9a-f]{64}/gi))\n return hashes.length > 0 ? hashes[hashes.length - 1][0] : null\n } catch (_err) {\n return null\n }\n}\n\nexport type UploadOptions = {\n signal?: AbortSignal\n auth?: SignedEvent | boolean\n timeout?: number\n onAuth?: (server: string, sha256: string) => Promise<SignedEvent>\n}\n\nexport async function uploadBlob(server: string, blob: Blob | File, opts?: UploadOptions): Promise<BlobDescriptor> {\n const url = new URL('/upload', server).toString()\n const sha256 = await computeBlobSha256(blob)\n\n const headers: Record<string, string> = { 'X-SHA-256': sha256 }\n\n if (opts?.auth) {\n const authEvent = typeof opts.auth === 'boolean' ? await opts.onAuth?.(server, sha256) : opts.auth\n if (authEvent) headers['Authorization'] = encodeAuthorizationHeader(authEvent)\n }\n\n const res = await fetch(url, {\n method: 'PUT',\n body: blob,\n headers,\n signal: opts?.signal,\n })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`upload returned error (${res.status}): ${reason}`)\n }\n\n return res.json()\n}\n\nexport type DownloadOptions = {\n signal?: AbortSignal\n auth?: SignedEvent | boolean\n timeout?: number\n onAuth?: (server: string, sha256: string) => Promise<SignedEvent>\n}\n\nexport async function downloadBlob(server: string, hash: string, opts?: DownloadOptions): Promise<Response> {\n const url = new URL('/' + hash, server).toString()\n const headers: Record<string, string> = {}\n\n if (opts?.auth) {\n const authEvent = typeof opts.auth === 'boolean' ? await opts.onAuth?.(server, hash) : opts.auth\n if (authEvent) headers['Authorization'] = encodeAuthorizationHeader(authEvent)\n }\n\n const res = await fetch(url, { headers, signal: opts?.signal })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`${hash} download error (${res.status}): ${reason}`)\n }\n\n return res\n}\n\nexport type ListOptions = {\n signal?: AbortSignal\n auth?: SignedEvent | boolean\n timeout?: number\n onAuth?: (server: string) => Promise<SignedEvent>\n cursor?: string\n limit?: number\n since?: number\n until?: number\n}\n\nexport async function listBlobs(server: string, pubkey: string, opts?: ListOptions): Promise<BlobDescriptor[]> {\n const url = new URL('/list/' + pubkey, server)\n if (opts?.cursor) url.searchParams.append('cursor', opts.cursor)\n if (opts?.limit) url.searchParams.append('limit', String(opts.limit))\n if (opts?.since) url.searchParams.append('since', String(opts.since))\n if (opts?.until) url.searchParams.append('until', String(opts.until))\n\n const headers: Record<string, string> = {}\n\n if (opts?.auth) {\n const authEvent = typeof opts.auth === 'boolean' ? await opts.onAuth?.(server) : opts.auth\n if (authEvent) headers['Authorization'] = encodeAuthorizationHeader(authEvent)\n }\n\n const res = await fetch(url.toString(), { headers, signal: opts?.signal })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`list error (${res.status}): ${reason}`)\n }\n\n return res.json()\n}\n\nexport async function* iterateBlobs(\n server: string,\n pubkey: string,\n opts?: ListOptions,\n): AsyncGenerator<BlobDescriptor[], void, void> {\n let cursor = opts?.cursor\n while (true) {\n const page = await listBlobs(server, pubkey, { ...opts, cursor })\n if (page.length === 0) return\n yield page\n if (opts?.limit && page.length < opts.limit) return\n cursor = page[page.length - 1]?.sha256\n if (!cursor) return\n }\n}\n\nexport type DeleteOptions = {\n signal?: AbortSignal\n auth?: SignedEvent | boolean\n timeout?: number\n onAuth?: (server: string, sha256: string) => Promise<SignedEvent>\n}\n\nexport async function deleteBlob(server: string, hash: string, opts?: DeleteOptions): Promise<boolean> {\n const url = new URL('/' + hash, server).toString()\n const headers: Record<string, string> = {}\n\n if (opts?.auth) {\n const authEvent = typeof opts.auth === 'boolean' ? await opts.onAuth?.(server, hash) : opts.auth\n if (authEvent) headers['Authorization'] = encodeAuthorizationHeader(authEvent)\n }\n\n const res = await fetch(url, { method: 'DELETE', headers, signal: opts?.signal })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`delete error (${res.status}): ${reason}`)\n }\n\n return res.ok\n}\n\nexport type HasBlobOptions = {\n signal?: AbortSignal\n timeout?: number\n}\n\nexport async function hasBlob(server: string, hash: string, opts?: HasBlobOptions): Promise<boolean> {\n const url = new URL('/' + hash, server)\n try {\n const res = await fetch(url.toString(), { method: 'HEAD', signal: opts?.signal })\n return res.status !== 404\n } catch {\n return false\n }\n}\n\nexport type MirrorOptions = {\n signal?: AbortSignal\n auth?: SignedEvent | boolean\n timeout?: number\n onAuth?: (server: string, sha256: string) => Promise<SignedEvent>\n}\n\nexport async function mirrorBlob(server: string, blob: BlobDescriptor, opts?: MirrorOptions): Promise<BlobDescriptor> {\n const url = new URL('/mirror', server).toString()\n\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n 'X-SHA-256': blob.sha256,\n }\n\n if (opts?.auth) {\n const authEvent = typeof opts.auth === 'boolean' ? await opts.onAuth?.(server, blob.sha256) : opts.auth\n if (authEvent) headers['Authorization'] = encodeAuthorizationHeader(authEvent)\n }\n\n const res = await fetch(url, {\n method: 'PUT',\n body: JSON.stringify({ url: blob.url }),\n headers,\n signal: opts?.signal,\n })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`mirror error (${res.status}): ${reason}`)\n }\n\n return res.json()\n}\n\nexport type ReportOptions = {\n signal?: AbortSignal\n timeout?: number\n onError?: (server: string, error: Error) => void\n}\n\nexport async function reportBlobs(\n servers: Iterable<string>,\n report: SignedEvent,\n opts?: ReportOptions,\n): Promise<Map<string, boolean>> {\n if (report.kind !== 1984 || !report.tags.some(tag => tag[0] === 'x' && !!tag[1])) {\n throw new Error('Invalid blob report event: must be kind 1984 with x tag')\n }\n\n const results = new Map<string, boolean>()\n const body = JSON.stringify(report)\n\n for (const server of servers) {\n try {\n const res = await fetch(new URL('/report', server).toString(), {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body,\n signal: opts?.signal,\n })\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`report error (${res.status}): ${reason}`)\n }\n results.set(server, true)\n } catch (error) {\n if (opts?.onError && error instanceof Error) opts.onError(server, error)\n }\n }\n\n return results\n}\n\nexport class BlossomClient {\n private mediaserver: string\n\n constructor(\n mediaserver: string,\n private signer: Signer,\n ) {\n if (!mediaserver.startsWith('http')) {\n mediaserver = 'https://' + mediaserver\n }\n this.mediaserver = mediaserver.replace(/\\/$/, '') + '/'\n }\n\n getMediaServer(): string {\n return this.mediaserver\n }\n\n private async authorizationHeader(modify?: (event: EventTemplate) => void): Promise<string> {\n const event = {\n created_at: now(),\n kind: kinds.BlobsAuth,\n content: 'blossom stuff',\n tags: [['expiration', String(now() + 60)]],\n }\n\n modify?.(event)\n\n try {\n const signedEvent = await this.signer.signEvent(event)\n const json = JSON.stringify(signedEvent)\n return 'Nostr ' + btoa(json)\n } catch {\n return ''\n }\n }\n\n private async httpCall(\n method: string,\n url: string,\n contentType?: string,\n addAuthorization?: () => Promise<string>,\n body?: File | Blob | string,\n ): Promise<any> {\n const headers: Record<string, string> = {}\n\n if (contentType) headers['Content-Type'] = contentType\n if (addAuthorization) {\n const auth = await addAuthorization()\n if (auth) headers['Authorization'] = auth\n }\n\n const res = await fetch(this.mediaserver + url, { method, headers, body })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`${url} returned error (${res.status}): ${reason}`)\n }\n\n if (res.headers.get('content-type')?.includes('application/json')) {\n return res.json()\n }\n\n return res\n }\n\n async uploadBlob(file: Blob | File, contentType?: string): Promise<BlobDescriptor> {\n const hash = bytesToHex(sha256(new Uint8Array(await file.arrayBuffer())))\n const actualContentType = contentType || getBlobType(file) || 'application/octet-stream'\n\n return this.httpCall(\n 'PUT',\n 'upload',\n actualContentType,\n () =>\n this.authorizationHeader(evt => {\n evt.tags.push(['t', 'upload'], ['x', hash])\n }),\n file,\n )\n }\n\n async download(hash: string): Promise<ArrayBuffer> {\n const authHeader = await this.authorizationHeader(evt => {\n evt.tags.push(['t', 'get'], ['x', hash])\n })\n\n const res = await fetch(this.mediaserver + hash, {\n method: 'GET',\n headers: { Authorization: authHeader },\n })\n\n if (res.status >= 300) {\n throw new Error(`${hash} not present on ${this.mediaserver}: ${res.status}`)\n }\n\n return res.arrayBuffer()\n }\n\n async downloadAsBlob(hash: string): Promise<Blob> {\n return new Blob([await this.download(hash)])\n }\n\n async list(): Promise<BlobDescriptor[]> {\n const pubkey = await this.signer.getPublicKey()\n return this.httpCall('GET', `list/${pubkey}`, undefined, () =>\n this.authorizationHeader(evt => {\n evt.tags.push(['t', 'list'])\n }),\n )\n }\n\n async delete(hash: string): Promise<void> {\n await this.httpCall('DELETE', hash, undefined, () =>\n this.authorizationHeader(evt => {\n evt.tags.push(['t', 'delete'], ['x', hash])\n }),\n )\n }\n\n async check(hash: string): Promise<void> {\n if (!isSha256(hash)) throw new Error(`${hash} is not valid 32-byte hex`)\n await this.httpCall('HEAD', hash)\n }\n\n async mirror(remoteBlobURL: string): Promise<BlobDescriptor> {\n const hash = remoteBlobURL.split('/').pop()?.split('.')[0] || ''\n return this.httpCall(\n 'PUT',\n 'mirror',\n 'application/json',\n () =>\n this.authorizationHeader(evt => {\n evt.tags.push(['t', 'upload'], ['x', hash])\n }),\n JSON.stringify({ url: remoteBlobURL }),\n )\n }\n}\n", "export interface Nostr {\n generateSecretKey(): Uint8Array\n getPublicKey(secretKey: Uint8Array): string\n finalizeEvent(event: EventTemplate, secretKey: Uint8Array): VerifiedEvent\n verifyEvent(event: Event): event is VerifiedEvent\n}\n\n/** Designates a verified event signature. */\nexport const verifiedSymbol = Symbol('verified')\n\nexport type NostrEvent = {\n kind: number\n tags: string[][]\n content: string\n created_at: number\n pubkey: string\n id: string\n sig: string\n [verifiedSymbol]?: boolean\n}\n\nexport type Event = NostrEvent\nexport type EventTemplate = Pick<Event, 'kind' | 'tags' | 'content' | 'created_at'>\nexport type UnsignedEvent = Pick<Event, 'kind' | 'tags' | 'content' | 'created_at' | 'pubkey'>\n\n/** An event whose signature has been verified. */\nexport interface VerifiedEvent extends Event {\n [verifiedSymbol]: true\n}\n\nconst isRecord = (obj: unknown): obj is Record<string, unknown> => obj instanceof Object\n\nexport function validateEvent<T>(event: T): event is T & UnsignedEvent {\n if (!isRecord(event)) return false\n if (typeof event.kind !== 'number') return false\n if (typeof event.content !== 'string') return false\n if (typeof event.created_at !== 'number') return false\n if (typeof event.pubkey !== 'string') return false\n if (!event.pubkey.match(/^[a-f0-9]{64}$/)) return false\n\n if (!Array.isArray(event.tags)) return false\n for (let i = 0; i < event.tags.length; i++) {\n let tag = event.tags[i]\n if (!Array.isArray(tag)) return false\n for (let j = 0; j < tag.length; j++) {\n if (typeof tag[j] !== 'string') return false\n }\n }\n\n return true\n}\n\n/**\n * Sort events in reverse-chronological order by the `created_at` timestamp,\n * and then by the event `id` (lexicographically) in case of ties.\n * This mutates the array.\n */\nexport function sortEvents(events: Event[]): Event[] {\n return events.sort((a: NostrEvent, b: NostrEvent): number => {\n if (a.created_at !== b.created_at) {\n return b.created_at - a.created_at\n }\n return a.id.localeCompare(b.id)\n })\n}\n", "import { NostrEvent, validateEvent } from './pure.ts'\n\n/** Events are **regular**, which means they're all expected to be stored by relays. */\nexport function isRegularKind(kind: number): boolean {\n return kind < 10000 && kind !== 0 && kind !== 3\n}\n\n/** Events are **replaceable**, which means that, for each combination of `pubkey` and `kind`, only the latest event is expected to (SHOULD) be stored by relays, older versions are expected to be discarded. */\nexport function isReplaceableKind(kind: number): boolean {\n return kind === 0 || kind === 3 || (10000 <= kind && kind < 20000)\n}\n\n/** Events are **ephemeral**, which means they are not expected to be stored by relays. */\nexport function isEphemeralKind(kind: number): boolean {\n return 20000 <= kind && kind < 30000\n}\n\n/** Events are **addressable**, which means that, for each combination of `pubkey`, `kind` and the `d` tag, only the latest event is expected to be stored by relays, older versions are expected to be discarded. */\nexport function isAddressableKind(kind: number): boolean {\n return 30000 <= kind && kind < 40000\n}\n\n/** Classification of the event kind. */\nexport type KindClassification = 'regular' | 'replaceable' | 'ephemeral' | 'parameterized' | 'unknown'\n\n/** Determine the classification of this kind of event if known, or `unknown`. */\nexport function classifyKind(kind: number): KindClassification {\n if (isRegularKind(kind)) return 'regular'\n if (isReplaceableKind(kind)) return 'replaceable'\n if (isEphemeralKind(kind)) return 'ephemeral'\n if (isAddressableKind(kind)) return 'parameterized'\n return 'unknown'\n}\n\nexport function isKind<T extends number>(event: unknown, kind: T | Array<T>): event is NostrEvent & { kind: T } {\n const kindAsArray: number[] = kind instanceof Array ? kind : [kind]\n return (validateEvent(event) && kindAsArray.includes(event.kind)) || false\n}\n\nexport const Metadata = 0\nexport type Metadata = typeof Metadata\nexport const ShortTextNote = 1\nexport type ShortTextNote = typeof ShortTextNote\nexport const RecommendRelay = 2\nexport type RecommendRelay = typeof RecommendRelay\nexport const Contacts = 3\nexport type Contacts = typeof Contacts\nexport const EncryptedDirectMessage = 4\nexport type EncryptedDirectMessage = typeof EncryptedDirectMessage\nexport const EventDeletion = 5\nexport type EventDeletion = typeof EventDeletion\nexport const Repost = 6\nexport type Repost = typeof Repost\nexport const Reaction = 7\nexport type Reaction = typeof Reaction\nexport const BadgeAward = 8\nexport type BadgeAward = typeof BadgeAward\nexport const ChatMessage = 9\nexport type ChatMessage = typeof ChatMessage\nexport const SimpleGroupThreadedReply = 10\nexport type SimpleGroupThreadedReply = typeof SimpleGroupThreadedReply\nexport const ForumThread = 11\nexport type ForumThread = typeof ForumThread\nexport const SimpleGroupReply = 12\nexport type SimpleGroupReply = typeof SimpleGroupReply\nexport const Seal = 13\nexport type Seal = typeof Seal\nexport const PrivateDirectMessage = 14\nexport type PrivateDirectMessage = typeof PrivateDirectMessage\nexport const FileMessage = 15\nexport type FileMessage = typeof FileMessage\nexport const GenericRepost = 16\nexport type GenericRepost = typeof GenericRepost\nexport const ReactionToWebsite = 17\nexport type ReactionToWebsite = typeof ReactionToWebsite\nexport const Photo = 20\nexport type Photo = typeof Photo\nexport const NormalVideo = 21\nexport type NormalVideo = typeof NormalVideo\nexport const ShortVideo = 22\nexport type ShortVideo = typeof ShortVideo\nexport const PublicMessage = 24\nexport type PublicMessage = typeof PublicMessage\nexport const ChannelCreation = 40\nexport type ChannelCreation = typeof ChannelCreation\nexport const ChannelMetadata = 41\nexport type ChannelMetadata = typeof ChannelMetadata\nexport const ChannelMessage = 42\nexport type ChannelMessage = typeof ChannelMessage\nexport const ChannelHideMessage = 43\nexport type ChannelHideMessage = typeof ChannelHideMessage\nexport const ChannelMuteUser = 44\nexport type ChannelMuteUser = typeof ChannelMuteUser\nexport const PodcastEpisode = 54\nexport type PodcastEpisode = typeof PodcastEpisode\nexport const Chess = 64\nexport type Chess = typeof Chess\nexport const MergeRequests = 818\nexport type MergeRequests = typeof MergeRequests\nexport const PollResponse = 1018\nexport type PollResponse = typeof PollResponse\nexport const Bid = 1021\nexport type Bid = typeof Bid\nexport const BidConfirmation = 1022\nexport type BidConfirmation = typeof BidConfirmation\nexport const OpenTimestamps = 1040\nexport type OpenTimestamps = typeof OpenTimestamps\nexport const GiftWrap = 1059\nexport type GiftWrap = typeof GiftWrap\nexport const FileMetadata = 1063\nexport type FileMetadata = typeof FileMetadata\nexport const Poll = 1068\nexport type Poll = typeof Poll\nexport const Comment = 1111\nexport type Comment = typeof Comment\nexport const Voice = 1222\nexport type Voice = typeof Voice\nexport const Scroll = 1227\nexport type Scroll = typeof Scroll\nexport const VoiceComment = 1244\nexport type VoiceComment = typeof VoiceComment\nexport const LiveChatMessage = 1311\nexport type LiveChatMessage = typeof LiveChatMessage\nexport const CodeSnippet = 1337\nexport type CodeSnippet = typeof CodeSnippet\nexport const Patch = 1617\nexport type Patch = typeof Patch\nexport const GitPullRequest = 1618\nexport type GitPullRequest = typeof GitPullRequest\nexport const GitPullRequestUpdate = 1619\nexport type GitPullRequestUpdate = typeof GitPullRequestUpdate\nexport const Issue = 1621\nexport type Issue = typeof Issue\nexport const Reply = 1622\nexport type Reply = typeof Reply\nexport const StatusOpen = 1630\nexport type StatusOpen = typeof StatusOpen\nexport const StatusApplied = 1631\nexport type StatusApplied = typeof StatusApplied\nexport const StatusClosed = 1632\nexport type StatusClosed = typeof StatusClosed\nexport const StatusDraft = 1633\nexport type StatusDraft = typeof StatusDraft\nexport const ProblemTracker = 1971\nexport type ProblemTracker = typeof ProblemTracker\nexport const Report = 1984\nexport type Report = typeof Report\nexport const Reporting = 1984\nexport type Reporting = typeof Reporting\nexport const Label = 1985\nexport type Label = typeof Label\nexport const RelayReviews = 1986\nexport type RelayReviews = typeof RelayReviews\nexport const AIEmbeddings = 1987\nexport type AIEmbeddings = typeof AIEmbeddings\nexport const Torrent = 2003\nexport type Torrent = typeof Torrent\nexport const TorrentComment = 2004\nexport type TorrentComment = typeof TorrentComment\nexport const CoinjoinPool = 2022\nexport type CoinjoinPool = typeof CoinjoinPool\nexport const DecoupledKeyClientAnnouncement = 4454\nexport type DecoupledKeyClientAnnouncement = typeof DecoupledKeyClientAnnouncement\nexport const DecoupledEncryptionKeyDistribution = 4455\nexport type DecoupledEncryptionKeyDistribution = typeof DecoupledEncryptionKeyDistribution\nexport const CommunityPostApproval = 4550\nexport type CommunityPostApproval = typeof CommunityPostApproval\nexport const JobRequest = 5999\nexport type JobRequest = typeof JobRequest\nexport const JobResult = 6999\nexport type JobResult = typeof JobResult\nexport const JobFeedback = 7000\nexport type JobFeedback = typeof JobFeedback\nexport const ReservedCashuWalletTokens = 7374\nexport type ReservedCashuWalletTokens = typeof ReservedCashuWalletTokens\nexport const CashuWalletTokens = 7375\nexport type CashuWalletTokens = typeof CashuWalletTokens\nexport const CashuWalletHistory = 7376\nexport type CashuWalletHistory = typeof CashuWalletHistory\nexport const GeocacheLog = 7516\nexport type GeocacheLog = typeof GeocacheLog\nexport const GeocacheProofOfFind = 7517\nexport type GeocacheProofOfFind = typeof GeocacheProofOfFind\nexport const SimpleGroupPutUser = 9000\nexport type SimpleGroupPutUser = typeof SimpleGroupPutUser\nexport const SimpleGroupRemoveUser = 9001\nexport type SimpleGroupRemoveUser = typeof SimpleGroupRemoveUser\nexport const SimpleGroupEditMetadata = 9002\nexport type SimpleGroupEditMetadata = typeof SimpleGroupEditMetadata\nexport const SimpleGroupDeleteEvent = 9005\nexport type SimpleGroupDeleteEvent = typeof SimpleGroupDeleteEvent\nexport const SimpleGroupCreateGroup = 9007\nexport type SimpleGroupCreateGroup = typeof SimpleGroupCreateGroup\nexport const SimpleGroupDeleteGroup = 9008\nexport type SimpleGroupDeleteGroup = typeof SimpleGroupDeleteGroup\nexport const SimpleGroupCreateInvite = 9009\nexport type SimpleGroupCreateInvite = typeof SimpleGroupCreateInvite\nexport const SimpleGroupJoinRequest = 9021\nexport type SimpleGroupJoinRequest = typeof SimpleGroupJoinRequest\nexport const SimpleGroupLeaveRequest = 9022\nexport type SimpleGroupLeaveRequest = typeof SimpleGroupLeaveRequest\nexport const ZapGoal = 9041\nexport type ZapGoal = typeof ZapGoal\nexport const NutZap = 9321\nexport type NutZap = typeof NutZap\nexport const TidalLogin = 9467\nexport type TidalLogin = typeof TidalLogin\nexport const ZapRequest = 9734\nexport type ZapRequest = typeof ZapRequest\nexport const Zap = 9735\nexport type Zap = typeof Zap\nexport const Highlights = 9802\nexport type Highlights = typeof Highlights\nexport const Mutelist = 10000\nexport type Mutelist = typeof Mutelist\nexport const Pinlist = 10001\nexport type Pinlist = typeof Pinlist\nexport const RelayList = 10002\nexport type RelayList = typeof RelayList\nexport const BookmarkList = 10003\nexport type BookmarkList = typeof BookmarkList\nexport const CommunitiesList = 10004\nexport type CommunitiesList = typeof CommunitiesList\nexport const PublicChatsList = 10005\nexport type PublicChatsList = typeof PublicChatsList\nexport const BlockedRelaysList = 10006\nexport type BlockedRelaysList = typeof BlockedRelaysList\nexport const SearchRelaysList = 10007\nexport type SearchRelaysList = typeof SearchRelaysList\nexport const SimpleGroupList = 10009\nexport type SimpleGroupList = typeof SimpleGroupList\nexport const FavoriteRelays = 10012\nexport type FavoriteRelays = typeof FavoriteRelays\nexport const PrivateEventRelayList = 10013\nexport type PrivateEventRelayList = typeof PrivateEventRelayList\nexport const InterestsList = 10015\nexport type InterestsList = typeof InterestsList\nexport const NutZapInfo = 10019\nexport type NutZapInfo = typeof NutZapInfo\nexport const MediaFollows = 10020\nexport type MediaFollows = typeof MediaFollows\nexport const UserEmojiList = 10030\nexport type UserEmojiList = typeof UserEmojiList\nexport const DecoupledKeyAnnouncement = 10044\nexport type DecoupledKeyAnnouncement = typeof DecoupledKeyAnnouncement\nexport const DirectMessageRelaysList = 10050\nexport type DirectMessageRelaysList = typeof DirectMessageRelaysList\nexport const FavoritePodcasts = 10054\nexport type FavoritePodcasts = typeof FavoritePodcasts\nexport const BlossomServerList = 10063\nexport type BlossomServerList = typeof BlossomServerList\nexport const FileServerPreference = 10096\nexport type FileServerPreference = typeof FileServerPreference\nexport const GoodWikiAuthorList = 10101\nexport type GoodWikiAuthorList = typeof GoodWikiAuthorList\nexport const GoodWikiRelayList = 10102\nexport type GoodWikiRelayList = typeof GoodWikiRelayList\nexport const PodcastMetadata = 10154\nexport type PodcastMetadata = typeof PodcastMetadata\nexport const AuthoredPodcasts = 10164\nexport type AuthoredPodcasts = typeof AuthoredPodcasts\nexport const RelayMonitorAnnouncement = 10166\nexport type RelayMonitorAnnouncement = typeof RelayMonitorAnnouncement\nexport const RoomPresence = 10312\nexport type RoomPresence = typeof RoomPresence\nexport const UserGraspList = 10317\nexport type UserGraspList = typeof UserGraspList\nexport const ProxyAnnouncement = 10377\nexport type ProxyAnnouncement = typeof ProxyAnnouncement\nexport const TransportMethodAnnouncement = 11111\nexport type TransportMethodAnnouncement = typeof TransportMethodAnnouncement\nexport const NWCWalletInfo = 13194\nexport type NWCWalletInfo = typeof NWCWalletInfo\nexport const NsiteRoot = 15128\nexport type NsiteRoot = typeof NsiteRoot\nexport const CashuWalletEvent = 17375\nexport type CashuWalletEvent = typeof CashuWalletEvent\nexport const LightningPubRPC = 21000\nexport type LightningPubRPC = typeof LightningPubRPC\nexport const ClientAuth = 22242\nexport type ClientAuth = typeof ClientAuth\nexport const NWCWalletRequest = 23194\nexport type NWCWalletRequest = typeof NWCWalletRequest\nexport const NWCWalletResponse = 23195\nexport type NWCWalletResponse = typeof NWCWalletResponse\nexport const NostrConnect = 24133\nexport type NostrConnect = typeof NostrConnect\nexport const BlobsAuth = 24242\nexport type BlobsAuth = typeof BlobsAuth\nexport const HTTPAuth = 27235\nexport type HTTPAuth = typeof HTTPAuth\nexport const Followsets = 30000\nexport type Followsets = typeof Followsets\nexport const Genericlists = 30001\nexport type Genericlists = typeof Genericlists\nexport const Relaysets = 30002\nexport type Relaysets = typeof Relaysets\nexport const Bookmarksets = 30003\nexport type Bookmarksets = typeof Bookmarksets\nexport const Curationsets = 30004\nexport type Curationsets = typeof Curationsets\nexport const CuratedVideoSets = 30005\nexport type CuratedVideoSets = typeof CuratedVideoSets\nexport const MuteSets = 30007\nexport type MuteSets = typeof MuteSets\nexport const ProfileBadges = 30008\nexport type ProfileBadges = typeof ProfileBadges\nexport const BadgeDefinition = 30009\nexport type BadgeDefinition = typeof BadgeDefinition\nexport const Interestsets = 30015\nexport type Interestsets = typeof Interestsets\nexport const CreateOrUpdateStall = 30017\nexport type CreateOrUpdateStall = typeof CreateOrUpdateStall\nexport const CreateOrUpdateProduct = 30018\nexport type CreateOrUpdateProduct = typeof CreateOrUpdateProduct\nexport const MarketplaceUI = 30019\nexport type MarketplaceUI = typeof MarketplaceUI\nexport const ProductSoldAsAuction = 30020\nexport type ProductSoldAsAuction = typeof ProductSoldAsAuction\nexport const LongFormArticle = 30023\nexport type LongFormArticle = typeof LongFormArticle\nexport const DraftLong = 30024\nexport type DraftLong = typeof DraftLong\nexport const Emojisets = 30030\nexport type Emojisets = typeof Emojisets\nexport const ModularArticleHeader = 30040\nexport type ModularArticleHeader = typeof ModularArticleHeader\nexport const ModularArticleContent = 30041\nexport type ModularArticleContent = typeof ModularArticleContent\nexport const ReleaseArtifactSets = 30063\nexport type ReleaseArtifactSets = typeof ReleaseArtifactSets\nexport const Application = 30078\nexport type Application = typeof Application\nexport const RelayDiscovery = 30166\nexport type RelayDiscovery = typeof RelayDiscovery\nexport const AppCurationSet = 30267\nexport type AppCurationSet = typeof AppCurationSet\nexport const LiveEvent = 30311\nexport type LiveEvent = typeof LiveEvent\nexport const InteractiveRoom = 30312\nexport type InteractiveRoom = typeof InteractiveRoom\nexport const ConferenceEvent = 30313\nexport type ConferenceEvent = typeof ConferenceEvent\nexport const UserStatuses = 30315\nexport type UserStatuses = typeof UserStatuses\nexport const SlideSet = 30388\nexport type SlideSet = typeof SlideSet\nexport const ClassifiedListing = 30402\nexport type ClassifiedListing = typeof ClassifiedListing\nexport const DraftClassifiedListing = 30403\nexport type DraftClassifiedListing = typeof DraftClassifiedListing\nexport const RepositoryAnnouncement = 30617\nexport type RepositoryAnnouncement = typeof RepositoryAnnouncement\nexport const RepositoryState = 30618\nexport type RepositoryState = typeof RepositoryState\nexport const WikiArticle = 30818\nexport type WikiArticle = typeof WikiArticle\nexport const Redirects = 30819\nexport type Redirects = typeof Redirects\nexport const DraftEvent = 31234\nexport type DraftEvent = typeof DraftEvent\nexport const LinkSet = 31388\nexport type LinkSet = typeof LinkSet\nexport const Feed = 31890\nexport type Feed = typeof Feed\nexport const Date = 31922\nexport type Date = typeof Date\nexport const Time = 31923\nexport type Time = typeof Time\nexport const Calendar = 31924\nexport type Calendar = typeof Calendar\nexport const CalendarEventRSVP = 31925\nexport type CalendarEventRSVP = typeof CalendarEventRSVP\nexport const RelayReview = 31987\nexport type RelayReview = typeof RelayReview\nexport const Handlerrecommendation = 31989\nexport type Handlerrecommendation = typeof Handlerrecommendation\nexport const Handlerinformation = 31990\nexport type Handlerinformation = typeof Handlerinformation\nexport const SoftwareApplication = 32267\nexport type SoftwareApplication = typeof SoftwareApplication\nexport const LegacyNsiteFile = 34128\nexport type LegacyNsiteFile = typeof LegacyNsiteFile\nexport const VideoViewEvent = 34237\nexport type VideoViewEvent = typeof VideoViewEvent\nexport const CommunityDefinition = 34550\nexport type CommunityDefinition = typeof CommunityDefinition\nexport const NsiteNamed = 35128\nexport type NsiteNamed = typeof NsiteNamed\nexport const GeocacheListing = 37515\nexport type GeocacheListing = typeof GeocacheListing\nexport const GeocacheLogEntry = 37516\nexport type GeocacheLogEntry = typeof GeocacheLogEntry\nexport const CashuMintAnnouncement = 38172\nexport type CashuMintAnnouncement = typeof CashuMintAnnouncement\nexport const FedimintAnnouncement = 38173\nexport type FedimintAnnouncement = typeof FedimintAnnouncement\nexport const PeerToPeerOrderEvents = 38383\nexport type PeerToPeerOrderEvents = typeof PeerToPeerOrderEvents\nexport const GroupMetadata = 39000\nexport type GroupMetadata = typeof GroupMetadata\nexport const SimpleGroupAdmins = 39001\nexport type SimpleGroupAdmins = typeof SimpleGroupAdmins\nexport const SimpleGroupMembers = 39002\nexport type SimpleGroupMembers = typeof SimpleGroupMembers\nexport const SimpleGroupRoles = 39003\nexport type SimpleGroupRoles = typeof SimpleGroupRoles\nexport const SimpleGroupLiveKitParticipants = 39004\nexport type SimpleGroupLiveKitParticipants = typeof SimpleGroupLiveKitParticipants\nexport const StarterPacks = 39089\nexport type StarterPacks = typeof StarterPacks\nexport const MediaStarterPacks = 39092\nexport type MediaStarterPacks = typeof MediaStarterPacks\nexport const WebBookmarks = 39701\nexport type WebBookmarks = typeof WebBookmarks\n"],
5
- "mappings": ";;;;;;;AAAA,SAAS,cAAc;AACvB,SAAS,kBAAkB;;;ACOpB,IAAM,iBAAiB,OAAO,UAAU;AAsB/C,IAAM,WAAW,CAAC,QAAiD,eAAe;AAE3E,SAAS,cAAiB,OAAsC;AACrE,MAAI,CAAC,SAAS,KAAK;AAAG,WAAO;AAC7B,MAAI,OAAO,MAAM,SAAS;AAAU,WAAO;AAC3C,MAAI,OAAO,MAAM,YAAY;AAAU,WAAO;AAC9C,MAAI,OAAO,MAAM,eAAe;AAAU,WAAO;AACjD,MAAI,OAAO,MAAM,WAAW;AAAU,WAAO;AAC7C,MAAI,CAAC,MAAM,OAAO,MAAM,gBAAgB;AAAG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KAAK,KAAK,CAAC,KAAK,MAAM,CAAC;AAAA,MAC7B,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,MAAM,OAAO,MAA6B;AACxC,UAAM,KAAK;AAAA,MAAS;AAAA,MAAU;AAAA,MAAM;AAAA,MAAW,MAC7C,KAAK,oBAAoB,SAAO;AAC9B,YAAI,KAAK,KAAK,CAAC,KAAK,QAAQ,GAAG,CAAC,KAAK,IAAI,CAAC;AAAA,MAC5C,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,MAAM,MAAM,MAA6B;AACvC,QAAI,CAAC,SAAS,IAAI;AAAG,YAAM,IAAI,MAAM,GAAG,+BAA+B;AACvE,UAAM,KAAK,SAAS,QAAQ,IAAI;AAAA,EAClC;AAAA,EAEA,MAAM,OAAO,eAAgD;AAC3D,UAAM,OAAO,cAAc,MAAM,GAAG,EAAE,IAAI,GAAG,MAAM,GAAG,EAAE,MAAM;AAC9D,WAAO,KAAK;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA,MACE,KAAK,oBAAoB,SAAO;AAC9B,YAAI,KAAK,KAAK,CAAC,KAAK,QAAQ,GAAG,CAAC,KAAK,IAAI,CAAC;AAAA,MAC5C,CAAC;AAAA,MACH,KAAK,UAAU,EAAE,KAAK,cAAc,CAAC;AAAA,IACvC;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import { sha256 } from '@noble/hashes/sha2.js'\nimport { bytesToHex } from '@noble/hashes/utils.js'\nimport type { EventTemplate } from './core.ts'\nimport type { Signer } from './signer.ts'\nimport { kinds } from './index.ts'\n\nexport type BlobDescriptor = {\n url: string\n sha256: string\n size: number\n type: string\n uploaded: number\n}\n\nexport type UploadType = Blob | File | Buffer\n\nexport type SignedEvent = EventTemplate & {\n id: string\n sig: string\n pubkey: string\n}\n\nexport type AuthEventOptions = {\n blobs?: string | string[]\n servers?: string | string[]\n message?: string\n expiration?: number\n}\n\nexport function isSha256(str: string): boolean {\n return /^[0-9a-f]{64}$/i.test(str)\n}\n\nexport function getBlobSize(blob: UploadType): number {\n if ((typeof File !== 'undefined' && blob instanceof File) || blob instanceof Blob) {\n return blob.size\n }\n return (blob as Buffer).length\n}\n\nexport function getBlobType(blob: UploadType): string | undefined {\n if ((typeof File !== 'undefined' && blob instanceof File) || blob instanceof Blob) {\n return blob.type || undefined\n }\n return undefined\n}\n\nexport async function computeBlobSha256(blob: UploadType): Promise<string> {\n let buffer: ArrayBuffer | Uint8Array\n\n if ((typeof File !== 'undefined' && blob instanceof File) || blob instanceof Blob) {\n buffer = await blob.arrayBuffer()\n } else {\n buffer = blob\n }\n\n const hash = sha256.create().update(new Uint8Array(buffer)).digest()\n return bytesToHex(hash)\n}\n\n// auth\n\nexport function encodeAuthorizationHeader(event: SignedEvent): string {\n const json = JSON.stringify(event)\n const bytes = new TextEncoder().encode(json)\n let binary = ''\n for (const byte of bytes) binary += String.fromCharCode(byte)\n return 'Nostr ' + btoa(binary).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/g, '')\n}\n\nexport function now(): number {\n return Math.floor(Date.now() / 1000)\n}\n\nexport function oneHour(): number {\n return now() + 3600\n}\n\nexport function getAuthTagValues(auth: SignedEvent, tagName: string): string[] {\n return auth.tags.filter(tag => tag[0] === tagName).map(tag => tag[1])\n}\n\nexport function getAuthExpiration(auth: SignedEvent): number | undefined {\n const expiration = auth.tags.find(tag => tag[0] === 'expiration')?.[1]\n if (!expiration) return undefined\n const timestamp = Number(expiration)\n if (!Number.isFinite(timestamp)) return undefined\n return timestamp\n}\n\nexport function isAuthExpired(auth: SignedEvent, timestamp: number = now()): boolean {\n const expiration = getAuthExpiration(auth)\n return expiration !== undefined && expiration <= timestamp\n}\n\nexport function normalizeServerTag(server: string | URL): string {\n if (server instanceof URL) return server.hostname.toLowerCase()\n if (URL.canParse(server)) return new URL(server).hostname.toLowerCase()\n return server.toLowerCase()\n}\n\nexport function areServersEqual(a: string | URL, b: string | URL): boolean {\n return normalizeServerTag(a) === normalizeServerTag(b)\n}\n\nfunction normalizeServers(servers: string | string[]): string[] {\n const values = Array.isArray(servers) ? servers : [servers]\n return [...new Set(values.map(normalizeServerTag))]\n}\n\nexport async function createAuthEvent(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n type: 'upload' | 'list' | 'delete' | 'get' | 'media',\n options?: AuthEventOptions,\n): Promise<SignedEvent> {\n const draft: EventTemplate = {\n created_at: now(),\n kind: kinds.BlobsAuth,\n content: options?.message ?? '',\n tags: [\n ['t', type],\n ['expiration', String(options?.expiration ?? oneHour())],\n ],\n }\n\n if (options?.blobs) {\n const blobList = Array.isArray(options.blobs) ? options.blobs : [options.blobs]\n const seen = new Set<string>()\n for (const blob of blobList) {\n const hash = typeof blob === 'string' ? blob : await computeBlobSha256(blob)\n if (!seen.has(hash)) {\n draft.tags.push(['x', hash])\n seen.add(hash)\n }\n }\n }\n\n if (options?.servers) {\n for (const server of normalizeServers(options.servers)) {\n draft.tags.push(['server', server])\n }\n }\n\n return signer(draft)\n}\n\nexport type UploadAuthOptions = Omit<AuthEventOptions, 'blobs'> & { type?: 'upload' | 'media' }\n\nexport async function createUploadAuth(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n blobs: string | string[],\n options?: UploadAuthOptions,\n): Promise<SignedEvent> {\n return createAuthEvent(signer, options?.type ?? 'upload', { message: 'Upload Blob', ...options, blobs })\n}\n\nexport type DownloadAuthOptions = Omit<AuthEventOptions, 'blobs' | 'servers'>\n\nexport async function createDownloadAuth(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n hash: string,\n options?: DownloadAuthOptions,\n): Promise<SignedEvent> {\n return createAuthEvent(signer, 'get', { message: 'Download Blob', ...options, blobs: [hash] })\n}\n\nexport type MirrorAuthOptions = Omit<AuthEventOptions, 'blobs'>\n\nexport async function createMirrorAuth(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n hash: string,\n options?: MirrorAuthOptions,\n): Promise<SignedEvent> {\n return createAuthEvent(signer, 'upload', { message: 'Mirror Blob', ...options, blobs: [hash] })\n}\n\nexport type ListAuthOptions = Omit<AuthEventOptions, 'blobs'>\n\nexport async function createListAuth(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n options?: ListAuthOptions,\n): Promise<SignedEvent> {\n return createAuthEvent(signer, 'list', { message: 'List Blobs', ...options })\n}\n\nexport type DeleteAuthOptions = Omit<AuthEventOptions, 'blobs'>\n\nexport async function createDeleteAuth(\n signer: (draft: EventTemplate) => Promise<SignedEvent>,\n hash: string,\n options?: DeleteAuthOptions,\n): Promise<SignedEvent> {\n return createAuthEvent(signer, 'delete', { message: 'Delete Blob', ...options, blobs: [hash] })\n}\n\n// blossom URI\n\nexport type BlossomURI = {\n sha256: string\n ext: string\n servers: string[]\n authors: string[]\n size?: number\n}\n\nexport function parseBlossomURI(uri: string): BlossomURI {\n if (!uri.startsWith('blossom:')) throw new Error('Invalid blossom URI: missing blossom: scheme')\n const body = uri.slice('blossom:'.length)\n const queryIndex = body.indexOf('?')\n const path = queryIndex === -1 ? body : body.slice(0, queryIndex)\n const query = queryIndex === -1 ? '' : body.slice(queryIndex + 1)\n const dotIndex = path.indexOf('.')\n if (dotIndex === -1) throw new Error('Invalid blossom URI: missing file extension')\n const sha256 = path.slice(0, dotIndex)\n const ext = path.slice(dotIndex + 1)\n if (!isSha256(sha256)) throw new Error('Invalid blossom URI: invalid sha256 hash')\n if (!ext) throw new Error('Invalid blossom URI: empty file extension')\n const params = new URLSearchParams(query)\n const servers = params.getAll('xs')\n const authors = params.getAll('as')\n const szValue = params.get('sz')\n let size: number | undefined\n if (szValue !== null) {\n size = Number(szValue)\n if (!Number.isFinite(size) || size <= 0 || Math.floor(size) !== size) {\n throw new Error('Invalid blossom URI: sz must be a positive integer')\n }\n }\n return { sha256, ext, servers, authors, size }\n}\n\nexport function buildBlossomURI(options: BlossomURI): string {\n const params = new URLSearchParams()\n for (const server of options.servers) params.append('xs', server)\n for (const author of options.authors) params.append('as', author)\n if (options.size !== undefined) params.append('sz', String(options.size))\n const query = params.toString()\n return `blossom:${options.sha256}.${options.ext}${query ? '?' + query : ''}`\n}\n\nexport function blossomURIToURL(uri: string | BlossomURI): URL {\n const str = typeof uri === 'string' ? uri : buildBlossomURI(uri)\n return new URL(str)\n}\n\nexport function blossomURIFromURL(url: URL): BlossomURI {\n if (url.protocol !== 'blossom:') throw new Error('Invalid blossom URL: expected blossom: protocol')\n const path = url.pathname\n const dotIndex = path.indexOf('.')\n if (dotIndex === -1) throw new Error('Invalid blossom URL: missing file extension')\n const sha256 = path.slice(0, dotIndex)\n const ext = path.slice(dotIndex + 1)\n if (!isSha256(sha256)) throw new Error('Invalid blossom URL: invalid sha256 hash')\n if (!ext) throw new Error('Invalid blossom URL: empty file extension')\n const servers = url.searchParams.getAll('xs')\n const authors = url.searchParams.getAll('as')\n const szValue = url.searchParams.get('sz')\n let size: number | undefined\n if (szValue !== null) {\n size = Number(szValue)\n if (!Number.isFinite(size) || size <= 0 || Math.floor(size) !== size) {\n throw new Error('Invalid blossom URL: sz must be a positive integer')\n }\n }\n return { sha256, ext, servers, authors, size }\n}\n\nconst commonMimeExtensions: Record<string, string> = {\n 'application/json': '.json',\n 'application/pdf': '.pdf',\n 'application/vnd.android.package-archive': '.apk',\n 'application/vnd.sqlite3': '.sqlite3',\n 'application/xml': '.xml',\n 'audio/aac': '.aac',\n 'audio/flac': '.flac',\n 'audio/midi': '.midi',\n 'audio/mp3': '.mp3',\n 'audio/mpeg': '.mp3',\n 'audio/mp4': '.m4a',\n 'audio/ogg': '.ogg',\n 'audio/wav': '.wav',\n 'audio/webm': '.weba',\n 'audio/x-aiff': '.aiff',\n 'audio/x-m4a': '.m4a',\n 'image/avif': '.avif',\n 'image/gif': '.gif',\n 'image/jpeg': '.jpg',\n 'image/png': '.png',\n 'image/svg+xml': '.svg',\n 'image/webp': '.webp',\n 'text/css': '.css',\n 'text/csv': '.csv',\n 'text/html': '.html',\n 'text/javascript': '.js',\n 'text/markdown': '.md',\n 'text/plain': '.txt',\n 'text/xml': '.xml',\n 'video/mp2t': '.ts',\n 'video/mp4': '.mp4',\n 'video/ogg': '.ogv',\n 'video/quicktime': '.mov',\n 'video/webm': '.webm',\n 'video/x-matroska': '.mkv',\n}\n\nconst commonExtensionMimes: Record<string, string> = {\n '.aac': 'audio/aac',\n '.aiff': 'audio/x-aiff',\n '.apk': 'application/vnd.android.package-archive',\n '.avif': 'image/avif',\n '.css': 'text/css; charset=utf-8',\n '.csv': 'text/csv; charset=utf-8',\n '.flac': 'audio/flac',\n '.gif': 'image/gif',\n '.html': 'text/html; charset=utf-8',\n '.jpeg': 'image/jpeg',\n '.jpg': 'image/jpeg',\n '.js': 'text/javascript; charset=utf-8',\n '.json': 'application/json',\n '.m4a': 'audio/mp4',\n '.md': 'text/markdown; charset=utf-8',\n '.midi': 'audio/midi',\n '.mkv': 'video/x-matroska',\n '.mov': 'video/quicktime',\n '.mp3': 'audio/mpeg',\n '.mp4': 'video/mp4',\n '.oga': 'audio/ogg',\n '.ogg': 'audio/ogg',\n '.ogv': 'video/ogg',\n '.pdf': 'application/pdf',\n '.png': 'image/png',\n '.sqlite3': 'application/vnd.sqlite3',\n '.svg': 'image/svg+xml',\n '.ts': 'video/mp2t',\n '.txt': 'text/plain; charset=utf-8',\n '.wav': 'audio/wav',\n '.weba': 'audio/webm',\n '.webm': 'video/webm',\n '.webp': 'image/webp',\n '.xml': 'application/xml',\n}\n\nfunction normalizeMIMEType(mimetype: string): string {\n const idx = mimetype.indexOf(';')\n return idx >= 0 ? mimetype.slice(0, idx).trim().toLowerCase() : mimetype.trim().toLowerCase()\n}\n\nexport function getExtension(mimetype: string): string {\n const normalized = normalizeMIMEType(mimetype)\n if (!normalized) return ''\n return commonMimeExtensions[normalized] ?? ''\n}\n\nexport function getMIMEType(ext: string): string {\n if (!ext) return ''\n ext = ext.trim().toLowerCase()\n if (ext[0] !== '.') ext = '.' + ext\n return commonExtensionMimes[ext] ?? ''\n}\n\nexport function getServersFromServerListEvent(event: { tags: string[][] }): URL[] {\n const servers: URL[] = []\n for (const tag of event.tags) {\n if (tag[0] === 'server' && tag[1]) {\n try {\n const url = new URL(tag[1])\n url.pathname = '/'\n servers.push(url)\n } catch {}\n }\n }\n return servers\n}\n\nexport function getHashFromURL(url: string | URL): string | null {\n try {\n if (typeof url === 'string') url = new URL(url)\n const hashes = Array.from(url.pathname.matchAll(/[0-9a-f]{64}/gi))\n return hashes.length > 0 ? hashes[hashes.length - 1][0] : null\n } catch (_err) {\n return null\n }\n}\n\nexport type UploadOptions = {\n signal?: AbortSignal\n auth?: SignedEvent | boolean\n timeout?: number\n onAuth?: (server: string, sha256: string) => Promise<SignedEvent>\n}\n\nexport async function uploadBlob(server: string, blob: Blob | File, opts?: UploadOptions): Promise<BlobDescriptor> {\n const url = new URL('/upload', server).toString()\n const sha256 = await computeBlobSha256(blob)\n\n const headers: Record<string, string> = {\n 'X-SHA-256': sha256,\n 'Content-Type': getBlobType(blob) || 'application/octet-stream',\n }\n\n if (opts?.auth) {\n const authEvent = typeof opts.auth === 'boolean' ? await opts.onAuth?.(server, sha256) : opts.auth\n if (authEvent) headers['Authorization'] = encodeAuthorizationHeader(authEvent)\n }\n\n const res = await fetch(url, {\n method: 'PUT',\n body: blob,\n headers,\n signal: opts?.signal,\n })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`upload returned error (${res.status}): ${reason}`)\n }\n\n return res.json()\n}\n\nexport type DownloadOptions = {\n signal?: AbortSignal\n auth?: SignedEvent | boolean\n timeout?: number\n onAuth?: (server: string, sha256: string) => Promise<SignedEvent>\n}\n\nexport async function downloadBlob(server: string, hash: string, opts?: DownloadOptions): Promise<Response> {\n const url = new URL('/' + hash, server).toString()\n const headers: Record<string, string> = {}\n\n if (opts?.auth) {\n const authEvent = typeof opts.auth === 'boolean' ? await opts.onAuth?.(server, hash) : opts.auth\n if (authEvent) headers['Authorization'] = encodeAuthorizationHeader(authEvent)\n }\n\n const res = await fetch(url, { headers, signal: opts?.signal })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`${hash} download error (${res.status}): ${reason}`)\n }\n\n return res\n}\n\nexport type ListOptions = {\n signal?: AbortSignal\n auth?: SignedEvent | boolean\n timeout?: number\n onAuth?: (server: string) => Promise<SignedEvent>\n cursor?: string\n limit?: number\n since?: number\n until?: number\n}\n\nexport async function listBlobs(server: string, pubkey: string, opts?: ListOptions): Promise<BlobDescriptor[]> {\n const url = new URL('/list/' + pubkey, server)\n if (opts?.cursor) url.searchParams.append('cursor', opts.cursor)\n if (opts?.limit) url.searchParams.append('limit', String(opts.limit))\n if (opts?.since) url.searchParams.append('since', String(opts.since))\n if (opts?.until) url.searchParams.append('until', String(opts.until))\n\n const headers: Record<string, string> = {}\n\n if (opts?.auth) {\n const authEvent = typeof opts.auth === 'boolean' ? await opts.onAuth?.(server) : opts.auth\n if (authEvent) headers['Authorization'] = encodeAuthorizationHeader(authEvent)\n }\n\n const res = await fetch(url.toString(), { headers, signal: opts?.signal })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`list error (${res.status}): ${reason}`)\n }\n\n return res.json()\n}\n\nexport async function* iterateBlobs(\n server: string,\n pubkey: string,\n opts?: ListOptions,\n): AsyncGenerator<BlobDescriptor[], void, void> {\n let cursor = opts?.cursor\n while (true) {\n const page = await listBlobs(server, pubkey, { ...opts, cursor })\n if (page.length === 0) return\n yield page\n if (opts?.limit && page.length < opts.limit) return\n cursor = page[page.length - 1]?.sha256\n if (!cursor) return\n }\n}\n\nexport type DeleteOptions = {\n signal?: AbortSignal\n auth?: SignedEvent | boolean\n timeout?: number\n onAuth?: (server: string, sha256: string) => Promise<SignedEvent>\n}\n\nexport async function deleteBlob(server: string, hash: string, opts?: DeleteOptions): Promise<boolean> {\n const url = new URL('/' + hash, server).toString()\n const headers: Record<string, string> = {}\n\n if (opts?.auth) {\n const authEvent = typeof opts.auth === 'boolean' ? await opts.onAuth?.(server, hash) : opts.auth\n if (authEvent) headers['Authorization'] = encodeAuthorizationHeader(authEvent)\n }\n\n const res = await fetch(url, { method: 'DELETE', headers, signal: opts?.signal })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`delete error (${res.status}): ${reason}`)\n }\n\n return res.ok\n}\n\nexport type HasBlobOptions = {\n signal?: AbortSignal\n timeout?: number\n}\n\nexport async function hasBlob(server: string, hash: string, opts?: HasBlobOptions): Promise<boolean> {\n const url = new URL('/' + hash, server)\n try {\n const res = await fetch(url.toString(), { method: 'HEAD', signal: opts?.signal })\n return res.status !== 404\n } catch {\n return false\n }\n}\n\nexport type MirrorOptions = {\n signal?: AbortSignal\n auth?: SignedEvent | boolean\n timeout?: number\n onAuth?: (server: string, sha256: string) => Promise<SignedEvent>\n}\n\nexport async function mirrorBlob(server: string, blob: BlobDescriptor, opts?: MirrorOptions): Promise<BlobDescriptor> {\n const url = new URL('/mirror', server).toString()\n\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n 'X-SHA-256': blob.sha256,\n }\n\n if (opts?.auth) {\n const authEvent = typeof opts.auth === 'boolean' ? await opts.onAuth?.(server, blob.sha256) : opts.auth\n if (authEvent) headers['Authorization'] = encodeAuthorizationHeader(authEvent)\n }\n\n const res = await fetch(url, {\n method: 'PUT',\n body: JSON.stringify({ url: blob.url }),\n headers,\n signal: opts?.signal,\n })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`mirror error (${res.status}): ${reason}`)\n }\n\n return res.json()\n}\n\nexport type ReportOptions = {\n signal?: AbortSignal\n timeout?: number\n onError?: (server: string, error: Error) => void\n}\n\nexport async function reportBlobs(\n servers: Iterable<string>,\n report: SignedEvent,\n opts?: ReportOptions,\n): Promise<Map<string, boolean>> {\n if (report.kind !== 1984 || !report.tags.some(tag => tag[0] === 'x' && !!tag[1])) {\n throw new Error('Invalid blob report event: must be kind 1984 with x tag')\n }\n\n const results = new Map<string, boolean>()\n const body = JSON.stringify(report)\n\n for (const server of servers) {\n try {\n const res = await fetch(new URL('/report', server).toString(), {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body,\n signal: opts?.signal,\n })\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`report error (${res.status}): ${reason}`)\n }\n results.set(server, true)\n } catch (error) {\n if (opts?.onError && error instanceof Error) opts.onError(server, error)\n }\n }\n\n return results\n}\n\nexport class BlossomClient {\n private mediaserver: string\n\n constructor(\n mediaserver: string,\n private signer: Signer,\n ) {\n if (!mediaserver.startsWith('http')) {\n mediaserver = 'https://' + mediaserver\n }\n this.mediaserver = mediaserver.replace(/\\/$/, '') + '/'\n }\n\n getMediaServer(): string {\n return this.mediaserver\n }\n\n private async authorizationHeader(modify?: (event: EventTemplate) => void): Promise<string> {\n const event = {\n created_at: now(),\n kind: kinds.BlobsAuth,\n content: 'blossom stuff',\n tags: [['expiration', String(now() + 60)]],\n }\n\n modify?.(event)\n\n try {\n const signedEvent = await this.signer.signEvent(event)\n const json = JSON.stringify(signedEvent)\n return 'Nostr ' + btoa(json)\n } catch {\n return ''\n }\n }\n\n private async httpCall(\n method: string,\n url: string,\n contentType?: string,\n addAuthorization?: () => Promise<string>,\n body?: File | Blob | string,\n ): Promise<any> {\n const headers: Record<string, string> = {}\n\n if (contentType) headers['Content-Type'] = contentType\n if (addAuthorization) {\n const auth = await addAuthorization()\n if (auth) headers['Authorization'] = auth\n }\n\n const res = await fetch(this.mediaserver + url, { method, headers, body })\n\n if (res.status >= 300) {\n const reason = res.headers.get('X-Reason') || res.statusText\n throw new Error(`${url} returned error (${res.status}): ${reason}`)\n }\n\n if (res.headers.get('content-type')?.includes('application/json')) {\n return res.json()\n }\n\n return res\n }\n\n async uploadBlob(file: Blob | File, contentType?: string): Promise<BlobDescriptor> {\n const hash = bytesToHex(sha256(new Uint8Array(await file.arrayBuffer())))\n const actualContentType = contentType || getBlobType(file) || 'application/octet-stream'\n\n return this.httpCall(\n 'PUT',\n 'upload',\n actualContentType,\n () =>\n this.authorizationHeader(evt => {\n evt.tags.push(['t', 'upload'], ['x', hash])\n }),\n file,\n )\n }\n\n async download(hash: string): Promise<ArrayBuffer> {\n const authHeader = await this.authorizationHeader(evt => {\n evt.tags.push(['t', 'get'], ['x', hash])\n })\n\n const res = await fetch(this.mediaserver + hash, {\n method: 'GET',\n headers: { Authorization: authHeader },\n })\n\n if (res.status >= 300) {\n throw new Error(`${hash} not present on ${this.mediaserver}: ${res.status}`)\n }\n\n return res.arrayBuffer()\n }\n\n async downloadAsBlob(hash: string): Promise<Blob> {\n return new Blob([await this.download(hash)])\n }\n\n async list(): Promise<BlobDescriptor[]> {\n const pubkey = await this.signer.getPublicKey()\n return this.httpCall('GET', `list/${pubkey}`, undefined, () =>\n this.authorizationHeader(evt => {\n evt.tags.push(['t', 'list'])\n }),\n )\n }\n\n async delete(hash: string): Promise<void> {\n await this.httpCall('DELETE', hash, undefined, () =>\n this.authorizationHeader(evt => {\n evt.tags.push(['t', 'delete'], ['x', hash])\n }),\n )\n }\n\n async check(hash: string): Promise<void> {\n if (!isSha256(hash)) throw new Error(`${hash} is not valid 32-byte hex`)\n await this.httpCall('HEAD', hash)\n }\n\n async mirror(remoteBlobURL: string): Promise<BlobDescriptor> {\n const hash = remoteBlobURL.split('/').pop()?.split('.')[0] || ''\n return this.httpCall(\n 'PUT',\n 'mirror',\n 'application/json',\n () =>\n this.authorizationHeader(evt => {\n evt.tags.push(['t', 'upload'], ['x', hash])\n }),\n JSON.stringify({ url: remoteBlobURL }),\n )\n }\n}\n", "export interface Nostr {\n generateSecretKey(): Uint8Array\n getPublicKey(secretKey: Uint8Array): string\n finalizeEvent(event: EventTemplate, secretKey: Uint8Array): VerifiedEvent\n verifyEvent(event: Event): event is VerifiedEvent\n}\n\n/** Designates a verified event signature. */\nexport const verifiedSymbol = Symbol('verified')\n\nexport type NostrEvent = {\n kind: number\n tags: string[][]\n content: string\n created_at: number\n pubkey: string\n id: string\n sig: string\n [verifiedSymbol]?: boolean\n}\n\nexport type Event = NostrEvent\nexport type EventTemplate = Pick<Event, 'kind' | 'tags' | 'content' | 'created_at'>\nexport type UnsignedEvent = Pick<Event, 'kind' | 'tags' | 'content' | 'created_at' | 'pubkey'>\n\n/** An event whose signature has been verified. */\nexport interface VerifiedEvent extends Event {\n [verifiedSymbol]: true\n}\n\nconst isRecord = (obj: unknown): obj is Record<string, unknown> => obj instanceof Object\n\nexport function validateEvent<T>(event: T): event is T & UnsignedEvent {\n if (!isRecord(event)) return false\n if (typeof event.kind !== 'number') return false\n if (typeof event.content !== 'string') return false\n if (typeof event.created_at !== 'number') return false\n if (typeof event.pubkey !== 'string') return false\n if (!event.pubkey.match(/^[a-f0-9]{64}$/)) return false\n\n if (!Array.isArray(event.tags)) return false\n for (let i = 0; i < event.tags.length; i++) {\n let tag = event.tags[i]\n if (!Array.isArray(tag)) return false\n for (let j = 0; j < tag.length; j++) {\n if (typeof tag[j] !== 'string') return false\n }\n }\n\n return true\n}\n\n/**\n * Sort events in reverse-chronological order by the `created_at` timestamp,\n * and then by the event `id` (lexicographically) in case of ties.\n * This mutates the array.\n */\nexport function sortEvents(events: Event[]): Event[] {\n return events.sort((a: NostrEvent, b: NostrEvent): number => {\n if (a.created_at !== b.created_at) {\n return b.created_at - a.created_at\n }\n return a.id.localeCompare(b.id)\n })\n}\n", "import { NostrEvent, validateEvent } from './pure.ts'\n\n/** Events are **regular**, which means they're all expected to be stored by relays. */\nexport function isRegularKind(kind: number): boolean {\n return kind < 10000 && kind !== 0 && kind !== 3\n}\n\n/** Events are **replaceable**, which means that, for each combination of `pubkey` and `kind`, only the latest event is expected to (SHOULD) be stored by relays, older versions are expected to be discarded. */\nexport function isReplaceableKind(kind: number): boolean {\n return kind === 0 || kind === 3 || (10000 <= kind && kind < 20000)\n}\n\n/** Events are **ephemeral**, which means they are not expected to be stored by relays. */\nexport function isEphemeralKind(kind: number): boolean {\n return 20000 <= kind && kind < 30000\n}\n\n/** Events are **addressable**, which means that, for each combination of `pubkey`, `kind` and the `d` tag, only the latest event is expected to be stored by relays, older versions are expected to be discarded. */\nexport function isAddressableKind(kind: number): boolean {\n return 30000 <= kind && kind < 40000\n}\n\n/** Classification of the event kind. */\nexport type KindClassification = 'regular' | 'replaceable' | 'ephemeral' | 'parameterized' | 'unknown'\n\n/** Determine the classification of this kind of event if known, or `unknown`. */\nexport function classifyKind(kind: number): KindClassification {\n if (isRegularKind(kind)) return 'regular'\n if (isReplaceableKind(kind)) return 'replaceable'\n if (isEphemeralKind(kind)) return 'ephemeral'\n if (isAddressableKind(kind)) return 'parameterized'\n return 'unknown'\n}\n\nexport function isKind<T extends number>(event: unknown, kind: T | Array<T>): event is NostrEvent & { kind: T } {\n const kindAsArray: number[] = kind instanceof Array ? kind : [kind]\n return (validateEvent(event) && kindAsArray.includes(event.kind)) || false\n}\n\nexport const Metadata = 0\nexport type Metadata = typeof Metadata\nexport const ShortTextNote = 1\nexport type ShortTextNote = typeof ShortTextNote\nexport const RecommendRelay = 2\nexport type RecommendRelay = typeof RecommendRelay\nexport const Contacts = 3\nexport type Contacts = typeof Contacts\nexport const EncryptedDirectMessage = 4\nexport type EncryptedDirectMessage = typeof EncryptedDirectMessage\nexport const EventDeletion = 5\nexport type EventDeletion = typeof EventDeletion\nexport const Repost = 6\nexport type Repost = typeof Repost\nexport const Reaction = 7\nexport type Reaction = typeof Reaction\nexport const BadgeAward = 8\nexport type BadgeAward = typeof BadgeAward\nexport const ChatMessage = 9\nexport type ChatMessage = typeof ChatMessage\nexport const SimpleGroupThreadedReply = 10\nexport type SimpleGroupThreadedReply = typeof SimpleGroupThreadedReply\nexport const ForumThread = 11\nexport type ForumThread = typeof ForumThread\nexport const SimpleGroupReply = 12\nexport type SimpleGroupReply = typeof SimpleGroupReply\nexport const Seal = 13\nexport type Seal = typeof Seal\nexport const PrivateDirectMessage = 14\nexport type PrivateDirectMessage = typeof PrivateDirectMessage\nexport const FileMessage = 15\nexport type FileMessage = typeof FileMessage\nexport const GenericRepost = 16\nexport type GenericRepost = typeof GenericRepost\nexport const ReactionToWebsite = 17\nexport type ReactionToWebsite = typeof ReactionToWebsite\nexport const Photo = 20\nexport type Photo = typeof Photo\nexport const NormalVideo = 21\nexport type NormalVideo = typeof NormalVideo\nexport const ShortVideo = 22\nexport type ShortVideo = typeof ShortVideo\nexport const PublicMessage = 24\nexport type PublicMessage = typeof PublicMessage\nexport const ChannelCreation = 40\nexport type ChannelCreation = typeof ChannelCreation\nexport const ChannelMetadata = 41\nexport type ChannelMetadata = typeof ChannelMetadata\nexport const ChannelMessage = 42\nexport type ChannelMessage = typeof ChannelMessage\nexport const ChannelHideMessage = 43\nexport type ChannelHideMessage = typeof ChannelHideMessage\nexport const ChannelMuteUser = 44\nexport type ChannelMuteUser = typeof ChannelMuteUser\nexport const PodcastEpisode = 54\nexport type PodcastEpisode = typeof PodcastEpisode\nexport const Chess = 64\nexport type Chess = typeof Chess\nexport const MergeRequests = 818\nexport type MergeRequests = typeof MergeRequests\nexport const PollResponse = 1018\nexport type PollResponse = typeof PollResponse\nexport const Bid = 1021\nexport type Bid = typeof Bid\nexport const BidConfirmation = 1022\nexport type BidConfirmation = typeof BidConfirmation\nexport const OpenTimestamps = 1040\nexport type OpenTimestamps = typeof OpenTimestamps\nexport const GiftWrap = 1059\nexport type GiftWrap = typeof GiftWrap\nexport const FileMetadata = 1063\nexport type FileMetadata = typeof FileMetadata\nexport const Poll = 1068\nexport type Poll = typeof Poll\nexport const Comment = 1111\nexport type Comment = typeof Comment\nexport const Voice = 1222\nexport type Voice = typeof Voice\nexport const Scroll = 1227\nexport type Scroll = typeof Scroll\nexport const VoiceComment = 1244\nexport type VoiceComment = typeof VoiceComment\nexport const LiveChatMessage = 1311\nexport type LiveChatMessage = typeof LiveChatMessage\nexport const CodeSnippet = 1337\nexport type CodeSnippet = typeof CodeSnippet\nexport const Patch = 1617\nexport type Patch = typeof Patch\nexport const GitPullRequest = 1618\nexport type GitPullRequest = typeof GitPullRequest\nexport const GitPullRequestUpdate = 1619\nexport type GitPullRequestUpdate = typeof GitPullRequestUpdate\nexport const Issue = 1621\nexport type Issue = typeof Issue\nexport const Reply = 1622\nexport type Reply = typeof Reply\nexport const StatusOpen = 1630\nexport type StatusOpen = typeof StatusOpen\nexport const StatusApplied = 1631\nexport type StatusApplied = typeof StatusApplied\nexport const StatusClosed = 1632\nexport type StatusClosed = typeof StatusClosed\nexport const StatusDraft = 1633\nexport type StatusDraft = typeof StatusDraft\nexport const ProblemTracker = 1971\nexport type ProblemTracker = typeof ProblemTracker\nexport const Report = 1984\nexport type Report = typeof Report\nexport const Reporting = 1984\nexport type Reporting = typeof Reporting\nexport const Label = 1985\nexport type Label = typeof Label\nexport const RelayReviews = 1986\nexport type RelayReviews = typeof RelayReviews\nexport const AIEmbeddings = 1987\nexport type AIEmbeddings = typeof AIEmbeddings\nexport const Torrent = 2003\nexport type Torrent = typeof Torrent\nexport const TorrentComment = 2004\nexport type TorrentComment = typeof TorrentComment\nexport const CoinjoinPool = 2022\nexport type CoinjoinPool = typeof CoinjoinPool\nexport const DecoupledKeyClientAnnouncement = 4454\nexport type DecoupledKeyClientAnnouncement = typeof DecoupledKeyClientAnnouncement\nexport const DecoupledEncryptionKeyDistribution = 4455\nexport type DecoupledEncryptionKeyDistribution = typeof DecoupledEncryptionKeyDistribution\nexport const CommunityPostApproval = 4550\nexport type CommunityPostApproval = typeof CommunityPostApproval\nexport const JobRequest = 5999\nexport type JobRequest = typeof JobRequest\nexport const JobResult = 6999\nexport type JobResult = typeof JobResult\nexport const JobFeedback = 7000\nexport type JobFeedback = typeof JobFeedback\nexport const ReservedCashuWalletTokens = 7374\nexport type ReservedCashuWalletTokens = typeof ReservedCashuWalletTokens\nexport const CashuWalletTokens = 7375\nexport type CashuWalletTokens = typeof CashuWalletTokens\nexport const CashuWalletHistory = 7376\nexport type CashuWalletHistory = typeof CashuWalletHistory\nexport const GeocacheLog = 7516\nexport type GeocacheLog = typeof GeocacheLog\nexport const GeocacheProofOfFind = 7517\nexport type GeocacheProofOfFind = typeof GeocacheProofOfFind\nexport const SimpleGroupPutUser = 9000\nexport type SimpleGroupPutUser = typeof SimpleGroupPutUser\nexport const SimpleGroupRemoveUser = 9001\nexport type SimpleGroupRemoveUser = typeof SimpleGroupRemoveUser\nexport const SimpleGroupEditMetadata = 9002\nexport type SimpleGroupEditMetadata = typeof SimpleGroupEditMetadata\nexport const SimpleGroupDeleteEvent = 9005\nexport type SimpleGroupDeleteEvent = typeof SimpleGroupDeleteEvent\nexport const SimpleGroupCreateGroup = 9007\nexport type SimpleGroupCreateGroup = typeof SimpleGroupCreateGroup\nexport const SimpleGroupDeleteGroup = 9008\nexport type SimpleGroupDeleteGroup = typeof SimpleGroupDeleteGroup\nexport const SimpleGroupCreateInvite = 9009\nexport type SimpleGroupCreateInvite = typeof SimpleGroupCreateInvite\nexport const SimpleGroupJoinRequest = 9021\nexport type SimpleGroupJoinRequest = typeof SimpleGroupJoinRequest\nexport const SimpleGroupLeaveRequest = 9022\nexport type SimpleGroupLeaveRequest = typeof SimpleGroupLeaveRequest\nexport const ZapGoal = 9041\nexport type ZapGoal = typeof ZapGoal\nexport const NutZap = 9321\nexport type NutZap = typeof NutZap\nexport const TidalLogin = 9467\nexport type TidalLogin = typeof TidalLogin\nexport const ZapRequest = 9734\nexport type ZapRequest = typeof ZapRequest\nexport const Zap = 9735\nexport type Zap = typeof Zap\nexport const Highlights = 9802\nexport type Highlights = typeof Highlights\nexport const Mutelist = 10000\nexport type Mutelist = typeof Mutelist\nexport const Pinlist = 10001\nexport type Pinlist = typeof Pinlist\nexport const RelayList = 10002\nexport type RelayList = typeof RelayList\nexport const BookmarkList = 10003\nexport type BookmarkList = typeof BookmarkList\nexport const CommunitiesList = 10004\nexport type CommunitiesList = typeof CommunitiesList\nexport const PublicChatsList = 10005\nexport type PublicChatsList = typeof PublicChatsList\nexport const BlockedRelaysList = 10006\nexport type BlockedRelaysList = typeof BlockedRelaysList\nexport const SearchRelaysList = 10007\nexport type SearchRelaysList = typeof SearchRelaysList\nexport const SimpleGroupList = 10009\nexport type SimpleGroupList = typeof SimpleGroupList\nexport const FavoriteRelays = 10012\nexport type FavoriteRelays = typeof FavoriteRelays\nexport const PrivateEventRelayList = 10013\nexport type PrivateEventRelayList = typeof PrivateEventRelayList\nexport const InterestsList = 10015\nexport type InterestsList = typeof InterestsList\nexport const NutZapInfo = 10019\nexport type NutZapInfo = typeof NutZapInfo\nexport const MediaFollows = 10020\nexport type MediaFollows = typeof MediaFollows\nexport const UserEmojiList = 10030\nexport type UserEmojiList = typeof UserEmojiList\nexport const DecoupledKeyAnnouncement = 10044\nexport type DecoupledKeyAnnouncement = typeof DecoupledKeyAnnouncement\nexport const DirectMessageRelaysList = 10050\nexport type DirectMessageRelaysList = typeof DirectMessageRelaysList\nexport const FavoritePodcasts = 10054\nexport type FavoritePodcasts = typeof FavoritePodcasts\nexport const BlossomServerList = 10063\nexport type BlossomServerList = typeof BlossomServerList\nexport const FileServerPreference = 10096\nexport type FileServerPreference = typeof FileServerPreference\nexport const GoodWikiAuthorList = 10101\nexport type GoodWikiAuthorList = typeof GoodWikiAuthorList\nexport const GoodWikiRelayList = 10102\nexport type GoodWikiRelayList = typeof GoodWikiRelayList\nexport const PodcastMetadata = 10154\nexport type PodcastMetadata = typeof PodcastMetadata\nexport const AuthoredPodcasts = 10164\nexport type AuthoredPodcasts = typeof AuthoredPodcasts\nexport const RelayMonitorAnnouncement = 10166\nexport type RelayMonitorAnnouncement = typeof RelayMonitorAnnouncement\nexport const RoomPresence = 10312\nexport type RoomPresence = typeof RoomPresence\nexport const UserGraspList = 10317\nexport type UserGraspList = typeof UserGraspList\nexport const ProxyAnnouncement = 10377\nexport type ProxyAnnouncement = typeof ProxyAnnouncement\nexport const TransportMethodAnnouncement = 11111\nexport type TransportMethodAnnouncement = typeof TransportMethodAnnouncement\nexport const NWCWalletInfo = 13194\nexport type NWCWalletInfo = typeof NWCWalletInfo\nexport const NsiteRoot = 15128\nexport type NsiteRoot = typeof NsiteRoot\nexport const CashuWalletEvent = 17375\nexport type CashuWalletEvent = typeof CashuWalletEvent\nexport const LightningPubRPC = 21000\nexport type LightningPubRPC = typeof LightningPubRPC\nexport const ClientAuth = 22242\nexport type ClientAuth = typeof ClientAuth\nexport const NWCWalletRequest = 23194\nexport type NWCWalletRequest = typeof NWCWalletRequest\nexport const NWCWalletResponse = 23195\nexport type NWCWalletResponse = typeof NWCWalletResponse\nexport const NostrConnect = 24133\nexport type NostrConnect = typeof NostrConnect\nexport const BlobsAuth = 24242\nexport type BlobsAuth = typeof BlobsAuth\nexport const HTTPAuth = 27235\nexport type HTTPAuth = typeof HTTPAuth\nexport const Followsets = 30000\nexport type Followsets = typeof Followsets\nexport const Genericlists = 30001\nexport type Genericlists = typeof Genericlists\nexport const Relaysets = 30002\nexport type Relaysets = typeof Relaysets\nexport const Bookmarksets = 30003\nexport type Bookmarksets = typeof Bookmarksets\nexport const Curationsets = 30004\nexport type Curationsets = typeof Curationsets\nexport const CuratedVideoSets = 30005\nexport type CuratedVideoSets = typeof CuratedVideoSets\nexport const MuteSets = 30007\nexport type MuteSets = typeof MuteSets\nexport const ProfileBadges = 30008\nexport type ProfileBadges = typeof ProfileBadges\nexport const BadgeDefinition = 30009\nexport type BadgeDefinition = typeof BadgeDefinition\nexport const Interestsets = 30015\nexport type Interestsets = typeof Interestsets\nexport const CreateOrUpdateStall = 30017\nexport type CreateOrUpdateStall = typeof CreateOrUpdateStall\nexport const CreateOrUpdateProduct = 30018\nexport type CreateOrUpdateProduct = typeof CreateOrUpdateProduct\nexport const MarketplaceUI = 30019\nexport type MarketplaceUI = typeof MarketplaceUI\nexport const ProductSoldAsAuction = 30020\nexport type ProductSoldAsAuction = typeof ProductSoldAsAuction\nexport const LongFormArticle = 30023\nexport type LongFormArticle = typeof LongFormArticle\nexport const DraftLong = 30024\nexport type DraftLong = typeof DraftLong\nexport const Emojisets = 30030\nexport type Emojisets = typeof Emojisets\nexport const ModularArticleHeader = 30040\nexport type ModularArticleHeader = typeof ModularArticleHeader\nexport const ModularArticleContent = 30041\nexport type ModularArticleContent = typeof ModularArticleContent\nexport const ReleaseArtifactSets = 30063\nexport type ReleaseArtifactSets = typeof ReleaseArtifactSets\nexport const Application = 30078\nexport type Application = typeof Application\nexport const RelayDiscovery = 30166\nexport type RelayDiscovery = typeof RelayDiscovery\nexport const AppCurationSet = 30267\nexport type AppCurationSet = typeof AppCurationSet\nexport const LiveEvent = 30311\nexport type LiveEvent = typeof LiveEvent\nexport const InteractiveRoom = 30312\nexport type InteractiveRoom = typeof InteractiveRoom\nexport const ConferenceEvent = 30313\nexport type ConferenceEvent = typeof ConferenceEvent\nexport const UserStatuses = 30315\nexport type UserStatuses = typeof UserStatuses\nexport const SlideSet = 30388\nexport type SlideSet = typeof SlideSet\nexport const ClassifiedListing = 30402\nexport type ClassifiedListing = typeof ClassifiedListing\nexport const DraftClassifiedListing = 30403\nexport type DraftClassifiedListing = typeof DraftClassifiedListing\nexport const RepositoryAnnouncement = 30617\nexport type RepositoryAnnouncement = typeof RepositoryAnnouncement\nexport const RepositoryState = 30618\nexport type RepositoryState = typeof RepositoryState\nexport const WikiArticle = 30818\nexport type WikiArticle = typeof WikiArticle\nexport const Redirects = 30819\nexport type Redirects = typeof Redirects\nexport const DraftEvent = 31234\nexport type DraftEvent = typeof DraftEvent\nexport const LinkSet = 31388\nexport type LinkSet = typeof LinkSet\nexport const Feed = 31890\nexport type Feed = typeof Feed\nexport const Date = 31922\nexport type Date = typeof Date\nexport const Time = 31923\nexport type Time = typeof Time\nexport const Calendar = 31924\nexport type Calendar = typeof Calendar\nexport const CalendarEventRSVP = 31925\nexport type CalendarEventRSVP = typeof CalendarEventRSVP\nexport const RelayReview = 31987\nexport type RelayReview = typeof RelayReview\nexport const Handlerrecommendation = 31989\nexport type Handlerrecommendation = typeof Handlerrecommendation\nexport const Handlerinformation = 31990\nexport type Handlerinformation = typeof Handlerinformation\nexport const SoftwareApplication = 32267\nexport type SoftwareApplication = typeof SoftwareApplication\nexport const LegacyNsiteFile = 34128\nexport type LegacyNsiteFile = typeof LegacyNsiteFile\nexport const VideoViewEvent = 34237\nexport type VideoViewEvent = typeof VideoViewEvent\nexport const CommunityDefinition = 34550\nexport type CommunityDefinition = typeof CommunityDefinition\nexport const NsiteNamed = 35128\nexport type NsiteNamed = typeof NsiteNamed\nexport const GeocacheListing = 37515\nexport type GeocacheListing = typeof GeocacheListing\nexport const GeocacheLogEntry = 37516\nexport type GeocacheLogEntry = typeof GeocacheLogEntry\nexport const CashuMintAnnouncement = 38172\nexport type CashuMintAnnouncement = typeof CashuMintAnnouncement\nexport const FedimintAnnouncement = 38173\nexport type FedimintAnnouncement = typeof FedimintAnnouncement\nexport const PeerToPeerOrderEvents = 38383\nexport type PeerToPeerOrderEvents = typeof PeerToPeerOrderEvents\nexport const GroupMetadata = 39000\nexport type GroupMetadata = typeof GroupMetadata\nexport const SimpleGroupAdmins = 39001\nexport type SimpleGroupAdmins = typeof SimpleGroupAdmins\nexport const SimpleGroupMembers = 39002\nexport type SimpleGroupMembers = typeof SimpleGroupMembers\nexport const SimpleGroupRoles = 39003\nexport type SimpleGroupRoles = typeof SimpleGroupRoles\nexport const SimpleGroupLiveKitParticipants = 39004\nexport type SimpleGroupLiveKitParticipants = typeof SimpleGroupLiveKitParticipants\nexport const StarterPacks = 39089\nexport type StarterPacks = typeof StarterPacks\nexport const MediaStarterPacks = 39092\nexport type MediaStarterPacks = typeof MediaStarterPacks\nexport const WebBookmarks = 39701\nexport type WebBookmarks = typeof WebBookmarks\n"],
5
+ "mappings": ";;;;;;;AAAA,SAAS,cAAc;AACvB,SAAS,kBAAkB;;;ACOpB,IAAM,iBAAiB,OAAO,UAAU;AAsB/C,IAAM,WAAW,CAAC,QAAiD,eAAe;AAE3E,SAAS,cAAiB,OAAsC;AACrE,MAAI,CAAC,SAAS,KAAK;AAAG,WAAO;AAC7B,MAAI,OAAO,MAAM,SAA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"description": "Tools for making a Nostr client.",
6
6
  "repository": {
7
7
  "type": "git",