@xmtp/wasm-bindings 1.8.0 → 1.8.1

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.
@@ -5,42 +5,51 @@ export function metadataFieldName(field: MetadataField): string;
5
5
  export function contentTypeLeaveRequest(): ContentTypeId;
6
6
  export function generateInboxId(accountIdentifier: Identifier, nonce?: bigint | null): string;
7
7
  export function getInboxIdForIdentifier(host: string, gatewayHost: string | null | undefined, isSecure: boolean, accountIdentifier: Identifier): Promise<string | undefined>;
8
+ export function verifySignedWithPublicKey(signatureText: string, signatureBytes: Uint8Array, publicKey: Uint8Array): void;
8
9
  export function revokeInstallationsSignatureRequest(host: string, gatewayHost: string | null | undefined, recoveryIdentifier: Identifier, inboxId: string, installationIds: Uint8Array[]): SignatureRequestHandle;
9
10
  export function applySignatureRequest(host: string, gatewayHost: string | null | undefined, signatureRequest: SignatureRequestHandle): Promise<void>;
10
- export function verifySignedWithPublicKey(signatureText: string, signatureBytes: Uint8Array, publicKey: Uint8Array): void;
11
- export function contentTypeAttachment(): ContentTypeId;
12
11
  export function encodeAttachment(attachment: Attachment): EncodedContent;
12
+ export function contentTypeAttachment(): ContentTypeId;
13
13
  export function contentTypeReadReceipt(): ContentTypeId;
14
14
  export function encodeReadReceipt(read_receipt: ReadReceipt): EncodedContent;
15
15
  export function contentTypeGroupUpdated(): ContentTypeId;
16
- /**
17
- * Decrypts an encrypted payload from a remote attachment.
18
- */
19
- export function decryptAttachment(encryptedBytes: Uint8Array, remoteAttachment: RemoteAttachment): Attachment;
20
16
  /**
21
17
  * Encrypts an attachment for storage as a remote attachment.
22
18
  */
23
19
  export function encryptAttachment(attachment: Attachment): EncryptedAttachment;
24
20
  export function encodeRemoteAttachment(remote_attachment: RemoteAttachment): EncodedContent;
25
21
  export function contentTypeRemoteAttachment(): ContentTypeId;
22
+ /**
23
+ * Decrypts an encrypted payload from a remote attachment.
24
+ */
25
+ export function decryptAttachment(encryptedBytes: Uint8Array, remoteAttachment: RemoteAttachment): Attachment;
26
26
  export function encodeWalletSendCalls(wallet_send_calls: WalletSendCalls): EncodedContent;
27
27
  export function contentTypeWalletSendCalls(): ContentTypeId;
28
- export function contentTypeTransactionReference(): ContentTypeId;
29
28
  export function encodeTransactionReference(transaction_reference: TransactionReference): EncodedContent;
30
- export function encodeMultiRemoteAttachment(multi_remote_attachment: MultiRemoteAttachment): EncodedContent;
29
+ export function contentTypeTransactionReference(): ContentTypeId;
31
30
  export function contentTypeMultiRemoteAttachment(): ContentTypeId;
32
- export function encodeText(text: string): EncodedContent;
31
+ export function encodeMultiRemoteAttachment(multi_remote_attachment: MultiRemoteAttachment): EncodedContent;
33
32
  export function contentTypeText(): ContentTypeId;
33
+ export function encodeText(text: string): EncodedContent;
34
34
  export function contentTypeReply(): ContentTypeId;
35
35
  export function encodeIntent(intent: Intent): EncodedContent;
36
36
  export function contentTypeIntent(): ContentTypeId;
37
- export function contentTypeActions(): ContentTypeId;
38
37
  export function encodeActions(actions: Actions): EncodedContent;
38
+ export function contentTypeActions(): ContentTypeId;
39
39
  export function contentTypeMarkdown(): ContentTypeId;
40
40
  export function encodeMarkdown(text: string): EncodedContent;
41
41
  export function encodeReaction(reaction: Reaction): EncodedContent;
42
42
  export function contentTypeReaction(): ContentTypeId;
43
43
  export function createClient(host: string, inboxId: string, accountIdentifier: Identifier, dbPath?: string | null, encryptionKey?: Uint8Array | null, deviceSyncServerUrl?: string | null, deviceSyncWorkerMode?: DeviceSyncWorkerMode | null, logOptions?: LogOptions | null, allowOffline?: boolean | null, appVersion?: string | null, gatewayHost?: string | null, nonce?: bigint | null, authCallback?: any | null, authHandle?: AuthHandle | null, clientMode?: ClientMode | null): Promise<Client>;
44
+ /**
45
+ * Get the current capacity of the OPFS file pool.
46
+ */
47
+ export function opfsPoolCapacity(): Promise<number>;
48
+ /**
49
+ * Delete all database files from OPFS.
50
+ * Note: All databases must be closed before calling this function.
51
+ */
52
+ export function opfsClearAll(): Promise<void>;
44
53
  /**
45
54
  * Get the number of database files stored in OPFS.
46
55
  */
