@xmtp/wasm-bindings 1.9.0-rc2 → 1.9.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.
@@ -1,23 +1,55 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function verifySignedWithPublicKey(signatureText: string, signatureBytes: Uint8Array, publicKey: Uint8Array): void;
3
+ export function inboxStateFromInboxIds(host: string, gatewayHost: string | null | undefined, inboxIds: string[]): Promise<InboxState[]>;
4
+ export function contentTypeGroupUpdated(): ContentTypeId;
5
+ export function contentTypeLeaveRequest(): ContentTypeId;
6
+ export function contentTypeText(): ContentTypeId;
7
+ export function encodeText(text: string): EncodedContent;
8
+ export function contentTypeMarkdown(): ContentTypeId;
9
+ export function encodeMarkdown(text: string): EncodedContent;
4
10
  export function applySignatureRequest(host: string, gatewayHost: string | null | undefined, signatureRequest: SignatureRequestHandle): Promise<void>;
5
11
  export function revokeInstallationsSignatureRequest(host: string, gatewayHost: string | null | undefined, recoveryIdentifier: Identifier, inboxId: string, installationIds: Uint8Array[]): SignatureRequestHandle;
12
+ export function verifySignedWithPublicKey(signatureText: string, signatureBytes: Uint8Array, publicKey: Uint8Array): void;
13
+ 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>;
6
14
  export function metadataFieldName(field: MetadataField): string;
15
+ export function generateInboxId(accountIdentifier: Identifier, nonce?: bigint | null): string;
16
+ export function getInboxIdForIdentifier(host: string, gatewayHost: string | null | undefined, isSecure: boolean, accountIdentifier: Identifier): Promise<string | undefined>;
7
17
  export function encodeAttachment(attachment: Attachment): EncodedContent;
8
18
  export function contentTypeAttachment(): ContentTypeId;
9
- export function contentTypeGroupUpdated(): ContentTypeId;
10
- export function contentTypeLeaveRequest(): ContentTypeId;
11
- export function contentTypeMultiRemoteAttachment(): ContentTypeId;
19
+ export function encodeReadReceipt(read_receipt: ReadReceipt): EncodedContent;
20
+ export function contentTypeReadReceipt(): ContentTypeId;
21
+ export function encodeRemoteAttachment(remote_attachment: RemoteAttachment): EncodedContent;
22
+ /**
23
+ * Decrypts an encrypted payload from a remote attachment.
24
+ */
25
+ export function decryptAttachment(encryptedBytes: Uint8Array, remoteAttachment: RemoteAttachment): Attachment;
26
+ /**
27
+ * Encrypts an attachment for storage as a remote attachment.
28
+ */
29
+ export function encryptAttachment(attachment: Attachment): EncryptedAttachment;
30
+ export function contentTypeRemoteAttachment(): ContentTypeId;
31
+ export function contentTypeWalletSendCalls(): ContentTypeId;
32
+ export function encodeWalletSendCalls(wallet_send_calls: WalletSendCalls): EncodedContent;
33
+ export function encodeTransactionReference(transaction_reference: TransactionReference): EncodedContent;
34
+ export function contentTypeTransactionReference(): ContentTypeId;
12
35
  export function encodeMultiRemoteAttachment(multi_remote_attachment: MultiRemoteAttachment): EncodedContent;
13
- export function contentTypeText(): ContentTypeId;
14
- export function encodeText(text: string): EncodedContent;
15
- export function contentTypeIntent(): ContentTypeId;
36
+ export function contentTypeMultiRemoteAttachment(): ContentTypeId;
37
+ export function contentTypeReply(): ContentTypeId;
16
38
  export function encodeIntent(intent: Intent): EncodedContent;
17
- export function contentTypeMarkdown(): ContentTypeId;
18
- export function encodeMarkdown(text: string): EncodedContent;
39
+ export function contentTypeIntent(): ContentTypeId;
40
+ export function contentTypeActions(): ContentTypeId;
41
+ export function encodeActions(actions: Actions): EncodedContent;
19
42
  export function encodeReaction(reaction: Reaction): EncodedContent;
20
43
  export function contentTypeReaction(): ContentTypeId;
44
+ /**
45
+ * Delete all database files from OPFS.
46
+ * Note: All databases must be closed before calling this function.
47
+ */
48
+ export function opfsClearAll(): Promise<void>;
49
+ /**
50
+ * Check if a database file exists in OPFS.
51
+ */
52
+ export function opfsFileExists(filename: string): Promise<boolean>;
21
53
  /**
22
54
  * Delete a specific database file from OPFS.
23
55
  * Returns true if the file was deleted, false if it didn't exist.
@@ -30,33 +62,14 @@ export function opfsDeleteFile(filename: string): Promise<boolean>;
30
62
  */
31
63
  export function opfsInit(): Promise<void>;
32
64
  /**
33
- * Check if a database file exists in OPFS.
34
- */
35
- export function opfsFileExists(filename: string): Promise<boolean>;
36
- /**
37
- * Get the number of database files stored in OPFS.
38
- */
39
- export function opfsFileCount(): Promise<number>;
40
- /**
41
- * Delete all database files from OPFS.
42
- * Note: All databases must be closed before calling this function.
65
+ * List all database files stored in OPFS.
66
+ * Returns an array of file names.
43
67
  */
44
- export function opfsClearAll(): Promise<void>;
68
+ export function opfsListFiles(): Promise<string[]>;
45
69
  /**
46
70
  * Get the current capacity of the OPFS file pool.
47
71
  */
