@xmtp/wasm-bindings 1.0.0-rc3 → 1.0.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.
@@ -230,62 +230,11 @@ function _assertClass(instance, klass) {
230
230
  }
231
231
  }
232
232
 
233
- function passArray8ToWasm0(arg, malloc) {
234
- const ptr = malloc(arg.length * 1, 1) >>> 0;
235
- getUint8ArrayMemory0().set(arg, ptr / 1);
236
- WASM_VECTOR_LEN = arg.length;
237
- return ptr;
238
- }
239
-
240
233
  function takeFromExternrefTable0(idx) {
241
234
  const value = wasm.__wbindgen_export_4.get(idx);
242
235
  wasm.__externref_table_dealloc(idx);
243
236
  return value;
244
237
  }
245
- /**
246
- * @param {string} host
247
- * @param {string} inbox_id
248
- * @param {Identifier} account_identifier
249
- * @param {string | null} [db_path]
250
- * @param {Uint8Array | null} [encryption_key]
251
- * @param {string | null} [history_sync_url]
252
- * @param {LogOptions | null} [log_options]
253
- * @returns {Promise<Client>}
254
- */
255
- export function createClient(host, inbox_id, account_identifier, db_path, encryption_key, history_sync_url, log_options) {
256
- const ptr0 = passStringToWasm0(host, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
257
- const len0 = WASM_VECTOR_LEN;
258
- const ptr1 = passStringToWasm0(inbox_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
259
- const len1 = WASM_VECTOR_LEN;
260
- _assertClass(account_identifier, Identifier);
261
- var ptr2 = account_identifier.__destroy_into_raw();
262
- var ptr3 = isLikeNone(db_path) ? 0 : passStringToWasm0(db_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
263
- var len3 = WASM_VECTOR_LEN;
264
- var ptr4 = isLikeNone(history_sync_url) ? 0 : passStringToWasm0(history_sync_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
265
- var len4 = WASM_VECTOR_LEN;
266
- let ptr5 = 0;
267
- if (!isLikeNone(log_options)) {
268
- _assertClass(log_options, LogOptions);
269
- ptr5 = log_options.__destroy_into_raw();
270
- }
271
- const ret = wasm.createClient(ptr0, len0, ptr1, len1, ptr2, ptr3, len3, isLikeNone(encryption_key) ? 0 : addToExternrefTable0(encryption_key), ptr4, len4, ptr5);
272
- return ret;
273
- }
274
-
275
- /**
276
- * @param {string} signature_text
277
- * @param {Uint8Array} signature_bytes
278
- * @param {Uint8Array} public_key
279
- */
280
- export function verifySignedWithPublicKey(signature_text, signature_bytes, public_key) {
281
- const ptr0 = passStringToWasm0(signature_text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
282
- const len0 = WASM_VECTOR_LEN;
283
- const ret = wasm.verifySignedWithPublicKey(ptr0, len0, signature_bytes, public_key);
284
- if (ret[1]) {
285
- throw takeFromExternrefTable0(ret[0]);
286
- }
287
- }
288
-
289
238
  /**
290
239
  * @param {MultiRemoteAttachment} multiRemoteAttachment
291
240
  * @returns {Uint8Array}
@@ -338,6 +287,26 @@ export function decodeReaction(bytes) {
338
287
  return Reaction.__wrap(ret[0]);
339
288
  }
340
289
 
290
+ /**
291
+ * @param {string} signature_text
292
+ * @param {Uint8Array} signature_bytes
293
+ * @param {Uint8Array} public_key
294
+ */
295
+ export function verifySignedWithPublicKey(signature_text, signature_bytes, public_key) {
296
+ const ptr0 = passStringToWasm0(signature_text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
297
+ const len0 = WASM_VECTOR_LEN;
298
+ const ret = wasm.verifySignedWithPublicKey(ptr0, len0, signature_bytes, public_key);
299
+ if (ret[1]) {
300
+ throw takeFromExternrefTable0(ret[0]);
301
+ }
302
+ }
303
+
304
+ function passArray8ToWasm0(arg, malloc) {
305
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
306
+ getUint8ArrayMemory0().set(arg, ptr / 1);
307
+ WASM_VECTOR_LEN = arg.length;
308
+ return ptr;
309
+ }
341
310
  /**
342
311
  * @param {string} host
343
312
  * @param {Identifier} accountIdentifier
@@ -346,9 +315,7 @@ export function decodeReaction(bytes) {
346
315
  export function getInboxIdForIdentifier(host, accountIdentifier) {
347
316
  const ptr0 = passStringToWasm0(host, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
348
317
  const len0 = WASM_VECTOR_LEN;
349
- _assertClass(accountIdentifier, Identifier);
350
- var ptr1 = accountIdentifier.__destroy_into_raw();
351
- const ret = wasm.getInboxIdForIdentifier(ptr0, len0, ptr1);
318
+ const ret = wasm.getInboxIdForIdentifier(ptr0, len0, accountIdentifier);
352
319
  return ret;
353
320
  }
354
321
 
@@ -357,41 +324,67 @@ export function getInboxIdForIdentifier(host, accountIdentifier) {
357
324
  * @returns {string}
358
325
  */
359
326
  export function generateInboxId(accountIdentifier) {
360
- let deferred3_0;
361
- let deferred3_1;
327
+ let deferred2_0;
328
+ let deferred2_1;
362
329
  try {
363
- _assertClass(accountIdentifier, Identifier);
364
- var ptr0 = accountIdentifier.__destroy_into_raw();
365
- const ret = wasm.generateInboxId(ptr0);
366
- var ptr2 = ret[0];
367
- var len2 = ret[1];
330
+ const ret = wasm.generateInboxId(accountIdentifier);
331
+ var ptr1 = ret[0];
332
+ var len1 = ret[1];
368
333
  if (ret[3]) {
369
- ptr2 = 0; len2 = 0;
334
+ ptr1 = 0; len1 = 0;
370
335
  throw takeFromExternrefTable0(ret[2]);
371
336
  }
372
- deferred3_0 = ptr2;
373
- deferred3_1 = len2;
374
- return getStringFromWasm0(ptr2, len2);
337
+ deferred2_0 = ptr1;
338
+ deferred2_1 = len1;
339
+ return getStringFromWasm0(ptr1, len1);
375
340
  } finally {
376
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
341
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
377
342
  }
378
343
  }
379
344
 
380
- function __wbg_adapter_46(arg0, arg1) {
345
+ /**
346
+ * @param {string} host
347
+ * @param {string} inbox_id
348
+ * @param {Identifier} account_identifier
349
+ * @param {string | null} [db_path]
350
+ * @param {Uint8Array | null} [encryption_key]
351
+ * @param {string | null} [history_sync_url]
352
+ * @param {LogOptions | null} [log_options]
353
+ * @returns {Promise<Client>}
354
+ */
355
+ export function createClient(host, inbox_id, account_identifier, db_path, encryption_key, history_sync_url, log_options) {
356
+ const ptr0 = passStringToWasm0(host, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
357
+ const len0 = WASM_VECTOR_LEN;
358
+ const ptr1 = passStringToWasm0(inbox_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
359
+ const len1 = WASM_VECTOR_LEN;
360
+ var ptr2 = isLikeNone(db_path) ? 0 : passStringToWasm0(db_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
361
+ var len2 = WASM_VECTOR_LEN;
362
+ var ptr3 = isLikeNone(history_sync_url) ? 0 : passStringToWasm0(history_sync_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
363
+ var len3 = WASM_VECTOR_LEN;
364
+ let ptr4 = 0;
365
+ if (!isLikeNone(log_options)) {
366
+ _assertClass(log_options, LogOptions);
367
+ ptr4 = log_options.__destroy_into_raw();
368
+ }
369
+ const ret = wasm.createClient(ptr0, len0, ptr1, len1, account_identifier, ptr2, len2, isLikeNone(encryption_key) ? 0 : addToExternrefTable0(encryption_key), ptr3, len3, ptr4);
370
+ return ret;
371
+ }
372
+
373
+ function __wbg_adapter_48(arg0, arg1) {
381
374
  wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hff1927556d6713ec(arg0, arg1);
382
375
  }
383
376
 
384
- function __wbg_adapter_49(arg0, arg1, arg2) {
385
- wasm.closure3754_externref_shim(arg0, arg1, arg2);
377
+ function __wbg_adapter_51(arg0, arg1, arg2) {
378
+ wasm.closure3799_externref_shim(arg0, arg1, arg2);
386
379
  }
387
380
 
388
- function __wbg_adapter_590(arg0, arg1, arg2, arg3, arg4) {
389
- const ret = wasm.closure4763_externref_shim(arg0, arg1, arg2, arg3, arg4);
381
+ function __wbg_adapter_598(arg0, arg1, arg2, arg3, arg4) {
382
+ const ret = wasm.closure4807_externref_shim(arg0, arg1, arg2, arg3, arg4);
390
383
  return ret !== 0;
391
384
  }
392
385
 
393
- function __wbg_adapter_691(arg0, arg1, arg2, arg3) {
394
- wasm.closure4762_externref_shim(arg0, arg1, arg2, arg3);
386
+ function __wbg_adapter_699(arg0, arg1, arg2, arg3) {
387
+ wasm.closure4806_externref_shim(arg0, arg1, arg2, arg3);
395
388
  }
396
389
 
397
390
  /**
@@ -463,13 +456,6 @@ export const GroupPermissionsOptions = Object.freeze({
463
456
  AdminOnly: 1, "1": "AdminOnly",
464
457
  CustomPolicy: 2, "2": "CustomPolicy",
465
458
  });
466
- /**
467
- * @enum {0 | 1}
468
- */
469
- export const IdentifierKind = Object.freeze({
470
- Ethereum: 0, "0": "Ethereum",
471
- Passkey: 1, "1": "Passkey",
472
- });
473
459
  /**
474
460
  * @enum {0 | 1 | 2 | 3 | 4}
475
461
  */
@@ -576,130 +562,6 @@ export class Client {
576
562
  const ptr = this.__destroy_into_raw();
577
563
  wasm.__wbg_client_free(ptr, 0);
578
564
  }
579
- /**
580
- *
581
- * * Get the client's inbox state.
582
- * *
583
- * * If `refresh_from_network` is true, the client will go to the network first to refresh the state.
584
- * * Otherwise, the state will be read from the local database.
585
- *
586
- * @param {boolean} refresh_from_network
587
- * @returns {Promise<InboxState>}
588
- */
589
- inboxState(refresh_from_network) {
590
- const ret = wasm.client_inboxState(this.__wbg_ptr, refresh_from_network);
591
- return ret;
592
- }
593
- /**
594
- * @param {string} inbox_id
595
- * @returns {Promise<InboxState>}
596
- */
597
- getLatestInboxState(inbox_id) {
598
- const ptr0 = passStringToWasm0(inbox_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
599
- const len0 = WASM_VECTOR_LEN;
600
- const ret = wasm.client_getLatestInboxState(this.__wbg_ptr, ptr0, len0);
601
- return ret;
602
- }
603
- /**
604
- * @returns {Identifier}
605
- */
606
- get accountIdentifier() {
607
- const ret = wasm.client_accountIdentifier(this.__wbg_ptr);
608
- return Identifier.__wrap(ret);
609
- }
610
- /**
611
- * @returns {string}
612
- */
613
- get inboxId() {
614
- let deferred1_0;
615
- let deferred1_1;
616
- try {
617
- const ret = wasm.client_inboxId(this.__wbg_ptr);
618
- deferred1_0 = ret[0];
619
- deferred1_1 = ret[1];
620
- return getStringFromWasm0(ret[0], ret[1]);
621
- } finally {
622
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
623
- }
624
- }
625
- /**
626
- * @returns {boolean}
627
- */
628
- get isRegistered() {
629
- const ret = wasm.client_isRegistered(this.__wbg_ptr);
630
- return ret !== 0;
631
- }
632
- /**
633
- * @returns {string}
634
- */
635
- get installationId() {
636
- let deferred1_0;
637
- let deferred1_1;
638
- try {
639
- const ret = wasm.client_installationId(this.__wbg_ptr);
640
- deferred1_0 = ret[0];
641
- deferred1_1 = ret[1];
642
- return getStringFromWasm0(ret[0], ret[1]);
643
- } finally {
644
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
645
- }
646
- }
647
- /**
648
- * @returns {Uint8Array}
649
- */
650
- get installationIdBytes() {
651
- const ret = wasm.client_installationIdBytes(this.__wbg_ptr);
652
- return ret;
653
- }
654
- /**
655
- * Output booleans should be zipped with the index of input identifiers
656
- * @param {Identifier[]} account_identifiers
657
- * @returns {Promise<any>}
658
- */
659
- canMessage(account_identifiers) {
660
- const ptr0 = passArrayJsValueToWasm0(account_identifiers, wasm.__wbindgen_malloc);
661
- const len0 = WASM_VECTOR_LEN;
662
- const ret = wasm.client_canMessage(this.__wbg_ptr, ptr0, len0);
663
- return ret;
664
- }
665
- /**
666
- * @returns {Promise<void>}
667
- */
668
- registerIdentity() {
669
- const ret = wasm.client_registerIdentity(this.__wbg_ptr);
670
- return ret;
671
- }
672
- /**
673
- * @returns {Promise<void>}
674
- */
675
- sendHistorySyncRequest() {
676
- const ret = wasm.client_sendHistorySyncRequest(this.__wbg_ptr);
677
- return ret;
678
- }
679
- /**
680
- * @returns {Promise<void>}
681
- */
682
- sendConsentSyncRequest() {
683
- const ret = wasm.client_sendConsentSyncRequest(this.__wbg_ptr);
684
- return ret;
685
- }
686
- /**
687
- * @param {Identifier} identifier
688
- * @returns {Promise<string | undefined>}
689
- */
690
- findInboxIdByIdentifier(identifier) {
691
- _assertClass(identifier, Identifier);
692
- var ptr0 = identifier.__destroy_into_raw();
693
- const ret = wasm.client_findInboxIdByIdentifier(this.__wbg_ptr, ptr0);
694
- return ret;
695
- }
696
- /**
697
- * @returns {Conversations}
698
- */
699
- conversations() {
700
- const ret = wasm.client_conversations(this.__wbg_ptr);
701
- return Conversations.__wrap(ret);
702
- }
703
565
  /**
704
566
  * @returns {string | undefined}
705
567
  */
@@ -720,9 +582,7 @@ export class Client {
720
582
  * @returns {Promise<string>}
721
583
  */
722
584
  addWalletSignatureText(new_identifier) {
723
- _assertClass(new_identifier, Identifier);
724
- var ptr0 = new_identifier.__destroy_into_raw();
725
- const ret = wasm.client_addWalletSignatureText(this.__wbg_ptr, ptr0);
585
+ const ret = wasm.client_addWalletSignatureText(this.__wbg_ptr, new_identifier);
726
586
  return ret;
727
587
  }
728
588
  /**
@@ -730,9 +590,7 @@ export class Client {
730
590
  * @returns {Promise<string>}
731
591
  */
732
592
  revokeWalletSignatureText(identifier) {
733
- _assertClass(identifier, Identifier);
734
- var ptr0 = identifier.__destroy_into_raw();
735
- const ret = wasm.client_revokeWalletSignatureText(this.__wbg_ptr, ptr0);
593
+ const ret = wasm.client_revokeWalletSignatureText(this.__wbg_ptr, identifier);
736
594
  return ret;
737
595
  }
738
596
  /**
@@ -836,6 +694,128 @@ export class Client {
836
694
  const ret = wasm.client_getConsentState(this.__wbg_ptr, entity_type, ptr0, len0);
837
695
  return ret;
838
696
  }
697
+ /**
698
+ * @returns {Identifier}
699
+ */
700
+ get accountIdentifier() {
701
+ const ret = wasm.client_accountIdentifier(this.__wbg_ptr);
702
+ return ret;
703
+ }
704
+ /**
705
+ * @returns {string}
706
+ */
707
+ get inboxId() {
708
+ let deferred1_0;
709
+ let deferred1_1;
710
+ try {
711
+ const ret = wasm.client_inboxId(this.__wbg_ptr);
712
+ deferred1_0 = ret[0];
713
+ deferred1_1 = ret[1];
714
+ return getStringFromWasm0(ret[0], ret[1]);
715
+ } finally {
716
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
717
+ }
718
+ }
719
+ /**
720
+ * @returns {boolean}
721
+ */
722
+ get isRegistered() {
723
+ const ret = wasm.client_isRegistered(this.__wbg_ptr);
724
+ return ret !== 0;
725
+ }
726
+ /**
727
+ * @returns {string}
728
+ */
729
+ get installationId() {
730
+ let deferred1_0;
731
+ let deferred1_1;
732
+ try {
733
+ const ret = wasm.client_installationId(this.__wbg_ptr);
734
+ deferred1_0 = ret[0];
735
+ deferred1_1 = ret[1];
736
+ return getStringFromWasm0(ret[0], ret[1]);
737
+ } finally {
738
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
739
+ }
740
+ }
741
+ /**
742
+ * @returns {Uint8Array}
743
+ */
744
+ get installationIdBytes() {
745
+ const ret = wasm.client_installationIdBytes(this.__wbg_ptr);
746
+ return ret;
747
+ }
748
+ /**
749
+ * Output booleans should be zipped with the index of input identifiers
750
+ * @param {Identifier[]} account_identifiers
751
+ * @returns {Promise<any>}
752
+ */
753
+ canMessage(account_identifiers) {
754
+ const ptr0 = passArrayJsValueToWasm0(account_identifiers, wasm.__wbindgen_malloc);
755
+ const len0 = WASM_VECTOR_LEN;
756
+ const ret = wasm.client_canMessage(this.__wbg_ptr, ptr0, len0);
757
+ return ret;
758
+ }
759
+ /**
760
+ * @returns {Promise<void>}
761
+ */
762
+ registerIdentity() {
763
+ const ret = wasm.client_registerIdentity(this.__wbg_ptr);
764
+ return ret;
765
+ }
766
+ /**
767
+ * @returns {Promise<void>}
768
+ */
769
+ sendHistorySyncRequest() {
770
+ const ret = wasm.client_sendHistorySyncRequest(this.__wbg_ptr);
771
+ return ret;
772
+ }
773
+ /**
774
+ * @returns {Promise<void>}
775
+ */
776
+ sendConsentSyncRequest() {
777
+ const ret = wasm.client_sendConsentSyncRequest(this.__wbg_ptr);
778
+ return ret;
779
+ }
780
+ /**
781
+ * @param {Identifier} identifier
782
+ * @returns {Promise<string | undefined>}
783
+ */
784
+ findInboxIdByIdentifier(identifier) {
785
+ const ret = wasm.client_findInboxIdByIdentifier(this.__wbg_ptr, identifier);
786
+ return ret;
787
+ }
788
+ /**
789
+ * @returns {Conversations}
790
+ */
791
+ conversations() {
792
+ const ret = wasm.client_conversations(this.__wbg_ptr);
793
+ return Conversations.__wrap(ret);
794
+ }
795
+ /**
796
+ *
797
+ * * Get the client's inbox state.
798
+ * *
799
+ * * If `refresh_from_network` is true, the client will go to the network first to refresh the state.
800
+ * * Otherwise, the state will be read from the local database.
801
+ *
802
+ * @param {boolean} refresh_from_network
803
+ * @returns {Promise<InboxState>}
804
+ */
805
+ inboxState(refresh_from_network) {
806
+ const ret = wasm.client_inboxState(this.__wbg_ptr, refresh_from_network);
807
+ return ret;
808
+ }
809
+ /**
810
+ * @param {string} inbox_id
811
+ * @returns {Promise<InboxState>}
812
+ */
813
+ getLatestInboxState(inbox_id) {
814
+ const ptr0 = passStringToWasm0(inbox_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
815
+ const len0 = WASM_VECTOR_LEN;
816
+ const ret = wasm.client_getLatestInboxState(this.__wbg_ptr, ptr0, len0);
817
+ return ret;
818
+ }
839
819
  }
840
820
 
841
821
  const ConsentFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -1707,14 +1687,12 @@ export class Conversations {
1707
1687
  * @returns {Promise<Conversation>}
1708
1688
  */
1709
1689
  createDm(account_identifier, options) {
1710
- _assertClass(account_identifier, Identifier);
1711
- var ptr0 = account_identifier.__destroy_into_raw();
1712
- let ptr1 = 0;
1690
+ let ptr0 = 0;
1713
1691
  if (!isLikeNone(options)) {
1714
1692
  _assertClass(options, CreateDMOptions);
1715
- ptr1 = options.__destroy_into_raw();
1693
+ ptr0 = options.__destroy_into_raw();
1716
1694
  }
1717
- const ret = wasm.conversations_createDm(this.__wbg_ptr, ptr0, ptr1);
1695
+ const ret = wasm.conversations_createDm(this.__wbg_ptr, account_identifier, ptr0);
1718
1696
  return ret;
1719
1697
  }
1720
1698
  /**
@@ -2524,88 +2502,6 @@ export class HmacKey {
2524
2502
  }
2525
2503
  }
2526
2504
 
2527
- const IdentifierFinalization = (typeof FinalizationRegistry === 'undefined')
2528
- ? { register: () => {}, unregister: () => {} }
2529
- : new FinalizationRegistry(ptr => wasm.__wbg_identifier_free(ptr >>> 0, 1));
2530
-
2531
- export class Identifier {
2532
-
2533
- static __wrap(ptr) {
2534
- ptr = ptr >>> 0;
2535
- const obj = Object.create(Identifier.prototype);
2536
- obj.__wbg_ptr = ptr;
2537
- IdentifierFinalization.register(obj, obj.__wbg_ptr, obj);
2538
- return obj;
2539
- }
2540
-
2541
- static __unwrap(jsValue) {
2542
- if (!(jsValue instanceof Identifier)) {
2543
- return 0;
2544
- }
2545
- return jsValue.__destroy_into_raw();
2546
- }
2547
-
2548
- __destroy_into_raw() {
2549
- const ptr = this.__wbg_ptr;
2550
- this.__wbg_ptr = 0;
2551
- IdentifierFinalization.unregister(this);
2552
- return ptr;
2553
- }
2554
-
2555
- free() {
2556
- const ptr = this.__destroy_into_raw();
2557
- wasm.__wbg_identifier_free(ptr, 0);
2558
- }
2559
- /**
2560
- * @returns {string}
2561
- */
2562
- get identifier() {
2563
- let deferred1_0;
2564
- let deferred1_1;
2565
- try {
2566
- const ret = wasm.__wbg_get_identifier_identifier(this.__wbg_ptr);
2567
- deferred1_0 = ret[0];
2568
- deferred1_1 = ret[1];
2569
- return getStringFromWasm0(ret[0], ret[1]);
2570
- } finally {
2571
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2572
- }
2573
- }
2574
- /**
2575
- * @param {string} arg0
2576
- */
2577
- set identifier(arg0) {
2578
- const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2579
- const len0 = WASM_VECTOR_LEN;
2580
- wasm.__wbg_set_consent_entity(this.__wbg_ptr, ptr0, len0);
2581
- }
2582
- /**
2583
- * @returns {IdentifierKind}
2584
- */
2585
- get identifierKind() {
2586
- const ret = wasm.__wbg_get_identifier_identifierKind(this.__wbg_ptr);
2587
- return ret;
2588
- }
2589
- /**
2590
- * @param {IdentifierKind} arg0
2591
- */
2592
- set identifierKind(arg0) {
2593
- wasm.__wbg_set_identifier_identifierKind(this.__wbg_ptr, arg0);
2594
- }
2595
- /**
2596
- * @param {string} identifier
2597
- * @param {IdentifierKind} identifierKind
2598
- */
2599
- constructor(identifier, identifierKind) {
2600
- const ptr0 = passStringToWasm0(identifier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2601
- const len0 = WASM_VECTOR_LEN;
2602
- const ret = wasm.identifier_new(ptr0, len0, identifierKind);
2603
- this.__wbg_ptr = ret >>> 0;
2604
- IdentifierFinalization.register(this, this.__wbg_ptr, this);
2605
- return this;
2606
- }
2607
- }
2608
-
2609
2505
  const InboxStateFinalization = (typeof FinalizationRegistry === 'undefined')
2610
2506
  ? { register: () => {}, unregister: () => {} }
2611
2507
  : new FinalizationRegistry(ptr => wasm.__wbg_inboxstate_free(ptr >>> 0, 1));
@@ -2652,22 +2548,20 @@ export class InboxState {
2652
2548
  set inboxId(arg0) {
2653
2549
  const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2654
2550
  const len0 = WASM_VECTOR_LEN;
2655
- wasm.__wbg_set_contenttypeid_authorityId(this.__wbg_ptr, ptr0, len0);
2551
+ wasm.__wbg_set_inboxstate_inboxId(this.__wbg_ptr, ptr0, len0);
2656
2552
  }
2657
2553
  /**
2658
2554
  * @returns {Identifier}
2659
2555
  */
2660
2556
  get recoveryIdentifier() {
2661
2557
  const ret = wasm.__wbg_get_inboxstate_recoveryIdentifier(this.__wbg_ptr);
2662
- return Identifier.__wrap(ret);
2558
+ return ret;
2663
2559
  }
2664
2560
  /**
2665
2561
  * @param {Identifier} arg0
2666
2562
  */
2667
2563
  set recoveryIdentifier(arg0) {
2668
- _assertClass(arg0, Identifier);
2669
- var ptr0 = arg0.__destroy_into_raw();
2670
- wasm.__wbg_set_inboxstate_recoveryIdentifier(this.__wbg_ptr, ptr0);
2564
+ wasm.__wbg_set_inboxstate_recoveryIdentifier(this.__wbg_ptr, arg0);
2671
2565
  }
2672
2566
  /**
2673
2567
  * @returns {Installation[]}
@@ -2712,13 +2606,11 @@ export class InboxState {
2712
2606
  constructor(inbox_id, recovery_identifier, installations, account_identifiers) {
2713
2607
  const ptr0 = passStringToWasm0(inbox_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2714
2608
  const len0 = WASM_VECTOR_LEN;
2715
- _assertClass(recovery_identifier, Identifier);
2716
- var ptr1 = recovery_identifier.__destroy_into_raw();
2717
- const ptr2 = passArrayJsValueToWasm0(installations, wasm.__wbindgen_malloc);
2609
+ const ptr1 = passArrayJsValueToWasm0(installations, wasm.__wbindgen_malloc);
2610
+ const len1 = WASM_VECTOR_LEN;
2611
+ const ptr2 = passArrayJsValueToWasm0(account_identifiers, wasm.__wbindgen_malloc);
2718
2612
  const len2 = WASM_VECTOR_LEN;
2719
- const ptr3 = passArrayJsValueToWasm0(account_identifiers, wasm.__wbindgen_malloc);
2720
- const len3 = WASM_VECTOR_LEN;
2721
- const ret = wasm.inboxstate_new(ptr0, len0, ptr1, ptr2, len2, ptr3, len3);
2613
+ const ret = wasm.inboxstate_new(ptr0, len0, recovery_identifier, ptr1, len1, ptr2, len2);
2722
2614
  this.__wbg_ptr = ret >>> 0;
2723
2615
  InboxStateFinalization.register(this, this.__wbg_ptr, this);
2724
2616
  return this;
@@ -2995,7 +2887,7 @@ export class ListConversationsOptions {
2995
2887
  * @param {bigint | null} [arg0]
2996
2888
  */
2997
2889
  set createdAfterNs(arg0) {
2998
- wasm.__wbg_set_installation_clientTimestampNs(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? BigInt(0) : arg0);
2890
+ wasm.__wbg_set_listconversationsoptions_createdAfterNs(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? BigInt(0) : arg0);
2999
2891
  }
3000
2892
  /**
3001
2893
  * @returns {bigint | undefined}
@@ -3101,7 +2993,7 @@ export class ListMessagesOptions {
3101
2993
  * @param {bigint | null} [arg0]
3102
2994
  */
3103
2995
  set sentBeforeNs(arg0) {
3104
- wasm.__wbg_set_installation_clientTimestampNs(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? BigInt(0) : arg0);
2996
+ wasm.__wbg_set_listconversationsoptions_createdAfterNs(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? BigInt(0) : arg0);
3105
2997
  }
3106
2998
  /**
3107
2999
  * @returns {bigint | undefined}
@@ -3607,6 +3499,141 @@ export class MultiRemoteAttachment {
3607
3499
  }
3608
3500
  }
3609
3501
 
3502
+ const OpfsFinalization = (typeof FinalizationRegistry === 'undefined')
3503
+ ? { register: () => {}, unregister: () => {} }
3504
+ : new FinalizationRegistry(ptr => wasm.__wbg_opfs_free(ptr >>> 0, 1));
3505
+
3506
+ export class Opfs {
3507
+
3508
+ __destroy_into_raw() {
3509
+ const ptr = this.__wbg_ptr;
3510
+ this.__wbg_ptr = 0;
3511
+ OpfsFinalization.unregister(this);
3512
+ return ptr;
3513
+ }
3514
+
3515
+ free() {
3516
+ const ptr = this.__destroy_into_raw();
3517
+ wasm.__wbg_opfs_free(ptr, 0);
3518
+ }
3519
+ /**
3520
+ * Check if the global OPFS object has been initialized
3521
+ * @returns {boolean}
3522
+ */
3523
+ static exists() {
3524
+ const ret = wasm.opfs_exists();
3525
+ return ret !== 0;
3526
+ }
3527
+ /**
3528
+ * gets the error from Opfs, if any.
3529
+ * @returns {string | undefined}
3530
+ */
3531
+ static error() {
3532
+ const ret = wasm.opfs_error();
3533
+ let v1;
3534
+ if (ret[0] !== 0) {
3535
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
3536
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
3537
+ }
3538
+ return v1;
3539
+ }
3540
+ /**
3541
+ * @returns {Promise<void>}
3542
+ */
3543
+ static wipeFiles() {
3544
+ const ret = wasm.opfs_wipeFiles();
3545
+ return ret;
3546
+ }
3547
+ /**
3548
+ * If a virtual file exists with the given name, disassociates it from the pool and returns true, else returns false without side effects.
3549
+ * @param {string} name
3550
+ * @returns {boolean}
3551
+ */
3552
+ static rm(name) {
3553
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3554
+ const len0 = WASM_VECTOR_LEN;
3555
+ const ret = wasm.opfs_rm(ptr0, len0);
3556
+ if (ret[2]) {
3557
+ throw takeFromExternrefTable0(ret[1]);
3558
+ }
3559
+ return ret[0] !== 0;
3560
+ }
3561
+ /**
3562
+ * list files in current pool
3563
+ * @returns {string[]}
3564
+ */
3565
+ static getFileNames() {
3566
+ const ret = wasm.opfs_getFileNames();
3567
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
3568
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
3569
+ return v1;
3570
+ }
3571
+ /**
3572
+ * import a db file at 'path'
3573
+ * @param {string} path
3574
+ * @param {Uint8Array} bytes
3575
+ */
3576
+ static importDb(path, bytes) {
3577
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3578
+ const len0 = WASM_VECTOR_LEN;
3579
+ const ptr1 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
3580
+ const len1 = WASM_VECTOR_LEN;
3581
+ const ret = wasm.opfs_importDb(ptr0, len0, ptr1, len1);
3582
+ if (ret[1]) {
3583
+ throw takeFromExternrefTable0(ret[0]);
3584
+ }
3585
+ }
3586
+ /**
3587
+ * export db file with 'name'
3588
+ * @param {string} name
3589
+ * @returns {Uint8Array}
3590
+ */
3591
+ static exportFile(name) {
3592
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3593
+ const len0 = WASM_VECTOR_LEN;
3594
+ const ret = wasm.opfs_exportFile(ptr0, len0);
3595
+ if (ret[3]) {
3596
+ throw takeFromExternrefTable0(ret[2]);
3597
+ }
3598
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
3599
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
3600
+ return v2;
3601
+ }
3602
+ /**
3603
+ * get number of files in pool
3604
+ * @returns {number}
3605
+ */
3606
+ static getFileCount() {
3607
+ const ret = wasm.opfs_getFileCount();
3608
+ return ret >>> 0;
3609
+ }
3610
+ /**
3611
+ * @returns {number}
3612
+ */
3613
+ static getCapacity() {
3614
+ const ret = wasm.opfs_getCapacity();
3615
+ return ret >>> 0;
3616
+ }
3617
+ /**
3618
+ * Adds n entries to the current pool.
3619
+ * @param {number} n
3620
+ * @returns {Promise<number>}
3621
+ */
3622
+ static addCapacity(n) {
3623
+ const ret = wasm.opfs_addCapacity(n);
3624
+ return ret;
3625
+ }
3626
+ /**
3627
+ * Removes up to n entries from the pool, with the caveat that it can only remove currently-unused entries.
3628
+ * @param {number} n
3629
+ * @returns {Promise<number>}
3630
+ */
3631
+ static reduceCapacity(n) {
3632
+ const ret = wasm.opfs_reduceCapacity(n);
3633
+ return ret;
3634
+ }
3635
+ }
3636
+
3610
3637
  const PasskeySignatureFinalization = (typeof FinalizationRegistry === 'undefined')
3611
3638
  ? { register: () => {}, unregister: () => {} }
3612
3639
  : new FinalizationRegistry(ptr => wasm.__wbg_passkeysignature_free(ptr >>> 0, 1));
@@ -4371,7 +4398,7 @@ function __wbg_get_imports() {
4371
4398
  const a = state0.a;
4372
4399
  state0.a = 0;
4373
4400
  try {
4374
- return __wbg_adapter_590(a, state0.b, arg0, arg1, arg2);
4401
+ return __wbg_adapter_598(a, state0.b, arg0, arg1, arg2);
4375
4402
  } finally {
4376
4403
  state0.a = a;
4377
4404
  }
@@ -4401,7 +4428,7 @@ function __wbg_get_imports() {
4401
4428
  const a = state0.a;
4402
4429
  state0.a = 0;
4403
4430
  try {
4404
- return __wbg_adapter_590(a, state0.b, arg0, arg1, arg2);
4431
+ return __wbg_adapter_598(a, state0.b, arg0, arg1, arg2);
4405
4432
  } finally {
4406
4433
  state0.a = a;
4407
4434
  }
@@ -4510,6 +4537,10 @@ function __wbg_get_imports() {
4510
4537
  const ret = arg0.value;
4511
4538
  return ret;
4512
4539
  };
4540
+ imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
4541
+ const ret = arg0[arg1];
4542
+ return ret;
4543
+ };
4513
4544
  imports.wbg.__wbg_groupmetadata_new = function(arg0) {
4514
4545
  const ret = GroupMetadata.__wrap(arg0);
4515
4546
  return ret;
@@ -4526,14 +4557,6 @@ function __wbg_get_imports() {
4526
4557
  const ret = arg0.headers;
4527
4558
  return ret;
4528
4559
  };
4529
- imports.wbg.__wbg_identifier_new = function(arg0) {
4530
- const ret = Identifier.__wrap(arg0);
4531
- return ret;
4532
- };
4533
- imports.wbg.__wbg_identifier_unwrap = function(arg0) {
4534
- const ret = Identifier.__unwrap(arg0);
4535
- return ret;
4536
- };
4537
4560
  imports.wbg.__wbg_inboxstate_new = function(arg0) {
4538
4561
  const ret = InboxState.__wrap(arg0);
4539
4562
  return ret;
@@ -4693,7 +4716,7 @@ function __wbg_get_imports() {
4693
4716
  const a = state0.a;
4694
4717
  state0.a = 0;
4695
4718
  try {
4696
- return __wbg_adapter_691(a, state0.b, arg0, arg1);
4719
+ return __wbg_adapter_699(a, state0.b, arg0, arg1);
4697
4720
  } finally {
4698
4721
  state0.a = a;
4699
4722
  }
@@ -4885,6 +4908,10 @@ function __wbg_get_imports() {
4885
4908
  const ret = RemoteAttachmentInfo.__unwrap(arg0);
4886
4909
  return ret;
4887
4910
  };
4911
+ imports.wbg.__wbg_removeEntry_9f6bc325e3383e59 = function(arg0, arg1, arg2) {
4912
+ const ret = arg0.removeEntry(getStringFromWasm0(arg1, arg2));
4913
+ return ret;
4914
+ };
4888
4915
  imports.wbg.__wbg_require_79b1e9274cde3c87 = function() { return handleError(function () {
4889
4916
  const ret = module.require;
4890
4917
  return ret;
@@ -5092,12 +5119,12 @@ function __wbg_get_imports() {
5092
5119
  const ret = false;
5093
5120
  return ret;
5094
5121
  };
5095
- imports.wbg.__wbindgen_closure_wrapper16214 = function(arg0, arg1, arg2) {
5096
- const ret = makeMutClosure(arg0, arg1, 3682, __wbg_adapter_46);
5122
+ imports.wbg.__wbindgen_closure_wrapper16361 = function(arg0, arg1, arg2) {
5123
+ const ret = makeMutClosure(arg0, arg1, 3728, __wbg_adapter_48);
5097
5124
  return ret;
5098
5125
  };
5099
- imports.wbg.__wbindgen_closure_wrapper16510 = function(arg0, arg1, arg2) {
5100
- const ret = makeMutClosure(arg0, arg1, 3755, __wbg_adapter_49);
5126
+ imports.wbg.__wbindgen_closure_wrapper16655 = function(arg0, arg1, arg2) {
5127
+ const ret = makeMutClosure(arg0, arg1, 3800, __wbg_adapter_51);
5101
5128
  return ret;
5102
5129
  };
5103
5130
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
@@ -5111,6 +5138,10 @@ function __wbg_get_imports() {
5111
5138
  const ret = new Error(getStringFromWasm0(arg0, arg1));
5112
5139
  return ret;
5113
5140
  };
5141
+ imports.wbg.__wbindgen_in = function(arg0, arg1) {
5142
+ const ret = arg0 in arg1;
5143
+ return ret;
5144
+ };
5114
5145
  imports.wbg.__wbindgen_init_externref_table = function() {
5115
5146
  const table = wasm.__wbindgen_export_4;
5116
5147
  const offset = table.grow(4);