@synonymdev/pubky 0.5.2 → 0.5.4

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/index.cjs CHANGED
@@ -212,28 +212,17 @@ function debugString(val) {
212
212
  return className;
213
213
  }
214
214
 
215
- function takeFromExternrefTable0(idx) {
216
- const value = wasm.__wbindgen_export_2.get(idx);
217
- wasm.__externref_table_dealloc(idx);
218
- return value;
219
- }
220
- /**
221
- * @param {string} level
222
- */
223
- module.exports.setLogLevel = function(level) {
224
- const ptr0 = passStringToWasm0(level, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
225
- const len0 = WASM_VECTOR_LEN;
226
- const ret = wasm.setLogLevel(ptr0, len0);
227
- if (ret[1]) {
228
- throw takeFromExternrefTable0(ret[0]);
229
- }
230
- };
231
-
232
215
  function _assertClass(instance, klass) {
233
216
  if (!(instance instanceof klass)) {
234
217
  throw new Error(`expected instance of ${klass.name}`);
235
218
  }
236
219
  }
220
+
221
+ function takeFromExternrefTable0(idx) {
222
+ const value = wasm.__wbindgen_export_2.get(idx);
223
+ wasm.__externref_table_dealloc(idx);
224
+ return value;
225
+ }
237
226
  /**
238
227
  * Create a recovery file of the `keypair`, containing the secret key encrypted
239
228
  * using the `passphrase`.
@@ -284,16 +273,28 @@ function getArrayJsValueFromWasm0(ptr, len) {
284
273
  wasm.__externref_drop_slice(ptr, len);
285
274
  return result;
286
275
  }
276
+ /**
277
+ * @param {string} level
278
+ */
279
+ module.exports.setLogLevel = function(level) {
280
+ const ptr0 = passStringToWasm0(level, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
281
+ const len0 = WASM_VECTOR_LEN;
282
+ const ret = wasm.setLogLevel(ptr0, len0);
283
+ if (ret[1]) {
284
+ throw takeFromExternrefTable0(ret[0]);
285
+ }
286
+ };
287
+
287
288
  function __wbg_adapter_28(arg0, arg1) {
288
- wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h76b7e185a7848c9a(arg0, arg1);
289
+ wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h05941f9305bd75fb(arg0, arg1);
289
290
  }
290
291
 
291
292
  function __wbg_adapter_31(arg0, arg1, arg2) {
292
- wasm.closure650_externref_shim(arg0, arg1, arg2);
293
+ wasm.closure147_externref_shim(arg0, arg1, arg2);
293
294
  }
294
295
 
295
- function __wbg_adapter_167(arg0, arg1, arg2, arg3) {
296
- wasm.closure767_externref_shim(arg0, arg1, arg2, arg3);
296
+ function __wbg_adapter_74(arg0, arg1, arg2, arg3) {
297
+ wasm.closure70_externref_shim(arg0, arg1, arg2, arg3);
297
298
  }
298
299
 
299
300
  const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
@@ -384,17 +385,6 @@ class Client {
384
385
  const ptr = this.__destroy_into_raw();
385
386
  wasm.__wbg_client_free(ptr, 0);
386
387
  }
387
- /**
388
- * @param {string} url
389
- * @param {any | null} [init]
390
- * @returns {Promise<Promise<any>>}
391
- */
392
- fetch(url, init) {
393
- const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
394
- const len0 = WASM_VECTOR_LEN;
395
- const ret = wasm.client_fetch(this.__wbg_ptr, ptr0, len0, isLikeNone(init) ? 0 : addToExternrefTable0(init));
396
- return ret;
397
- }
398
388
  /**
399
389
  * Signup to a homeserver and update Pkarr accordingly.
400
390
  *
@@ -540,6 +530,17 @@ class Client {
540
530
  const ret = wasm.client_list(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(reverse) ? 0xFFFFFF : reverse ? 1 : 0, isLikeNone(limit) ? 0xFFFFFF : limit, isLikeNone(shallow) ? 0xFFFFFF : shallow ? 1 : 0);
541
531
  return ret;
542
532
  }
533
+ /**
534
+ * @param {string} url
535
+ * @param {any | null} [init]
536
+ * @returns {Promise<Promise<any>>}
537
+ */
538
+ fetch(url, init) {
539
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
540
+ const len0 = WASM_VECTOR_LEN;
541
+ const ret = wasm.client_fetch(this.__wbg_ptr, ptr0, len0, isLikeNone(init) ? 0 : addToExternrefTable0(init));
542
+ return ret;
543
+ }
543
544
  /**
544
545
  * Create a new Pubky Client with an optional configuration.
545
546
  * @param {PubkyClientConfig | null} [config_opt]
@@ -795,12 +796,12 @@ module.exports.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(fun
795
796
  return ret;
796
797
  }, arguments) };
797
798
 
798
- module.exports.__wbg_clearTimeout_0b53d391c1b94dda = function(arg0) {
799
+ module.exports.__wbg_clearTimeout_86721db0036bea98 = function(arg0) {
799
800
  const ret = clearTimeout(arg0);
800
801
  return ret;
801
802
  };
802
803
 
803
- module.exports.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
804
+ module.exports.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
804
805
  const ret = arg0.crypto;
805
806
  return ret;
806
807
  };
@@ -818,26 +819,26 @@ module.exports.__wbg_error_80de38b3f7cc3c3c = function(arg0, arg1, arg2, arg3) {
818
819
  console.error(arg0, arg1, arg2, arg3);
819
820
  };
820
821
 
821
- module.exports.__wbg_fetch_11bff8299d0ecd2b = function(arg0) {
822
- const ret = fetch(arg0);
822
+ module.exports.__wbg_fetch_509096533071c657 = function(arg0, arg1) {
823
+ const ret = arg0.fetch(arg1);
823
824
  return ret;
824
825
  };
825
826
 
826
- module.exports.__wbg_fetch_509096533071c657 = function(arg0, arg1) {
827
- const ret = arg0.fetch(arg1);
827
+ module.exports.__wbg_fetch_9e120ad639656465 = function(arg0) {
828
+ const ret = fetch(arg0);
828
829
  return ret;
829
830
  };
830
831
 
831
- module.exports.__wbg_fetch_de12f9389c1d3a90 = function(arg0) {
832
+ module.exports.__wbg_fetch_d36a73832f0a45e8 = function(arg0) {
832
833
  const ret = fetch(arg0);
833
834
  return ret;
834
835
  };
835
836
 
836
- module.exports.__wbg_getRandomValues_3c9c0d586e575a16 = function() { return handleError(function (arg0, arg1) {
837
+ module.exports.__wbg_getRandomValues_78e016fdd1d721cf = function() { return handleError(function (arg0, arg1) {
837
838
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
838
839
  }, arguments) };
839
840
 
840
- module.exports.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
841
+ module.exports.__wbg_getRandomValues_bcb4912f16000dc4 = function() { return handleError(function (arg0, arg1) {
841
842
  arg0.getRandomValues(arg1);
842
843
  }, arguments) };
843
844
 
@@ -885,7 +886,7 @@ module.exports.__wbg_log_cad59bb680daec67 = function(arg0, arg1, arg2, arg3) {
885
886
  console.log(arg0, arg1, arg2, arg3);
886
887
  };
887
888
 
888
- module.exports.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
889
+ module.exports.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
889
890
  const ret = arg0.msCrypto;
890
891
  return ret;
891
892
  };
@@ -902,7 +903,7 @@ module.exports.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
902
903
  const a = state0.a;
903
904
  state0.a = 0;
904
905
  try {
905
- return __wbg_adapter_167(a, state0.b, arg0, arg1);
906
+ return __wbg_adapter_74(a, state0.b, arg0, arg1);
906
907
  } finally {
907
908
  state0.a = a;
908
909
  }
@@ -964,7 +965,7 @@ module.exports.__wbg_next_6574e1a8a62d1055 = function() { return handleError(fun
964
965
  return ret;
965
966
  }, arguments) };
966
967
 
967
- module.exports.__wbg_node_905d3e251edff8a2 = function(arg0) {
968
+ module.exports.__wbg_node_02999533c4ea02e3 = function(arg0) {
968
969
  const ret = arg0.node;
969
970
  return ret;
970
971
  };
@@ -974,7 +975,7 @@ module.exports.__wbg_now_807e54c39636c349 = function() {
974
975
  return ret;
975
976
  };
976
977
 
977
- module.exports.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
978
+ module.exports.__wbg_process_5c1d670bc53614b8 = function(arg0) {
978
979
  const ret = arg0.process;
979
980
  return ret;
980
981
  };
@@ -998,11 +999,11 @@ module.exports.__wbg_queueMicrotask_d3219def82552485 = function(arg0) {
998
999
  return ret;
999
1000
  };
1000
1001
 
1001
- module.exports.__wbg_randomFillSync_ac0988aba3254290 = function() { return handleError(function (arg0, arg1) {
1002
+ module.exports.__wbg_randomFillSync_ab2cfe79ebbf2740 = function() { return handleError(function (arg0, arg1) {
1002
1003
  arg0.randomFillSync(arg1);
1003
1004
  }, arguments) };
1004
1005
 
1005
- module.exports.__wbg_require_60cc747a6bc5215a = function() { return handleError(function () {
1006
+ module.exports.__wbg_require_79b1e9274cde3c87 = function() { return handleError(function () {
1006
1007
  const ret = module.require;
1007
1008
  return ret;
1008
1009
  }, arguments) };
@@ -1017,7 +1018,7 @@ module.exports.__wbg_session_new = function(arg0) {
1017
1018
  return ret;
1018
1019
  };
1019
1020
 
1020
- module.exports.__wbg_setTimeout_73ce8df12de4f2f2 = function(arg0, arg1) {
1021
+ module.exports.__wbg_setTimeout_2e707715f8cc9497 = function(arg0, arg1) {
1021
1022
  const ret = setTimeout(arg0, arg1);
1022
1023
  return ret;
1023
1024
  };
@@ -1118,7 +1119,7 @@ module.exports.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
1118
1119
  return ret;
1119
1120
  };
1120
1121
 
1121
- module.exports.__wbg_versions_c01dfd4722a88165 = function(arg0) {
1122
+ module.exports.__wbg_versions_c71aa1626a93e0a1 = function(arg0) {
1122
1123
  const ret = arg0.versions;
1123
1124
  return ret;
1124
1125
  };
@@ -1137,13 +1138,13 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
1137
1138
  return ret;
1138
1139
  };
1139
1140
 
1140
- module.exports.__wbindgen_closure_wrapper1409 = function(arg0, arg1, arg2) {
1141
- const ret = makeMutClosure(arg0, arg1, 624, __wbg_adapter_28);
1141
+ module.exports.__wbindgen_closure_wrapper2423 = function(arg0, arg1, arg2) {
1142
+ const ret = makeMutClosure(arg0, arg1, 129, __wbg_adapter_28);
1142
1143
  return ret;
1143
1144
  };
1144
1145
 
1145
- module.exports.__wbindgen_closure_wrapper1514 = function(arg0, arg1, arg2) {
1146
- const ret = makeMutClosure(arg0, arg1, 651, __wbg_adapter_31);
1146
+ module.exports.__wbindgen_closure_wrapper2756 = function(arg0, arg1, arg2) {
1147
+ const ret = makeMutClosure(arg0, arg1, 129, __wbg_adapter_31);
1147
1148
  return ret;
1148
1149
  };
1149
1150
 
@@ -1210,7 +1211,7 @@ module.exports.__wbindgen_throw = function(arg0, arg1) {
1210
1211
  throw new Error(getStringFromWasm0(arg0, arg1));
1211
1212
  };
1212
1213
 
1213
- const path = require('path').join(__dirname, 'pubky_wasm_bg.wasm');
1214
+ const path = require('path').join(__dirname, 'pubky_bg.wasm');
1214
1215
  const bytes = require('fs').readFileSync(path);
1215
1216
 
1216
1217
  const wasmModule = new WebAssembly.Module(bytes);