@xmtp/node-bindings 1.2.0-dev.ef2c57d → 1.2.0-rc2

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
@@ -10,10 +10,10 @@ export declare class Client {
10
10
  canMessage(accountIdentities: Array<Identifier>): Promise<Record<string, boolean>>
11
11
  registerIdentity(): Promise<void>
12
12
  conversations(): Conversations
13
- sendHistorySyncRequest(): Promise<void>
14
- sendConsentSyncRequest(): Promise<void>
13
+ sendSyncRequest(): Promise<void>
15
14
  findInboxIdByIdentifier(identifier: Identifier): Promise<string | null>
16
15
  addressesFromInboxId(refreshFromNetwork: boolean, inboxIds: Array<string>): Promise<Array<InboxState>>
16
+ syncPreferences(): Promise<number>
17
17
  setConsentStates(records: Array<Consent>): Promise<void>
18
18
  getConsentState(entityType: ConsentEntityType, entity: string): Promise<ConsentState>
19
19
  /**
@@ -88,6 +88,8 @@ export declare class Conversation {
88
88
  messageDisappearingSettings(): MessageDisappearingSettings | null
89
89
  isMessageDisappearingEnabled(): boolean
90
90
  getHmacKeys(): Array<HmacKey>
91
+ debugInfo(): Promise<ConversationDebugInfo>
92
+ findDuplicateDms(): Promise<Array<Conversation>>
91
93
  }
92
94
 
93
95
  export declare class ConversationListItem {
@@ -96,6 +98,7 @@ export declare class ConversationListItem {
96
98
  }
97
99
 
98
100
  export declare class Conversations {
101
+ createGroupOptimistic(options?: CreateGroupOptions | undefined | null): Conversation
99
102
  createGroup(accountIdentities: Array<Identifier>, options?: CreateGroupOptions | undefined | null): Promise<Conversation>
100
103
  createGroupByInboxId(inboxIds: Array<string>, options?: CreateGroupOptions | undefined | null): Promise<Conversation>
101
104
  createDm(accountIdentity: Identifier, options?: CreateDmOptions | undefined | null): Promise<Conversation>
@@ -106,16 +109,11 @@ export declare class Conversations {
106
109
  processStreamedWelcomeMessage(envelopeBytes: Uint8Array): Promise<Conversation>
107
110
  sync(): Promise<void>
108
111
  syncAllConversations(consentStates?: Array<ConsentState> | undefined | null): Promise<bigint>
112
+ syncDeviceSync(): Promise<void>
109
113
  list(opts?: ListConversationsOptions | undefined | null): Array<ConversationListItem>
110
- listGroups(opts?: ListConversationsOptions | undefined | null): Array<ConversationListItem>
111
- listDms(opts?: ListConversationsOptions | undefined | null): Array<ConversationListItem>
112
114
  getHmacKeys(): Record<string, Array<HmacKey>>
113
- stream(callback: (err: null | Error, result: Conversation | undefined) => void): StreamCloser
114
- streamGroups(callback: (err: null | Error, result: Conversation | undefined) => void): StreamCloser
115
- streamDms(callback: (err: null | Error, result: Conversation | undefined) => void): StreamCloser
116
- streamAllMessages(callback: (err: null | Error, result: Message | undefined) => void): StreamCloser
117
- streamAllGroupMessages(callback: (err: null | Error, result: Message | undefined) => void): StreamCloser
118
- streamAllDmMessages(callback: (err: null | Error, result: Message | undefined) => void): StreamCloser
115
+ stream(callback: (err: Error | null, result: Conversation | undefined) => void, conversationType?: ConversationType): StreamCloser
116
+ streamAllMessages(callback: (err: null | Error, result: Message | undefined) => void, conversationType?: ConversationType, consentStates?: ConsentState[]): StreamCloser
119
117
  streamConsent(callback: (err: null | Error, result: Consent[] | undefined) => void): StreamCloser
120
118
  streamPreferences(callback: (err: null | Error, result: any[] | undefined) => void): StreamCloser
121
119
  }
@@ -192,6 +190,12 @@ export interface ContentTypeId {
192
190
  versionMinor: number
193
191
  }
194
192
 
193
+ export interface ConversationDebugInfo {
194
+ epoch: bigint
195
+ maybeForked: boolean
196
+ forkDetails: string
197
+ }
198
+
195
199
  export declare const enum ConversationType {
196
200
  Dm = 0,
197
201
  Group = 1,
@@ -199,13 +203,13 @@ export declare const enum ConversationType {
199
203
  }
200
204
 
201
205
  /**
202
- * Create a client
206
+ * Create a client.
203
207
  *
204
208
  * Optionally specify a filter for the log level as a string.
205
209
  * It can be one of: `debug`, `info`, `warn`, `error` or 'off'.
206
210
  * By default, logging is disabled.
207
211
  */
208
- export declare export declare function createClient(host: string, isSecure: boolean, dbPath: string | undefined | null, inboxId: string, accountIdentifier: Identifier, encryptionKey?: Uint8Array | undefined | null, historySyncUrl?: string | undefined | null, logOptions?: LogOptions | undefined | null): Promise<Client>
212
+ 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): Promise<Client>
209
213
 