@@ -49,6 +58,12 @@ export function opfsFileCount(): Promise<number>;
49
58
  * Check if a database file exists in OPFS.
50
59
  */
51
60
  export function opfsFileExists(filename: string): Promise<boolean>;
61
+ /**
62
+ * Delete a specific database file from OPFS.
63
+ * Returns true if the file was deleted, false if it didn't exist.
64
+ * Note: The database must be closed before calling this function.
65
+ */
66
+ export function opfsDeleteFile(filename: string): Promise<boolean>;
52
67
  /**
53
68
  * Import a database from a byte array into OPFS.
54
69
  * This will overwrite any existing database with the same name.
@@ -56,27 +71,12 @@ export function opfsFileExists(filename: string): Promise<boolean>;
56
71
  * Note: Any existing database with the same name must be closed before importing.
57
72
  */
58
73
  export function opfsImportDb(filename: string, data: Uint8Array): Promise<void>;
59
- /**
60
- * Delete all database files from OPFS.
61
- * Note: All databases must be closed before calling this function.
62
- */
63
- export function opfsClearAll(): Promise<void>;
64
- /**
65
- * Get the current capacity of the OPFS file pool.
66
- */
67
- export function opfsPoolCapacity(): Promise<number>;
68
74
  /**
69
75
  * Export a database file from OPFS as a byte array.
70
76
  * This can be used to backup or transfer a database.
71
77
  * Note: The database should be closed before exporting for consistency.
72
78
  */
73
79
  export function opfsExportDb(filename: string): Promise<Uint8Array>;
74
- /**
75
- * Delete a specific database file from OPFS.
76
- * Returns true if the file was deleted, false if it didn't exist.
77
- * Note: The database must be closed before calling this function.
78
- */
79
- export function opfsDeleteFile(filename: string): Promise<boolean>;
80
80
  /**
81
81
  * Initialize the OPFS SQLite VFS if not already initialized.
82
82
  * This must be called before using other OPFS functions.
@@ -227,16 +227,22 @@ export enum SortDirection {
227
227
  * *This API requires the following crate features to be activated: `ReadableStreamType`*
228
228
  */
229
229
  type ReadableStreamType = "bytes";
230
- export interface KeyPackageStatus {
231
- lifetime?: Lifetime;
232
- validationError?: string;
233
- }
234
-
235
230
  export interface Lifetime {
236
231
  notBefore: bigint;
237
232
  notAfter: bigint;
238
233
  }
239
234
 
