@xmtp/node-bindings 1.6.0-dev.397eb83 → 1.6.0-dev.419b6dc

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.
Binary file
package/dist/index.d.ts CHANGED
@@ -21,6 +21,8 @@ export declare class Client {
21
21
  apiAggregateStatistics(): string
22
22
  clearAllStatistics(): void
23
23
  uploadDebugArchive(serverUrl: string): Promise<string>
24
+ deleteMessage(messageId: Uint8Array): number
25
+ enrichedMessage(messageId: Array<number>): Promise<DecodedMessage>
24
26
  setConsentStates(records: Array<Consent>): Promise<void>
25
27
  getConsentState(entityType: ConsentEntityType, entity: string): Promise<ConsentState>
26
28
  /**
@@ -50,11 +52,12 @@ export declare class Client {
50
52
 
51
53
  export declare class Conversation {
52
54
  id(): string
53
- send(encodedContent: EncodedContent): Promise<string>
54
- sendOptimistic(encodedContent: EncodedContent): string
55
+ send(encodedContent: EncodedContent, opts: SendMessageOpts): Promise<string>
56
+ sendOptimistic(encodedContent: EncodedContent, opts: SendMessageOpts): string
55
57
  publishMessages(): Promise<void>
56
58
  sync(): Promise<void>
57
59
  findMessages(opts?: ListMessagesOptions | undefined | null): Promise<Array<Message>>
60
+ countMessages(opts?: ListMessagesOptions | undefined | null): Promise<number>
58
61
  findMessagesWithReactions(opts?: ListMessagesOptions | undefined | null): Promise<Array<MessageWithReactions>>
59
62
  processStreamedGroupMessage(envelopeBytes: Uint8Array): Promise<Message>
60
63
  listMembers(): Promise<Array<GroupMember>>
@@ -72,7 +75,6 @@ export declare class Conversation {
72
75
  removeMembers(accountIdentities: Array<Identifier>): Promise<void>
73
76
  removeMembersByInboxId(inboxIds: Array<string>): Promise<void>
74
77
  updateGroupName(groupName: string): Promise<void>
75
- updateGroupMinVersionToMatchSelf(): Promise<void>
76
78
  groupName(): string
77
79
  updateGroupImageUrlSquare(groupImageUrlSquare: string): Promise<void>
78
80
  groupImageUrlSquare(): string
@@ -95,6 +97,8 @@ export declare class Conversation {
95
97
  getHmacKeys(): Record<string, Array<HmacKey>>
96
98
  debugInfo(): Promise<ConversationDebugInfo>
97
99
  findDuplicateDms(): Promise<Array<Conversation>>
100
+ findEnrichedMessages(opts?: ListMessagesOptions | undefined | null): Promise<Array<DecodedMessage>>
101
+ getLastReadTimes(): Promise<Record<string, number>>
98
102
  }
99
103
 
100
104
  export declare class ConversationListItem {
@@ -123,6 +127,37 @@ export declare class Conversations {
123
127
  streamPreferences(callback: (err: null | Error, result: any) => void, onClose: () => void): StreamCloser
124
128
  }
125
129
 
130
+ export declare class DecodedMessage {
131
+ id: Array<number>
132
+ sentAtNs: number
133
+ kind: GroupMessageKind
134
+ senderInstallationId: Array<number>
135
+ senderInboxId: string
136
+ contentType: ContentTypeId
137
+ conversationId: Array<number>
138
+ fallbackText?: string
139
+ deliveryStatus: DeliveryStatus
140
+ numReplies: number
141
+ get reactions(): Array<DecodedMessage>
142
+ get textContent(): TextContent | null
143
+ get replyContent(): EnrichedReply | null
144
+ get reactionContent(): ReactionPayload | null
145
+ get attachmentContent(): Attachment | null
146
+ get remoteAttachmentContent(): RemoteAttachment | null
147
+ get multiRemoteAttachmentContent(): MultiRemoteAttachmentPayload | null
148
+ get transactionReferenceContent(): TransactionReference | null
149
+ get groupUpdatedContent(): GroupUpdated | null
150
+ get readReceiptContent(): ReadReceipt | null
151
+ get walletSendCallsContent(): WalletSendCalls | null
152
+ get customContent(): EncodedContent | null
153
+ }
154
+
155
+ export declare class EnrichedReply {
156
+ get referenceId(): string
157
+ get content(): DecodedMessageBody
158
+ get inReplyTo(): NodeDecodedMessage | null
159
+ }
160
+
126
161
  export declare class GroupMember {
127
162
  inboxId: string
128
163
  accountIdentifiers: Array<Identifier>
@@ -176,7 +211,13 @@ export interface ApiStats {
176
211
  subscribeWelcomes: bigint
177
212
  }
178
213
 
179
- export declare export declare function applySignatureRequest(host: string, signatureRequest: SignatureRequestHandle): Promise<void>
214
+ export declare export declare function applySignatureRequest(v3Host: string, gatewayHost: string | undefined | null, signatureRequest: SignatureRequestHandle): Promise<void>
215
+
216
+ export interface Attachment {
217
+ filename?: string
218
+ mimeType: string
219
+ content: Array<number>
220
+ }
180
221
 
181
222
  export interface Consent {
182
223
  entityType: ConsentEntityType
@@ -198,14 +239,15 @@ export declare const enum ConsentState {
198
239
  export declare const enum ContentType {
199
240
  Unknown = 0,
200
241
  Text = 1,
201
- GroupMembershipChange = 2,
202
- GroupUpdated = 3,
203
- Reaction = 4,
204
- ReadReceipt = 5,
205
- Reply = 6,
206
- Attachment = 7,
207
- RemoteAttachment = 8,
208
- TransactionReference = 9
242
+ LeaveRequest = 2,
243
+ GroupMembershipChange = 3,
244
+ GroupUpdated = 4,
245
+ Reaction = 5,
246
+ ReadReceipt = 6,
247
+ Reply = 7,
248
+ Attachment = 8,
249
+ RemoteAttachment = 9,
250
+ TransactionReference = 10
209
251
  }
210
252
 
211
253
  export interface ContentTypeId {
@@ -222,7 +264,7 @@ export interface ConversationDebugInfo {
222
264
  isCommitLogForked?: boolean
223
265
  localCommitLog: string
224
266
  remoteCommitLog: string
225
- cursor: number
267
+ cursor: Array<XmtpCursor>
226
268
  }
227
269
 
228
270
  export declare const enum ConversationType {
@@ -239,7 +281,7 @@ export declare const enum ConversationType {
239
281
  * It can be one of: `debug`, `info`, `warn`, `error` or 'off'.
240
282
  * By default, logging is disabled.
241
283
  */
242
- export declare export declare function createClient(host: string, isSecure: boolean, dbPath: string | undefined | null, inboxId: string, accountIdentifier: Identifier, encryptionKey?: Uint8Array | undefined | null, deviceSyncServerUrl?: string | undefined | null, deviceSyncWorkerMode?: SyncWorkerMode | undefined | null, logOptions?: LogOptions | undefined | null, allowOffline?: boolean | undefined | null, disableEvents?: boolean | undefined | null, appVersion?: string | undefined | null): Promise<Client>
284
+ export declare export declare function createClient(v3Host: string, gatewayHost: string | undefined | null, isSecure: boolean, dbPath: string | undefined | null, inboxId: string, accountIdentifier: Identifier, encryptionKey?: Uint8Array | undefined | null, deviceSyncServerUrl?: string | undefined | null, deviceSyncWorkerMode?: SyncWorkerMode | undefined | null, logOptions?: LogOptions | undefined | null, allowOffline?: boolean | undefined | null, disableEvents?: boolean | undefined | null, appVersion?: string | undefined | null): Promise<Client>
243
285
 
244
286
  export interface CreateDmOptions {
245
287
  messageDisappearingSettings?: MessageDisappearingSettings
@@ -254,6 +296,19 @@ export interface CreateGroupOptions {
254
296
  messageDisappearingSettings?: MessageDisappearingSettings
255
297
  }
256
298
 
299
+ export interface DecodedMessageBody {
300
+ textContent?: TextContent
301
+ reactionContent?: ReactionPayload
302
+ attachmentContent?: Attachment
303
+ remoteAttachmentContent?: RemoteAttachment
304
+ multiRemoteAttachmentContent?: MultiRemoteAttachmentPayload
305
+ transactionReferenceContent?: TransactionReference
306
+ groupUpdatedContent?: GroupUpdated
307
+ readReceiptContent?: ReadReceipt
308
+ walletSendCallsContent?: WalletSendCalls
309
+ customContent?: EncodedContent
310
+ }
311
+
257
312
  export declare export declare function decodeMultiRemoteAttachment(bytes: Uint8Array): MultiRemoteAttachment
258
313
 
259
314
  export declare export declare function decodeReaction(bytes: Uint8Array): Reaction
@@ -264,6 +319,8 @@ export declare const enum DeliveryStatus {
264
319
  Failed = 2
265
320
  }
266
321
 
322
+ export declare export declare function deserializeEncodedContent(bytes: Uint8Array): EncodedContent
323
+
267
324
  export interface EncodedContent {
268
325
  type?: ContentTypeId
269
326
  parameters: Record<string, string>
@@ -278,13 +335,14 @@ export declare export declare function encodeReaction(reaction: Reaction): Uint8
278
335
 
279
336
  export declare export declare function generateInboxId(accountIdent: Identifier): string
280
337
 
281
- export declare export declare function getInboxIdForIdentifier(host: string, isSecure: boolean, identifier: Identifier): Promise<string | null>
338
+ export declare export declare function getInboxIdForIdentifier(v3Host: string, gatewayHost: string | undefined | null, isSecure: boolean, identifier: Identifier): Promise<string | null>
282
339
 
283
340
  export declare const enum GroupMembershipState {
284
341
  Allowed = 0,
285
342
  Rejected = 1,
286
343
  Pending = 2,
287
- Restored = 3
344
+ Restored = 3,
345
+ PendingRemove = 4
288
346
  }
289
347
 
290
348
  export declare const enum GroupMessageKind {
@@ -298,6 +356,13 @@ export declare const enum GroupPermissionsOptions {
298
356
  CustomPolicy = 2
299
357
  }
300
358
 
359
+ export interface GroupUpdated {
360
+ initiatedByInboxId: string
361
+ addedInboxes: Array<Inbox>
362
+ removedInboxes: Array<Inbox>
363
+ metadataFieldChanges: Array<MetadataFieldChange>
364
+ }
365
+
301
366
  export interface HmacKey {
302
367
  key: Uint8Array
303
368
  epoch: bigint
@@ -320,6 +385,10 @@ export interface IdentityStats {
320
385
  verifySmartContractWalletSignature: bigint
321
386
  }
322
387
 
388
+ export interface Inbox {
389
+ inboxId: string
390
+ }
391
+
323
392
  export interface InboxState {
324
393
  inboxId: string
325
394
  recoveryIdentifier: Identifier
@@ -327,7 +396,7 @@ export interface InboxState {
327
396
  identifiers: Array<Identifier>
328
397
  }
329
398
 
330
- export declare export declare function inboxStateFromInboxIds(host: string, inboxIds: Array<string>): Promise<Array<InboxState>>
399
+ export declare export declare function inboxStateFromInboxIds(v3Host: string, gatewayHost: string | undefined | null, inboxIds: Array<string>): Promise<Array<InboxState>>
331
400
 
332
401
  export interface Installation {
333
402
  bytes: Uint8Array
@@ -335,9 +404,9 @@ export interface Installation {
335
404
  id: string
336
405
  }
337
406
 
338
- export declare export declare function isAddressAuthorized(host: string, inboxId: string, address: string): Promise<boolean>
407
+ export declare export declare function isAddressAuthorized(host: string, gatewayHost: string | undefined | null, inboxId: string, address: string): Promise<boolean>
339
408
 
340
- export declare export declare function isInstallationAuthorized(host: string, inboxId: string, installationId: Uint8Array): Promise<boolean>
409
+ export declare export declare function isInstallationAuthorized(host: string, gatewayHost: string | undefined | null, inboxId: string, installationId: Uint8Array): Promise<boolean>
341
410
 
342
411
  export interface KeyPackageStatus {
343
412
  lifetime?: Lifetime
@@ -365,7 +434,9 @@ export interface ListMessagesOptions {
365
434
  deliveryStatus?: DeliveryStatus
366
435
  direction?: SortDirection
367
436
  contentTypes?: Array<ContentType>
437
+ excludeContentTypes?: Array<ContentType>
368
438
  kind?: GroupMessageKind
439
+ excludeSenderInboxIds?: Array<string>
369
440
  }
370
441
 
371
442
  export declare const enum LogLevel {
@@ -414,10 +485,20 @@ export declare const enum MetadataField {
414
485
  ImageUrlSquare = 2
415
486
  }
416
487
 
488
+ export interface MetadataFieldChange {
489
+ fieldName: string
490
+ oldValue?: string
491
+ newValue?: string
492
+ }
493
+
417
494
  export interface MultiRemoteAttachment {
418
495
  attachments: Array<RemoteAttachmentInfo>
419
496
  }
420
497
 
498
+ export interface MultiRemoteAttachmentPayload {
499
+ attachments: Array<RemoteAttachmentInfoPayload>
500
+ }
501
+
421
502
  export interface PasskeySignature {
422
503
  publicKey: Array<number>
423
504
  signature: Array<number>
@@ -473,6 +554,14 @@ export declare const enum ReactionAction {
473
554
  Removed = 2
474
555
  }
475
556
 
557
+ export interface ReactionPayload {
558
+ reference: string
559
+ referenceInboxId: string
560
+ action: ReactionAction
561
+ content: string
562
+ schema: ReactionSchema
563
+ }
564
+
476
565
  export declare const enum ReactionSchema {
477
566
  Unknown = 0,
478
567
  Unicode = 1,
@@ -480,6 +569,21 @@ export declare const enum ReactionSchema {
480
569
  Custom = 3
481
570
  }
482
571
 
572
+ export interface ReadReceipt {
573
+
574
+ }
575
+
576
+ export interface RemoteAttachment {
577
+ url: string
578
+ contentDigest: string
579
+ secret: Array<number>
580
+ salt: Array<number>
581
+ nonce: Array<number>
582
+ scheme: string
583
+ contentLength: number
584
+ filename?: string
585
+ }
586
+
483
587
  export interface RemoteAttachmentInfo {
484
588
  secret: Uint8Array
485
589
  contentDigest: string
@@ -491,7 +595,24 @@ export interface RemoteAttachmentInfo {
491
595
  filename?: string
492
596
  }
493
597
 
494
- export declare export declare function revokeInstallationsSignatureRequest(host: string, recoveryIdentifier: Identifier, inboxId: string, installationIds: Array<Uint8Array>): Promise<SignatureRequestHandle>
598
+ export interface RemoteAttachmentInfoPayload {
599
+ url: string
600
+ contentDigest: string
601
+ secret: Array<number>
602
+ salt: Array<number>
603
+ nonce: Array<number>
604
+ scheme: string
605
+ contentLength?: number
606
+ filename?: string
607
+ }
608
+
609
+ export declare export declare function revokeInstallationsSignatureRequest(v3Host: string, gatewayHost: string | undefined | null, recoveryIdentifier: Identifier, inboxId: string, installationIds: Array<Uint8Array>): SignatureRequestHandle
610
+
611
+ export interface SendMessageOpts {
612
+ shouldPush: boolean
613
+ }
614
+
615
+ export declare export declare function serializeEncodedContent(content: EncodedContent): Uint8Array
495
616
 
496
617
  export declare const enum SortDirection {
497
618
  Ascending = 0,
@@ -503,4 +624,51 @@ export declare const enum SyncWorkerMode {
503
624
  disabled = 'disabled'
504
625
  }
505
626
 
627
+ export interface TextContent {
628
+ content: string
629
+ }
630
+
631
+ export interface TransactionMetadata {
632
+ transactionType: string
633
+ currency: string
634
+ amount: number
635
+ decimals: number
636
+ fromAddress: string
637
+ toAddress: string
638
+ }
639
+
640
+ export interface TransactionReference {
641
+ namespace?: string
642
+ networkId: string
643
+ reference: string
644
+ metadata?: TransactionMetadata
645
+ }
646
+
506
647
  export declare export declare function verifySignedWithPublicKey(signatureText: string, signatureBytes: Uint8Array, publicKey: Uint8Array): void
648
+
649
+ export interface WalletCall {
650
+ to?: string
651
+ data?: string
652
+ value?: string
653
+ gas?: string
654
+ metadata?: WalletCallMetadata
655
+ }
656
+
657
+ export interface WalletCallMetadata {
658
+ description: string
659
+ transactionType: string
660
+ extra: Record<string, string>
661
+ }
662
+
663
+ export interface WalletSendCalls {
664
+ version: string
665
+ chainId: string
666
+ from: string
667
+ calls: Array<WalletCall>
668
+ capabilities?: Record<string, string>
669
+ }
670
+
671
+ export interface XmtpCursor {
672
+ originatorId: number
673
+ sequenceId: number
674
+ }
package/dist/index.js CHANGED
@@ -365,11 +365,13 @@ if (!nativeBinding) {
365
365
  throw new Error(`Failed to load native binding`)
366
366
  }
367
367
 
368
- const { Client, Conversation, ConversationListItem, Conversations, GroupMember, GroupMetadata, GroupPermissions, SignatureRequestHandle, StreamCloser, applySignatureRequest, ConsentEntityType, ConsentState, ContentType, ConversationType, createClient, decodeMultiRemoteAttachment, decodeReaction, DeliveryStatus, encodeMultiRemoteAttachment, encodeReaction, generateInboxId, getInboxIdForIdentifier, GroupMembershipState, GroupMessageKind, GroupPermissionsOptions, IdentifierKind, inboxStateFromInboxIds, isAddressAuthorized, isInstallationAuthorized, LogLevel, MetadataField, PermissionLevel, PermissionPolicy, PermissionUpdateType, ReactionAction, ReactionSchema, revokeInstallationsSignatureRequest, SortDirection, SyncWorkerMode, verifySignedWithPublicKey } = nativeBinding
368
+ const { Client, Conversation, ConversationListItem, Conversations, DecodedMessage, EnrichedReply, GroupMember, GroupMetadata, GroupPermissions, SignatureRequestHandle, StreamCloser, applySignatureRequest, ConsentEntityType, ConsentState, ContentType, ConversationType, createClient, decodeMultiRemoteAttachment, decodeReaction, DeliveryStatus, deserializeEncodedContent, encodeMultiRemoteAttachment, encodeReaction, generateInboxId, getInboxIdForIdentifier, GroupMembershipState, GroupMessageKind, GroupPermissionsOptions, IdentifierKind, inboxStateFromInboxIds, isAddressAuthorized, isInstallationAuthorized, LogLevel, MetadataField, PermissionLevel, PermissionPolicy, PermissionUpdateType, ReactionAction, ReactionSchema, revokeInstallationsSignatureRequest, serializeEncodedContent, SortDirection, SyncWorkerMode, verifySignedWithPublicKey } = nativeBinding
369
369
  export { Client }
370
370
  export { Conversation }
371
371
  export { ConversationListItem }
372
372
  export { Conversations }
373
+ export { DecodedMessage }
374
+ export { EnrichedReply }
373
375
  export { GroupMember }
374
376
  export { GroupMetadata }
375
377
  export { GroupPermissions }
@@ -384,6 +386,7 @@ export { createClient }
384
386
  export { decodeMultiRemoteAttachment }
385
387
  export { decodeReaction }
386
388
  export { DeliveryStatus }
389
+ export { deserializeEncodedContent }
387
390
  export { encodeMultiRemoteAttachment }
388
391
  export { encodeReaction }
389
392
  export { generateInboxId }
@@ -403,6 +406,7 @@ export { PermissionUpdateType }
403
406
  export { ReactionAction }
404
407
  export { ReactionSchema }
405
408
  export { revokeInstallationsSignatureRequest }
409
+ export { serializeEncodedContent }
406
410
  export { SortDirection }
407
411
  export { SyncWorkerMode }
408
412
  export { verifySignedWithPublicKey }
package/dist/version.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "branch": "cv/update-min-version-bot-one-off",
3
- "version": "397eb83",
4
- "date": "2025-09-25 16:54:34 +0000"
2
+ "branch": "mc/self-removal-ama-protos",
3
+ "version": "419b6dc",
4
+ "date": "2025-10-21 09:09:12 +0000"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmtp/node-bindings",
3
- "version": "1.6.0-dev.397eb83",
3
+ "version": "1.6.0-dev.419b6dc",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://git@github.com/xmtp/libxmtp.git",