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

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
@@ -15,12 +15,14 @@ export declare class Client {
15
15
  sendSyncRequest(): Promise<void>
16
16
  findInboxIdByIdentifier(identifier: Identifier): Promise<string | null>
17
17
  addressesFromInboxId(refreshFromNetwork: boolean, inboxIds: Array<string>): Promise<Array<InboxState>>
18
- syncPreferences(): Promise<number>
18
+ syncPreferences(): Promise<GroupSyncSummary>
19
19
  apiStatistics(): ApiStats
20
20
  apiIdentityStatistics(): IdentityStats
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 {
@@ -114,7 +118,7 @@ export declare class Conversations {
114
118
  findMessageById(messageId: string): Message
115
119
  processStreamedWelcomeMessage(envelopeBytes: Uint8Array): Promise<Conversation>
116
120
  sync(): Promise<void>
117
- syncAllConversations(consentStates?: Array<ConsentState> | undefined | null): Promise<bigint>
121
+ syncAllConversations(consentStates?: Array<ConsentState> | undefined | null): Promise<GroupSyncSummary>
118
122
  list(opts?: ListConversationsOptions | undefined | null): Array<ConversationListItem>
119
123
  getHmacKeys(): Record<string, Array<HmacKey>>
120
124
  stream(callback: (err: Error | null, result: Conversation | undefined) => void, onClose: () => void, conversationType?: ConversationType): StreamCloser
@@ -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
@@ -222,7 +263,7 @@ export interface ConversationDebugInfo {
222
263
  isCommitLogForked?: boolean
223
264
  localCommitLog: string
224
265
  remoteCommitLog: string
225
- cursor: number
266
+ cursor: Array<XmtpCursor>
226
267
  }
227
268
 
228
269
  export declare const enum ConversationType {
@@ -239,7 +280,7 @@ export declare const enum ConversationType {
239
280
  * It can be one of: `debug`, `info`, `warn`, `error` or 'off'.
240
281
  * By default, logging is disabled.
241
282
  */
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>
283
+ 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
284
 
244
285
  export interface CreateDmOptions {
245
286
  messageDisappearingSettings?: MessageDisappearingSettings
@@ -254,6 +295,19 @@ export interface CreateGroupOptions {
254
295
  messageDisappearingSettings?: MessageDisappearingSettings
255
296
  }
256
297
 
298
+ export interface DecodedMessageBody {
299
+ textContent?: TextContent
300
+ reactionContent?: ReactionPayload
301
+ attachmentContent?: Attachment
302
+ remoteAttachmentContent?: RemoteAttachment
303
+ multiRemoteAttachmentContent?: MultiRemoteAttachmentPayload
304
+ transactionReferenceContent?: TransactionReference
305
+ groupUpdatedContent?: GroupUpdated
306
+ readReceiptContent?: ReadReceipt
307
+ walletSendCallsContent?: WalletSendCalls
308
+ customContent?: EncodedContent
309
+ }
310
+
257
311
  export declare export declare function decodeMultiRemoteAttachment(bytes: Uint8Array): MultiRemoteAttachment
258
312
 
259
313
  export declare export declare function decodeReaction(bytes: Uint8Array): Reaction
@@ -264,6 +318,8 @@ export declare const enum DeliveryStatus {
264
318
  Failed = 2
265
319
  }
266
320
 
321
+ export declare export declare function deserializeEncodedContent(bytes: Uint8Array): EncodedContent
322
+
267
323
  export interface EncodedContent {
268
324
  type?: ContentTypeId
269
325
  parameters: Record<string, string>
@@ -278,7 +334,7 @@ export declare export declare function encodeReaction(reaction: Reaction): Uint8
278
334
 
279
335
  export declare export declare function generateInboxId(accountIdent: Identifier): string
280
336
 
281
- export declare export declare function getInboxIdForIdentifier(host: string, isSecure: boolean, identifier: Identifier): Promise<string | null>
337
+ export declare export declare function getInboxIdForIdentifier(v3Host: string, gatewayHost: string | undefined | null, isSecure: boolean, identifier: Identifier): Promise<string | null>
282
338
 
283
339
  export declare const enum GroupMembershipState {
284
340
  Allowed = 0,
@@ -298,6 +354,18 @@ export declare const enum GroupPermissionsOptions {
298
354
  CustomPolicy = 2
299
355
  }
300
356
 
357
+ export interface GroupSyncSummary {
358
+ numEligible: number
359
+ numSynced: number
360
+ }
361
+
362
+ export interface GroupUpdated {
363
+ initiatedByInboxId: string
364
+ addedInboxes: Array<Inbox>
365
+ removedInboxes: Array<Inbox>
366
+ metadataFieldChanges: Array<MetadataFieldChange>
367
+ }
368
+
301
369
  export interface HmacKey {
302
370
  key: Uint8Array
303
371
  epoch: bigint
@@ -320,6 +388,10 @@ export interface IdentityStats {
320
388
  verifySmartContractWalletSignature: bigint
321
389
  }
322
390
 
391
+ export interface Inbox {
392
+ inboxId: string
393
+ }
394
+
323
395
  export interface InboxState {
324
396
  inboxId: string
325
397
  recoveryIdentifier: Identifier
@@ -327,7 +399,7 @@ export interface InboxState {
327
399
  identifiers: Array<Identifier>
328
400
  }
329
401
 
330
- export declare export declare function inboxStateFromInboxIds(host: string, inboxIds: Array<string>): Promise<Array<InboxState>>
402
+ export declare export declare function inboxStateFromInboxIds(v3Host: string, gatewayHost: string | undefined | null, inboxIds: Array<string>): Promise<Array<InboxState>>
331
403
 
332
404
  export interface Installation {
333
405
  bytes: Uint8Array
@@ -335,9 +407,9 @@ export interface Installation {
335
407
  id: string
336
408
  }
337
409
 
338
- export declare export declare function isAddressAuthorized(host: string, inboxId: string, address: string): Promise<boolean>
410
+ export declare export declare function isAddressAuthorized(host: string, gatewayHost: string | undefined | null, inboxId: string, address: string): Promise<boolean>
339
411
 
340
- export declare export declare function isInstallationAuthorized(host: string, inboxId: string, installationId: Uint8Array): Promise<boolean>
412
+ export declare export declare function isInstallationAuthorized(host: string, gatewayHost: string | undefined | null, inboxId: string, installationId: Uint8Array): Promise<boolean>
341
413
 
342
414
  export interface KeyPackageStatus {
343
415
  lifetime?: Lifetime
@@ -365,7 +437,9 @@ export interface ListMessagesOptions {
365
437
  deliveryStatus?: DeliveryStatus
366
438
  direction?: SortDirection
367
439
  contentTypes?: Array<ContentType>
440
+ excludeContentTypes?: Array<ContentType>
368
441
  kind?: GroupMessageKind
442
+ excludeSenderInboxIds?: Array<string>
369
443
  }
370
444
 
371
445
  export declare const enum LogLevel {
@@ -414,10 +488,20 @@ export declare const enum MetadataField {
414
488
  ImageUrlSquare = 2
415
489
  }
416
490
 
491
+ export interface MetadataFieldChange {
492
+ fieldName: string
493
+ oldValue?: string
494
+ newValue?: string
495
+ }
496
+
417
497
  export interface MultiRemoteAttachment {
418
498
  attachments: Array<RemoteAttachmentInfo>
419
499
  }
420
500
 
501
+ export interface MultiRemoteAttachmentPayload {
502
+ attachments: Array<RemoteAttachmentInfoPayload>
503
+ }
504
+
421
505
  export interface PasskeySignature {
422
506
  publicKey: Array<number>
423
507
  signature: Array<number>
@@ -473,6 +557,14 @@ export declare const enum ReactionAction {
473
557
  Removed = 2
474
558
  }
475
559
 
560
+ export interface ReactionPayload {
561
+ reference: string
562
+ referenceInboxId: string
563
+ action: ReactionAction
564
+ content: string
565
+ schema: ReactionSchema
566
+ }
567
+
476
568
  export declare const enum ReactionSchema {
477
569
  Unknown = 0,
478
570
  Unicode = 1,
@@ -480,6 +572,21 @@ export declare const enum ReactionSchema {
480
572
  Custom = 3
481
573
  }
482
574
 
575
+ export interface ReadReceipt {
576
+
577
+ }
578
+
579
+ export interface RemoteAttachment {
580
+ url: string
581
+ contentDigest: string
582
+ secret: Array<number>
583
+ salt: Array<number>
584
+ nonce: Array<number>
585
+ scheme: string
586
+ contentLength: number
587
+ filename?: string
588
+ }
589
+
483
590
  export interface RemoteAttachmentInfo {
484
591
  secret: Uint8Array
485
592
  contentDigest: string
@@ -491,7 +598,24 @@ export interface RemoteAttachmentInfo {
491
598
  filename?: string
492
599
  }
493
600
 
494
- export declare export declare function revokeInstallationsSignatureRequest(host: string, recoveryIdentifier: Identifier, inboxId: string, installationIds: Array<Uint8Array>): Promise<SignatureRequestHandle>
601
+ export interface RemoteAttachmentInfoPayload {
602
+ url: string
603
+ contentDigest: string
604
+ secret: Array<number>
605
+ salt: Array<number>
606
+ nonce: Array<number>
607
+ scheme: string
608
+ contentLength?: number
609
+ filename?: string
610
+ }
611
+
612
+ export declare export declare function revokeInstallationsSignatureRequest(v3Host: string, gatewayHost: string | undefined | null, recoveryIdentifier: Identifier, inboxId: string, installationIds: Array<Uint8Array>): SignatureRequestHandle
613
+
614
+ export interface SendMessageOpts {
615
+ shouldPush: boolean
616
+ }
617
+
618
+ export declare export declare function serializeEncodedContent(content: EncodedContent): Uint8Array
495
619
 
496
620
  export declare const enum SortDirection {
497
621
  Ascending = 0,
@@ -503,4 +627,51 @@ export declare const enum SyncWorkerMode {
503
627
  disabled = 'disabled'
504
628
  }
505
629
 
630
+ export interface TextContent {
631
+ content: string
632
+ }
633
+
634
+ export interface TransactionMetadata {
635
+ transactionType: string
636
+ currency: string
637
+ amount: number
638
+ decimals: number
639
+ fromAddress: string
640
+ toAddress: string
641
+ }
642
+
643
+ export interface TransactionReference {
644
+ namespace?: string
645
+ networkId: string
646
+ reference: string
647
+ metadata?: TransactionMetadata
648
+ }
649
+
506
650
  export declare export declare function verifySignedWithPublicKey(signatureText: string, signatureBytes: Uint8Array, publicKey: Uint8Array): void
651
+
652
+ export interface WalletCall {
653
+ to?: string
654
+ data?: string
655
+ value?: string
656
+ gas?: string
657
+ metadata?: WalletCallMetadata
658
+ }
659
+
660
+ export interface WalletCallMetadata {
661
+ description: string
662
+ transactionType: string
663
+ extra: Record<string, string>
664
+ }
665
+
666
+ export interface WalletSendCalls {
667
+ version: string
668
+ chainId: string
669
+ from: string
670
+ calls: Array<WalletCall>
671
+ capabilities?: Record<string, string>
672
+ }
673
+
674
+ export interface XmtpCursor {
675
+ originatorId: number
676
+ sequenceId: number
677
+ }
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": "main",
3
+ "version": "e545a64",
4
+ "date": "2025-10-22 05:46:27 +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.e545a64",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://git@github.com/xmtp/libxmtp.git",