@xmtp/node-bindings 1.5.5 → 1.6.0-dev.07065a7

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>>
@@ -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 {
@@ -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
@@ -221,7 +263,7 @@ export interface ConversationDebugInfo {
221
263
  isCommitLogForked?: boolean
222
264
  localCommitLog: string
223
265
  remoteCommitLog: string
224
- cursor: number
266
+ cursor: Array<XmtpCursor>
225
267
  }
226
268
 
227
269
  export declare const enum ConversationType {
@@ -238,7 +280,7 @@ export declare const enum ConversationType {
238
280
  * It can be one of: `debug`, `info`, `warn`, `error` or 'off'.
239
281
  * By default, logging is disabled.
240
282
  */
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>
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>
242
284
 
243
285
  export interface CreateDmOptions {
244
286
  messageDisappearingSettings?: MessageDisappearingSettings
@@ -253,6 +295,19 @@ export interface CreateGroupOptions {
253
295
  messageDisappearingSettings?: MessageDisappearingSettings
254
296
  }
255
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
+
256
311
  export declare export declare function decodeMultiRemoteAttachment(bytes: Uint8Array): MultiRemoteAttachment
257
312
 
258
313
  export declare export declare function decodeReaction(bytes: Uint8Array): Reaction
@@ -263,6 +318,8 @@ export declare const enum DeliveryStatus {
263
318
  Failed = 2
264
319
  }
265
320
 
321
+ export declare export declare function deserializeEncodedContent(bytes: Uint8Array): EncodedContent
322
+
266
323
  export interface EncodedContent {
267
324
  type?: ContentTypeId
268
325
  parameters: Record<string, string>
@@ -277,7 +334,7 @@ export declare export declare function encodeReaction(reaction: Reaction): Uint8
277
334
 
278
335
  export declare export declare function generateInboxId(accountIdent: Identifier): string
279
336
 
280
- 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>
281
338
 
282
339
  export declare const enum GroupMembershipState {
283
340
  Allowed = 0,
@@ -297,6 +354,13 @@ export declare const enum GroupPermissionsOptions {
297
354
  CustomPolicy = 2
298
355
  }
299
356
 
357
+ export interface GroupUpdated {
358
+ initiatedByInboxId: string
359
+ addedInboxes: Array<Inbox>
360
+ removedInboxes: Array<Inbox>
361
+ metadataFieldChanges: Array<MetadataFieldChange>
362
+ }
363
+
300
364
  export interface HmacKey {
301
365
  key: Uint8Array
302
366
  epoch: bigint
@@ -319,6 +383,10 @@ export interface IdentityStats {
319
383
  verifySmartContractWalletSignature: bigint
320
384
  }
321
385
 
386
+ export interface Inbox {
387
+ inboxId: string
388
+ }
389
+
322
390
  export interface InboxState {
323
391
  inboxId: string
324
392
  recoveryIdentifier: Identifier
@@ -326,7 +394,7 @@ export interface InboxState {
326
394
  identifiers: Array<Identifier>
327
395
  }
328
396
 
329
- export declare export declare function inboxStateFromInboxIds(host: string, inboxIds: Array<string>): Promise<Array<InboxState>>
397
+ export declare export declare function inboxStateFromInboxIds(v3Host: string, gatewayHost: string | undefined | null, inboxIds: Array<string>): Promise<Array<InboxState>>
330
398
 
331
399
  export interface Installation {
332
400
  bytes: Uint8Array
@@ -334,9 +402,9 @@ export interface Installation {
334
402
  id: string
335
403
  }
336
404
 
337
- export declare export declare function isAddressAuthorized(host: string, inboxId: string, address: string): Promise<boolean>
405
+ export declare export declare function isAddressAuthorized(host: string, gatewayHost: string | undefined | null, inboxId: string, address: string): Promise<boolean>
338
406
 
339
- export declare export declare function isInstallationAuthorized(host: string, inboxId: string, installationId: Uint8Array): Promise<boolean>
407
+ export declare export declare function isInstallationAuthorized(host: string, gatewayHost: string | undefined | null, inboxId: string, installationId: Uint8Array): Promise<boolean>
340
408
 
341
409
  export interface KeyPackageStatus {
342
410
  lifetime?: Lifetime
@@ -364,7 +432,9 @@ export interface ListMessagesOptions {
364
432
  deliveryStatus?: DeliveryStatus
365
433
  direction?: SortDirection
366
434
  contentTypes?: Array<ContentType>
435
+ excludeContentTypes?: Array<ContentType>
367
436
  kind?: GroupMessageKind
437
+ excludeSenderInboxIds?: Array<string>
368
438
  }
369
439
 
370
440
  export declare const enum LogLevel {
@@ -413,10 +483,20 @@ export declare const enum MetadataField {
413
483
  ImageUrlSquare = 2
414
484
  }
415
485
 
486
+ export interface MetadataFieldChange {
487
+ fieldName: string
488
+ oldValue?: string
489
+ newValue?: string
490
+ }
491
+
416
492
  export interface MultiRemoteAttachment {
417
493
  attachments: Array<RemoteAttachmentInfo>
418
494
  }
419
495
 
496
+ export interface MultiRemoteAttachmentPayload {
497
+ attachments: Array<RemoteAttachmentInfoPayload>
498
+ }
499
+
420
500
  export interface PasskeySignature {
421
501
  publicKey: Array<number>
422
502
  signature: Array<number>
@@ -472,6 +552,14 @@ export declare const enum ReactionAction {
472
552
  Removed = 2
473
553
  }
474
554
 
555
+ export interface ReactionPayload {
556
+ reference: string
557
+ referenceInboxId: string
558
+ action: ReactionAction
559
+ content: string
560
+ schema: ReactionSchema
561
+ }
562
+
475
563
  export declare const enum ReactionSchema {
476
564
  Unknown = 0,
477
565
  Unicode = 1,
@@ -479,6 +567,21 @@ export declare const enum ReactionSchema {
479
567
  Custom = 3
480
568
  }
481
569
 
570
+ export interface ReadReceipt {
571
+
572
+ }
573
+
574
+ export interface RemoteAttachment {
575
+ url: string
576
+ contentDigest: string
577
+ secret: Array<number>
578
+ salt: Array<number>
579
+ nonce: Array<number>
580
+ scheme: string
581
+ contentLength: number
582
+ filename?: string
583
+ }
584
+
482
585
  export interface RemoteAttachmentInfo {
483
586
  secret: Uint8Array
484
587
  contentDigest: string
@@ -490,7 +593,24 @@ export interface RemoteAttachmentInfo {
490
593
  filename?: string
491
594
  }
492
595
 
493
- export declare export declare function revokeInstallationsSignatureRequest(host: string, recoveryIdentifier: Identifier, inboxId: string, installationIds: Array<Uint8Array>): Promise<SignatureRequestHandle>
596
+ export interface RemoteAttachmentInfoPayload {
597
+ url: string
598
+ contentDigest: string
599
+ secret: Array<number>
600
+ salt: Array<number>
601
+ nonce: Array<number>
602
+ scheme: string
603
+ contentLength?: number
604
+ filename?: string
605
+ }
606
+
607
+ export declare export declare function revokeInstallationsSignatureRequest(v3Host: string, gatewayHost: string | undefined | null, recoveryIdentifier: Identifier, inboxId: string, installationIds: Array<Uint8Array>): SignatureRequestHandle
608
+
609
+ export interface SendMessageOpts {
610
+ shouldPush: boolean
611
+ }
612
+
613
+ export declare export declare function serializeEncodedContent(content: EncodedContent): Uint8Array
494
614
 
495
615
  export declare const enum SortDirection {
496
616
  Ascending = 0,
@@ -502,4 +622,51 @@ export declare const enum SyncWorkerMode {
502
622
  disabled = 'disabled'
503
623
  }
504
624
 
625
+ export interface TextContent {
626
+ content: string
627
+ }
628
+
629
+ export interface TransactionMetadata {
630
+ transactionType: string
631
+ currency: string
632
+ amount: number
633
+ decimals: number
634
+ fromAddress: string
635
+ toAddress: string
636
+ }
637
+
638
+ export interface TransactionReference {
639
+ namespace?: string
640
+ networkId: string
641
+ reference: string
642
+ metadata?: TransactionMetadata
643
+ }
644
+
505
645
  export declare export declare function verifySignedWithPublicKey(signatureText: string, signatureBytes: Uint8Array, publicKey: Uint8Array): void
646
+
647
+ export interface WalletCall {
648
+ to?: string
649
+ data?: string
650
+ value?: string
651
+ gas?: string
652
+ metadata?: WalletCallMetadata
653
+ }
654
+
655
+ export interface WalletCallMetadata {
656
+ description: string
657
+ transactionType: string
658
+ extra: Record<string, string>
659
+ }
660
+
661
+ export interface WalletSendCalls {
662
+ version: string
663
+ chainId: string
664
+ from: string
665
+ calls: Array<WalletCall>
666
+ capabilities?: Record<string, string>
667
+ }
668
+
669
+ export interface XmtpCursor {
670
+ originatorId: number
671
+ sequenceId: number
672
+ }
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": "main",
3
+ "version": "07065a7",
4
+ "date": "2025-10-21 08:11:27 +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.07065a7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://git@github.com/xmtp/libxmtp.git",