@synonymdev/pubky 0.6.0-rc.2 → 0.6.0-rc.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (6) hide show
  1. package/README.md +117 -40
  2. package/index.cjs +499 -147
  3. package/index.js +534 -152
  4. package/package.json +9 -5
  5. package/pubky.d.ts +296 -186
  6. package/pubky_bg.wasm +0 -0
package/index.cjs CHANGED
@@ -111,15 +111,15 @@ function handleError(f, args) {
111
111
  }
112
112
  }
113
113
 
114
+ function isLikeNone(x) {
115
+ return x === undefined || x === null;
116
+ }
117
+
114
118
  function getArrayU8FromWasm0(ptr, len) {
115
119
  ptr = ptr >>> 0;
116
120
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
117
121
  }
118
122
 
119
- function isLikeNone(x) {
120
- return x === undefined || x === null;
121
- }
122
-
123
123
  const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
124
124
  ? { register: () => {}, unregister: () => {} }
125
125
  : new FinalizationRegistry(state => {
@@ -216,18 +216,18 @@ function debugString(val) {
216
216
  return className;
217
217
  }
218
218
 
219
- function _assertClass(instance, klass) {
220
- if (!(instance instanceof klass)) {
221
- throw new Error(`expected instance of ${klass.name}`);
222
- }
223
- }
224
-
225
219
  function takeFromExternrefTable0(idx) {
226
220
  const value = wasm.__wbindgen_export_4.get(idx);
227
221
  wasm.__externref_table_dealloc(idx);
228
222
  return value;
229
223
  }
230
224
 
225
+ function _assertClass(instance, klass) {
226
+ if (!(instance instanceof klass)) {
227
+ throw new Error(`expected instance of ${klass.name}`);
228
+ }
229
+ }
230
+
231
231
  function passArray8ToWasm0(arg, malloc) {
232
232
  const ptr = malloc(arg.length * 1, 1) >>> 0;
233
233
  getUint8ArrayMemory0().set(arg, ptr / 1);
@@ -248,13 +248,13 @@ function getArrayJsValueFromWasm0(ptr, len) {
248
248
  /**
249
249
  * Set the global logging verbosity for the WASM Pubky SDK. Routes Rust `log` output to the browser console.
250
250
  *
251
- * Accepted values (case-insensitive): "error" | "warn" | "info" | "debug" | "trace".
251
+ * Accepted values (case-sensitive): "error" | "warn" | "info" | "debug" | "trace".
252
252
  * Effects:
253
253
  * - Initializes the logger once; subsequent calls may throw if the logger is already set.
254
254
  * - Emits a single info log: `Log level set to: <level>`.
255
255
  * - Messages at or above `level` are forwarded to the appropriate `console.*` method.
256
256
  *
257
- * @param {string} level
257
+ * @param {Level} level
258
258
  * Minimum log level to enable. One of: "error" | "warn" | "info" | "debug" | "trace".
259
259
  *
260
260
  * @returns {void}
@@ -265,17 +265,44 @@ function getArrayJsValueFromWasm0(ptr, len) {
265
265
  *
266
266
  * Usage:
267
267
  * Call once at application startup, before invoking other SDK APIs.
268
- * @param {string} level
268
+ * @param {Level} level
269
269
  */
270
270
  module.exports.setLogLevel = function(level) {
271
- const ptr0 = passStringToWasm0(level, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
272
- const len0 = WASM_VECTOR_LEN;
273
- const ret = wasm.setLogLevel(ptr0, len0);
271
+ const ret = wasm.setLogLevel((__wbindgen_enum_Level.indexOf(level) + 1 || 6) - 1);
274
272
  if (ret[1]) {
275
273
  throw takeFromExternrefTable0(ret[0]);
276
274
  }
277
275
  };
278
276
 
277
+ /**
278
+ * Resolve a `pubky://` or `pubky<pk>/…` identifier into the homeserver transport URL.
279
+ *
280
+ * @param {string} identifier Either `pubky<pk>/...` (preferred) or `pubky://<pk>/...`.
281
+ * @returns {string} HTTPS URL in the form `https://_pubky.<pk>/...`.
282
+ * @param {string} identifier
283
+ * @returns {string}
284
+ */
285
+ module.exports.resolvePubky = function(identifier) {
286
+ let deferred3_0;
287
+ let deferred3_1;
288
+ try {
289
+ const ptr0 = passStringToWasm0(identifier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
290
+ const len0 = WASM_VECTOR_LEN;
291
+ const ret = wasm.resolvePubky(ptr0, len0);
292
+ var ptr2 = ret[0];
293
+ var len2 = ret[1];
294
+ if (ret[3]) {
295
+ ptr2 = 0; len2 = 0;
296
+ throw takeFromExternrefTable0(ret[2]);
297
+ }
298
+ deferred3_0 = ptr2;
299
+ deferred3_1 = len2;
300
+ return getStringFromWasm0(ptr2, len2);
301
+ } finally {
302
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
303
+ }
304
+ };
305
+
279
306
  /**
280
307
  * Validate and normalize a capabilities string.
281
308
  *
@@ -284,7 +311,8 @@ module.exports.setLogLevel = function(level) {
284
311
  *
285
312
  * @param {string} input
286
313
  * @returns {string} Normalized string (same shape as input).
287
- * @throws {PubkyJsError} `{ name: "InvalidInput" }` with a helpful message.
314
+ * @throws {PubkyError} `{ name: "InvalidInput" }` with a helpful message.
315
+ * The error's `data` field is `{ invalidEntries: string[] }` listing malformed tokens.
288
316
  * @param {string} input
289
317
  * @returns {string}
290
318
  */
@@ -310,17 +338,21 @@ module.exports.validateCapabilities = function(input) {
310
338
  };
311
339
 
312
340
  function __wbg_adapter_54(arg0, arg1) {
313
- wasm.wasm_bindgen__convert__closures_____invoke__h1ed9ddf46f2cacfa(arg0, arg1);
341
+ wasm.wasm_bindgen__convert__closures_____invoke__hb6e4fd3a69a27099(arg0, arg1);
314
342
  }
315
343
 
316
344
  function __wbg_adapter_57(arg0, arg1, arg2) {
317
- wasm.closure170_externref_shim(arg0, arg1, arg2);
345
+ wasm.closure179_externref_shim(arg0, arg1, arg2);
318
346
  }
319
347
 
320
- function __wbg_adapter_120(arg0, arg1, arg2, arg3) {
321
- wasm.closure74_externref_shim(arg0, arg1, arg2, arg3);
348
+ function __wbg_adapter_128(arg0, arg1, arg2, arg3) {
349
+ wasm.closure89_externref_shim(arg0, arg1, arg2, arg3);
322
350
  }
323
351
 
352
+ const __wbindgen_enum_Level = ["error", "warn", "info", "debug", "trace"];
353
+
354
+ const __wbindgen_enum_ReadableStreamType = ["bytes"];
355
+
324
356
  const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
325
357
 
326
358
  const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
@@ -361,7 +393,7 @@ class AuthFlow {
361
393
  }
362
394
  /**
363
395
  * Start a flow (standalone).
364
- * Prefer `pubky.startAuthFlow()` to reuse a façade client.
396
+ * Prefer `pubky.startAuthFlow()` to reuse a facade client.
365
397
  *
366
398
  * @param {string} capabilities
367
399
  * Comma-separated capabilities, e.g. `"/pub/app/:rw,/priv/foo.txt:r"`.
@@ -377,14 +409,14 @@ class AuthFlow {
377
409
  * @returns {AuthFlow}
378
410
  * A running auth flow. Call `authorizationUrl()` to show the deep link,
379
411
  * then `awaitApproval()` to receive a `Session`.
380
- * @throws {PubkyJsError}
412
+ * @throws {PubkyError}
381
413
  * - `{ name: "InvalidInput", message: string }` if any capability entry is invalid
382
414
  * or for an invalid relay URL.
383
415
  * @example
384
416
  * const flow = AuthFlow.start("/pub/my.app/:rw,/pub/pubky.app/:w");
385
417
  * renderQRCode(flow.authorizationUrl());
386
418
  * const session = await flow.awaitApproval();
387
- * @param {string} capabilities
419
+ * @param {Capabilities} capabilities
388
420
  * @param {string | null} [relay]
389
421
  * @returns {AuthFlow}
390
422
  */
@@ -408,7 +440,7 @@ class AuthFlow {
408
440
  * renderQr(flow.authorizationUrl());
409
441
  * @returns {string}
410
442
  */
411
- authorizationUrl() {
443
+ get authorizationUrl() {
412
444
  let deferred1_0;
413
445
  let deferred1_1;
414
446
  try {
@@ -426,7 +458,7 @@ class AuthFlow {
426
458
  * @returns {Promise<Session>}
427
459
  * Resolves when approved; rejects on timeout/cancel/network errors.
428
460
  *
429
- * @throws {PubkyJsError}
461
+ * @throws {PubkyError}
430
462
  * - `RequestError` if relay/network fails
431
463
  * - `AuthenticationError` if approval is denied/invalid
432
464
  * @returns {Promise<Session>}
@@ -442,7 +474,7 @@ class AuthFlow {
442
474
  * @returns {Promise<AuthToken>}
443
475
  * Resolves when approved; rejects on timeout/cancel/network errors.
444
476
  *
445
- * @throws {PubkyJsError}
477
+ * @throws {PubkyError}
446
478
  * - `RequestError` if relay/network fails
447
479
  * @returns {Promise<AuthToken>}
448
480
  */
@@ -454,7 +486,7 @@ class AuthFlow {
454
486
  /**
455
487
  * Non-blocking single poll step (advanced UIs).
456
488
  *
457
- * @returns {Promise<Session|null>} A session if the approval arrived, otherwise `null`.
489
+ * @returns {Promise<Session|undefined>} A session if the approval arrived, otherwise `undefined`.
458
490
  * @returns {Promise<Session | undefined>}
459
491
  */
460
492
  tryPollOnce() {
@@ -563,12 +595,11 @@ class AuthToken {
563
595
  *
564
596
  * Use `.z32()` on the returned `PublicKey` to get the string form.
565
597
  *
566
- * ```js
567
- * const who = token.publicKey().z32();
568
- * ```
598
+ * @example
599
+ * const who = sessionInfo.publicKey.z32();
569
600
  * @returns {PublicKey}
570
601
  */
571
- publicKey() {
602
+ get publicKey() {
572
603
  const ret = wasm.authtoken_publicKey(this.__wbg_ptr);
573
604
  return PublicKey.__wrap(ret);
574
605
  }
@@ -581,11 +612,13 @@ class AuthToken {
581
612
  * Returns: `string[]`, where each item is the canonical entry `"<scope>:<actions>"`.
582
613
  *
583
614
  * Example entry: `"/pub/my.app/:rw"`
584
- * @returns {Array<any>}
615
+ * @returns {string[]}
585
616
  */
586
- capabilities() {
617
+ get capabilities() {
587
618
  const ret = wasm.authtoken_capabilities(this.__wbg_ptr);
588
- return ret;
619
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
620
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
621
+ return v1;
589
622
  }
590
623
  /**
591
624
  * Serialize the token to a `Uint8Array` in its **canonical** (postcard) binary format.
@@ -609,9 +642,9 @@ const ClientFinalization = (typeof FinalizationRegistry === 'undefined')
609
642
  ? { register: () => {}, unregister: () => {} }
610
643
  : new FinalizationRegistry(ptr => wasm.__wbg_client_free(ptr >>> 0, 1));
611
644
  /**
612
- * Low-level HTTP bridge used by the Pubky façade and actors.
645
+ * Low-level HTTP bridge used by the Pubky facade and actors.
613
646
  *
614
- * - Supports `pubky://<user-z32>/<abs-path>` and `http(s)://` URLs.
647
+ * - Supports `http(s)://` URLs targeting Pubky or ICANN hosts.
615
648
  * - In browsers/undici, passes `credentials: "include"` to send cookies.
616
649
  */
617
650
  class Client {
@@ -635,6 +668,26 @@ class Client {
635
668
  const ptr = this.__destroy_into_raw();
636
669
  wasm.__wbg_client_free(ptr, 0);
637
670
  }
671
+ /**
672
+ * Perform a raw fetch. Works with `http(s)://` URLs.
673
+ *
674
+ * @param {string} url
675
+ * @param {RequestInit} init Standard fetch options; `credentials: "include"` recommended for session I/O.
676
+ * @returns {Promise<Response>}
677
+ *
678
+ * @example
679
+ * const client = pubky.client;
680
+ * const res = await client.fetch(`https://_pubky.${user}/pub/app/file.txt`, { method: "PUT", body: "hi", credentials: "include" });
681
+ * @param {string} url
682
+ * @param {RequestInit | null} [init]
683
+ * @returns {Promise<Response>}
684
+ */
685
+ fetch(url, init) {
686
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
687
+ const len0 = WASM_VECTOR_LEN;
688
+ const ret = wasm.client_fetch(this.__wbg_ptr, ptr0, len0, isLikeNone(init) ? 0 : addToExternrefTable0(init));
689
+ return ret;
690
+ }
638
691
  /**
639
692
  * Create a Pubky HTTP client.
640
693
  *
@@ -643,7 +696,7 @@ class Client {
643
696
  * `{ pkarr?: { relays?: string[], request_timeout?: number } }`.
644
697
  *
645
698
  * @returns {Client}
646
- * A configured low-level client. Prefer `new Pubky().client()` unless you
699
+ * A configured low-level client. Prefer `new Pubky().client` unless you
647
700
  * need custom relays/timeouts.
648
701
  *
649
702
  * @throws {InvalidInput}
@@ -668,8 +721,7 @@ class Client {
668
721
  /**
669
722
  * Create a client wired for **local testnet**.
670
723
  *
671
- * Sets PKARR relays to `http://<host>:15411/` and enables WASM `pubky://`
672
- * mapping for that host.
724
+ * Configures PKARR relays for the testnet and remembers the hostname for WASM `_pubky` mapping.
673
725
  *
674
726
  * @param {string} [host="localhost"]
675
727
  * Testnet hostname or IP.
@@ -695,28 +747,145 @@ class Client {
695
747
  }
696
748
  return Client.__wrap(ret[0]);
697
749
  }
750
+ }
751
+ module.exports.Client = Client;
752
+
753
+ const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined')
754
+ ? { register: () => {}, unregister: () => {} }
755
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingbytesource_free(ptr >>> 0, 1));
756
+
757
+ class IntoUnderlyingByteSource {
758
+
759
+ __destroy_into_raw() {
760
+ const ptr = this.__wbg_ptr;
761
+ this.__wbg_ptr = 0;
762
+ IntoUnderlyingByteSourceFinalization.unregister(this);
763
+ return ptr;
764
+ }
765
+
766
+ free() {
767
+ const ptr = this.__destroy_into_raw();
768
+ wasm.__wbg_intounderlyingbytesource_free(ptr, 0);
769
+ }
698
770
  /**
699
- * Perform a raw fetch. Works with `pubky://` or `http(s)://` URLs.
700
- *
701
- * @param {string} url
702
- * @param {RequestInit=} init Standard fetch options; `credentials: "include"` recommended for session I/O.
703
- * @returns {Promise<Response>}
704
- *
705
- * @example
706
- * const client = pubky.client();
707
- * const res = await client.fetch(`pubky://${user}/pub/app/file.txt`, { method: "PUT", body: "hi", credentials: "include" });
708
- * @param {string} url
709
- * @param {any | null} [init]
710
- * @returns {Promise<Promise<any>>}
771
+ * @returns {ReadableStreamType}
711
772
  */
712
- fetch(url, init) {
713
- const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
714
- const len0 = WASM_VECTOR_LEN;
715
- const ret = wasm.client_fetch(this.__wbg_ptr, ptr0, len0, isLikeNone(init) ? 0 : addToExternrefTable0(init));
773
+ get type() {
774
+ const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr);
775
+ return __wbindgen_enum_ReadableStreamType[ret];
776
+ }
777
+ /**
778
+ * @returns {number}
779
+ */
780
+ get autoAllocateChunkSize() {
781
+ const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr);
782
+ return ret >>> 0;
783
+ }
784
+ /**
785
+ * @param {ReadableByteStreamController} controller
786
+ */
787
+ start(controller) {
788
+ wasm.intounderlyingbytesource_start(this.__wbg_ptr, controller);
789
+ }
790
+ /**
791
+ * @param {ReadableByteStreamController} controller
792
+ * @returns {Promise<any>}
793
+ */
794
+ pull(controller) {
795
+ const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, controller);
716
796
  return ret;
717
797
  }
798
+ cancel() {
799
+ const ptr = this.__destroy_into_raw();
800
+ wasm.intounderlyingbytesource_cancel(ptr);
801
+ }
718
802
  }
719
- module.exports.Client = Client;
803
+ module.exports.IntoUnderlyingByteSource = IntoUnderlyingByteSource;
804
+
805
+ const IntoUnderlyingSinkFinalization = (typeof FinalizationRegistry === 'undefined')
806
+ ? { register: () => {}, unregister: () => {} }
807
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsink_free(ptr >>> 0, 1));
808
+
809
+ class IntoUnderlyingSink {
810
+
811
+ __destroy_into_raw() {
812
+ const ptr = this.__wbg_ptr;
813
+ this.__wbg_ptr = 0;
814
+ IntoUnderlyingSinkFinalization.unregister(this);
815
+ return ptr;
816
+ }
817
+
818
+ free() {
819
+ const ptr = this.__destroy_into_raw();
820
+ wasm.__wbg_intounderlyingsink_free(ptr, 0);
821
+ }
822
+ /**
823
+ * @param {any} chunk
824
+ * @returns {Promise<any>}
825
+ */
826
+ write(chunk) {
827
+ const ret = wasm.intounderlyingsink_write(this.__wbg_ptr, chunk);
828
+ return ret;
829
+ }
830
+ /**
831
+ * @returns {Promise<any>}
832
+ */
833
+ close() {
834
+ const ptr = this.__destroy_into_raw();
835
+ const ret = wasm.intounderlyingsink_close(ptr);
836
+ return ret;
837
+ }
838
+ /**
839
+ * @param {any} reason
840
+ * @returns {Promise<any>}
841
+ */
842
+ abort(reason) {
843
+ const ptr = this.__destroy_into_raw();
844
+ const ret = wasm.intounderlyingsink_abort(ptr, reason);
845
+ return ret;
846
+ }
847
+ }
848
+ module.exports.IntoUnderlyingSink = IntoUnderlyingSink;
849
+
850
+ const IntoUnderlyingSourceFinalization = (typeof FinalizationRegistry === 'undefined')
851
+ ? { register: () => {}, unregister: () => {} }
852
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsource_free(ptr >>> 0, 1));
853
+
854
+ class IntoUnderlyingSource {
855
+
856
+ static __wrap(ptr) {
857
+ ptr = ptr >>> 0;
858
+ const obj = Object.create(IntoUnderlyingSource.prototype);
859
+ obj.__wbg_ptr = ptr;
860
+ IntoUnderlyingSourceFinalization.register(obj, obj.__wbg_ptr, obj);
861
+ return obj;
862
+ }
863
+
864
+ __destroy_into_raw() {
865
+ const ptr = this.__wbg_ptr;
866
+ this.__wbg_ptr = 0;
867
+ IntoUnderlyingSourceFinalization.unregister(this);
868
+ return ptr;
869
+ }
870
+
871
+ free() {
872
+ const ptr = this.__destroy_into_raw();
873
+ wasm.__wbg_intounderlyingsource_free(ptr, 0);
874
+ }
875
+ /**
876
+ * @param {ReadableStreamDefaultController} controller
877
+ * @returns {Promise<any>}
878
+ */
879
+ pull(controller) {
880
+ const ret = wasm.intounderlyingsource_pull(this.__wbg_ptr, controller);
881
+ return ret;
882
+ }
883
+ cancel() {
884
+ const ptr = this.__destroy_into_raw();
885
+ wasm.intounderlyingsource_cancel(ptr);
886
+ }
887
+ }
888
+ module.exports.IntoUnderlyingSource = IntoUnderlyingSource;
720
889
 
721
890
  const KeypairFinalization = (typeof FinalizationRegistry === 'undefined')
722
891
  ? { register: () => {}, unregister: () => {} }
@@ -775,9 +944,14 @@ class Keypair {
775
944
  }
776
945
  /**
777
946
  * Returns the [PublicKey] of this keypair.
947
+ *
948
+ * Use `.z32()` on the returned `PublicKey` to get the string form.
949
+ *
950
+ * @example
951
+ * const who = keypair.publicKey.z32();
778
952
  * @returns {PublicKey}
779
953
  */
780
- publicKey() {
954
+ get publicKey() {
781
955
  const ret = wasm.keypair_publicKey(this.__wbg_ptr);
782
956
  return PublicKey.__wrap(ret);
783
957
  }
@@ -868,9 +1042,9 @@ class Pkdns {
868
1042
  * Resolve the homeserver for a given public key (read-only).
869
1043
  *
870
1044
  * @param {PublicKey} user
871
- * @returns {Promise<string|undefined>} Homeserver public key (z32) or `undefined` if not found.
1045
+ * @returns {Promise<PublicKey|undefined>} Homeserver public key or `undefined` if not found.
872
1046
  * @param {PublicKey} pubky
873
- * @returns {Promise<string | undefined>}
1047
+ * @returns {Promise<PublicKey | undefined>}
874
1048
  */
875
1049
  getHomeserverOf(pubky) {
876
1050
  _assertClass(pubky, PublicKey);
@@ -880,15 +1054,15 @@ class Pkdns {
880
1054
  /**
881
1055
  * Resolve the homeserver for **this** user (requires keypair).
882
1056
  *
883
- * @returns {Promise<string|undefined>} Homeserver public key (z32) or `undefined` if not found.
884
- * @returns {Promise<string | undefined>}
1057
+ * @returns {Promise<PublicKey|undefined>} Homeserver public key or `undefined` if not found.
1058
+ * @returns {Promise<PublicKey | undefined>}
885
1059
  */
886
1060
  getHomeserver() {
887
1061
  const ret = wasm.pkdns_getHomeserver(this.__wbg_ptr);
888
1062
  return ret;
889
1063
  }
890
1064
  /**
891
- * Republish homeserver if record is missing/stale.
1065
+ * Force publish homeserver immediately (even if fresh).
892
1066
  *
893
1067
  * Requires keypair or to be signer bound.
894
1068
  *
@@ -907,7 +1081,7 @@ class Pkdns {
907
1081
  return ret;
908
1082
  }
909
1083
  /**
910
- * Force publish homeserver immediately (even if fresh).
1084
+ * Republish homeserver if record is missing/stale.
911
1085
  *
912
1086
  * Requires keypair or to be signer bound.
913
1087
  *
@@ -956,10 +1130,10 @@ class Pubky {
956
1130
  wasm.__wbg_pubky_free(ptr, 0);
957
1131
  }
958
1132
  /**
959
- * Create a Pubky façade wired for **mainnet** defaults (public relays).
1133
+ * Create a Pubky facade wired for **mainnet** defaults (public relays).
960
1134
  *
961
1135
  * @returns {Pubky}
962
- * A new façade instance. Use this to create signers, start auth flows, etc.
1136
+ * A new facade instance. Use this to create signers, start auth flows, etc.
963
1137
  *
964
1138
  * @example
965
1139
  * const pubky = new Pubky();
@@ -975,7 +1149,7 @@ class Pubky {
975
1149
  return this;
976
1150
  }
977
1151
  /**
978
- * Create a Pubky façade preconfigured for a **local testnet**.
1152
+ * Create a Pubky facade preconfigured for a **local testnet**.
979
1153
  *
980
1154
  * If `host` is provided, PKARR and HTTP endpoints are derived as `http://<host>:ports/...`.
981
1155
  * If omitted, `"localhost"` is assumed (handy for `cargo install pubky-testnet`).
@@ -999,7 +1173,7 @@ class Pubky {
999
1173
  return Pubky.__wrap(ret[0]);
1000
1174
  }
1001
1175
  /**
1002
- * Wrap an existing configured HTTP client into a Pubky façade.
1176
+ * Wrap an existing configured HTTP client into a Pubky facade.
1003
1177
  *
1004
1178
  * @param {Client} client A previously constructed client.
1005
1179
  * @returns {Pubky}
@@ -1028,18 +1202,18 @@ class Pubky {
1028
1202
  * @param {string} capabilities Comma-separated caps, e.g. `"/pub/app/:rw,/pub/foo/file:r"`.
1029
1203
  * @param {string=} relay Optional HTTP relay base (e.g. `"https://…/link/"`).
1030
1204
  * @returns {AuthFlow}
1031
- * A running auth flow. Call `authorizationUrl()` to show a QR/deeplink,
1205
+ * A running auth flow. Show `authorizationUrl` as QR/deeplink,
1032
1206
  * then `awaitApproval()` to obtain a `Session`.
1033
1207
  *
1034
- * @throws {PubkyJsError}
1208
+ * @throws {PubkyError}
1035
1209
  * - `{ name: "InvalidInput" }` for malformed capabilities or bad relay URL
1036
1210
  * - `{ name: "RequestError" }` if the flow cannot be started (network/relay)
1037
1211
  *
1038
1212
  * @example
1039
1213
  * const flow = pubky.startAuthFlow("/pub/my.app/:rw");
1040
- * renderQr(flow.authorizationUrl());
1214
+ * renderQr(flow.authorizationUrl);
1041
1215
  * const session = await flow.awaitApproval();
1042
- * @param {string} capabilities
1216
+ * @param {Capabilities} capabilities
1043
1217
  * @param {string | null} [relay]
1044
1218
  * @returns {AuthFlow}
1045
1219
  */
@@ -1068,8 +1242,7 @@ class Pubky {
1068
1242
  */
1069
1243
  signer(keypair) {
1070
1244
  _assertClass(keypair, Keypair);
1071
- var ptr0 = keypair.__destroy_into_raw();
1072
- const ret = wasm.pubky_signer(this.__wbg_ptr, ptr0);
1245
+ const ret = wasm.pubky_signer(this.__wbg_ptr, keypair.__wbg_ptr);
1073
1246
  return Signer.__wrap(ret);
1074
1247
  }
1075
1248
  /**
@@ -1081,27 +1254,27 @@ class Pubky {
1081
1254
  * @returns {PublicStorage}
1082
1255
  *
1083
1256
  * @example
1084
- * const pub = pubky.publicStorage();
1085
- * const text = await pub.getText(`${userPk.z32()}/pub/example.com/hello.txt`);
1257
+ * const text = await pubky.publicStorage.getText(`${userPk.z32()}/pub/example.com/hello.txt`);
1086
1258
  * @returns {PublicStorage}
1087
1259
  */
1088
- publicStorage() {
1089
- const ret = wasm.pubky_publicStorage(this.__wbg_ptr);
1260
+ get publicStorage() {
1261
+ const ret = wasm.pubky_client(this.__wbg_ptr);
1090
1262
  return PublicStorage.__wrap(ret);
1091
1263
  }
1092
1264
  /**
1093
- * Read-only PKDNS (Pkarr) resolver.
1265
+ * Resolve the homeserver for a given public key (read-only).
1094
1266
  *
1095
- * @returns {Pkdns}
1267
+ * Uses an internal read-only Pkdns actor.
1096
1268
  *
1097
- * @example
1098
- * const dns = pubky.pkdns();
1099
- * const homeserver = await dns.getHomeserverOf(userPk);
1100
- * @returns {Pkdns}
1269
+ * @param {PublicKey} user
1270
+ * @returns {Promise<PublicKey|undefined>} Homeserver public key (z32) or `undefined` if not found.
1271
+ * @param {PublicKey} user_public_key
1272
+ * @returns {Promise<PublicKey | undefined>}
1101
1273
  */
1102
- pkdns() {
1103
- const ret = wasm.pubky_pkdns(this.__wbg_ptr);
1104
- return Pkdns.__wrap(ret);
1274
+ getHomeserverOf(user_public_key) {
1275
+ _assertClass(user_public_key, PublicKey);
1276
+ const ret = wasm.pubky_getHomeserverOf(this.__wbg_ptr, user_public_key.__wbg_ptr);
1277
+ return ret;
1105
1278
  }
1106
1279
  /**
1107
1280
  * Access the underlying HTTP client (advanced).
@@ -1110,10 +1283,10 @@ class Pubky {
1110
1283
  * Use this for low-level `fetch()` calls or testing with raw URLs.
1111
1284
  *
1112
1285
  * @example
1113
- * const r = await pubky.client().fetch(`pubky://${user}/pub/app/file.txt`, { credentials: "include" });
1286
+ * const r = await pubky.client.fetch(`pubky://${user}/pub/app/file.txt`, { credentials: "include" });
1114
1287
  * @returns {Client}
1115
1288
  */
1116
- client() {
1289
+ get client() {
1117
1290
  const ret = wasm.pubky_client(this.__wbg_ptr);
1118
1291
  return Client.__wrap(ret);
1119
1292
  }
@@ -1226,15 +1399,15 @@ class PublicStorage {
1226
1399
  return this;
1227
1400
  }
1228
1401
  /**
1229
- * List a directory. Results are `pubky://…` absolute URLs.
1402
+ * List a directory. Results are `pubky://…` identifier URLs.
1230
1403
  *
1231
- * @param {string} address Addressed directory (must end with `/`).
1404
+ * @param {Address} address Addressed directory (must end with `/`).
1232
1405
  * @param {string|null=} cursor Optional suffix or full URL to start **after**.
1233
1406
  * @param {boolean=} reverse Default `false`. When `true`, newest/lexicographically-last first.
1234
1407
  * @param {number=} limit Optional result limit.
1235
1408
  * @param {boolean=} shallow Default `false`. When `true`, lists only first-level entries.
1236
1409
  * @returns {Promise<string[]>}
1237
- * @param {string} address
1410
+ * @param {Address} address
1238
1411
  * @param {string | null} [cursor]
1239
1412
  * @param {boolean | null} [reverse]
1240
1413
  * @param {number | null} [limit]
@@ -1249,12 +1422,26 @@ class PublicStorage {
1249
1422
  const ret = wasm.publicstorage_list(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(reverse) ? 0xFFFFFF : reverse ? 1 : 0, isLikeNone(limit) ? 0xFFFFFF : limit, isLikeNone(shallow) ? 0xFFFFFF : shallow ? 1 : 0);
1250
1423
  return ret;
1251
1424
  }
1425
+ /**
1426
+ * Perform a streaming `GET` and expose the raw `Response` object.
1427
+ *
1428
+ * @param {Address} address
1429
+ * @returns {Promise<Response>}
1430
+ * @param {Address} address
1431
+ * @returns {Promise<Response>}
1432
+ */
1433
+ get(address) {
1434
+ const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1435
+ const len0 = WASM_VECTOR_LEN;
1436
+ const ret = wasm.publicstorage_get(this.__wbg_ptr, ptr0, len0);
1437
+ return ret;
1438
+ }
1252
1439
  /**
1253
1440
  * Fetch bytes from an addressed path.
1254
1441
  *
1255
- * @param {string} address
1442
+ * @param {Address} address
1256
1443
  * @returns {Promise<Uint8Array>}
1257
- * @param {string} address
1444
+ * @param {Address} address
1258
1445
  * @returns {Promise<Uint8Array>}
1259
1446
  */
1260
1447
  getBytes(address) {
@@ -1266,9 +1453,9 @@ class PublicStorage {
1266
1453
  /**
1267
1454
  * Fetch text from an addressed path as UTF-8 text.
1268
1455
  *
1269
- * @param {string} address
1456
+ * @param {Address} address
1270
1457
  * @returns {Promise<string>}
1271
- * @param {string} address
1458
+ * @param {Address} address
1272
1459
  * @returns {Promise<string>}
1273
1460
  */
1274
1461
  getText(address) {
@@ -1280,9 +1467,9 @@ class PublicStorage {
1280
1467
  /**
1281
1468
  * Fetch JSON from an addressed path.
1282
1469
  *
1283
- * @param {string} address `"<user-z32>/pub/.../file.json"` or `pubky://<user>/pub/...`.
1470
+ * @param {Address} address `"pubky<user>/pub/.../file.json"` (preferred) or `pubky://<user>/pub/...`.
1284
1471
  * @returns {Promise<any>}
1285
- * @param {string} address
1472
+ * @param {Address} address
1286
1473
  * @returns {Promise<any>}
1287
1474
  */
1288
1475
  getJson(address) {
@@ -1294,9 +1481,9 @@ class PublicStorage {
1294
1481
  /**
1295
1482
  * Check if a path exists.
1296
1483
  *
1297
- * @param {string} address
1484
+ * @param {Address} address
1298
1485
  * @returns {Promise<boolean>}
1299
- * @param {string} address
1486
+ * @param {Address} address
1300
1487
  * @returns {Promise<boolean>}
1301
1488
  */
1302
1489
  exists(address) {
@@ -1308,10 +1495,10 @@ class PublicStorage {
1308
1495
  /**
1309
1496
  * Get metadata for an address
1310
1497
  *
1311
- * @param {string} address `"<user-z32>/pub/.../file.json"` or `pubky://<user>/pub/...`.
1498
+ * @param {Address} address `"pubky<user>/pub/.../file.json"` (preferred) or `pubky://<user>/pub/...`.
1312
1499
  * @returns {Promise<ResourceStats|undefined>} `undefined` if the resource does not exist.
1313
- * @throws {PubkyJsError} On invalid input or transport/server errors.
1314
- * @param {string} address
1500
+ * @throws {PubkyError} On invalid input or transport/server errors.
1501
+ * @param {Address} address
1315
1502
  * @returns {Promise<ResourceStats | undefined>}
1316
1503
  */
1317
1504
  stats(address) {
@@ -1328,7 +1515,7 @@ const SessionFinalization = (typeof FinalizationRegistry === 'undefined')
1328
1515
  : new FinalizationRegistry(ptr => wasm.__wbg_session_free(ptr >>> 0, 1));
1329
1516
  /**
1330
1517
  * An authenticated context “as the user”.
1331
- * - Use `storage()` for reads/writes (absolute paths like `/pub/app/file.txt`)
1518
+ * - Use `storage` for reads/writes (absolute paths like `/pub/app/file.txt`)
1332
1519
  * - Cookie is managed automatically by the underlying fetch client
1333
1520
  */
1334
1521
  class Session {
@@ -1358,7 +1545,7 @@ class Session {
1358
1545
  * @returns {SessionInfo}
1359
1546
  * @returns {SessionInfo}
1360
1547
  */
1361
- info() {
1548
+ get info() {
1362
1549
  const ret = wasm.session_info(this.__wbg_ptr);
1363
1550
  return SessionInfo.__wrap(ret);
1364
1551
  }
@@ -1368,20 +1555,19 @@ class Session {
1368
1555
  * @returns {SessionStorage}
1369
1556
  * @returns {SessionStorage}
1370
1557
  */
1371
- storage() {
1558
+ get storage() {
1372
1559
  const ret = wasm.session_storage(this.__wbg_ptr);
1373
1560
  return SessionStorage.__wrap(ret);
1374
1561
  }
1375
1562
  /**
1376
1563
  * Invalidate the session on the server (clears server cookie).
1377
- * It also consumes this JS/Wasm Session. Further calls will fail.
1564
+ * Further calls to storage API will fail.
1378
1565
  *
1379
1566
  * @returns {Promise<void>}
1380
1567
  * @returns {Promise<void>}
1381
1568
  */
1382
1569
  signout() {
1383
- const ptr = this.__destroy_into_raw();
1384
- const ret = wasm.session_signout(ptr);
1570
+ const ret = wasm.session_signout(this.__wbg_ptr);
1385
1571
  return ret;
1386
1572
  }
1387
1573
  }
@@ -1417,10 +1603,15 @@ class SessionInfo {
1417
1603
  /**
1418
1604
  * The user’s public key for this session.
1419
1605
  *
1606
+ * Use `.z32()` on the returned `PublicKey` to get the string form.
1607
+ *
1420
1608
  * @returns {PublicKey}
1609
+ *
1610
+ * @example
1611
+ * const who = sessionInfo.publicKey.z32();
1421
1612
  * @returns {PublicKey}
1422
1613
  */
1423
- publicKey() {
1614
+ get publicKey() {
1424
1615
  const ret = wasm.sessioninfo_publicKey(this.__wbg_ptr);
1425
1616
  return PublicKey.__wrap(ret);
1426
1617
  }
@@ -1430,7 +1621,7 @@ class SessionInfo {
1430
1621
  * @returns {string[]} Normalized capability entries (e.g. `"/pub/app/:rw"`).
1431
1622
  * @returns {string[]}
1432
1623
  */
1433
- capabilities() {
1624
+ get capabilities() {
1434
1625
  const ret = wasm.sessioninfo_capabilities(this.__wbg_ptr);
1435
1626
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1436
1627
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
@@ -1469,13 +1660,13 @@ class SessionStorage {
1469
1660
  /**
1470
1661
  * List a directory (absolute session path). Returns `pubky://…` URLs.
1471
1662
  *
1472
- * @param {string} path Must end with `/`.
1663
+ * @param {Path} path Must end with `/`.
1473
1664
  * @param {string|null=} cursor Optional suffix or full URL to start **after**.
1474
1665
  * @param {boolean=} reverse Default `false`.
1475
1666
  * @param {number=} limit Optional result limit.
1476
1667
  * @param {boolean=} shallow Default `false`.
1477
1668
  * @returns {Promise<string[]>}
1478
- * @param {string} path
1669
+ * @param {Path} path
1479
1670
  * @param {string | null} [cursor]
1480
1671
  * @param {boolean | null} [reverse]
1481
1672
  * @param {number | null} [limit]
@@ -1490,12 +1681,26 @@ class SessionStorage {
1490
1681
  const ret = wasm.sessionstorage_list(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(reverse) ? 0xFFFFFF : reverse ? 1 : 0, isLikeNone(limit) ? 0xFFFFFF : limit, isLikeNone(shallow) ? 0xFFFFFF : shallow ? 1 : 0);
1491
1682
  return ret;
1492
1683
  }
1684
+ /**
1685
+ * GET a streaming response for an absolute session path.
1686
+ *
1687
+ * @param {Path} path
1688
+ * @returns {Promise<Response>}
1689
+ * @param {Path} path
1690
+ * @returns {Promise<Response>}
1691
+ */
1692
+ get(path) {
1693
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1694
+ const len0 = WASM_VECTOR_LEN;
1695
+ const ret = wasm.sessionstorage_get(this.__wbg_ptr, ptr0, len0);
1696
+ return ret;
1697
+ }
1493
1698
  /**
1494
1699
  * GET bytes from an absolute session path.
1495
1700
  *
1496
- * @param {string} path
1701
+ * @param {Path} path
1497
1702
  * @returns {Promise<Uint8Array>}
1498
- * @param {string} path
1703
+ * @param {Path} path
1499
1704
  * @returns {Promise<Uint8Array>}
1500
1705
  */
1501
1706
  getBytes(path) {
@@ -1507,9 +1712,9 @@ class SessionStorage {
1507
1712
  /**
1508
1713
  * GET text from an absolute session path.
1509
1714
  *
1510
- * @param {string} path
1715
+ * @param {Path} path
1511
1716
  * @returns {Promise<string>}
1512
- * @param {string} path
1717
+ * @param {Path} path
1513
1718
  * @returns {Promise<string>}
1514
1719
  */
1515
1720
  getText(path) {
@@ -1521,13 +1726,13 @@ class SessionStorage {
1521
1726
  /**
1522
1727
  * GET JSON from an absolute session path.
1523
1728
  *
1524
- * @param {string} path
1729
+ * @param {Path} path
1525
1730
  * @returns {Promise<any>}
1526
- * @param {string} addr
1731
+ * @param {Path} path
1527
1732
  * @returns {Promise<any>}
1528
1733
  */
1529
- getJson(addr) {
1530
- const ptr0 = passStringToWasm0(addr, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1734
+ getJson(path) {
1735
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1531
1736
  const len0 = WASM_VECTOR_LEN;
1532
1737
  const ret = wasm.sessionstorage_getJson(this.__wbg_ptr, ptr0, len0);
1533
1738
  return ret;
@@ -1535,9 +1740,9 @@ class SessionStorage {
1535
1740
  /**
1536
1741
  * Check existence.
1537
1742
  *
1538
- * @param {string} path
1743
+ * @param {Path} path
1539
1744
  * @returns {Promise<boolean>}
1540
- * @param {string} path
1745
+ * @param {Path} path
1541
1746
  * @returns {Promise<boolean>}
1542
1747
  */
1543
1748
  exists(path) {
@@ -1549,10 +1754,10 @@ class SessionStorage {
1549
1754
  /**
1550
1755
  * Get metadata for an absolute, session-scoped path (e.g. `"/pub/app/file.json"`).
1551
1756
  *
1552
- * @param {string} path Absolute path under your user (starts with `/`).
1757
+ * @param {Path} path Absolute path under your user (starts with `/`).
1553
1758
  * @returns {Promise<ResourceStats|undefined>} `undefined` if the resource does not exist.
1554
- * @throws {PubkyJsError} On invalid input or transport/server errors.
1555
- * @param {string} path
1759
+ * @throws {PubkyError} On invalid input or transport/server errors.
1760
+ * @param {Path} path
1556
1761
  * @returns {Promise<ResourceStats | undefined>}
1557
1762
  */
1558
1763
  stats(path) {
@@ -1564,10 +1769,10 @@ class SessionStorage {
1564
1769
  /**
1565
1770
  * PUT binary at an absolute session path.
1566
1771
  *
1567
- * @param {string} path
1772
+ * @param {Path} path
1568
1773
  * @param {Uint8Array} bytes
1569
1774
  * @returns {Promise<void>}
1570
- * @param {string} path
1775
+ * @param {Path} path
1571
1776
  * @param {Uint8Array} body
1572
1777
  * @returns {Promise<void>}
1573
1778
  */
@@ -1582,10 +1787,10 @@ class SessionStorage {
1582
1787
  /**
1583
1788
  * PUT text at an absolute session path.
1584
1789
  *
1585
- * @param {string} path
1790
+ * @param {Path} path
1586
1791
  * @param {string} text
1587
1792
  * @returns {Promise<void>}
1588
- * @param {string} path
1793
+ * @param {Path} path
1589
1794
  * @param {string} body
1590
1795
  * @returns {Promise<void>}
1591
1796
  */
@@ -1600,10 +1805,10 @@ class SessionStorage {
1600
1805
  /**
1601
1806
  * PUT JSON at an absolute session path.
1602
1807
  *
1603
- * @param {string} path Absolute path (e.g. `"/pub/app/data.json"`).
1808
+ * @param {Path} path Absolute path (e.g. `"/pub/app/data.json"`).
1604
1809
  * @param {any} value JSON-serializable value.
1605
1810
  * @returns {Promise<void>}
1606
- * @param {string} path
1811
+ * @param {Path} path
1607
1812
  * @param {any} body
1608
1813
  * @returns {Promise<void>}
1609
1814
  */
@@ -1616,9 +1821,9 @@ class SessionStorage {
1616
1821
  /**
1617
1822
  * Delete a path (file or empty directory).
1618
1823
  *
1619
- * @param {string} path
1824
+ * @param {Path} path
1620
1825
  * @returns {Promise<void>}
1621
- * @param {string} path
1826
+ * @param {Path} path
1622
1827
  * @returns {Promise<void>}
1623
1828
  */
1624
1829
  delete(path) {
@@ -1672,7 +1877,10 @@ class Signer {
1672
1877
  static fromKeypair(keypair) {
1673
1878
  _assertClass(keypair, Keypair);
1674
1879
  const ret = wasm.signer_fromKeypair(keypair.__wbg_ptr);
1675
- return Signer.__wrap(ret);
1880
+ if (ret[2]) {
1881
+ throw takeFromExternrefTable0(ret[1]);
1882
+ }
1883
+ return Signer.__wrap(ret[0]);
1676
1884
  }
1677
1885
  /**
1678
1886
  * Get the public key of this signer.
@@ -1680,7 +1888,7 @@ class Signer {
1680
1888
  * @returns {PublicKey}
1681
1889
  * @returns {PublicKey}
1682
1890
  */
1683
- publicKey() {
1891
+ get publicKey() {
1684
1892
  const ret = wasm.signer_publicKey(this.__wbg_ptr);
1685
1893
  return PublicKey.__wrap(ret);
1686
1894
  }
@@ -1693,7 +1901,7 @@ class Signer {
1693
1901
  * @param {string|null} signupToken Invite/registration token or `null`.
1694
1902
  * @returns {Promise<Session>}
1695
1903
  *
1696
- * @throws {PubkyJsError}
1904
+ * @throws {PubkyError}
1697
1905
  * - `AuthenticationError` (bad/expired token)
1698
1906
  * - `RequestError` (network/server)
1699
1907
  * @param {PublicKey} homeserver
@@ -1714,7 +1922,7 @@ class Signer {
1714
1922
  *
1715
1923
  * @returns {Promise<Session>}
1716
1924
  *
1717
- * @throws {PubkyJsError}
1925
+ * @throws {PubkyError}
1718
1926
  * @returns {Promise<Session>}
1719
1927
  */
1720
1928
  signin() {
@@ -1748,9 +1956,12 @@ class Signer {
1748
1956
  * Get a PKDNS actor bound to this signer's client & keypair (publishing enabled).
1749
1957
  *
1750
1958
  * @returns {Pkdns}
1959
+ *
1960
+ * @example
1961
+ * await signer.pkdns.publishHomeserverIfStale(homeserverPk);
1751
1962
  * @returns {Pkdns}
1752
1963
  */
1753
- pkdns() {
1964
+ get pkdns() {
1754
1965
  const ret = wasm.signer_pkdns(this.__wbg_ptr);
1755
1966
  return Pkdns.__wrap(ret);
1756
1967
  }
@@ -1792,11 +2003,36 @@ module.exports.__wbg_authtoken_new = function(arg0) {
1792
2003
  return ret;
1793
2004
  };
1794
2005
 
2006
+ module.exports.__wbg_body_e1e045c770257634 = function(arg0) {
2007
+ const ret = arg0.body;
2008
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
2009
+ };
2010
+
1795
2011
  module.exports.__wbg_buffer_a1a27a0dfa70165d = function(arg0) {
1796
2012
  const ret = arg0.buffer;
1797
2013
  return ret;
1798
2014
  };
1799
2015
 
2016
+ module.exports.__wbg_buffer_e495ba54cee589cc = function(arg0) {
2017
+ const ret = arg0.buffer;
2018
+ return ret;
2019
+ };
2020
+
2021
+ module.exports.__wbg_byobRequest_56aa768ee4dfed17 = function(arg0) {
2022
+ const ret = arg0.byobRequest;
2023
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
2024
+ };
2025
+
2026
+ module.exports.__wbg_byteLength_937f8a52f9697148 = function(arg0) {
2027
+ const ret = arg0.byteLength;
2028
+ return ret;
2029
+ };
2030
+
2031
+ module.exports.__wbg_byteOffset_4d94b7170e641898 = function(arg0) {
2032
+ const ret = arg0.byteOffset;
2033
+ return ret;
2034
+ };
2035
+
1800
2036
  module.exports.__wbg_call_f2db6205e5c51dc8 = function() { return handleError(function (arg0, arg1, arg2) {
1801
2037
  const ret = arg0.call(arg1, arg2);
1802
2038
  return ret;
@@ -1807,11 +2043,29 @@ module.exports.__wbg_call_fbe8be8bf6436ce5 = function() { return handleError(fun
1807
2043
  return ret;
1808
2044
  }, arguments) };
1809
2045
 
2046
+ module.exports.__wbg_cancel_4d78160f447bbbeb = function(arg0) {
2047
+ const ret = arg0.cancel();
2048
+ return ret;
2049
+ };
2050
+
2051
+ module.exports.__wbg_catch_b51fce253ee18ec3 = function(arg0, arg1) {
2052
+ const ret = arg0.catch(arg1);
2053
+ return ret;
2054
+ };
2055
+
1810
2056
  module.exports.__wbg_clearTimeout_6222fede17abcb1a = function(arg0) {
1811
2057
  const ret = clearTimeout(arg0);
1812
2058
  return ret;
1813
2059
  };
1814
2060
 
2061
+ module.exports.__wbg_close_290fb040af98d3ac = function() { return handleError(function (arg0) {
2062
+ arg0.close();
2063
+ }, arguments) };
2064
+
2065
+ module.exports.__wbg_close_b2641ef0870e518c = function() { return handleError(function (arg0) {
2066
+ arg0.close();
2067
+ }, arguments) };
2068
+
1815
2069
  module.exports.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
1816
2070
  const ret = arg0.crypto;
1817
2071
  return ret;
@@ -1826,6 +2080,10 @@ module.exports.__wbg_done_4d01f352bade43b7 = function(arg0) {
1826
2080
  return ret;
1827
2081
  };
1828
2082
 
2083
+ module.exports.__wbg_enqueue_a62faa171c4fd287 = function() { return handleError(function (arg0, arg1) {
2084
+ arg0.enqueue(arg1);
2085
+ }, arguments) };
2086
+
1829
2087
  module.exports.__wbg_entries_41651c850143b957 = function(arg0) {
1830
2088
  const ret = Object.entries(arg0);
1831
2089
  return ret;
@@ -1835,7 +2093,7 @@ module.exports.__wbg_error_624160881466fd69 = function(arg0, arg1, arg2, arg3) {
1835
2093
  console.error(arg0, arg1, arg2, arg3);
1836
2094
  };
1837
2095
 
1838
- module.exports.__wbg_fetch_0fde801b2e1aa024 = function(arg0) {
2096
+ module.exports.__wbg_fetch_a4b4512b936c2d70 = function(arg0) {
1839
2097
  const ret = fetch(arg0);
1840
2098
  return ret;
1841
2099
  };
@@ -1850,6 +2108,11 @@ module.exports.__wbg_fetch_f156d10be9a5c88a = function(arg0) {
1850
2108
  return ret;
1851
2109
  };
1852
2110
 
2111
+ module.exports.__wbg_from_12ff8e47307bd4c7 = function(arg0) {
2112
+ const ret = Array.from(arg0);
2113
+ return ret;
2114
+ };
2115
+
1853
2116
  module.exports.__wbg_getRandomValues_3c9c0d586e575a16 = function() { return handleError(function (arg0, arg1) {
1854
2117
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1855
2118
  }, arguments) };
@@ -1858,6 +2121,11 @@ module.exports.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return hand
1858
2121
  arg0.getRandomValues(arg1);
1859
2122
  }, arguments) };
1860
2123
 
2124
+ module.exports.__wbg_getReader_48e00749fe3f6089 = function() { return handleError(function (arg0) {
2125
+ const ret = arg0.getReader();
2126
+ return ret;
2127
+ }, arguments) };
2128
+
1861
2129
  module.exports.__wbg_get_92470be87867c2e5 = function() { return handleError(function (arg0, arg1) {
1862
2130
  const ret = Reflect.get(arg0, arg1);
1863
2131
  return ret;
@@ -1868,6 +2136,16 @@ module.exports.__wbg_get_a131a44bd1eb6979 = function(arg0, arg1) {
1868
2136
  return ret;
1869
2137
  };
1870
2138
 
2139
+ module.exports.__wbg_getdone_8355ddb2bc75c731 = function(arg0) {
2140
+ const ret = arg0.done;
2141
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
2142
+ };
2143
+
2144
+ module.exports.__wbg_getvalue_c1890a401d13f00b = function(arg0) {
2145
+ const ret = arg0.value;
2146
+ return ret;
2147
+ };
2148
+
1871
2149
  module.exports.__wbg_has_809e438ee9d787a7 = function() { return handleError(function (arg0, arg1) {
1872
2150
  const ret = Reflect.has(arg0, arg1);
1873
2151
  return ret;
@@ -1893,6 +2171,17 @@ module.exports.__wbg_instanceof_ArrayBuffer_a8b6f580b363f2bc = function(arg0) {
1893
2171
  return ret;
1894
2172
  };
1895
2173
 
2174
+ module.exports.__wbg_instanceof_Error_58a92d81483a4b16 = function(arg0) {
2175
+ let result;
2176
+ try {
2177
+ result = arg0 instanceof Error;
2178
+ } catch (_) {
2179
+ result = false;
2180
+ }
2181
+ const ret = result;
2182
+ return ret;
2183
+ };
2184
+
1896
2185
  module.exports.__wbg_instanceof_Headers_8b4c0df841a5ed48 = function(arg0) {
1897
2186
  let result;
1898
2187
  try {
@@ -1981,6 +2270,11 @@ module.exports.__wbg_new_186abcfdff244e42 = function() { return handleError(func
1981
2270
  return ret;
1982
2271
  }, arguments) };
1983
2272
 
2273
+ module.exports.__wbg_new_476169e6d59f23ae = function(arg0, arg1) {
2274
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
2275
+ return ret;
2276
+ };
2277
+
1984
2278
  module.exports.__wbg_new_4796e1cd2eb9ea6d = function() { return handleError(function () {
1985
2279
  const ret = new Headers();
1986
2280
  return ret;
@@ -2003,7 +2297,7 @@ module.exports.__wbg_new_e30c39c06edaabf2 = function(arg0, arg1) {
2003
2297
  const a = state0.a;
2004
2298
  state0.a = 0;
2005
2299
  try {
2006
- return __wbg_adapter_120(a, state0.b, arg0, arg1);
2300
+ return __wbg_adapter_128(a, state0.b, arg0, arg1);
2007
2301
  } finally {
2008
2302
  state0.a = a;
2009
2303
  }
@@ -2035,11 +2329,21 @@ module.exports.__wbg_newwithbyteoffsetandlength_3b01ecda099177e8 = function(arg0
2035
2329
  return ret;
2036
2330
  };
2037
2331
 
2332
+ module.exports.__wbg_newwithintounderlyingsource_b47f6a6a596a7f24 = function(arg0, arg1) {
2333
+ const ret = new ReadableStream(IntoUnderlyingSource.__wrap(arg0), arg1);
2334
+ return ret;
2335
+ };
2336
+
2038
2337
  module.exports.__wbg_newwithlength_08f872dc1e3ada2e = function(arg0) {
2039
2338
  const ret = new Uint8Array(arg0 >>> 0);
2040
2339
  return ret;
2041
2340
  };
2042
2341
 
2342
+ module.exports.__wbg_newwithoptreadablestreamandinit_ce4ecbe22555867e = function() { return handleError(function (arg0, arg1) {
2343
+ const ret = new Response(arg0, arg1);
2344
+ return ret;
2345
+ }, arguments) };
2346
+
2043
2347
  module.exports.__wbg_newwithstrandinit_f8a9dbe009d6be37 = function() { return handleError(function (arg0, arg1, arg2) {
2044
2348
  const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
2045
2349
  return ret;
@@ -2075,8 +2379,8 @@ module.exports.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
2075
2379
  return ret;
2076
2380
  };
2077
2381
 
2078
- module.exports.__wbg_push_73fd7b5550ebf707 = function(arg0, arg1) {
2079
- const ret = arg0.push(arg1);
2382
+ module.exports.__wbg_publickey_new = function(arg0) {
2383
+ const ret = PublicKey.__wrap(arg0);
2080
2384
  return ret;
2081
2385
  };
2082
2386
 
@@ -2093,6 +2397,15 @@ module.exports.__wbg_randomFillSync_ac0988aba3254290 = function() { return handl
2093
2397
  arg0.randomFillSync(arg1);
2094
2398
  }, arguments) };
2095
2399
 
2400
+ module.exports.__wbg_read_f4b89f69cc51efc7 = function(arg0) {
2401
+ const ret = arg0.read();
2402
+ return ret;
2403
+ };
2404
+
2405
+ module.exports.__wbg_releaseLock_c589dd51c0812aca = function(arg0) {
2406
+ arg0.releaseLock();
2407
+ };
2408
+
2096
2409
  module.exports.__wbg_require_60cc747a6bc5215a = function() { return handleError(function () {
2097
2410
  const ret = module.require;
2098
2411
  return ret;
@@ -2103,6 +2416,10 @@ module.exports.__wbg_resolve_0dac8c580ffd4678 = function(arg0) {
2103
2416
  return ret;
2104
2417
  };
2105
2418
 
2419
+ module.exports.__wbg_respond_b227f1c3be2bb879 = function() { return handleError(function (arg0, arg1) {
2420
+ arg0.respond(arg1 >>> 0);
2421
+ }, arguments) };
2422
+
2106
2423
  module.exports.__wbg_session_new = function(arg0) {
2107
2424
  const ret = Session.__wrap(arg0);
2108
2425
  return ret;
@@ -2125,6 +2442,11 @@ module.exports.__wbg_set_b042eef31c50834d = function() { return handleError(func
2125
2442
  arg0.set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
2126
2443
  }, arguments) };
2127
2444
 
2445
+ module.exports.__wbg_set_c43293f93a35998a = function() { return handleError(function (arg0, arg1, arg2) {
2446
+ const ret = Reflect.set(arg0, arg1, arg2);
2447
+ return ret;
2448
+ }, arguments) };
2449
+
2128
2450
  module.exports.__wbg_set_d6bdfd275fb8a4ce = function(arg0, arg1, arg2) {
2129
2451
  const ret = arg0.set(arg1, arg2);
2130
2452
  return ret;
@@ -2146,10 +2468,18 @@ module.exports.__wbg_setcredentials_920d91fb5984c94a = function(arg0, arg1) {
2146
2468
  arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
2147
2469
  };
2148
2470
 
2471
+ module.exports.__wbg_setheaders_408564032a1382da = function(arg0, arg1) {
2472
+ arg0.headers = arg1;
2473
+ };
2474
+
2149
2475
  module.exports.__wbg_setheaders_65a4eb4c0443ae61 = function(arg0, arg1) {
2150
2476
  arg0.headers = arg1;
2151
2477
  };
2152
2478
 
2479
+ module.exports.__wbg_sethighwatermark_3017ad772d071dcb = function(arg0, arg1) {
2480
+ arg0.highWaterMark = arg1;
2481
+ };
2482
+
2153
2483
  module.exports.__wbg_setmethod_8ce1be0b4d701b7c = function(arg0, arg1, arg2) {
2154
2484
  arg0.method = getStringFromWasm0(arg1, arg2);
2155
2485
  };
@@ -2158,10 +2488,22 @@ module.exports.__wbg_setmode_bd35f026f55b6247 = function(arg0, arg1) {
2158
2488
  arg0.mode = __wbindgen_enum_RequestMode[arg1];
2159
2489
  };
2160
2490
 
2491
+ module.exports.__wbg_setname_098bc917fa3ff0d0 = function(arg0, arg1, arg2) {
2492
+ arg0.name = getStringFromWasm0(arg1, arg2);
2493
+ };
2494
+
2161
2495
  module.exports.__wbg_setsignal_8e72abfe7ee03c97 = function(arg0, arg1) {
2162
2496
  arg0.signal = arg1;
2163
2497
  };
2164
2498
 
2499
+ module.exports.__wbg_setstatus_bd5b448a903a8658 = function(arg0, arg1) {
2500
+ arg0.status = arg1;
2501
+ };
2502
+
2503
+ module.exports.__wbg_setstatustext_01104c878f7651a0 = function(arg0, arg1, arg2) {
2504
+ arg0.statusText = getStringFromWasm0(arg1, arg2);
2505
+ };
2506
+
2165
2507
  module.exports.__wbg_signal_b96223519a041faa = function(arg0) {
2166
2508
  const ret = arg0.signal;
2167
2509
  return ret;
@@ -2217,6 +2559,11 @@ module.exports.__wbg_then_db882932c0c714c6 = function(arg0, arg1) {
2217
2559
  return ret;
2218
2560
  };
2219
2561
 
2562
+ module.exports.__wbg_toString_21791a66666b3afd = function(arg0) {
2563
+ const ret = arg0.toString();
2564
+ return ret;
2565
+ };
2566
+
2220
2567
  module.exports.__wbg_url_e6ed869ea05b7a71 = function(arg0, arg1) {
2221
2568
  const ret = arg1.url;
2222
2569
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -2235,6 +2582,11 @@ module.exports.__wbg_versions_c01dfd4722a88165 = function(arg0) {
2235
2582
  return ret;
2236
2583
  };
2237
2584
 
2585
+ module.exports.__wbg_view_a9ad80dcbad7cf1c = function(arg0) {
2586
+ const ret = arg0.view;
2587
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
2588
+ };
2589
+
2238
2590
  module.exports.__wbg_warn_90607373221a6b1c = function(arg0, arg1, arg2, arg3) {
2239
2591
  console.warn(arg0, arg1, arg2, arg3);
2240
2592
  };
@@ -2281,13 +2633,13 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
2281
2633
  return ret;
2282
2634
  };
2283
2635
 
2284
- module.exports.__wbindgen_closure_wrapper2747 = function(arg0, arg1, arg2) {
2285
- const ret = makeMutClosure(arg0, arg1, 154, __wbg_adapter_54);
2636
+ module.exports.__wbindgen_closure_wrapper2879 = function(arg0, arg1, arg2) {
2637
+ const ret = makeMutClosure(arg0, arg1, 165, __wbg_adapter_54);
2286
2638
  return ret;
2287
2639
  };
2288
2640
 
2289
- module.exports.__wbindgen_closure_wrapper3056 = function(arg0, arg1, arg2) {
2290
- const ret = makeMutClosure(arg0, arg1, 154, __wbg_adapter_57);
2641
+ module.exports.__wbindgen_closure_wrapper2888 = function(arg0, arg1, arg2) {
2642
+ const ret = makeMutClosure(arg0, arg1, 178, __wbg_adapter_57);
2291
2643
  return ret;
2292
2644
  };
2293
2645