48
72
  export function opfsPoolCapacity(): Promise<number>;
49
- /**
50
- * Export a database file from OPFS as a byte array.
51
- * This can be used to backup or transfer a database.
52
- * Note: The database should be closed before exporting for consistency.
53
- */
54
- export function opfsExportDb(filename: string): Promise<Uint8Array>;
55
- /**
56
- * List all database files stored in OPFS.
57
- * Returns an array of file names.
58
- */
59
- export function opfsListFiles(): Promise<string[]>;
60
73
  /**
61
74
  * Import a database from a byte array into OPFS.
62
75
  * This will overwrite any existing database with the same name.
@@ -64,29 +77,16 @@ export function opfsListFiles(): Promise<string[]>;
64
77
  * Note: Any existing database with the same name must be closed before importing.
65
78
  */
66
79
  export function opfsImportDb(filename: string, data: Uint8Array): Promise<void>;
67
- export function getInboxIdForIdentifier(host: string, gatewayHost: string | null | undefined, isSecure: boolean, accountIdentifier: Identifier): Promise<string | undefined>;
68
- export function generateInboxId(accountIdentifier: Identifier, nonce?: bigint | null): string;
69
- export function inboxStateFromInboxIds(host: string, gatewayHost: string | null | undefined, inboxIds: string[]): Promise<InboxState[]>;
70
- 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>;
71
- export function encodeReadReceipt(read_receipt: ReadReceipt): EncodedContent;
72
- export function contentTypeReadReceipt(): ContentTypeId;
73
- export function encodeRemoteAttachment(remote_attachment: RemoteAttachment): EncodedContent;
74
80
  /**
75
- * Decrypts an encrypted payload from a remote attachment.
81
+ * Get the number of database files stored in OPFS.
76
82
  */
77
- export function decryptAttachment(encryptedBytes: Uint8Array, remoteAttachment: RemoteAttachment): Attachment;
78
- export function contentTypeRemoteAttachment(): ContentTypeId;
83
+ export function opfsFileCount(): Promise<number>;
79
84
  /**
80
- * Encrypts an attachment for storage as a remote attachment.
85
+ * Export a database file from OPFS as a byte array.
86
+ * This can be used to backup or transfer a database.
87
+ * Note: The database should be closed before exporting for consistency.
81
88
  */
82
- export function encryptAttachment(attachment: Attachment): EncryptedAttachment;
83
- export function encodeWalletSendCalls(wallet_send_calls: WalletSendCalls): EncodedContent;
84
- export function contentTypeWalletSendCalls(): ContentTypeId;
85
- export function contentTypeTransactionReference(): ContentTypeId;
86
- export function encodeTransactionReference(transaction_reference: TransactionReference): EncodedContent;
87
- export function contentTypeReply(): ContentTypeId;
88
- export function encodeActions(actions: Actions): EncodedContent;
89
- export function contentTypeActions(): ContentTypeId;
89
+ export function opfsExportDb(filename: string): Promise<Uint8Array>;
90
90
  /**
91
91
  * Entry point invoked by JavaScript in a worker.
92
92
  */