235
+ export interface Installation {
236
+ bytes: Uint8Array;
237
+ id: string;
238
+ clientTimestampNs?: bigint;
239
+ }
240
+
241
+ export interface KeyPackageStatus {
242
+ lifetime?: Lifetime;
243
+ validationError?: string;
244
+ }
245
+
240
246
  export interface InboxState {
241
247
  inboxId: string;
242
248
  recoveryIdentifier: Identifier;
@@ -244,12 +250,6 @@ export interface InboxState {
244
250
  accountIdentifiers: Identifier[];
245
251
  }
246
252
 
247
- export interface Installation {
248
- bytes: Uint8Array;
249
- id: string;
250
- clientTimestampNs?: bigint;
251
- }
252
-
253
253
  export interface PermissionPolicySet {
254
254
  addMemberPolicy: PermissionPolicy;
255
255
  removeMemberPolicy: PermissionPolicy;
@@ -267,9 +267,9 @@ export interface GroupPermissions {
267
267
  policySet: PermissionPolicySet;
268
268
  }
269
269
 
270
- export interface GroupMetadata {
271
- creatorInboxId: string;
272
- conversationType: ConversationType;
270
+ export interface SendMessageOpts {
271
+ shouldPush: boolean;
272
+ optimistic?: boolean;
273
273
  }
274
274
 
275
275
  export interface GroupMember {
@@ -280,9 +280,9 @@ export interface GroupMember {
280
280
  consentState: ConsentState;
281
281
  }
282
282
 
283
- export interface SendMessageOpts {
284
- shouldPush: boolean;
285
- optimistic?: boolean;
283
+ export interface GroupMetadata {
284
+ creatorInboxId: string;
285
+ conversationType: ConversationType;
286
286
  }
287
287
 
288
288
  export interface Consent {
@@ -295,6 +295,20 @@ export interface LeaveRequest {
295
295
  authenticatedNote?: Uint8Array;
296
296
  }
297
297
 
298
+ export interface CreateGroupOptions {
299
+ permissions?: GroupPermissionsOptions;
300
+ groupName?: string;
301
+ groupImageUrlSquare?: string;
302
+ groupDescription?: string;
303
+ customPermissionPolicySet?: PermissionPolicySet;
304
+ messageDisappearingSettings?: MessageDisappearingSettings;
305
+ appData?: string;
306
+ }
307
+
308
+ export interface CreateDmOptions {
309
+ messageDisappearingSettings?: MessageDisappearingSettings;
310
+ }
311
+
298
312
  export interface ListConversationsOptions {
299
313
  consentStates?: ConsentState[];
300
314
  conversationType?: ConversationType;
@@ -305,9 +319,9 @@ export interface ListConversationsOptions {
305
319
  limit?: bigint;
306
320
  }
307
321
 
308
- export interface HmacKey {
309
- key: Uint8Array;
310
- epoch: bigint;
322
+ export interface MessageDisappearingSettings {
323
+ fromNs: bigint;
324
+ inNs: bigint;
311
325
  }
312
326
 
313
327
  export interface Cursor {
@@ -315,23 +329,9 @@ export interface Cursor {
315
329
  sequenceId: bigint;
316
330
  }
317
331
 
318
- export interface CreateDmOptions {
319
- messageDisappearingSettings?: MessageDisappearingSettings;
320
- }
321
-
322
- export interface CreateGroupOptions {
323
- permissions?: GroupPermissionsOptions;
324
- groupName?: string;
325
- groupImageUrlSquare?: string;
326
- groupDescription?: string;
327
- customPermissionPolicySet?: PermissionPolicySet;
328
- messageDisappearingSettings?: MessageDisappearingSettings;
329
- appData?: string;
330
- }
331
-
332
- export interface MessageDisappearingSettings {
333
- fromNs: bigint;
334
- inNs: bigint;
332
+ export interface HmacKey {
333
+ key: Uint8Array;
334
+ epoch: bigint;
335
335
  }
336
336
 
337
337
  export interface ConversationDebugInfo {
@@ -366,21 +366,6 @@ export interface Credential {
366
366
  expiresAtSeconds: bigint;
367
367
  }
368
368
 
369
- export interface MessageWithReactions {
370
- message: Message;
371
- reactions: Message[];
372
- }
373
-
374
- export interface Message {
375
- id: string;
376
- sentAtNs: bigint;
377
- convoId: string;
378
- senderInboxId: string;
379
- content: EncodedContent;
380
- kind: GroupMessageKind;
381
- deliveryStatus: DeliveryStatus;
382
- }
383
-
384
369
  export interface ListMessagesOptions {
385
370
  contentTypes?: ContentType[];
386
371
  excludeContentTypes?: ContentType[];
@@ -396,6 +381,21 @@ export interface ListMessagesOptions {
396
381
  insertedBeforeNs?: bigint;
397
382
  }
398
383
 
384
+ export interface MessageWithReactions {
385
+ message: Message;
386
+ reactions: Message[];
387
+ }
388
+
389
+ export interface Message {
390
+ id: string;
391
+ sentAtNs: bigint;
392
+ convoId: string;
393
+ senderInboxId: string;
394
+ content: EncodedContent;
395
+ kind: GroupMessageKind;
396
+ deliveryStatus: DeliveryStatus;
397
+ }
398
+
399
399
  export interface PasskeySignature {
400
400
  publicKey: Uint8Array;
401
401
  signature: Uint8Array;
@@ -411,6 +411,10 @@ export interface Attachment {
411
411
 
412
412
  export type ReadReceipt = Record<string, never>;
413
413
 
414
+ export interface Inbox {
415
+ inboxId: string;
416
+ }
417
+
414
418
  export interface GroupUpdated {
415
419
  initiatedByInboxId: string;
416
420
  addedInboxes: Inbox[];
@@ -423,10 +427,6 @@ export interface GroupUpdated {
423
427
  removedSuperAdminInboxes: Inbox[];
424
428
  }
425
429
 
426
- export interface Inbox {
427
- inboxId: string;
428
- }
429
-
430
430
  export interface MetadataFieldChange {
431
431
  fieldName: string;
432
432
  oldValue?: string;
@@ -494,6 +494,13 @@ export interface WalletCall {
494
494
  metadata?: Record<string, string>;
495
495
  }
496
496
 
497
+ export interface TransactionReference {
498
+ namespace?: string;
499
+ networkId: string;
500
+ reference: string;
501
+ metadata?: TransactionMetadata;
502
+ }
503
+
497
504
  export interface TransactionMetadata {
498
505
  transactionType: string;
499
506
  currency: string;
@@ -503,15 +510,12 @@ export interface TransactionMetadata {
503
510
  toAddress: string;
504
511
  }
505
512
 
506
- export interface TransactionReference {
507
- namespace?: string;
508
- networkId: string;
509
- reference: string;
510
- metadata?: TransactionMetadata;
511
- }
512
-
513
513
  export type DecodedMessageContent = { type: "actions"; content: Actions | undefined } | { type: "attachment"; content: Attachment } | { type: "custom"; content: EncodedContent } | { type: "groupUpdated"; content: GroupUpdated } | { type: "intent"; content: Intent | undefined } | { type: "leaveRequest"; content: LeaveRequest } | { type: "markdown"; content: string } | { type: "multiRemoteAttachment"; content: MultiRemoteAttachment } | { type: "reaction"; content: Reaction } | { type: "readReceipt"; content: ReadReceipt } | { type: "remoteAttachment"; content: RemoteAttachment } | { type: "reply"; content: EnrichedReply } | { type: "text"; content: string } | { type: "transactionReference"; content: TransactionReference } | { type: "walletSendCalls"; content: WalletSendCalls };
514
514
 
515
+ export interface MultiRemoteAttachment {
516
+ attachments: RemoteAttachmentInfo[];
517
+ }
518
+
515
519
  export interface RemoteAttachmentInfo {
516
520
  secret: Uint8Array;
517
521
  contentDigest: string;
@@ -523,10 +527,6 @@ export interface RemoteAttachmentInfo {
523
527
  filename?: string;
524
528
  }
525
529
 
526
- export interface MultiRemoteAttachment {
527
- attachments: RemoteAttachmentInfo[];
528
- }
529
-
530
530
  export interface EnrichedReply {
531
531
  referenceId: string;
532
532
  content: DecodedMessageContent;
@@ -545,13 +545,6 @@ export interface Intent {
545
545
  metadata?: Record<string, string | number | boolean | null>;
546
546
  }
547
547
 
548
- export interface Actions {
549
- id: string;
550
- description: string;
551
- actions: Action[];
552
- expiresAtNs?: bigint;
553
- }
554
-
555
548
  export interface Action {
556
549
  id: string;
557
550
  label: string;
@@ -560,6 +553,13 @@ export interface Action {
560
553
  expiresAtNs?: bigint;
561
554
  }
562
555
 
556
+ export interface Actions {
557
+ id: string;
558
+ description: string;
559
+ actions: Action[];
560
+ expiresAtNs?: bigint;
561
+ }
562
+
563
563
  export interface Reaction {
564
564
  reference: string;
565
565
  referenceInboxId: string;
@@ -585,11 +585,6 @@ export interface ContentTypeId {
585
585
 
586
586
  export type UserPreferenceUpdate = { type: "ConsentUpdate"; consent: Consent } | { type: "HmacKeyUpdate"; key: number[] };
587
587
 
588
- export interface GroupSyncSummary {
589
- numEligible: number;
590
- numSynced: number;
591
- }
592
-
593
588
  /**
594
589
  * Specify options for the logger
595
590
  */
@@ -608,15 +603,9 @@ export interface LogOptions {
608
603
  level?: LogLevel;
609
604
  }
610
605
 
611
- export interface ApiStats {
612
- uploadKeyPackage: bigint;
613
- fetchKeyPackage: bigint;
614
- sendGroupMessages: bigint;
615
- sendWelcomeMessages: bigint;
616
- queryGroupMessages: bigint;
617
- queryWelcomeMessages: bigint;
618
- subscribeMessages: bigint;
619
- subscribeWelcomes: bigint;
606
+ export interface GroupSyncSummary {
607
+ numEligible: number;
608
+ numSynced: number;
620
609
  }
621
610
 
622
611
  export interface IdentityStats {
@@ -631,6 +620,17 @@ export interface Identifier {
631
620
  identifierKind: IdentifierKind;
632
621
  }
633
622
 
623
+ export interface ApiStats {
624
+ uploadKeyPackage: bigint;
625
+ fetchKeyPackage: bigint;
626
+ sendGroupMessages: bigint;
627
+ sendWelcomeMessages: bigint;
628
+ queryGroupMessages: bigint;
629
+ queryWelcomeMessages: bigint;
630
+ subscribeMessages: bigint;
631
+ subscribeWelcomes: bigint;
632
+ }
633
+
634
634
  export class AuthHandle {
635
635
  free(): void;
636
636
  [Symbol.dispose](): void;
@@ -1083,14 +1083,14 @@ export interface InitOutput {
1083
1083
  readonly intounderlyingbytesource_pull: (a: number, b: any) => any;
1084
1084
  readonly intounderlyingbytesource_start: (a: number, b: any) => void;
1085
1085
  readonly intounderlyingbytesource_type: (a: number) => number;
1086
- readonly wasm_bindgen__convert__closures_____invoke__h956b60152b2cf005: (a: number, b: number) => void;
1087
- readonly wasm_bindgen__closure__destroy__h3c5639ee43c80f22: (a: number, b: number) => void;
1088
1086
  readonly wasm_bindgen__convert__closures_____invoke__hdff293b41f2cecc6: (a: number, b: number, c: any) => void;
1089
1087
  readonly wasm_bindgen__closure__destroy__hed8af60076250245: (a: number, b: number) => void;
1090
1088
  readonly wasm_bindgen__convert__closures_____invoke__hceddd2b8fc291040: (a: number, b: number) => void;
1091
1089
  readonly wasm_bindgen__closure__destroy__hfbd660e60d498df9: (a: number, b: number) => void;
1092
1090
  readonly wasm_bindgen__convert__closures_____invoke__h6af3cd86eb56f4b1: (a: number, b: number) => void;
1093
1091
  readonly wasm_bindgen__closure__destroy__he7b712e0eb1b5ac1: (a: number, b: number) => void;
1092
+ readonly wasm_bindgen__convert__closures_____invoke__h956b60152b2cf005: (a: number, b: number) => void;
1093
+ readonly wasm_bindgen__closure__destroy__h3c5639ee43c80f22: (a: number, b: number) => void;
1094
1094
  readonly wasm_bindgen__convert__closures_____invoke__h47a8fb56fc48c5fb: (a: number, b: number, c: any, d: any) => void;
1095
1095
  readonly __wbindgen_malloc: (a: number, b: number) => number;
1096
1096
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
@@ -326,6 +326,20 @@ export function getInboxIdForIdentifier(host, gatewayHost, isSecure, accountIden
326
326
  return ret;
327
327
  }
328
328
 
329
+ /**
330
+ * @param {string} signatureText
331
+ * @param {Uint8Array} signatureBytes
332
+ * @param {Uint8Array} publicKey
333
+ */
334
+ export function verifySignedWithPublicKey(signatureText, signatureBytes, publicKey) {
335
+ const ptr0 = passStringToWasm0(signatureText, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
336
+ const len0 = WASM_VECTOR_LEN;
337
+ const ret = wasm.verifySignedWithPublicKey(ptr0, len0, signatureBytes, publicKey);
338
+ if (ret[1]) {
339
+ throw takeFromExternrefTable0(ret[0]);
340
+ }
341
+ }
342
+
329
343
  /**
330
344
  * @param {string} host
331
345
  * @param {string | null | undefined} gatewayHost
@@ -367,17 +381,15 @@ export function applySignatureRequest(host, gatewayHost, signatureRequest) {
367
381
  }
368
382
 
369
383
  /**
370
- * @param {string} signatureText
371
- * @param {Uint8Array} signatureBytes
372
- * @param {Uint8Array} publicKey
384
+ * @param {Attachment} attachment
385
+ * @returns {EncodedContent}
373
386
  */
374
- export function verifySignedWithPublicKey(signatureText, signatureBytes, publicKey) {
375
- const ptr0 = passStringToWasm0(signatureText, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
376
- const len0 = WASM_VECTOR_LEN;
377
- const ret = wasm.verifySignedWithPublicKey(ptr0, len0, signatureBytes, publicKey);
378
- if (ret[1]) {
379
- throw takeFromExternrefTable0(ret[0]);
387
+ export function encodeAttachment(attachment) {
388
+ const ret = wasm.encodeAttachment(attachment);
389
+ if (ret[2]) {
390
+ throw takeFromExternrefTable0(ret[1]);
380
391
  }
392
+ return takeFromExternrefTable0(ret[0]);
381
393
  }
382
394
 
383
395
  /**
@@ -388,18 +400,6 @@ export function contentTypeAttachment() {
388
400
  return ret;
389
401
  }
390
402
 
391
- /**
392
- * @param {Attachment} attachment
393
- * @returns {EncodedContent}
394
- */
395
- export function encodeAttachment(attachment) {
396
- const ret = wasm.encodeAttachment(attachment);
397
- if (ret[2]) {
398
- throw takeFromExternrefTable0(ret[1]);
399
- }
400
- return takeFromExternrefTable0(ret[0]);
401
- }
402
-
403
403
  /**
404
404
  * @returns {ContentTypeId}
405
405
  */
@@ -428,28 +428,6 @@ export function contentTypeGroupUpdated() {
428
428
  return ret;
429
429
  }
430
430
 
431
- function passArray8ToWasm0(arg, malloc) {
432
- const ptr = malloc(arg.length * 1, 1) >>> 0;
433
- getUint8ArrayMemory0().set(arg, ptr / 1);
434
- WASM_VECTOR_LEN = arg.length;
435
- return ptr;
436
- }
437
- /**
438
- * Decrypts an encrypted payload from a remote attachment.
439
- * @param {Uint8Array} encryptedBytes
440
- * @param {RemoteAttachment} remoteAttachment
441
- * @returns {Attachment}
442
- */
443
- export function decryptAttachment(encryptedBytes, remoteAttachment) {
444
- const ptr0 = passArray8ToWasm0(encryptedBytes, wasm.__wbindgen_malloc);
445
- const len0 = WASM_VECTOR_LEN;
446
- const ret = wasm.decryptAttachment(ptr0, len0, remoteAttachment);
447
- if (ret[2]) {
448
- throw takeFromExternrefTable0(ret[1]);
449
- }
450
- return takeFromExternrefTable0(ret[0]);
451
- }
452
-
453
431
  /**
454
432
  * Encrypts an attachment for storage as a remote attachment.
455
433
  * @param {Attachment} attachment
@@ -483,6 +461,28 @@ export function contentTypeRemoteAttachment() {
483
461
  return ret;
484
462
  }
485
463
 
464
+ function passArray8ToWasm0(arg, malloc) {
465
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
466
+ getUint8ArrayMemory0().set(arg, ptr / 1);
467
+ WASM_VECTOR_LEN = arg.length;
468
+ return ptr;
469
+ }
470
+ /**
471
+ * Decrypts an encrypted payload from a remote attachment.
472
+ * @param {Uint8Array} encryptedBytes
473
+ * @param {RemoteAttachment} remoteAttachment
474
+ * @returns {Attachment}
475
+ */
476
+ export function decryptAttachment(encryptedBytes, remoteAttachment) {
477
+ const ptr0 = passArray8ToWasm0(encryptedBytes, wasm.__wbindgen_malloc);
478
+ const len0 = WASM_VECTOR_LEN;
479
+ const ret = wasm.decryptAttachment(ptr0, len0, remoteAttachment);
480
+ if (ret[2]) {
481
+ throw takeFromExternrefTable0(ret[1]);
482
+ }
483
+ return takeFromExternrefTable0(ret[0]);
484
+ }
485
+
486
486
  /**
487
487
  * @param {WalletSendCalls} wallet_send_calls
488
488
  * @returns {EncodedContent}
@@ -503,14 +503,6 @@ export function contentTypeWalletSendCalls() {
503
503
  return ret;
504
504
  }
505
505
 
506
- /**
507
- * @returns {ContentTypeId}
508
- */
509
- export function contentTypeTransactionReference() {
510
- const ret = wasm.contentTypeTransactionReference();
511
- return ret;
512
- }
513
-
514
506
  /**
515
507
  * @param {TransactionReference} transaction_reference
516
508
  * @returns {EncodedContent}
@@ -523,6 +515,22 @@ export function encodeTransactionReference(transaction_reference) {
523
515
  return takeFromExternrefTable0(ret[0]);
524
516
  }
525
517
 
518
+ /**
519
+ * @returns {ContentTypeId}
520
+ */
521
+ export function contentTypeTransactionReference() {
522
+ const ret = wasm.contentTypeTransactionReference();
523
+ return ret;
524
+ }
525
+
526
+ /**
527
+ * @returns {ContentTypeId}
528
+ */
529
+ export function contentTypeMultiRemoteAttachment() {
530
+ const ret = wasm.contentTypeMultiRemoteAttachment();
531
+ return ret;
532
+ }
533
+
526
534
  /**
527
535
  * @param {MultiRemoteAttachment} multi_remote_attachment
528
536
  * @returns {EncodedContent}
@@ -538,8 +546,8 @@ export function encodeMultiRemoteAttachment(multi_remote_attachment) {
538
546
  /**
539
547
  * @returns {ContentTypeId}
540
548
  */
541
- export function contentTypeMultiRemoteAttachment() {
542
- const ret = wasm.contentTypeMultiRemoteAttachment();
549
+ export function contentTypeText() {
550
+ const ret = wasm.contentTypeText();
543
551
  return ret;
544
552
  }
545
553
 
@@ -557,14 +565,6 @@ export function encodeText(text) {
557
565
  return takeFromExternrefTable0(ret[0]);
558
566
  }
559
567
 
560
- /**
561
- * @returns {ContentTypeId}
562
- */
563
- export function contentTypeText() {
564
- const ret = wasm.contentTypeText();
565
- return ret;
566
- }
567
-
568
568
  /**
569
569
  * @returns {ContentTypeId}
570
570
  */
@@ -593,14 +593,6 @@ export function contentTypeIntent() {
593
593
  return ret;
594
594
  }
595
595
 
596
- /**
597
- * @returns {ContentTypeId}
598
- */
599
- export function contentTypeActions() {
600
- const ret = wasm.contentTypeActions();
601
- return ret;
602
- }
603
-
604
596
  /**
605
597
  * @param {Actions} actions
606
598
  * @returns {EncodedContent}
@@ -613,6 +605,14 @@ export function encodeActions(actions) {
613
605
  return takeFromExternrefTable0(ret[0]);
614
606
  }
615
607
 
608
+ /**
609
+ * @returns {ContentTypeId}
610
+ */
611
+ export function contentTypeActions() {
612
+ const ret = wasm.contentTypeActions();
613
+ return ret;
614
+ }
615
+
616
616
  /**
617
617
  * @returns {ContentTypeId}
618
618
  */
@@ -695,6 +695,25 @@ export function createClient(host, inboxId, accountIdentifier, dbPath, encryptio
695
695
  return ret;
696
696
  }
697
697
 
698
+ /**
699
+ * Get the current capacity of the OPFS file pool.
700
+ * @returns {Promise<number>}
701
+ */
702
+ export function opfsPoolCapacity() {
703
+ const ret = wasm.opfsPoolCapacity();
704
+ return ret;
705
+ }
706
+
707
+ /**
708
+ * Delete all database files from OPFS.
709
+ * Note: All databases must be closed before calling this function.
710
+ * @returns {Promise<void>}
711
+ */
712
+ export function opfsClearAll() {
713
+ const ret = wasm.opfsClearAll();
714
+ return ret;
715
+ }
716
+
698
717
  /**
699
718
  * Get the number of database files stored in OPFS.
700
719
  * @returns {Promise<number>}
@@ -716,6 +735,20 @@ export function opfsFileExists(filename) {
716
735
  return ret;
717
736
  }
718
737
 
738
+ /**
739
+ * Delete a specific database file from OPFS.
740
+ * Returns true if the file was deleted, false if it didn't exist.
741
+ * Note: The database must be closed before calling this function.
742
+ * @param {string} filename
743
+ * @returns {Promise<boolean>}
744
+ */
745
+ export function opfsDeleteFile(filename) {
746
+ const ptr0 = passStringToWasm0(filename, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
747
+ const len0 = WASM_VECTOR_LEN;
748
+ const ret = wasm.opfsDeleteFile(ptr0, len0);
749
+ return ret;
750
+ }
751
+
719
752
  /**
720
753
  * Import a database from a byte array into OPFS.
721
754
  * This will overwrite any existing database with the same name.
@@ -732,25 +765,6 @@ export function opfsImportDb(filename, data) {
732
765
  return ret;
733
766
  }
734
767
 
735
- /**
736
- * Delete all database files from OPFS.
737
- * Note: All databases must be closed before calling this function.
738
- * @returns {Promise<void>}
739
- */
740
- export function opfsClearAll() {
741
- const ret = wasm.opfsClearAll();
742
- return ret;
743
- }
744
-
745
- /**
746
- * Get the current capacity of the OPFS file pool.
747
- * @returns {Promise<number>}
748
- */
749
- export function opfsPoolCapacity() {
750
- const ret = wasm.opfsPoolCapacity();
751
- return ret;
752
- }
753
-
754
768
  /**
755
769
  * Export a database file from OPFS as a byte array.
756
770
  * This can be used to backup or transfer a database.
@@ -765,20 +779,6 @@ export function opfsExportDb(filename) {
765
779
  return ret;
766
780
  }
767
781
 
768
- /**
769
- * Delete a specific database file from OPFS.
770
- * Returns true if the file was deleted, false if it didn't exist.
771
- * Note: The database must be closed before calling this function.
772
- * @param {string} filename
773
- * @returns {Promise<boolean>}
774
- */
775
- export function opfsDeleteFile(filename) {
776
- const ptr0 = passStringToWasm0(filename, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
777
- const len0 = WASM_VECTOR_LEN;
778
- const ret = wasm.opfsDeleteFile(ptr0, len0);
779
- return ret;
780
- }
781
-
782
782
  /**
783
783
  * Initialize the OPFS SQLite VFS if not already initialized.
784
784
  * This must be called before using other OPFS functions.
@@ -810,10 +810,6 @@ export function task_worker_entry_point(ptr) {
810
810
  }
811
811
  }
812
812
 
813
- function wasm_bindgen__convert__closures_____invoke__h956b60152b2cf005(arg0, arg1) {
814
- wasm.wasm_bindgen__convert__closures_____invoke__h956b60152b2cf005(arg0, arg1);
815
- }
816
-
817
813
  function wasm_bindgen__convert__closures_____invoke__hdff293b41f2cecc6(arg0, arg1, arg2) {
818
814
  wasm.wasm_bindgen__convert__closures_____invoke__hdff293b41f2cecc6(arg0, arg1, arg2);
819
815
  }
@@ -826,6 +822,10 @@ function wasm_bindgen__convert__closures_____invoke__h6af3cd86eb56f4b1(arg0, arg
826
822
  wasm.wasm_bindgen__convert__closures_____invoke__h6af3cd86eb56f4b1(arg0, arg1);
827
823
  }
828
824
 
825
+ function wasm_bindgen__convert__closures_____invoke__h956b60152b2cf005(arg0, arg1) {
826
+ wasm.wasm_bindgen__convert__closures_____invoke__h956b60152b2cf005(arg0, arg1);
827
+ }
828
+
829
829
  function wasm_bindgen__convert__closures_____invoke__h47a8fb56fc48c5fb(arg0, arg1, arg2, arg3) {
830
830
  wasm.wasm_bindgen__convert__closures_____invoke__h47a8fb56fc48c5fb(arg0, arg1, arg2, arg3);
831
831
  }
@@ -3374,26 +3374,26 @@ function __wbg_get_imports() {
3374
3374
  const ret = Date.now();
3375
3375
  return ret;
3376
3376
  };
3377
- imports.wbg.__wbg_on_auth_required_fd05f3c0815ef28f = function() { return handleError(function (arg0) {
3377
+ imports.wbg.__wbg_on_auth_required_bd4fddb2d64ca1f6 = function() { return handleError(function (arg0) {
3378
3378
  const ret = arg0.on_auth_required();
3379
3379
  return ret;
3380
3380
  }, arguments) };
3381
- imports.wbg.__wbg_on_close_1f957729f7d4d089 = function(arg0) {
3381
+ imports.wbg.__wbg_on_close_b7db71fe8139a5f0 = function(arg0) {
3382
3382
  arg0.on_close();
3383
3383
  };
3384
- imports.wbg.__wbg_on_consent_update_631e88f8737af44e = function(arg0, arg1) {
3384
+ imports.wbg.__wbg_on_consent_update_f646a191e881f57d = function(arg0, arg1) {
3385
3385
  arg0.on_consent_update(arg1);
3386
3386
  };
3387
- imports.wbg.__wbg_on_conversation_08c1f27f26ec064c = function(arg0, arg1) {
3387
+ imports.wbg.__wbg_on_conversation_9187414aca96940c = function(arg0, arg1) {
3388
3388
  arg0.on_conversation(Conversation.__wrap(arg1));
3389
3389
  };
3390
- imports.wbg.__wbg_on_error_385b8798e09f129a = function(arg0, arg1) {
3390
+ imports.wbg.__wbg_on_error_c58307424c85aaf5 = function(arg0, arg1) {
3391
3391
  arg0.on_error(arg1);
3392
3392
  };
3393
- imports.wbg.__wbg_on_message_61f6880471fdefb7 = function(arg0, arg1) {
3393
+ imports.wbg.__wbg_on_message_b60ee485d291967a = function(arg0, arg1) {
3394
3394
  arg0.on_message(arg1);
3395
3395
  };
3396
- imports.wbg.__wbg_on_message_deleted_ecf04db9f637cbd6 = function(arg0, arg1, arg2) {
3396
+ imports.wbg.__wbg_on_message_deleted_dc9cf7d3b9aefde7 = function(arg0, arg1, arg2) {
3397
3397
  let deferred0_0;
3398
3398
  let deferred0_1;
3399
3399
  try {
@@ -3404,7 +3404,7 @@ function __wbg_get_imports() {
3404
3404
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3405
3405
  }
3406
3406
  };
3407
- imports.wbg.__wbg_on_user_preference_update_a8904bf6b28360b6 = function(arg0, arg1, arg2) {
3407
+ imports.wbg.__wbg_on_user_preference_update_82574376a4af8566 = function(arg0, arg1, arg2) {
3408
3408
  var v0 = getArrayJsValueFromWasm0(arg1, arg2).slice();
3409
3409
  wasm.__wbindgen_free(arg1, arg2 * 4, 4);
3410
3410
  arg0.on_user_preference_update(v0);
Binary file
@@ -218,14 +218,14 @@ export const intounderlyingbytesource_cancel: (a: number) => void;
218
218
  export const intounderlyingbytesource_pull: (a: number, b: any) => any;
219
219
  export const intounderlyingbytesource_start: (a: number, b: any) => void;
220
220
  export const intounderlyingbytesource_type: (a: number) => number;
221
- export const wasm_bindgen__convert__closures_____invoke__h956b60152b2cf005: (a: number, b: number) => void;
222
- export const wasm_bindgen__closure__destroy__h3c5639ee43c80f22: (a: number, b: number) => void;
223
221
  export const wasm_bindgen__convert__closures_____invoke__hdff293b41f2cecc6: (a: number, b: number, c: any) => void;
224
222
  export const wasm_bindgen__closure__destroy__hed8af60076250245: (a: number, b: number) => void;
225
223
  export const wasm_bindgen__convert__closures_____invoke__hceddd2b8fc291040: (a: number, b: number) => void;
226
224
  export const wasm_bindgen__closure__destroy__hfbd660e60d498df9: (a: number, b: number) => void;
227
225
  export const wasm_bindgen__convert__closures_____invoke__h6af3cd86eb56f4b1: (a: number, b: number) => void;
228
226
  export const wasm_bindgen__closure__destroy__he7b712e0eb1b5ac1: (a: number, b: number) => void;
227
+ export const wasm_bindgen__convert__closures_____invoke__h956b60152b2cf005: (a: number, b: number) => void;
228
+ export const wasm_bindgen__closure__destroy__h3c5639ee43c80f22: (a: number, b: number) => void;
229
229
  export const wasm_bindgen__convert__closures_____invoke__h47a8fb56fc48c5fb: (a: number, b: number, c: any, d: any) => void;
230
230
  export const __wbindgen_malloc: (a: number, b: number) => number;
231
231
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmtp/wasm-bindings",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "WASM bindings for the libXMTP rust library",
5
5
  "keywords": [
6
6
  "xmtp",