@xmtp/node-bindings 1.5.5 → 1.6.0-dev.21f0ffd

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>>
@@ -94,6 +97,8 @@ export declare class Conversation {
94
97
  getHmacKeys(): Record<string, Array<HmacKey>>
95
98
  debugInfo(): Promise<ConversationDebugInfo>
96
99
  findDuplicateDms(): Promise<Array<Conversation>>
100
+ findEnrichedMessages(opts?: ListMessagesOptions | undefined | null): Promise<Array<DecodedMessage>>
101
+ getLastReadTimes(): Promise<Record<string, number>>
97
102
  }
98
103
 
99
104
  export declare class ConversationListItem {
@@ -113,7 +118,7 @@ export declare class Conversations {
113
118
  findMessageById(messageId: string): Message
114
119
  processStreamedWelcomeMessage(envelopeBytes: Uint8Array): Promise<Conversation>
115
120
  sync(): Promise<void>
116
- syncAllConversations(consentStates?: Array<ConsentState> | undefined | null): Promise<bigint>
121
+ syncAllConversations(consentStates?: Array<ConsentState> | undefined | null): Promise<GroupSyncSummary>
117
122
  list(opts?: ListConversationsOptions | undefined | null): Array<ConversationListItem>
118
123
  getHmacKeys(): Record<string, Array<HmacKey>>
119
124
  stream(callback: (err: Error | null, result: Conversation | undefined) => void, onClose: () => void, conversationType?: ConversationType): StreamCloser
@@ -122,6 +127,37 @@ export declare class Conversations {
122
127
  streamPreferences(callback: (err: null | Error, result: any) => void, onClose: () => void): StreamCloser
123
128
  }
124
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
+
125
161
  export declare class GroupMember {
126
162
  inboxId: string
127
163
  accountIdentifiers: Array<Identifier>
@@ -175,7 +211,13 @@ export interface ApiStats {
175
211
  subscribeWelcomes: bigint
176
212
  }
177
213
 
178
- 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
+ }
179
221
 
180
222
  export interface Consent {
181
223
  entityType: ConsentEntityType
@@ -197,14 +239,15 @@ export declare const enum ConsentState {
197
239
  export declare const enum ContentType {
198
240
  Unknown = 0,
199
241
  Text = 1,
200
- GroupMembershipChange = 2,
201
- GroupUpdated = 3,
202
- Reaction = 4,
203
- ReadReceipt = 5,
204
- Reply = 6,
205
- Attachment = 7,
206
- RemoteAttachment = 8,
207
- 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
208
251
  }
209
252
 
210
253
  export interface ContentTypeId {
@@ -221,7 +264,7 @@ export interface ConversationDebugInfo {
221
264
  isCommitLogForked?: boolean
222
265
  localCommitLog: string
223
266
  remoteCommitLog: string
224
- cursor: number
267
+ cursor: Array<XmtpCursor>
225
268
  }
226
269
 
227
270
  export declare const enum ConversationType {
@@ -238,7 +281,7 @@ export declare const enum ConversationType {
238
281
  * It can be one of: `debug`, `info`, `warn`, `error` or 'off'.
239
282
  * By default, logging is disabled.
240
283
  */
241
- 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>
242
285
 
243
286
  export interface CreateDmOptions {
244
287
  messageDisappearingSettings?: MessageDisappearingSettings
@@ -253,6 +296,19 @@ export interface CreateGroupOptions {
253
296
  messageDisappearingSettings?: MessageDisappearingSettings
254
297
  }
255
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
+
256
312
  export declare export declare function decodeMultiRemoteAttachment(bytes: Uint8Array): MultiRemoteAttachment
257
313
 
258
314
  export declare export declare function decodeReaction(bytes: Uint8Array): Reaction
@@ -263,6 +319,8 @@ export declare const enum DeliveryStatus {
263
319
  Failed = 2
264
320
  }
265
321
 
322
+ export declare export declare function deserializeEncodedContent(bytes: Uint8Array): EncodedContent
323
+
266
324
  export interface EncodedContent {
267
325
  type?: ContentTypeId
268
326
  parameters: Record<string, string>
@@ -277,13 +335,14 @@ export declare export declare function encodeReaction(reaction: Reaction): Uint8
277
335
 
278
336
  export declare export declare function generateInboxId(accountIdent: Identifier): string
279
337
 
280
- 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>
281
339
 
282
340
  export declare const enum GroupMembershipState {
283
341
  Allowed = 0,
284
342
  Rejected = 1,
285
343
  Pending = 2,
286
- Restored = 3
344
+ Restored = 3,
345
+ PendingRemove = 4
287
346
  }
288
347
 
289
348
  export declare const enum GroupMessageKind {
@@ -297,6 +356,18 @@ export declare const enum GroupPermissionsOptions {
297
356
  CustomPolicy = 2
298
357
  }
299
358
 
359
+ export interface GroupSyncSummary {
360
+ numEligible: number
361
+ numSynced: number
362
+ }
363
+
364
+ export interface GroupUpdated {
365
+ initiatedByInboxId: string
366
+ addedInboxes: Array<Inbox>
367
+ removedInboxes: Array<Inbox>
368
+ metadataFieldChanges: Array<MetadataFieldChange>
369
+ }
370
+
300
371
  export interface HmacKey {
301
372
  key: Uint8Array
302
373
  epoch: bigint
@@ -319,6 +390,10 @@ export interface IdentityStats {
319
390
  verifySmartContractWalletSignature: bigint
320
391
  }
321
392
 
393
+ export interface Inbox {
394
+ inboxId: string
395
+ }
396
+
322
397
  export interface InboxState {
323
398
  inboxId: string
324
399
  recoveryIdentifier: Identifier
@@ -326,7 +401,7 @@ export interface InboxState {
326
401
  identifiers: Array<Identifier>
327
402
  }
328
403
 
329
- export declare export declare function inboxStateFromInboxIds(host: string, inboxIds: Array<string>): Promise<Array<InboxState>>
404
+ export declare export declare function inboxStateFromInboxIds(v3Host: string, gatewayHost: string | undefined | null, inboxIds: Array<string>): Promise<Array<InboxState>>
330
405
 
331
406
  export interface Installation {
332
407
  bytes: Uint8Array
@@ -334,9 +409,9 @@ export interface Installation {
334
409
  id: string
335
410
  }
336
411
 
337
- export declare export declare function isAddressAuthorized(host: string, inboxId: string, address: string): Promise<boolean>
412
+ export declare export declare function isAddressAuthorized(host: string, gatewayHost: string | undefined | null, inboxId: string, address: string): Promise<boolean>
338
413
 
339
- export declare export declare function isInstallationAuthorized(host: string, inboxId: string, installationId: Uint8Array): Promise<boolean>
414
+ export declare export declare function isInstallationAuthorized(host: string, gatewayHost: string | undefined | null, inboxId: string, installationId: Uint8Array): Promise<boolean>
340
415
 
341
416
  export interface KeyPackageStatus {
342
417
  lifetime?: Lifetime
@@ -364,7 +439,9 @@ export interface ListMessagesOptions {
364
439
  deliveryStatus?: DeliveryStatus
365
440
  direction?: SortDirection
366
441
  contentTypes?: Array<ContentType>
442
+ excludeContentTypes?: Array<ContentType>
367
443
  kind?: GroupMessageKind
444
+ excludeSenderInboxIds?: Array<string>
368
445
  }
369
446
 
370
447
  export declare const enum LogLevel {
@@ -413,10 +490,20 @@ export declare const enum MetadataField {
413
490
  ImageUrlSquare = 2
414
491
  }
415
492
 
493
+ export interface MetadataFieldChange {
494
+ fieldName: string
495
+ oldValue?: string
496
+ newValue?: string
497
+ }
498
+
416
499
  export interface MultiRemoteAttachment {
417
500
  attachments: Array<RemoteAttachmentInfo>
418
501
  }
419
502
 
503
+ export interface MultiRemoteAttachmentPayload {
504
+ attachments: Array<RemoteAttachmentInfoPayload>
505
+ }
506
+
420
507
  export interface PasskeySignature {
421
508
  publicKey: Array<number>
422
509
  signature: Array<number>
@@ -472,6 +559,14 @@ export declare const enum ReactionAction {
472
559
  Removed = 2
473
560
  }
474
561
 
562
+ export interface ReactionPayload {
563
+ reference: string
564
+ referenceInboxId: string
565
+ action: ReactionAction
566
+ content: string
567
+ schema: ReactionSchema
568
+ }
569
+
475
570
  export declare const enum ReactionSchema {
476
571
  Unknown = 0,
477
572
  Unicode = 1,
@@ -479,6 +574,21 @@ export declare const enum ReactionSchema {
479
574
  Custom = 3
480
575
  }
481
576
 
577
+ export interface ReadReceipt {
578
+
579
+ }
580
+
581
+ export interface RemoteAttachment {
582
+ url: string
583
+ contentDigest: string
584
+ secret: Array<number>
585
+ salt: Array<number>
586
+ nonce: Array<number>
587
+ scheme: string
588
+ contentLength: number
589
+ filename?: string
590
+ }
591
+
482
592
  export interface RemoteAttachmentInfo {
483
593
  secret: Uint8Array
484
594
  contentDigest: string
@@ -490,7 +600,24 @@ export interface RemoteAttachmentInfo {
490
600
  filename?: string
491
601
  }
492
602
 
493
- export declare export declare function revokeInstallationsSignatureRequest(host: string, recoveryIdentifier: Identifier, inboxId: string, installationIds: Array<Uint8Array>): Promise<SignatureRequestHandle>
603
+ export interface RemoteAttachmentInfoPayload {
604
+ url: string
605
+ contentDigest: string
606
+ secret: Array<number>
607
+ salt: Array<number>
608
+ nonce: Array<number>
609
+ scheme: string
610
+ contentLength?: number
611
+ filename?: string
612
+ }
613
+
614
+ export declare export declare function revokeInstallationsSignatureRequest(v3Host: string, gatewayHost: string | undefined | null, recoveryIdentifier: Identifier, inboxId: string, installationIds: Array<Uint8Array>): SignatureRequestHandle
615
+
616
+ export interface SendMessageOpts {
617
+ shouldPush: boolean
618
+ }
619
+
620
+ export declare export declare function serializeEncodedContent(content: EncodedContent): Uint8Array
494
621
 
495
622
  export declare const enum SortDirection {
496
623
  Ascending = 0,
@@ -502,4 +629,51 @@ export declare const enum SyncWorkerMode {
502
629
  disabled = 'disabled'
503
630
  }
504
631
 
632
+ export interface TextContent {
633
+ content: string
634
+ }
635
+
636
+ export interface TransactionMetadata {
637
+ transactionType: string
638
+ currency: string
639
+ amount: number
640
+ decimals: number
641
+ fromAddress: string
642
+ toAddress: string
643
+ }
644
+
645
+ export interface TransactionReference {
646
+ namespace?: string
647
+ networkId: string
648
+ reference: string
649
+ metadata?: TransactionMetadata
650
+ }
651
+
505
652
  export declare export declare function verifySignedWithPublicKey(signatureText: string, signatureBytes: Uint8Array, publicKey: Uint8Array): void
653
+
654
+ export interface WalletCall {
655
+ to?: string
656
+ data?: string
657
+ value?: string
658
+ gas?: string
659
+ metadata?: WalletCallMetadata
660
+ }
661
+
662
+ export interface WalletCallMetadata {
663
+ description: string
664
+ transactionType: string
665
+ extra: Record<string, string>
666
+ }
667
+
668
+ export interface WalletSendCalls {
669
+ version: string
670
+ chainId: string
671
+ from: string
672
+ calls: Array<WalletCall>
673
+ capabilities?: Record<string, string>
674
+ }
675
+
676
+ export interface XmtpCursor {
677
+ originatorId: number
678
+ sequenceId: number
679
+ }
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": "release/v1.5",
3
- "version": "34eed53",
4
- "date": "2025-10-09 18:22:46 +0000"
2
+ "branch": "HEAD",
3
+ "version": "21f0ffd",
4
+ "date": "2025-10-23 22:32:15 +0000"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmtp/node-bindings",
3
- "version": "1.5.5",
3
+ "version": "1.6.0-dev.21f0ffd",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://git@github.com/xmtp/libxmtp.git",