@@ -231,46 +231,27 @@ export enum SortDirection {
231
231
  * *This API requires the following crate features to be activated: `ReadableStreamType`*
232
232
  */
233
233
  type ReadableStreamType = "bytes";
234
- export interface PasskeySignature {
235
- publicKey: Uint8Array;
236
- signature: Uint8Array;
237
- authenticatorData: Uint8Array;
238
- clientDataJson: Uint8Array;
239
- }
240
-
241
- export interface PermissionPolicySet {
242
- addMemberPolicy: PermissionPolicy;
243
- removeMemberPolicy: PermissionPolicy;
244
- addAdminPolicy: PermissionPolicy;
245
- removeAdminPolicy: PermissionPolicy;
246
- updateGroupNamePolicy: PermissionPolicy;
247
- updateGroupDescriptionPolicy: PermissionPolicy;
248
- updateGroupImageUrlSquarePolicy: PermissionPolicy;
249
- updateMessageDisappearingPolicy: PermissionPolicy;
250
- updateAppDataPolicy: PermissionPolicy;
234
+ export interface Lifetime {
235
+ notBefore: bigint;
236
+ notAfter: bigint;
251
237
  }
252
238
 
253
- export interface GroupPermissions {
254
- policyType: GroupPermissionsOptions;
255
- policySet: PermissionPolicySet;
239
+ export interface KeyPackageStatus {
240
+ lifetime?: Lifetime;
241
+ validationError?: string;
256
242
  }
257
243
 
258
- export interface SendMessageOpts {
259
- shouldPush: boolean;
260
- optimistic?: boolean;
244
+ export interface Installation {
245
+ bytes: Uint8Array;
246
+ id: string;
247
+ clientTimestampNs?: bigint;
261
248
  }
262
249
 
263
- export interface GroupMember {
250
+ export interface InboxState {
264
251
  inboxId: string;
252
+ recoveryIdentifier: Identifier;
253
+ installations: Installation[];
265
254
  accountIdentifiers: Identifier[];
266
- installationIds: string[];
267
- permissionLevel: PermissionLevel;
268
- consentState: ConsentState;
269
- }
270
-
271
- export interface GroupMetadata {
272
- creatorInboxId: string;
273
- conversationType: ConversationType;
274
255
  }
275
256
 
276
257
  export interface Consent {
@@ -279,22 +260,6 @@ export interface Consent {
279
260
  entity: string;
280
261
  }
281
262
 
282
- export interface Attachment {
283
- filename?: string;
284
- mimeType: string;
285
- content: Uint8Array;
286
- }
287
-
288
- export interface MetadataFieldChange {
289
- fieldName: string;
290
- oldValue?: string;
291
- newValue?: string;
292
- }
293
-
294
- export interface Inbox {
295
- inboxId: string;
296
- }
297
-
298
263
  export interface GroupUpdated {
299
264
  initiatedByInboxId: string;
300
265
  addedInboxes: Inbox[];
@@ -307,37 +272,74 @@ export interface GroupUpdated {
307
272
  removedSuperAdminInboxes: Inbox[];
308
273
  }
309
274
 
275
+ export interface MetadataFieldChange {
276
+ fieldName: string;
277
+ oldValue?: string;
278
+ newValue?: string;
279
+ }
280
+
281
+ export interface Inbox {
282
+ inboxId: string;
283
+ }
284
+
310
285
  export interface LeaveRequest {
311
286
  authenticatedNote?: Uint8Array;
312
287
  }
313
288
 
314
- export interface MultiRemoteAttachment {
315
- attachments: RemoteAttachmentInfo[];
289
+ export type UserPreferenceUpdate = { type: "ConsentUpdate"; consent: Consent } | { type: "HmacKeyUpdate"; key: number[] };
290
+
291
+ export interface Credential {
292
+ name?: string;
293
+ value: string;
294
+ expiresAtSeconds: bigint;
316
295
  }
317
296
 
318
- export interface RemoteAttachmentInfo {
319
- secret: Uint8Array;
320
- contentDigest: string;
321
- nonce: Uint8Array;
322
- scheme: string;
323
- url: string;
324
- salt: Uint8Array;
325
- contentLength?: number;
326
- filename?: string;
297
+ export interface ApiStats {
298
+ uploadKeyPackage: bigint;
299
+ fetchKeyPackage: bigint;
300
+ sendGroupMessages: bigint;
301
+ sendWelcomeMessages: bigint;
302
+ queryGroupMessages: bigint;
303
+ queryWelcomeMessages: bigint;
304
+ subscribeMessages: bigint;
305
+ subscribeWelcomes: bigint;
327
306
  }
328
307
 
329
- export interface Intent {
330
- id: string;
331
- actionId: string;
332
- metadata?: Record<string, string | number | boolean | null>;
308
+ export interface Identifier {
309
+ identifier: string;
310
+ identifierKind: IdentifierKind;
333
311
  }
334
312
 
335
- export interface Reaction {
336
- reference: string;
337
- referenceInboxId: string;
338
- action: ReactionAction;
339
- content: string;
340
- schema: ReactionSchema;
313
+ export interface IdentityStats {
314
+ publishIdentityUpdate: bigint;
315
+ getIdentityUpdatesV2: bigint;
316
+ getInboxIds: bigint;
317
+ verifySmartContractWalletSignature: bigint;
318
+ }
319
+
320
+ export interface PasskeySignature {
321
+ publicKey: Uint8Array;
322
+ signature: Uint8Array;
323
+ authenticatorData: Uint8Array;
324
+ clientDataJson: Uint8Array;
325
+ }
326
+
327
+ export interface GroupMetadata {
328
+ creatorInboxId: string;
329
+ conversationType: ConversationType;
330
+ }
331
+
332
+ export interface SendMessageOpts {
333
+ shouldPush: boolean;
334
+ optimistic?: boolean;
335
+ }
336
+
337
+ export interface GroupMember {
338
+ inboxId: string;
339
+ accountIdentifiers: Identifier[];
340
+ installationIds: string[];
341
+ permissionLevel: PermissionLevel;
342
+ consentState: ConsentState;
341
343
  }
342
344
 
343
345
  export interface ConversationDebugInfo {
@@ -350,6 +352,20 @@ export interface ConversationDebugInfo {
350
352
  cursor: Cursor[];
351
353
  }
352
354
 
355
+ export interface Cursor {
356
+ originatorId: number;
357
+ sequenceId: bigint;
358
+ }
359
+
360
+ export interface CreateDmOptions {
361
+ messageDisappearingSettings?: MessageDisappearingSettings;
362
+ }
363
+
364
+ export interface HmacKey {
365
+ key: Uint8Array;
366
+ epoch: bigint;
367
+ }
368
+
353
369
  export interface CreateGroupOptions {
354
370
  permissions?: GroupPermissionsOptions;
355
371
  groupName?: string;
@@ -360,11 +376,6 @@ export interface CreateGroupOptions {
360
376
  appData?: string;
361
377
  }
362
378
 
363
- export interface HmacKey {
364
- key: Uint8Array;
365
- epoch: bigint;
366
- }
367
-
368
379
  export interface ListConversationsOptions {
369
380
  consentStates?: ConsentState[];
370
381
  conversationType?: ConversationType;
@@ -375,41 +386,49 @@ export interface ListConversationsOptions {
375
386
  limit?: bigint;
376
387
  }
377
388
 
378
- export interface Cursor {
379
- originatorId: number;
380
- sequenceId: bigint;
381
- }
382
-
383
- export interface CreateDmOptions {
384
- messageDisappearingSettings?: MessageDisappearingSettings;
385
- }
386
-
387
389
  export interface MessageDisappearingSettings {
388
390
  fromNs: bigint;
389
391
  inNs: bigint;
390
392
  }
391
393
 
392
- export interface IdentityStats {
393
- publishIdentityUpdate: bigint;
394
- getIdentityUpdatesV2: bigint;
395
- getInboxIds: bigint;
396
- verifySmartContractWalletSignature: bigint;
394
+ export interface GroupSyncSummary {
395
+ numEligible: number;
396
+ numSynced: number;
397
397
  }
398
398
 
399
- export interface Identifier {
400
- identifier: string;
401
- identifierKind: IdentifierKind;
399
+ /**
400
+ * Specify options for the logger
401
+ */
402
+ export interface LogOptions {
403
+ /**
404
+ * enable structured JSON logging to stdout. Useful for third-party log viewers
405
+ */
406
+ structured?: boolean;
407
+ /**
408
+ * enable performance metrics for libxmtp in the `performance` tab
409
+ */
410
+ performance?: boolean;
411
+ /**
412
+ * filter for logs
413
+ */
414
+ level?: LogLevel;
402
415
  }
403
416
 
404
- export interface ApiStats {
405
- uploadKeyPackage: bigint;
406
- fetchKeyPackage: bigint;
407
- sendGroupMessages: bigint;
408
- sendWelcomeMessages: bigint;
409
- queryGroupMessages: bigint;
410
- queryWelcomeMessages: bigint;
411
- subscribeMessages: bigint;
412
- subscribeWelcomes: bigint;
417
+ export interface PermissionPolicySet {
418
+ addMemberPolicy: PermissionPolicy;
419
+ removeMemberPolicy: PermissionPolicy;
420
+ addAdminPolicy: PermissionPolicy;
421
+ removeAdminPolicy: PermissionPolicy;
422
+ updateGroupNamePolicy: PermissionPolicy;
423
+ updateGroupDescriptionPolicy: PermissionPolicy;
424
+ updateGroupImageUrlSquarePolicy: PermissionPolicy;
425
+ updateMessageDisappearingPolicy: PermissionPolicy;
426
+ updateAppDataPolicy: PermissionPolicy;
427
+ }
428
+
429
+ export interface GroupPermissions {
430
+ policyType: GroupPermissionsOptions;
431
+ policySet: PermissionPolicySet;
413
432
  }
414
433
 
415
434
  export interface ListMessagesOptions {
@@ -421,72 +440,26 @@ export interface ListMessagesOptions {
421
440
  deliveryStatus?: DeliveryStatus;
422
441
  direction?: SortDirection;
423
442
  kind?: GroupMessageKind;
424
- excludeSenderInboxIds?: string[];
425
- sortBy?: MessageSortBy;
426
- insertedAfterNs?: bigint;
427
- insertedBeforeNs?: bigint;
428
- }
429
-
430
- export interface Message {
431
- id: string;
432
- sentAtNs: bigint;
433
- convoId: string;
434
- senderInboxId: string;
435
- content: EncodedContent;
436
- kind: GroupMessageKind;
437
- deliveryStatus: DeliveryStatus;
438
- }
439
-
440
- export interface Lifetime {
441
- notBefore: bigint;
442
- notAfter: bigint;
443
- }
444
-
445
- export interface InboxState {
446
- inboxId: string;
447
- recoveryIdentifier: Identifier;
448
- installations: Installation[];
449
- accountIdentifiers: Identifier[];
450
- }
451
-
452
- export interface KeyPackageStatus {
453
- lifetime?: Lifetime;
454
- validationError?: string;
443
+ excludeSenderInboxIds?: string[];
444
+ sortBy?: MessageSortBy;
445
+ insertedAfterNs?: bigint;
446
+ insertedBeforeNs?: bigint;
455
447
  }
456
448
 
457
- export interface Installation {
458
- bytes: Uint8Array;
449
+ export interface Message {
459
450
  id: string;
460
- clientTimestampNs?: bigint;
461
- }
462
-
463
- export interface Credential {
464
- name?: string;
465
- value: string;
466
- expiresAtSeconds: bigint;
467
- }
468
-
469
- /**
470
- * Specify options for the logger
471
- */
472
- export interface LogOptions {
473
- /**
474
- * enable structured JSON logging to stdout. Useful for third-party log viewers
475
- */
476
- structured?: boolean;
477
- /**
478
- * enable performance metrics for libxmtp in the `performance` tab
479
- */
480
- performance?: boolean;
481
- /**
482
- * filter for logs
483
- */
484
- level?: LogLevel;
451
+ sentAtNs: bigint;
452
+ convoId: string;
453
+ senderInboxId: string;
454
+ content: EncodedContent;
455
+ kind: GroupMessageKind;
456
+ deliveryStatus: DeliveryStatus;
485
457
  }
486
458
 
487
- export interface GroupSyncSummary {
488
- numEligible: number;
489
- numSynced: number;
459
+ export interface Attachment {
460
+ filename?: string;
461
+ mimeType: string;
462
+ content: Uint8Array;
490
463
  }
491
464
 
492
465
  export type ReadReceipt = Record<string, never>;
@@ -536,6 +509,14 @@ export interface RemoteAttachment {
536
509
  filename?: string;
537
510
  }
538
511
 
512
+ export interface WalletSendCalls {
513
+ version: string;
514
+ chainId: string;
515
+ from: string;
516
+ calls: WalletCall[];
517
+ capabilities?: Record<string, string>;
518
+ }
519
+
539
520
  export interface WalletCall {
540
521
  to?: string;
541
522
  data?: string;
@@ -544,12 +525,11 @@ export interface WalletCall {
544
525
  metadata?: Record<string, string>;
545
526
  }
546
527
 
547
- export interface WalletSendCalls {
548
- version: string;
549
- chainId: string;
550
- from: string;
551
- calls: WalletCall[];
552
- capabilities?: Record<string, string>;
528
+ export interface TransactionReference {
529
+ namespace?: string;
530
+ networkId: string;
531
+ reference: string;
532
+ metadata?: TransactionMetadata;
553
533
  }
554
534
 
555
535
  export interface TransactionMetadata {
@@ -561,14 +541,22 @@ export interface TransactionMetadata {
561
541
  toAddress: string;
562
542
  }
563
543
 
564
- export interface TransactionReference {
565
- namespace?: string;
566
- networkId: string;
567
- reference: string;
568
- metadata?: TransactionMetadata;
544
+ 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 } | { type: "deletedMessage"; content: DeletedMessage };
545
+
546
+ export interface MultiRemoteAttachment {
547
+ attachments: RemoteAttachmentInfo[];
569
548
  }
570
549
 
571
- 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 } | { type: "deletedMessage"; content: DeletedMessage };
550
+ export interface RemoteAttachmentInfo {
551
+ secret: Uint8Array;
552
+ contentDigest: string;
553
+ nonce: Uint8Array;
554
+ scheme: string;
555
+ url: string;
556
+ salt: Uint8Array;
557
+ contentLength?: number;
558
+ filename?: string;
559
+ }
572
560
 
573
561
  export interface EnrichedReply {
574
562
  referenceId: string;
@@ -582,12 +570,10 @@ export interface Reply {
582
570
  referenceInboxId?: string;
583
571
  }
584
572
 
585
- export interface Action {
573
+ export interface Intent {
586
574
  id: string;
587
- label: string;
588
- imageUrl?: string;
589
- style?: ActionStyle;
590
- expiresAtNs?: bigint;
575
+ actionId: string;
576
+ metadata?: Record<string, string | number | boolean | null>;
591
577
  }
592
578
 
593
579
  export interface Actions {
@@ -597,6 +583,22 @@ export interface Actions {
597
583
  expiresAtNs?: bigint;
598
584
  }
599
585
 
586
+ export interface Action {
587
+ id: string;
588
+ label: string;
589
+ imageUrl?: string;
590
+ style?: ActionStyle;
591
+ expiresAtNs?: bigint;
592
+ }
593
+
594
+ export interface Reaction {
595
+ reference: string;
596
+ referenceInboxId: string;
597
+ action: ReactionAction;
598
+ content: string;
599
+ schema: ReactionSchema;
600
+ }
601
+
600
602
  export interface EncodedContent {
601
603
  type?: ContentTypeId;
602
604
  parameters: Record<string, string>;
@@ -628,8 +630,6 @@ export interface DecodedMessage {
628
630
  expiresAtNs: bigint | undefined;
629
631
  }
630
632
 
631
- export type UserPreferenceUpdate = { type: "ConsentUpdate"; consent: Consent } | { type: "HmacKeyUpdate"; key: number[] };
632
-
633
633
  export class AuthHandle {
634
634
  free(): void;
635
635
  [Symbol.dispose](): void;
@@ -641,18 +641,6 @@ export class Client {
641
641
  private constructor();
642
642
  free(): void;
643
643
  [Symbol.dispose](): void;
644
- registerIdentity(signatureRequest: SignatureRequestHandle): Promise<void>;
645
- applySignatureRequest(signatureRequest: SignatureRequestHandle): Promise<void>;
646
- signWithInstallationKey(signatureText: string): Uint8Array;
647
- createInboxSignatureRequest(): SignatureRequestHandle | undefined;
648
- addWalletSignatureRequest(newIdentifier: Identifier): Promise<SignatureRequestHandle>;
649
- revokeWalletSignatureRequest(identifier: Identifier): Promise<SignatureRequestHandle>;
650
- verifySignedWithInstallationKey(signatureText: string, signatureBytes: Uint8Array): void;
651
- revokeInstallationsSignatureRequest(installationIds: Uint8Array[]): Promise<SignatureRequestHandle>;
652
- changeRecoveryIdentifierSignatureRequest(newRecoveryIdentifier: Identifier): Promise<SignatureRequestHandle>;
653
- revokeAllOtherInstallationsSignatureRequest(): Promise<SignatureRequestHandle | undefined>;
654
- getConsentState(entityType: ConsentEntityType, entity: string): Promise<ConsentState>;
655
- setConsentStates(records: Consent[]): Promise<void>;
656
644
  /**
657
645
  *
658
646
  * * Get the client's inbox state.
@@ -671,6 +659,18 @@ export class Client {
671
659
  *
672
660
  */
673
661
  getKeyPackageStatusesForInstallationIds(installationIds: string[]): Promise<any>;
662
+ getConsentState(entityType: ConsentEntityType, entity: string): Promise<ConsentState>;
663
+ setConsentStates(records: Consent[]): Promise<void>;
664
+ registerIdentity(signatureRequest: SignatureRequestHandle): Promise<void>;
665
+ applySignatureRequest(signatureRequest: SignatureRequestHandle): Promise<void>;
666
+ signWithInstallationKey(signatureText: string): Uint8Array;
667
+ createInboxSignatureRequest(): SignatureRequestHandle | undefined;
668
+ addWalletSignatureRequest(newIdentifier: Identifier): Promise<SignatureRequestHandle>;
669
+ revokeWalletSignatureRequest(identifier: Identifier): Promise<SignatureRequestHandle>;
670
+ verifySignedWithInstallationKey(signatureText: string, signatureBytes: Uint8Array): void;
671
+ revokeInstallationsSignatureRequest(installationIds: Uint8Array[]): Promise<SignatureRequestHandle>;
672
+ changeRecoveryIdentifierSignatureRequest(newRecoveryIdentifier: Identifier): Promise<SignatureRequestHandle>;
673
+ revokeAllOtherInstallationsSignatureRequest(): Promise<SignatureRequestHandle | undefined>;
674
674
  /**
675
675
  * Output booleans should be zipped with the index of input identifiers
676
676
  */
@@ -696,6 +696,8 @@ export class Conversation {
696
696
  private constructor();
697
697
  free(): void;
698
698
  [Symbol.dispose](): void;
699
+ consentState(): ConsentState;
700
+ updateConsentState(state: ConsentState): void;
699
701
  adminList(): string[];
700
702
  getDebugInfo(): Promise<any>;
701
703
  groupName(): string;
@@ -768,8 +770,6 @@ export class Conversation {
768
770
  addAdmin(inboxId: string): Promise<void>;
769
771
  isActive(): boolean;
770
772
  sendText(text: string, optimistic?: boolean | null): Promise<string>;
771
- consentState(): ConsentState;
772
- updateConsentState(state: ConsentState): void;
773
773
  }
774
774
  export class ConversationListItem {
775
775
  free(): void;
@@ -877,6 +877,25 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
877
877
 
878
878
  export interface InitOutput {
879
879
  readonly memory: WebAssembly.Memory;
880
+ readonly client_getKeyPackageStatusesForInstallationIds: (a: number, b: number, c: number) => any;
881
+ readonly client_getLatestInboxState: (a: number, b: number, c: number) => any;
882
+ readonly client_inboxState: (a: number, b: number) => any;
883
+ readonly inboxStateFromInboxIds: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
884
+ readonly __wbg_authhandle_free: (a: number, b: number) => void;
885
+ readonly authhandle_id: (a: number) => number;
886
+ readonly authhandle_new: () => number;
887
+ readonly authhandle_set: (a: number, b: any) => any;
888
+ readonly client_getConsentState: (a: number, b: number, c: number, d: number) => any;
889
+ readonly client_setConsentStates: (a: number, b: number, c: number) => any;
890
+ readonly contentTypeGroupUpdated: () => any;
891
+ readonly contentTypeLeaveRequest: () => any;
892
+ readonly contentTypeMarkdown: () => any;
893
+ readonly contentTypeText: () => any;
894
+ readonly conversation_consentState: (a: number) => [number, number, number];
895
+ readonly conversation_updateConsentState: (a: number, b: number) => [number, number];
896
+ readonly encodeMarkdown: (a: number, b: number) => [number, number, number];
897
+ readonly encodeText: (a: number, b: number) => [number, number, number];
898
+ readonly __wbg_client_free: (a: number, b: number) => void;
880
899
  readonly __wbg_conversation_free: (a: number, b: number) => void;
881
900
  readonly __wbg_conversationlistitem_free: (a: number, b: number) => void;
882
901
  readonly __wbg_conversations_free: (a: number, b: number) => void;
@@ -894,26 +913,33 @@ export interface InitOutput {
894
913
  readonly __wbg_signaturerequesthandle_free: (a: number, b: number) => void;
895
914
  readonly __wbg_streamcloser_free: (a: number, b: number) => void;
896
915
  readonly applySignatureRequest: (a: number, b: number, c: number, d: number, e: number) => any;
916
+ readonly client_accountIdentifier: (a: number) => any;
897
917
  readonly client_addWalletSignatureRequest: (a: number, b: any) => any;
918
+ readonly client_apiAggregateStatistics: (a: number) => [number, number];
919
+ readonly client_apiIdentityStatistics: (a: number) => any;
920
+ readonly client_apiStatistics: (a: number) => any;
921
+ readonly client_appVersion: (a: number) => [number, number];
898
922
  readonly client_applySignatureRequest: (a: number, b: number) => any;
923
+ readonly client_canMessage: (a: number, b: number, c: number) => any;
899
924
  readonly client_changeRecoveryIdentifierSignatureRequest: (a: number, b: any) => any;
925
+ readonly client_clearAllStatistics: (a: number) => void;
926
+ readonly client_conversations: (a: number) => number;
900
927
  readonly client_createInboxSignatureRequest: (a: number) => [number, number, number];
901
- readonly client_getConsentState: (a: number, b: number, c: number, d: number) => any;
928
+ readonly client_findInboxIdByIdentifier: (a: number, b: any) => any;
929
+ readonly client_inboxId: (a: number) => [number, number];
930
+ readonly client_inboxStateFromInboxIds: (a: number, b: number, c: number, d: number) => any;
931
+ readonly client_installationId: (a: number) => [number, number];
932
+ readonly client_installationIdBytes: (a: number) => any;
933
+ readonly client_isRegistered: (a: number) => number;
934
+ readonly client_libxmtpVersion: (a: number) => [number, number];
902
935
  readonly client_registerIdentity: (a: number, b: number) => any;
903
936
  readonly client_revokeAllOtherInstallationsSignatureRequest: (a: number) => any;
904
937
  readonly client_revokeInstallationsSignatureRequest: (a: number, b: number, c: number) => any;
905
938
  readonly client_revokeWalletSignatureRequest: (a: number, b: any) => any;
906
- readonly client_setConsentStates: (a: number, b: number, c: number) => any;
939
+ readonly client_sendSyncRequest: (a: number) => any;
907
940
  readonly client_signWithInstallationKey: (a: number, b: number, c: number) => [number, number, number];
941
+ readonly client_syncPreferences: (a: number) => any;
908
942
  readonly client_verifySignedWithInstallationKey: (a: number, b: number, c: number, d: any) => [number, number];
909
- readonly contentTypeAttachment: () => any;
910
- readonly contentTypeGroupUpdated: () => any;
911
- readonly contentTypeIntent: () => any;
912
- readonly contentTypeLeaveRequest: () => any;
913
- readonly contentTypeMarkdown: () => any;
914
- readonly contentTypeMultiRemoteAttachment: () => any;
915
- readonly contentTypeReaction: () => any;
916
- readonly contentTypeText: () => any;
917
943
  readonly conversation_addAdmin: (a: number, b: number, c: number) => any;
918
944
  readonly conversation_addMembers: (a: number, b: number, c: number) => any;
919
945
  readonly conversation_addMembersByInboxId: (a: number, b: number, c: number) => any;
@@ -921,7 +947,6 @@ export interface InitOutput {
921
947
  readonly conversation_addedByInboxId: (a: number) => [number, number, number, number];
922
948
  readonly conversation_adminList: (a: number) => [number, number, number, number];
923
949
  readonly conversation_appData: (a: number) => [number, number, number, number];
924
- readonly conversation_consentState: (a: number) => [number, number, number];
925
950
  readonly conversation_countMessages: (a: number, b: number) => any;
926
951
  readonly conversation_createdAtNs: (a: number) => bigint;
927
952
  readonly conversation_dmPeerInboxId: (a: number) => [number, number, number, number];
@@ -972,7 +997,6 @@ export interface InitOutput {
972
997
  readonly conversation_superAdminList: (a: number) => [number, number, number, number];
973
998
  readonly conversation_sync: (a: number) => any;
974
999
  readonly conversation_updateAppData: (a: number, b: number, c: number) => any;
975
- readonly conversation_updateConsentState: (a: number, b: number) => [number, number];
976
1000
  readonly conversation_updateGroupDescription: (a: number, b: number, c: number) => any;
977
1001
  readonly conversation_updateGroupImageUrlSquare: (a: number, b: number, c: number) => any;
978
1002
  readonly conversation_updateGroupName: (a: number, b: number, c: number) => any;
@@ -999,24 +1023,7 @@ export interface InitOutput {
999
1023
  readonly conversations_streamPreferences: (a: number, b: any) => [number, number, number];
1000
1024
  readonly conversations_sync: (a: number) => any;
1001
1025
  readonly conversations_syncAllConversations: (a: number, b: number, c: number) => any;
1002
- readonly encodeAttachment: (a: any) => [number, number, number];
1003
- readonly encodeIntent: (a: any) => [number, number, number];
1004
- readonly encodeMarkdown: (a: number, b: number) => [number, number, number];
1005
- readonly encodeMultiRemoteAttachment: (a: any) => [number, number, number];
1006
- readonly encodeReaction: (a: any) => [number, number, number];
1007
- readonly encodeText: (a: number, b: number) => [number, number, number];
1008
- readonly generateInboxId: (a: any, b: number, c: bigint) => [number, number, number, number];
1009
- readonly getInboxIdForIdentifier: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
1010
- readonly metadataFieldName: (a: number) => [number, number];
1011
- readonly opfsClearAll: () => any;
1012
- readonly opfsDeleteFile: (a: number, b: number) => any;
1013
- readonly opfsExportDb: (a: number, b: number) => any;
1014
- readonly opfsFileCount: () => any;
1015
- readonly opfsFileExists: (a: number, b: number) => any;
1016
- readonly opfsImportDb: (a: number, b: number, c: any) => any;
1017
- readonly opfsInit: () => any;
1018
- readonly opfsListFiles: () => any;
1019
- readonly opfsPoolCapacity: () => any;
1026
+ readonly createClient: (a: number, b: number, c: number, d: number, e: any, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: bigint, t: number, u: number, v: number) => any;
1020
1027
  readonly revokeInstallationsSignatureRequest: (a: number, b: number, c: number, d: number, e: any, f: number, g: number, h: number, i: number) => [number, number, number];
1021
1028
  readonly signaturerequesthandle_addEcdsaSignature: (a: number, b: any) => any;
1022
1029
  readonly signaturerequesthandle_addPasskeySignature: (a: number, b: any) => any;
@@ -1027,34 +1034,14 @@ export interface InitOutput {
1027
1034
  readonly streamcloser_isClosed: (a: number) => number;
1028
1035
  readonly streamcloser_waitForReady: (a: number) => any;
1029
1036
  readonly verifySignedWithPublicKey: (a: number, b: number, c: any, d: any) => [number, number];
1030
- readonly __wbg_authhandle_free: (a: number, b: number) => void;
1031
- readonly authhandle_id: (a: number) => number;
1032
- readonly authhandle_new: () => number;
1033
- readonly authhandle_set: (a: number, b: any) => any;
1034
- readonly client_getKeyPackageStatusesForInstallationIds: (a: number, b: number, c: number) => any;
1035
- readonly client_getLatestInboxState: (a: number, b: number, c: number) => any;
1036
- readonly client_inboxState: (a: number, b: number) => any;
1037
- readonly inboxStateFromInboxIds: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
1038
- readonly __wbg_client_free: (a: number, b: number) => void;
1039
- readonly client_accountIdentifier: (a: number) => any;
1040
- readonly client_apiAggregateStatistics: (a: number) => [number, number];
1041
- readonly client_apiIdentityStatistics: (a: number) => any;
1042
- readonly client_apiStatistics: (a: number) => any;
1043
- readonly client_appVersion: (a: number) => [number, number];
1044
- readonly client_canMessage: (a: number, b: number, c: number) => any;
1045
- readonly client_clearAllStatistics: (a: number) => void;
1046
- readonly client_conversations: (a: number) => number;
1047
- readonly client_findInboxIdByIdentifier: (a: number, b: any) => any;
1048
- readonly client_inboxId: (a: number) => [number, number];
1049
- readonly client_inboxStateFromInboxIds: (a: number, b: number, c: number, d: number) => any;
1050
- readonly client_installationId: (a: number) => [number, number];
1051
- readonly client_installationIdBytes: (a: number) => any;
1052
- readonly client_isRegistered: (a: number) => number;
1053
- readonly client_libxmtpVersion: (a: number) => [number, number];
1054
- readonly client_sendSyncRequest: (a: number) => any;
1055
- readonly client_syncPreferences: (a: number) => any;
1056
- readonly createClient: (a: number, b: number, c: number, d: number, e: any, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: bigint, t: number, u: number, v: number) => any;
1037
+ readonly generateInboxId: (a: any, b: number, c: bigint) => [number, number, number, number];
1038
+ readonly getInboxIdForIdentifier: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
1039
+ readonly metadataFieldName: (a: number) => [number, number];
1057
1040
  readonly contentTypeActions: () => any;
1041
+ readonly contentTypeAttachment: () => any;
1042
+ readonly contentTypeIntent: () => any;
1043
+ readonly contentTypeMultiRemoteAttachment: () => any;
1044
+ readonly contentTypeReaction: () => any;
1058
1045
  readonly contentTypeReadReceipt: () => any;
1059
1046
  readonly contentTypeRemoteAttachment: () => any;
1060
1047
  readonly contentTypeReply: () => any;
@@ -1062,11 +1049,24 @@ export interface InitOutput {
1062
1049
  readonly contentTypeWalletSendCalls: () => any;
1063
1050
  readonly decryptAttachment: (a: number, b: number, c: any) => [number, number, number];
1064
1051
  readonly encodeActions: (a: any) => [number, number, number];
1052
+ readonly encodeAttachment: (a: any) => [number, number, number];
1053
+ readonly encodeIntent: (a: any) => [number, number, number];
1054
+ readonly encodeMultiRemoteAttachment: (a: any) => [number, number, number];
1055
+ readonly encodeReaction: (a: any) => [number, number, number];
1065
1056
  readonly encodeReadReceipt: (a: any) => [number, number, number];
1066
1057
  readonly encodeRemoteAttachment: (a: any) => [number, number, number];
1067
1058
  readonly encodeTransactionReference: (a: any) => [number, number, number];
1068
1059
  readonly encodeWalletSendCalls: (a: any) => [number, number, number];
1069
1060
  readonly encryptAttachment: (a: any) => [number, number, number];
1061
+ readonly opfsClearAll: () => any;
1062
+ readonly opfsDeleteFile: (a: number, b: number) => any;
1063
+ readonly opfsExportDb: (a: number, b: number) => any;
1064
+ readonly opfsFileCount: () => any;
1065
+ readonly opfsFileExists: (a: number, b: number) => any;
1066
+ readonly opfsImportDb: (a: number, b: number, c: any) => any;
1067
+ readonly opfsInit: () => any;
1068
+ readonly opfsListFiles: () => any;
1069
+ readonly opfsPoolCapacity: () => any;
1070
1070
  readonly rust_zstd_wasm_shim_calloc: (a: number, b: number) => number;
1071
1071
  readonly rust_zstd_wasm_shim_free: (a: number) => void;
1072
1072
  readonly rust_zstd_wasm_shim_malloc: (a: number) => number;
@@ -1099,12 +1099,12 @@ export interface InitOutput {
1099
1099
  readonly intounderlyingbytesource_pull: (a: number, b: any) => any;
1100
1100
  readonly intounderlyingbytesource_start: (a: number, b: any) => void;
1101
1101
  readonly intounderlyingbytesource_type: (a: number) => number;
1102
- readonly wasm_bindgen__convert__closures_____invoke__h956b60152b2cf005: (a: number, b: number) => void;
1103
- readonly wasm_bindgen__closure__destroy__h3c5639ee43c80f22: (a: number, b: number) => void;
1104
1102
  readonly wasm_bindgen__convert__closures_____invoke__hceddd2b8fc291040: (a: number, b: number) => void;
1105
1103
  readonly wasm_bindgen__closure__destroy__hfbd660e60d498df9: (a: number, b: number) => void;
1106
1104
  readonly wasm_bindgen__convert__closures_____invoke__hdff293b41f2cecc6: (a: number, b: number, c: any) => void;
1107
1105
  readonly wasm_bindgen__closure__destroy__hed8af60076250245: (a: number, b: number) => void;
1106
+ readonly wasm_bindgen__convert__closures_____invoke__h956b60152b2cf005: (a: number, b: number) => void;
1107
+ readonly wasm_bindgen__closure__destroy__h3c5639ee43c80f22: (a: number, b: number) => void;
1108
1108
  readonly wasm_bindgen__convert__closures_____invoke__h6af3cd86eb56f4b1: (a: number, b: number) => void;
1109
1109
  readonly wasm_bindgen__closure__destroy__he7b712e0eb1b5ac1: (a: number, b: number) => void;
1110
1110
  readonly wasm_bindgen__convert__closures_____invoke__h47a8fb56fc48c5fb: (a: number, b: number, c: any, d: any) => void;