210
214
  export interface CreateDmOptions {
211
215
  messageDisappearingSettings?: MessageDisappearingSettings
@@ -249,7 +253,8 @@ export declare export declare function getInboxIdForIdentifier(host: string, isS
249
253
  export declare const enum GroupMembershipState {
250
254
  Allowed = 0,
251
255
  Rejected = 1,
252
- Pending = 2
256
+ Pending = 2,
257
+ Restored = 3
253
258
  }
254
259
 
255
260
  export declare const enum GroupMessageKind {
@@ -307,9 +312,10 @@ export interface Lifetime {
307
312
 
308
313
  export interface ListConversationsOptions {
309
314
  consentStates?: Array<ConsentState>
315
+ conversationType?: ConversationType
310
316
  createdAfterNs?: number
311
317
  createdBeforeNs?: number
312
- includeDuplicateDms: boolean
318
+ includeDuplicateDms?: boolean
313
319
  limit?: number
314
320
  }
315
321
 
@@ -320,6 +326,7 @@ export interface ListMessagesOptions {
320
326
  deliveryStatus?: DeliveryStatus
321
327
  direction?: SortDirection
322
328
  contentTypes?: Array<ContentType>
329
+ kind?: GroupMessageKind
323
330
  }
324
331
 
325
332
  export declare const enum LogLevel {
@@ -458,4 +465,9 @@ export declare const enum SortDirection {
458
465
  Descending = 1
459
466
  }
460
467
 
468
+ export declare const enum SyncWorkerMode {
469
+ enabled = 'enabled',
470
+ disabled = 'disabled'
471
+ }
472
+
461
473
  export declare export declare function verifySignedWithPublicKey(signatureText: string, signatureBytes: Uint8Array, publicKey: Uint8Array): void
package/dist/index.js CHANGED
@@ -365,7 +365,7 @@ 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, StreamCloser, ConsentEntityType, ConsentState, ContentType, ConversationType, createClient, decodeMultiRemoteAttachment, decodeReaction, DeliveryStatus, encodeMultiRemoteAttachment, encodeReaction, generateInboxId, getInboxIdForIdentifier, GroupMembershipState, GroupMessageKind, GroupPermissionsOptions, IdentifierKind, isAddressAuthorized, isInstallationAuthorized, LogLevel, MetadataField, PermissionLevel, PermissionPolicy, PermissionUpdateType, ReactionAction, ReactionSchema, SignatureRequestType, SortDirection, verifySignedWithPublicKey } = nativeBinding
368
+ const { Client, Conversation, ConversationListItem, Conversations, GroupMember, GroupMetadata, GroupPermissions, StreamCloser, ConsentEntityType, ConsentState, ContentType, ConversationType, createClient, decodeMultiRemoteAttachment, decodeReaction, DeliveryStatus, encodeMultiRemoteAttachment, encodeReaction, generateInboxId, getInboxIdForIdentifier, GroupMembershipState, GroupMessageKind, GroupPermissionsOptions, IdentifierKind, isAddressAuthorized, isInstallationAuthorized, LogLevel, MetadataField, PermissionLevel, PermissionPolicy, PermissionUpdateType, ReactionAction, ReactionSchema, SignatureRequestType, SortDirection, SyncWorkerMode, verifySignedWithPublicKey } = nativeBinding
369
369
  export { Client }
370
370
  export { Conversation }
371
371
  export { ConversationListItem }
@@ -401,4 +401,5 @@ export { ReactionAction }
401
401
  export { ReactionSchema }
402
402
  export { SignatureRequestType }
403
403
  export { SortDirection }
404
+ export { SyncWorkerMode }
404
405
  export { verifySignedWithPublicKey }
package/dist/version.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "branch": "cv/stream-fix",
3
- "version": "ef2c57d",
4
- "date": "2025-05-05 22:34:10 +0000"
2
+ "branch": "release/v1.2",
3
+ "version": "51542b6",
4
+ "date": "2025-05-08 23:42:20 +0000"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmtp/node-bindings",
3
- "version": "1.2.0-dev.ef2c57d",
3
+ "version": "1.2.0-rc2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://git@github.com/xmtp/libxmtp.git",
@@ -40,7 +40,7 @@
40
40
  "devDependencies": {
41
41
  "@ianvs/prettier-plugin-sort-imports": "^4.4.1",
42
42
  "@napi-rs/cli": "^3.0.0-alpha.64",
43
- "@types/node": "^22.13.0",
43
+ "@types/node": "^22.15.2",
44
44
  "@types/uuid": "^10.0.0",
45
45
  "fast-glob": "^3.3.3",
46
46
  "prettier": "^3.5.0",
@@ -48,11 +48,11 @@
48
48
  "tsx": "^4.19.3",
49
49
  "typescript": "^5.8.2",
50
50
  "uuid": "^11.1.0",
51
- "viem": "^2.24.2",
52
- "vite": "^6.2.0",
51
+ "viem": "^2.28.0",
52
+ "vite": "^6.3.2",
53
53
  "vite-tsconfig-paths": "^5.1.4",
54
- "vitest": "^3.0.4",
55
- "zx": "^8.4.0"
54
+ "vitest": "^3.1.1",
55
+ "zx": "^8.5.0"
56
56
  },
57
57
  "packageManager": "yarn@4.6.0",
58
58
  "engines": {