@candypoets/nipworker 0.93.0 → 0.94.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/utils.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { nip19 as $, generateSecretKey as B, getPublicKey as A } from "nostr-tools";
2
2
  import { g as G } from "./index2.js";
3
3
  import { b as N } from "./NarrowTypes.js";
4
- import { l as ee, a0 as te, _ as ne, f as se, j as ae, g as oe, $ as ie, a1 as re, p as ce, r as de, H as le, J as ue, D as pe, F as ge, B as he, L as fe, t as ye, v as we, x as ke, z as me, N as Ke, P as ve, R as De, T as Se, V as xe, a5 as Ce, a3 as be, X as Me, a4 as Te, e as Be, d as Ae, Z as Ie, n as Pe, a2 as Re, k as Ee, h as $e, c as Ge, o as Ne, q as Le, G as Ve, I as ze, C as Ze, E as _e, A as He, K as Oe, s as Ue, u as Qe, w as Fe, y as We, M as je, O as Je, Q as Xe, S as Ye, U as qe, W as et, a as tt, i as nt, Y as st, m as at } from "./NarrowTypes.js";
5
- import { J as h, t as d, O as m, Q as M, T, U as I, X as L, Y as V, Z as z, _ as Z, $ as _ } from "./worker-message.js";
4
+ import { l as ee, a4 as te, a2 as ne, f as se, j as ae, g as oe, a3 as ie, a5 as re, p as ce, r as de, L as le, N as ue, H as pe, J as ge, B as he, P as fe, D as ye, F as we, t as Ke, v as ke, x as me, z as ve, R as De, T as Se, V as xe, X as Ce, Z as be, a9 as Me, a7 as Te, $ as Be, a8 as Ae, e as Ie, d as Pe, a1 as Re, n as Ee, a6 as $e, k as Ge, h as Ne, c as Le, o as Ve, q as ze, K as Ze, M as _e, G as He, I as Oe, A as Ue, O as Qe, C as Fe, E as We, s as je, u as Je, w as Xe, y as Ye, Q as qe, S as et, U as tt, W as nt, Y as st, _ as at, a as ot, i as it, a0 as rt, m as ct } from "./NarrowTypes.js";
5
+ import { J as h, v as d, O as k, Q as M, T, U as I, X as L, Y as V, Z as z, _ as Z, $ as _ } from "./worker-message.js";
6
6
  class F {
7
7
  constructor() {
8
8
  this.knownRelays = /* @__PURE__ */ new Map(), this.incomingCount = 0, this.resolvedCount = 0;
@@ -69,7 +69,7 @@ async function W(c) {
69
69
  t.encode(e),
70
70
  d.CashuData,
71
71
  new V(t.encode(e))
72
- ), K = (e) => new h(
72
+ ), m = (e) => new h(
73
73
  t.encode("hashtag"),
74
74
  t.encode(`#${e}`),
75
75
  d.HashtagData,
@@ -131,7 +131,7 @@ async function W(c) {
131
131
  type: "hashtag",
132
132
  // Match hashtags that are not part of a URL
133
133
  regex: new RegExp(`(?<![^\\s"'(])(#[a-zA-Z0-9_]+)(?![a-zA-Z0-9_])`, "g"),
134
- processMatch: (e) => K(e[0].substring(1))
134
+ processMatch: (e) => m(e[0].substring(1))
135
135
  },
136
136
  {
137
137
  type: "image",
@@ -175,7 +175,7 @@ async function W(c) {
175
175
  for (const { start: e, end: s, block: n } of x)
176
176
  e > D && i.push(r(c.substring(D, e))), i.push(n), D = s;
177
177
  D < c.length && i.push(r(c.substring(D)));
178
- const k = [];
178
+ const K = [];
179
179
  let u = [];
180
180
  const E = (e) => /^\s+$/.test(e);
181
181
  for (let e = 0; e < i.length; e++) {
@@ -190,21 +190,21 @@ async function W(c) {
190
190
  const n = u.map((a) => {
191
191
  if (a.dataType === d.ImageData) {
192
192
  const g = a.data;
193
- return new m(
193
+ return new k(
194
194
  new M(t.encode(g.url ?? a.text), null),
195
195
  null
196
196
  );
197
197
  } else if (a.dataType === d.VideoData) {
198
198
  const g = a.data;
199
- return new m(
199
+ return new k(
200
200
  null,
201
201
  new T(t.encode(g.url ?? a.text), null)
202
202
  );
203
203
  }
204
- return new m(null, null);
204
+ return new k(null, null);
205
205
  }), p = u.map((a) => String(a.text ?? "")).join(`
206
206
  `);
207
- k.push(
207
+ K.push(
208
208
  new h(
209
209
  t.encode("mediaGrid"),
210
210
  t.encode(p),
@@ -213,10 +213,10 @@ async function W(c) {
213
213
  )
214
214
  );
215
215
  } else
216
- k.push(u[0]);
216
+ K.push(u[0]);
217
217
  u = [];
218
218
  }
219
- k.push(s);
219
+ K.push(s);
220
220
  }
221
221
  }
222
222
  if (u.length > 0)
@@ -224,21 +224,21 @@ async function W(c) {
224
224
  const e = u.map((n) => {
225
225
  if (n.dataType === d.ImageData) {
226
226
  const p = n.data;
227
- return new m(
227
+ return new k(
228
228
  new M(t.encode(p.url ?? n.text), null),
229
229
  null
230
230
  );
231
231
  } else if (n.dataType === d.VideoData) {
232
232
  const p = n.data;
233
- return new m(
233
+ return new k(
234
234
  null,
235
235
  new T(t.encode(p.url ?? n.text), null)
236
236
  );
237
237
  }
238
- return new m(null, null);
238
+ return new k(null, null);
239
239
  }), s = u.map((n) => String(n.text ?? "")).join(`
240
240
  `);
241
- k.push(
241
+ K.push(
242
242
  new h(
243
243
  t.encode("mediaGrid"),
244
244
  t.encode(s),
@@ -247,8 +247,8 @@ async function W(c) {
247
247
  )
248
248
  );
249
249
  } else
250
- k.push(u[0]);
251
- return k;
250
+ K.push(u[0]);
251
+ return K;
252
252
  }
253
253
  function j(c, i) {
254
254
  const r = c[`${String(i)}Length`]();
@@ -285,8 +285,8 @@ async function X(c, i) {
285
285
  for (const v of i)
286
286
  y.append("relay", v);
287
287
  y.set("secret", w), y.set("name", c);
288
- const K = `nostrconnect://${l}?${y.toString()}`;
289
- return console.log("connect url:", K), G().setNip46QR(K, f), K;
288
+ const m = `nostrconnect://${l}?${y.toString()}`;
289
+ return console.log("connect url:", m), G().setNip46QR(m, f), m;
290
290
  }
291
291
  export {
292
292
  F as ConnectionTracker,
@@ -306,52 +306,56 @@ export {
306
306
  ge as asKind1311,
307
307
  he as asKind17,
308
308
  fe as asKind17375,
309
- ye as asKind3,
310
- we as asKind4,
311
- ke as asKind6,
312
- me as asKind7,
313
- Ke as asKind7374,
314
- ve as asKind7375,
315
- De as asKind7376,
316
- Se as asKind9321,
317
- xe as asKind9735,
318
- Ce as asLinkPreview,
319
- be as asMediaGroupData,
320
- Me as asNip51,
321
- Te as asNostrData,
322
- Be as asNostrEvent,
323
- Ae as asParsedEvent,
324
- Ie as asPreGeneric,
325
- Pe as asValidProofs,
326
- Re as asVideoData,
309
+ ye as asKind20,
310
+ we as asKind22,
311
+ Ke as asKind3,
312
+ ke as asKind4,
313
+ me as asKind6,
314
+ ve as asKind7,
315
+ De as asKind7374,
316
+ Se as asKind7375,
317
+ xe as asKind7376,
318
+ Ce as asKind9321,
319
+ be as asKind9735,
320
+ Me as asLinkPreview,
321
+ Te as asMediaGroupData,
322
+ Be as asNip51,
323
+ Ae as asNostrData,
324
+ Ie as asNostrEvent,
325
+ Pe as asParsedEvent,
326
+ Re as asPreGeneric,
327
+ Ee as asValidProofs,
328
+ $e as asVideoData,
327
329
  X as connectWithQRCode,
328
330
  J as fbArray,
329
331
  j as fbIterable,
330
- Ee as isBufferFull,
332
+ Ge as isBufferFull,
331
333
  N as isConnectionStatus,
332
- $e as isCountResponse,
333
- Ge as isEoce,
334
- Ne as isKind0,
335
- Le as isKind1,
336
- Ve as isKind10002,
337
- ze as isKind10019,
338
- Ze as isKind1111,
339
- _e as isKind1311,
340
- He as isKind17,
341
- Oe as isKind17375,
342
- Ue as isKind3,
343
- Qe as isKind4,
344
- Fe as isKind6,
345
- We as isKind7,
346
- je as isKind7374,
347
- Je as isKind7375,
348
- Xe as isKind7376,
349
- Ye as isKind9321,
350
- qe as isKind9735,
351
- et as isNip51,
352
- tt as isNostrEvent,
353
- nt as isParsedEvent,
354
- st as isPreGeneric,
355
- at as isValidProofs,
334
+ Ne as isCountResponse,
335
+ Le as isEoce,
336
+ Ve as isKind0,
337
+ ze as isKind1,
338
+ Ze as isKind10002,
339
+ _e as isKind10019,
340
+ He as isKind1111,
341
+ Oe as isKind1311,
342
+ Ue as isKind17,
343
+ Qe as isKind17375,
344
+ Fe as isKind20,
345
+ We as isKind22,
346
+ je as isKind3,
347
+ Je as isKind4,
348
+ Xe as isKind6,
349
+ Ye as isKind7,
350
+ qe as isKind7374,
351
+ et as isKind7375,
352
+ tt as isKind7376,
353
+ nt as isKind9321,
354
+ st as isKind9735,
355
+ at as isNip51,
356
+ ot as isNostrEvent,
357
+ it as isParsedEvent,
358
+ rt as isPreGeneric,
359
+ ct as isValidProofs,
356
360
  W as parseContent
357
361
  };
@@ -2794,8 +2794,7 @@ class P {
2794
2794
  t.startVector(4, s, 4);
2795
2795
  }
2796
2796
  static endKind20Parsed(t) {
2797
- const s = t.endObject();
2798
- return t.requiredField(s, 8), s;
2797
+ return t.endObject();
2799
2798
  }
2800
2799
  static createKind20Parsed(t, s, e, i, o, r, a, h, d) {
2801
2800
  return P.startKind20Parsed(t), P.addTitle(t, s), P.addDescription(t, e), P.addImages(t, i), P.addContentWarning(t, o), P.addLocation(t, r), P.addGeohash(t, a), P.addHashtags(t, h), P.addMentions(t, d), P.endKind20Parsed(t);
@@ -6731,12 +6730,12 @@ class be {
6731
6730
  }
6732
6731
  export {
6733
6732
  _s as $,
6734
- R as A,
6733
+ U as A,
6735
6734
  St as B,
6736
6735
  bt as C,
6737
- L as D,
6736
+ tt as D,
6738
6737
  wt as E,
6739
- P as F,
6738
+ R as F,
6740
6739
  Ht as G,
6741
6740
  Rt as H,
6742
6741
  nt as I,
@@ -6854,22 +6853,22 @@ export {
6854
6853
  Et as f,
6855
6854
  M as g,
6856
6855
  G as h,
6857
- _ as i,
6858
- N as j,
6859
- It as k,
6860
- W as l,
6861
- X as m,
6862
- ht as n,
6863
- H as o,
6864
- v as p,
6865
- I as q,
6866
- F as r,
6867
- f as s,
6868
- qt as t,
6869
- yt as u,
6870
- Vt as v,
6871
- ot as w,
6872
- Lt as x,
6873
- U as y,
6874
- tt as z
6856
+ P as i,
6857
+ L as j,
6858
+ _ as k,
6859
+ N as l,
6860
+ It as m,
6861
+ W as n,
6862
+ X as o,
6863
+ ht as p,
6864
+ H as q,
6865
+ v as r,
6866
+ I as s,
6867
+ F as t,
6868
+ f as u,
6869
+ qt as v,
6870
+ yt as w,
6871
+ Vt as x,
6872
+ ot as y,
6873
+ Lt as z
6875
6874
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candypoets/nipworker",
3
- "version": "0.93.0",
3
+ "version": "0.94.0",
4
4
  "description": "Nostr client library with worker-based architecture using Rust WASM",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",