@xmtp/node-sdk 6.2.0-dev.4b7b477 → 6.2.0-dev.9f72722

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.
package/dist/index.d.ts CHANGED
@@ -1,20 +1,19 @@
1
- import { ContentCodec, ContentTypeId } from '@xmtp/content-type-primitives';
2
- import * as _xmtp_node_bindings from '@xmtp/node-bindings';
3
- import { DeliveryCursor, ContentTypeId as ContentTypeId$1, DeliveryStatus, GroupMessageKind, Reaction, DecodedMessage as DecodedMessage$1, LeaveRequest, ReadReceipt, Attachment, RemoteAttachment, TransactionReference, WalletSendCalls, Actions, Intent, MultiRemoteAttachment, GroupUpdated, DeletedMessage, Backend, LogLevel, WorkerConfigOptions, VisibilityConfirmationOptions, AppDataChange, Identifier, StreamCloser, ConversationType, ConsentState, MessageCatchUp, Conversation as Conversation$1, Message, EncodedContent, SendMessageOpts, SendOpts, Reply, ListMessagesOptions, PermissionUpdateType, PermissionPolicy, MetadataField, Conversations as Conversations$1, CreateGroupOptions, CreateDmOptions, ListConversationsOptions, Client as Client$1, Consent, ConsentEntityType, UserPreferenceUpdate, SignatureRequestHandle, ArchiveOptions, ArchiveMetadata, GroupSyncSummary, ServerConfiguration } from '@xmtp/node-bindings';
4
- export { Action, ActionStyle, Actions, ApiStats, AppDataChange, ArchiveMetadata, ArchiveOptions, Attachment, AuthConfiguration, Backend, BackendBuilder, BackupElementSelectionOption, Consent, ConsentEntityType, ConsentState, ContentType, ConversationDebugInfo, ConversationListItem, ConversationType, CreateDmOptions, CreateGroupOptions, Cursor, DeliveryCursor, DeliveryStatus, EncryptedAttachment, GroupMember, GroupMembershipState, GroupMessageKind, GroupMetadata, GroupPermissions, GroupPermissionsOptions, GroupSyncSummary, GroupUpdated, HmacKey, Identifier, IdentifierKind, IdentityStats, Inbox, InboxState, Installation, Intent, KeyPackageStatus, LeaveRequest, Lifetime, LimitsConfiguration, ListConversationsOptions, ListConversationsOrderBy, ListMessagesOptions, LogLevel, LogOptions, Message, MessageCatchUp, MessageCatchUpGeneration, MessageDisappearingSettings, MessageHistorySnapshot, MessageSortBy, MessageTopicStatus, MetadataField, MetadataFieldChange, MlsConfiguration, MultiRemoteAttachment, PermissionLevel, PermissionPolicy, PermissionPolicySet, PermissionUpdateType, Reaction, ReactionAction, ReactionSchema, ReadReceipt, RemoteAttachment, Reply, RetentionConfiguration, SendMessageOpts, SendOpts, ServerConfiguration, SignatureRequestHandle, SigningKeyDescription, SortDirection, TransactionMetadata, TransactionReference, UserPreferenceUpdate, VisibilityConfirmationOptions, WalletCall, WalletSendCalls, WorkerConfigOptions, WorkerIntervalOverride, WorkerJitterOverride, WorkerKind, contentTypeActions, contentTypeAttachment, contentTypeGroupUpdated, contentTypeIntent, contentTypeLeaveRequest, contentTypeMarkdown, contentTypeMultiRemoteAttachment, contentTypeReaction, contentTypeReadReceipt, contentTypeRemoteAttachment, contentTypeReply, contentTypeText, contentTypeTransactionReference, contentTypeWalletSendCalls, decryptAttachment, encodeActions, encodeAttachment, encodeIntent, encodeMarkdown, encodeMultiRemoteAttachment, encodeReaction, encodeReadReceipt, encodeRemoteAttachment, encodeText, encodeTransactionReference, encodeWalletSendCalls, encryptAttachment, flushTelemetry, initLogging } from '@xmtp/node-bindings';
5
-
6
- declare class CodecRegistry {
7
- #private;
8
- constructor(codecs: ContentCodec[]);
9
- /**
10
- * Gets the codec for a given content type
11
- *
12
- * @param contentType - The content type to get the codec for
13
- * @returns The codec, if found
14
- */
15
- getCodec<ContentType = unknown>(contentType: ContentTypeId): ContentCodec<ContentType> | undefined;
1
+ import { Action, ActionStyle, Actions, Actions as Actions$1, ApiStats, AppDataChange, AppDataChange as AppDataChange$1, ArchiveMetadata, ArchiveMetadata as ArchiveMetadata$1, ArchiveOptions, ArchiveOptions as ArchiveOptions$1, Attachment, Attachment as Attachment$1, AuthConfiguration, Backend, Backend as Backend$1, BackendBuilder, BackupElementSelectionOption, Client as Client$1, Consent, Consent as Consent$1, ConsentEntityType, ConsentEntityType as ConsentEntityType$1, ConsentState, ConsentState as ConsentState$1, ContentType, ContentTypeId, Conversation as Conversation$1, ConversationDebugInfo, ConversationListItem, ConversationType, ConversationType as ConversationType$1, Conversations as Conversations$1, CreateDmOptions, CreateDmOptions as CreateDmOptions$1, CreateGroupOptions, CreateGroupOptions as CreateGroupOptions$1, Cursor, DecodedMessage as DecodedMessage$1, DeletedMessage, DeliveryCursor, DeliveryCursor as DeliveryCursor$1, DeliveryStatus, DeliveryStatus as DeliveryStatus$1, EncodedContent, EncryptedAttachment, GroupMember, GroupMembershipState, GroupMessageKind, GroupMessageKind as GroupMessageKind$1, GroupMetadata, GroupPermissions, GroupPermissionsOptions, GroupSyncSummary, GroupSyncSummary as GroupSyncSummary$1, GroupUpdated, GroupUpdated as GroupUpdated$1, HmacKey, Identifier, Identifier as Identifier$1, IdentifierKind, IdentityStats, Inbox, InboxState, Installation, Intent, Intent as Intent$1, KeyPackageStatus, LeaveRequest, LeaveRequest as LeaveRequest$1, Lifetime, LimitsConfiguration, ListConversationsOptions, ListConversationsOptions as ListConversationsOptions$1, ListConversationsOrderBy, ListMessagesOptions, ListMessagesOptions as ListMessagesOptions$1, LogLevel, LogLevel as LogLevel$1, LogOptions, Message, Message as Message$1, MessageCatchUp, MessageCatchUp as MessageCatchUp$1, MessageCatchUpGeneration, MessageDisappearingSettings, MessageHistorySnapshot, MessageSortBy, MessageTopicStatus, MetadataField, MetadataField as MetadataField$1, MetadataFieldChange, MlsConfiguration, MultiRemoteAttachment, MultiRemoteAttachment as MultiRemoteAttachment$1, NotificationOverride as NotificationOverride$1, PermissionLevel, PermissionPolicy, PermissionPolicy as PermissionPolicy$1, PermissionPolicySet, PermissionUpdateType, PermissionUpdateType as PermissionUpdateType$1, Reaction, Reaction as Reaction$1, ReactionAction, ReactionSchema, ReadReceipt, ReadReceipt as ReadReceipt$1, RemoteAttachment, RemoteAttachment as RemoteAttachment$1, Reply, Reply as Reply$1, RetentionConfiguration, SendMessageOpts, SendMessageOpts as SendMessageOpts$1, SendOpts, SendOpts as SendOpts$1, ServerConfiguration, ServerConfiguration as ServerConfiguration$1, SignatureRequestHandle, SignatureRequestHandle as SignatureRequestHandle$1, SigningKeyDescription, SortDirection, StreamCloser, TransactionMetadata, TransactionReference, TransactionReference as TransactionReference$1, UserPreferenceUpdate, UserPreferenceUpdate as UserPreferenceUpdate$1, VisibilityConfirmationOptions, VisibilityConfirmationOptions as VisibilityConfirmationOptions$1, WalletCall, WalletSendCalls, WalletSendCalls as WalletSendCalls$1, WorkerConfigOptions, WorkerConfigOptions as WorkerConfigOptions$1, WorkerIntervalOverride, WorkerJitterOverride, WorkerKind, contentTypeActions, contentTypeAttachment, contentTypeGroupUpdated, contentTypeIntent, contentTypeLeaveRequest, contentTypeMarkdown, contentTypeMultiRemoteAttachment, contentTypeReaction, contentTypeReadReceipt, contentTypeRemoteAttachment, contentTypeReply, contentTypeText, contentTypeTransactionReference, contentTypeWalletSendCalls, decryptAttachment, encodeActions, encodeAttachment, encodeIntent, encodeMarkdown, encodeMultiRemoteAttachment, encodeReaction, encodeReadReceipt, encodeRemoteAttachment, encodeText, encodeTransactionReference, encodeWalletSendCalls, encryptAttachment, flushTelemetry, initLogging } from "@xmtp/node-bindings";
2
+ import { ContentCodec, ContentTypeId as ContentTypeId$1 } from "@xmtp/content-type-primitives";
3
+ //#region src/CodecRegistry.d.ts
4
+ export declare class CodecRegistry {
5
+ #private;
6
+ constructor(codecs: ContentCodec[]);
7
+ /**
8
+ * Gets the codec for a given content type
9
+ *
10
+ * @param contentType - The content type to get the codec for
11
+ * @returns The codec, if found
12
+ */
13
+ getCodec<ContentType = unknown>(contentType: ContentTypeId$1): ContentCodec<ContentType> | undefined;
16
14
  }
17
-
15
+ //#endregion
16
+ //#region src/DecodedMessage.d.ts
18
17
  /**
19
18
  * Represents a decoded XMTP message
20
19
  *
@@ -34,199 +33,201 @@ declare class CodecRegistry {
34
33
  * @property {Date} sentAt - Timestamp when the message was sent
35
34
  * @property {bigint} sentAtNs - Timestamp when the message was sent (in nanoseconds)
36
35
  */
37
- declare class DecodedMessage<ContentTypes = unknown> {
38
- /** Database-local position of this delivery. Absent for ordinary history reads. */
39
- deliveryCursor?: DeliveryCursor;
40
- content: ContentTypes | undefined;
41
- contentType: ContentTypeId$1;
42
- conversationId: string;
43
- deliveryStatus: DeliveryStatus;
44
- expiresAtNs?: bigint;
45
- expiresAt?: Date;
46
- fallback?: string;
47
- id: string;
48
- kind: GroupMessageKind;
49
- numReplies: number;
50
- reactions: DecodedMessage<Reaction>[];
51
- senderInboxId: string;
52
- sentAt: Date;
53
- sentAtNs: bigint;
54
- constructor(codecRegistry: CodecRegistry, message: DecodedMessage$1);
36
+ export declare class DecodedMessage<ContentTypes = unknown> {
37
+ /** Database-local position of this delivery. Absent for ordinary history reads. */
38
+ deliveryCursor?: DeliveryCursor$1;
39
+ content: ContentTypes | undefined;
40
+ contentType: ContentTypeId;
41
+ conversationId: string;
42
+ deliveryStatus: DeliveryStatus$1;
43
+ expiresAtNs?: bigint;
44
+ expiresAt?: Date;
45
+ fallback?: string;
46
+ id: string;
47
+ kind: GroupMessageKind$1;
48
+ numReplies: number;
49
+ reactions: DecodedMessage<Reaction$1>[];
50
+ senderInboxId: string;
51
+ sentAt: Date;
52
+ sentAtNs: bigint;
53
+ constructor(codecRegistry: CodecRegistry, message: DecodedMessage$1);
55
54
  }
56
-
57
- type HexString = `0x${string}`;
58
- declare function isHexString(value: unknown): value is HexString;
59
- declare function validHex(value: unknown): HexString;
60
-
55
+ //#endregion
56
+ //#region src/utils/validation.d.ts
57
+ export type HexString = `0x${string}`;
58
+ export declare function isHexString(value: unknown): value is HexString;
59
+ export declare function validHex(value: unknown): HexString;
60
+ //#endregion
61
+ //#region src/types.d.ts
61
62
  /**
62
63
  * Network options
63
64
  */
64
65
  /** A backend credential. Include the `Bearer ` prefix when required. */
65
66
  type Credential = {
66
- /** Header name. Defaults to `authorization`. */
67
- name?: string;
68
- value: string;
69
- /** Expiration as Unix seconds. Must be a safe integer. */
70
- expiresAtSeconds: number;
67
+ /** Header name. Defaults to `authorization`. */
68
+ name?: string;
69
+ value: string;
70
+ /** Expiration as Unix seconds. Must be a safe integer. */
71
+ expiresAtSeconds: number;
71
72
  };
72
73
  /** Called when the backend needs a credential, including credential refresh. */
73
74
  type AuthCallback = () => Promise<Credential>;
74
75
  type NetworkOptions = {
75
- /** Backend URL, including the HTTP or HTTPS scheme. */
76
- backendUrl: string;
77
- /** Label used only for the default database file name. */
78
- env?: string;
79
- /** Custom app version. */
80
- appVersion?: string;
81
- /** Supply backend credentials. Separate from the XMTP identity signer. */
82
- authCallback?: AuthCallback;
76
+ /** Backend URL, including the HTTP or HTTPS scheme. */
77
+ backendUrl: string;
78
+ /** Label used only for the default database file name. */
79
+ env?: string;
80
+ /** Custom app version. */
81
+ appVersion?: string;
82
+ /** Supply backend credentials. Separate from the XMTP identity signer. */
83
+ authCallback?: AuthCallback;
83
84
  };
84
85
  /**
85
86
  * Device sync options
86
87
  */
87
88
  type DeviceSyncOptions = {
88
- /**
89
- * Disable device sync
90
- */
91
- disableDeviceSync?: boolean;
89
+ /**
90
+ * Disable device sync
91
+ */
92
+ disableDeviceSync?: boolean;
92
93
  };
93
94
  /**
94
95
  * Storage options
95
96
  */
96
97
  type StorageOptions = {
97
- /**
98
- * Path to the local DB
99
- *
100
- * There are 4 value types that can be used to specify the database path:
101
- *
102
- * - `undefined` (or excluded from the client options)
103
- * The database will be created in the current working directory and is based on
104
- * the environment label and client inbox ID.
105
- * Example: `xmtp-default-<inbox-id>.db3`
106
- *
107
- * - `null`
108
- * No database will be created and all data will be lost once the client disconnects.
109
- *
110
- * - `string`
111
- * The given path will be used to create the database.
112
- * Example: `./my-db.db3`
113
- *
114
- * - `function`
115
- * A callback function that receives the inbox ID and returns a string path.
116
- * Example: `(inboxId) => string`
117
- */
118
- dbPath?: string | null | ((inboxId: string) => string);
119
- /**
120
- * Encryption key for the local DB (32 bytes, hex)
121
- *
122
- * @see https://docs.xmtp.org/sdk/client/#view-an-encrypted-database
123
- */
124
- dbEncryptionKey?: Uint8Array | HexString;
125
- /**
126
- * Maximum number of connections in the local DB connection pool.
127
- *
128
- * Defaults to 25 when unset. Ignored when `useSingleConnection` is `true`.
129
- */
130
- maxDbPoolSize?: number;
131
- /**
132
- * Minimum number of connections kept warm in the local DB connection pool.
133
- *
134
- * Defaults to 5 when unset. Ignored when `useSingleConnection` is `true`.
135
- */
136
- minDbPoolSize?: number;
137
- /**
138
- * When `true`, the native DB uses a single connection (one file descriptor)
139
- * instead of a pool. The pool-size options above are ignored. Intended for
140
- * services running many clients in one process.
141
- *
142
- * Defaults to `false` (pooled).
143
- */
144
- useSingleConnection?: boolean;
98
+ /**
99
+ * Path to the local DB
100
+ *
101
+ * There are 4 value types that can be used to specify the database path:
102
+ *
103
+ * - `undefined` (or excluded from the client options)
104
+ * The database will be created in the current working directory and is based on
105
+ * the environment label and client inbox ID.
106
+ * Example: `xmtp-default-<inbox-id>.db3`
107
+ *
108
+ * - `null`
109
+ * No database will be created and all data will be lost once the client disconnects.
110
+ *
111
+ * - `string`
112
+ * The given path will be used to create the database.
113
+ * Example: `./my-db.db3`
114
+ *
115
+ * - `function`
116
+ * A callback function that receives the inbox ID and returns a string path.
117
+ * Example: `(inboxId) => string`
118
+ */
119
+ dbPath?: string | null | ((inboxId: string) => string);
120
+ /**
121
+ * Encryption key for the local DB (32 bytes, hex)
122
+ *
123
+ * @see https://docs.xmtp.org/sdk/client/#view-an-encrypted-database
124
+ */
125
+ dbEncryptionKey?: Uint8Array | HexString;
126
+ /**
127
+ * Maximum number of connections in the local DB connection pool.
128
+ *
129
+ * Defaults to 25 when unset. Ignored when `useSingleConnection` is `true`.
130
+ */
131
+ maxDbPoolSize?: number;
132
+ /**
133
+ * Minimum number of connections kept warm in the local DB connection pool.
134
+ *
135
+ * Defaults to 5 when unset. Ignored when `useSingleConnection` is `true`.
136
+ */
137
+ minDbPoolSize?: number;
138
+ /**
139
+ * When `true`, the native DB uses a single connection (one file descriptor)
140
+ * instead of a pool. The pool-size options above are ignored. Intended for
141
+ * services running many clients in one process.
142
+ *
143
+ * Defaults to `false` (pooled).
144
+ */
145
+ useSingleConnection?: boolean;
145
146
  };
146
147
  type ContentOptions = {
147
- /**
148
- * Allow configuring codecs for additional content types
149
- */
150
- codecs?: ContentCodec[];
148
+ /**
149
+ * Allow configuring codecs for additional content types
150
+ */
151
+ codecs?: ContentCodec[];
151
152
  };
152
153
  type OtherOptions = {
153
- /**
154
- * Enable structured JSON logging
155
- */
156
- structuredLogging?: boolean;
157
- /**
158
- * Logging level. Also the level exported to OTLP when `otelEndpoint` is set.
159
- */
160
- loggingLevel?: LogLevel;
161
- /**
162
- * Level for the stdout console layer only. Defaults to `loggingLevel`. Set to
163
- * `LogLevel.Warn` to quiet stdout below the OTLP export level — e.g. so a log
164
- * shipper does not duplicate logs already exported via OTLP, while OTLP still
165
- * receives `loggingLevel`.
166
- */
167
- stdoutLoggingLevel?: LogLevel;
168
- /**
169
- * OTLP endpoint (e.g. `"http://collector:4317"`) for exporting telemetry
170
- * spans and logs. When set, spans (and `tracing` events as correlated logs)
171
- * are exported via OTLP to this endpoint, where a downstream OpenTelemetry
172
- * Collector can derive metrics from the spans and forward the logs.
173
- *
174
- * Call {@link flushTelemetry} on graceful shutdown to flush buffered spans.
175
- */
176
- otelEndpoint?: string;
177
- /** Service name attached to exported telemetry. */
178
- otelServiceName?: string;
179
- /** Fraction of root spans sampled, from 0 to 1. */
180
- otelSampleRatio?: number;
181
- /**
182
- * Resource attributes attached to all exported telemetry spans
183
- * (e.g. `{ "service.instance.id": "herald-7", "deployment.environment": "prod" }`).
184
- * Use these to attribute telemetry to its source.
185
- */
186
- resourceAttributes?: Record<string, string>;
187
- /**
188
- * Tuning for the background worker scheduler (intervals, jitter, per-worker
189
- * overrides, and disabled workers). All fields are optional; omitting this
190
- * object preserves the default worker behavior.
191
- *
192
- * Intervals are specified in nanoseconds.
193
- */
194
- workerConfig?: WorkerConfigOptions;
195
- /**
196
- * Disable automatic registration when creating a client
197
- */
198
- disableAutoRegister?: boolean;
199
- /**
200
- * The nonce to use when generating an inbox ID
201
- * (default: undefined = 1)
202
- */
203
- nonce?: bigint;
204
- /**
205
- * Options for waiting until client registration is visible on the network.
206
- *
207
- * When set, `registerIdentity` waits until the backend can read the registration.
208
- */
209
- waitForRegistrationVisible?: VisibilityConfirmationOptions;
210
- /**
211
- * Unstable: notifications for group state changes, for clients that
212
- * reconcile a group's `appData` themselves.
213
- *
214
- * Only `appData` exists today; callbacks for the other mutable fields will
215
- * be added as further optional properties. Registered at client creation
216
- * because the changes they report arrive from the stream and sync paths,
217
- * where no SDK call is on the stack to carry them.
218
- *
219
- * The `appData` callback is awaited before message processing continues, so
220
- * a semantic merge — including republishing via `updateAppData` — can finish
221
- * first. It fires for changes this client made as well as remote ones, so
222
- * the merge must be idempotent.
223
- */
224
- unstableChangeCallbacks?: {
225
- appData?: (change: AppDataChange) => Promise<void>;
226
- };
154
+ /**
155
+ * Enable structured JSON logging
156
+ */
157
+ structuredLogging?: boolean;
158
+ /**
159
+ * Logging level. Also the level exported to OTLP when `otelEndpoint` is set.
160
+ */
161
+ loggingLevel?: LogLevel$1;
162
+ /**
163
+ * Level for the stdout console layer only. Defaults to `loggingLevel`. Set to
164
+ * `LogLevel.Warn` to quiet stdout below the OTLP export level — e.g. so a log
165
+ * shipper does not duplicate logs already exported via OTLP, while OTLP still
166
+ * receives `loggingLevel`.
167
+ */
168
+ stdoutLoggingLevel?: LogLevel$1;
169
+ /**
170
+ * OTLP endpoint (e.g. `"http://collector:4317"`) for exporting telemetry
171
+ * spans and logs. When set, spans (and `tracing` events as correlated logs)
172
+ * are exported via OTLP to this endpoint, where a downstream OpenTelemetry
173
+ * Collector can derive metrics from the spans and forward the logs.
174
+ *
175
+ * Call {@link flushTelemetry} on graceful shutdown to flush buffered spans.
176
+ */
177
+ otelEndpoint?: string;
178
+ /** Service name attached to exported telemetry. */
179
+ otelServiceName?: string;
180
+ /** Fraction of root spans sampled, from 0 to 1. */
181
+ otelSampleRatio?: number;
182
+ /**
183
+ * Resource attributes attached to all exported telemetry spans
184
+ * (e.g. `{ "service.instance.id": "herald-7", "deployment.environment": "prod" }`).
185
+ * Use these to attribute telemetry to its source.
186
+ */
187
+ resourceAttributes?: Record<string, string>;
188
+ /**
189
+ * Tuning for the background worker scheduler (intervals, jitter, per-worker
190
+ * overrides, and disabled workers). All fields are optional; omitting this
191
+ * object preserves the default worker behavior.
192
+ *
193
+ * Intervals are specified in nanoseconds.
194
+ */
195
+ workerConfig?: WorkerConfigOptions$1;
196
+ /**
197
+ * Disable automatic registration when creating a client
198
+ */
199
+ disableAutoRegister?: boolean;
200
+ /**
201
+ * The nonce to use when generating an inbox ID
202
+ * (default: undefined = 1)
203
+ */
204
+ nonce?: bigint;
205
+ /**
206
+ * Options for waiting until client registration is visible on the network.
207
+ *
208
+ * When set, `registerIdentity` waits until the backend can read the registration.
209
+ */
210
+ waitForRegistrationVisible?: VisibilityConfirmationOptions$1;
211
+ /**
212
+ * Unstable: notifications for group state changes, for clients that
213
+ * reconcile a group's `appData` themselves.
214
+ *
215
+ * Only `appData` exists today; callbacks for the other mutable fields will
216
+ * be added as further optional properties. Registered at client creation
217
+ * because the changes they report arrive from the stream and sync paths,
218
+ * where no SDK call is on the stack to carry them.
219
+ *
220
+ * The `appData` callback is awaited before message processing continues, so
221
+ * a semantic merge — including republishing via `updateAppData` — can finish
222
+ * first. It fires for changes this client made as well as remote ones, so
223
+ * the merge must be idempotent.
224
+ */
225
+ unstableChangeCallbacks?: {
226
+ appData?: (change: AppDataChange$1) => Promise<void>;
227
+ };
227
228
  };
228
229
  type ClientOptions = (NetworkOptions | {
229
- backend: Backend;
230
+ backend: Backend$1;
230
231
  }) & DeviceSyncOptions & StorageOptions & ContentOptions & OtherOptions;
231
232
  /**
232
233
  * `Omit` that distributes over unions. The built-in `Omit` collapses a union
@@ -236,74 +237,80 @@ type ClientOptions = (NetworkOptions | {
236
237
  */
237
238
  type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
238
239
  type EnrichedReply<T = unknown, U = unknown> = {
239
- referenceId: string;
240
- content: T;
241
- contentType: ContentTypeId$1 | undefined;
242
- inReplyTo: DecodedMessage<U> | null;
240
+ referenceId: string;
241
+ content: T;
242
+ contentType: ContentTypeId | undefined;
243
+ inReplyTo: DecodedMessage<U> | null;
243
244
  };
244
- type BuiltInContentTypes = string | LeaveRequest | Reaction | ReadReceipt | Attachment | RemoteAttachment | TransactionReference | WalletSendCalls | Actions | Intent | MultiRemoteAttachment | GroupUpdated | DeletedMessage;
245
+ type BuiltInContentTypes = string | LeaveRequest$1 | Reaction$1 | ReadReceipt$1 | Attachment$1 | RemoteAttachment$1 | TransactionReference$1 | WalletSendCalls$1 | Actions$1 | Intent$1 | MultiRemoteAttachment$1 | GroupUpdated$1 | DeletedMessage;
245
246
  type ExtractCodecContentTypes<C extends ContentCodec[] = []> = C extends readonly [] ? BuiltInContentTypes : [...C][number] extends ContentCodec<infer T> ? T | BuiltInContentTypes | EnrichedReply<T | BuiltInContentTypes, T | BuiltInContentTypes> : BuiltInContentTypes;
246
-
247
- declare const createBackend: (options: NetworkOptions) => Promise<Backend>;
248
-
249
- declare class InboxReassignError extends Error {
250
- constructor();
247
+ //#endregion
248
+ //#region src/utils/createBackend.d.ts
249
+ export declare const createBackend: (options: NetworkOptions) => Promise<Backend$1>;
250
+ //#endregion
251
+ //#region src/utils/errors.d.ts
252
+ export declare class InboxReassignError extends Error {
253
+ constructor();
251
254
  }
252
- declare class AccountAlreadyAssociatedError extends Error {
253
- constructor(inboxId: string);
255
+ export declare class AccountAlreadyAssociatedError extends Error {
256
+ constructor(inboxId: string);
254
257
  }
255
- declare class MissingContentTypeError extends Error {
256
- constructor();
258
+ export declare class MissingContentTypeError extends Error {
259
+ constructor();
257
260
  }
258
- declare class SignerUnavailableError extends Error {
259
- constructor();
261
+ export declare class SignerUnavailableError extends Error {
262
+ constructor();
260
263
  }
261
- declare class ClientNotInitializedError extends Error {
262
- constructor();
264
+ export declare class ClientNotInitializedError extends Error {
265
+ constructor();
263
266
  }
264
- declare class StreamFailedError extends Error {
265
- constructor(retryAttempts: number);
267
+ export declare class StreamFailedError extends Error {
268
+ constructor(retryAttempts: number);
266
269
  }
267
- declare class StreamInvalidRetryAttemptsError extends Error {
268
- constructor();
270
+ export declare class StreamInvalidRetryAttemptsError extends Error {
271
+ constructor();
269
272
  }
270
-
271
- declare const generateInboxId: (identifier: Identifier, nonce?: bigint) => string;
272
- declare const getInboxIdForIdentifier: (backend: Backend, identifier: Identifier) => Promise<string | null>;
273
-
273
+ //#endregion
274
+ //#region src/utils/inboxId.d.ts
275
+ export declare const generateInboxId: (identifier: Identifier$1, nonce?: bigint) => string;
276
+ export declare const getInboxIdForIdentifier: (backend: Backend$1, identifier: Identifier$1) => Promise<string | null>;
277
+ //#endregion
278
+ //#region src/utils/signer.d.ts
274
279
  type SignMessage = (message: string) => Promise<Uint8Array> | Uint8Array;
275
- type GetIdentifier = () => Promise<Identifier> | Identifier;
280
+ type GetIdentifier = () => Promise<Identifier$1> | Identifier$1;
276
281
  type GetChainId = () => bigint;
277
282
  type GetBlockNumber = () => bigint;
278
283
  type Signer = {
279
- type: "EOA";
280
- signMessage: SignMessage;
281
- getIdentifier: GetIdentifier;
284
+ type: "EOA";
285
+ signMessage: SignMessage;
286
+ getIdentifier: GetIdentifier;
282
287
  } | {
283
- type: "SCW";
284
- signMessage: SignMessage;
285
- getIdentifier: GetIdentifier;
286
- getBlockNumber?: GetBlockNumber;
287
- getChainId: GetChainId;
288
+ type: "SCW";
289
+ signMessage: SignMessage;
290
+ getIdentifier: GetIdentifier;
291
+ getBlockNumber?: GetBlockNumber;
292
+ getChainId: GetChainId;
288
293
  };
289
294
  type EOASigner = Extract<Signer, {
290
- type: "EOA";
295
+ type: "EOA";
291
296
  }>;
292
297
  type SCWSigner = Extract<Signer, {
293
- type: "SCW";
298
+ type: "SCW";
294
299
  }>;
295
-
300
+ //#endregion
301
+ //#region src/AsyncStream.d.ts
296
302
  type ResolveValue<T> = {
297
- value: T;
298
- done: boolean;
303
+ value: T;
304
+ done: boolean;
299
305
  };
300
306
  interface AsyncStreamProxy<T> extends AsyncIterable<T> {
301
- next(): Promise<ResolveValue<T>>;
302
- return(): Promise<ResolveValue<undefined>>;
303
- end(): Promise<ResolveValue<undefined>>;
304
- isDone: boolean;
307
+ next(): Promise<ResolveValue<T>>;
308
+ return(): Promise<ResolveValue<undefined>>;
309
+ end(): Promise<ResolveValue<undefined>>;
310
+ isDone: boolean;
305
311
  }
306
-
312
+ //#endregion
313
+ //#region src/utils/streams.d.ts
307
314
  declare const DEFAULT_RETRY_DELAY = 60000;
308
315
  declare const DEFAULT_RETRY_ATTEMPTS = 10;
309
316
  /**
@@ -312,53 +319,54 @@ declare const DEFAULT_RETRY_ATTEMPTS = 10;
312
319
  * network recovery; notification retry settings and hooks do not apply.
313
320
  */
314
321
  type StreamOptions<T = unknown, V = T> = {
315
- /**
316
- * Called when the stream ends
317
- */
318
- onEnd?: () => void;
319
- /**
320
- * Called when a stream error occurs
321
- */
322
- onError?: (error: Error) => void;
323
- /**
324
- * Called when a notification stream fails
325
- */
326
- onFail?: () => void;
327
- /**
328
- * Called when a notification stream is restarted
329
- */
330
- onRestart?: () => void;
331
- /**
332
- * Called when a notification stream is retried
333
- */
334
- onRetry?: (attempts: number, maxAttempts: number) => void;
335
- /**
336
- * Called when a value is emitted from the stream.
337
- * For message streams, this selects callback mode. Do not also iterate that stream.
338
- * Message delivery is acknowledged after this callback returns successfully.
339
- */
340
- onValue?: (value: V) => void | Promise<void>;
341
- /**
342
- * The number of times to retry a notification stream
343
- * (default: 10)
344
- */
345
- retryAttempts?: number;
346
- /**
347
- * The delay between notification stream retries (in milliseconds)
348
- * (default: 60000)
349
- */
350
- retryDelay?: number;
351
- /**
352
- * Whether to retry a notification stream if it fails
353
- * (default: true)
354
- */
355
- retryOnFail?: boolean;
356
- /**
357
- * Whether to skip pre-sync for notification streams.
358
- * Durable message readers start receipt without a separate pre-sync.
359
- * (default: false)
360
- */
361
- disableSync?: boolean;
322
+ /**
323
+ * Called when the stream ends
324
+ */
325
+ onEnd?: () => void;
326
+ /**
327
+ * Called when a stream error occurs
328
+ */
329
+ onError?: (error: Error) => void;
330
+ /**
331
+ * Called when a notification stream fails
332
+ */
333
+ onFail?: () => void;
334
+ /**
335
+ * Called when a notification stream is restarted
336
+ */
337
+ onRestart?: () => void;
338
+ /**
339
+ * Called when a notification stream is retried
340
+ */
341
+ onRetry?: (attempts: number, maxAttempts: number) => void;
342
+ /**
343
+ * Called when a value is emitted from the stream.
344
+ * For message streams, this selects callback mode. Do not also iterate that stream.
345
+ * Message delivery is acknowledged after this callback returns successfully.
346
+ */
347
+ onValue?: (value: V) => void | Promise<void>;
348
+ /**
349
+ * The number of times to retry an unexpected notification stream closure.
350
+ * Terminal native storage and network errors are not retried.
351
+ * (default: 10)
352
+ */
353
+ retryAttempts?: number;
354
+ /**
355
+ * The delay between notification stream retries (in milliseconds)
356
+ * (default: 60000)
357
+ */
358
+ retryDelay?: number;
359
+ /**
360
+ * Whether to retry a notification stream if it fails
361
+ * (default: true)
362
+ */
363
+ retryOnFail?: boolean;
364
+ /**
365
+ * Whether to skip pre-sync for notification streams.
366
+ * Durable message readers start receipt without a separate pre-sync.
367
+ * (default: false)
368
+ */
369
+ disableSync?: boolean;
362
370
  };
363
371
  type StreamCallback<T = unknown> = (error: Error | null, value: T | undefined) => void;
364
372
  type StreamFunction<T = unknown> = (callback: StreamCallback<T>, onFail: () => void) => Promise<StreamCloser>;
@@ -366,7 +374,8 @@ type StreamValueMutator<T = unknown, V = T> = (value: T) => V | Promise<V>;
366
374
  /**
367
375
  * Creates a stream from a stream function
368
376
  *
369
- * If the stream fails, an attempt will be made to restart it.
377
+ * Unexpected native closures can be retried. Terminal native storage and
378
+ * network errors end the stream and reject iteration with the original cause.
370
379
  *
371
380
  * Ending the stream is terminal: no callbacks are invoked and no native
372
381
  * stream is created after the stream ends.
@@ -381,1393 +390,1406 @@ type StreamValueMutator<T = unknown, V = T> = (value: T) => V | Promise<V>;
381
390
  * @throws {StreamFailedError} if the stream fails and can't be restarted
382
391
  */
383
392
  declare const createStream: <T = unknown, V = T>(streamFunction: StreamFunction<T>, streamValueMutator?: StreamValueMutator<T, V | undefined>, options?: StreamOptions<T, V>) => Promise<AsyncStreamProxy<V>>;
384
-
385
- declare const isReaction: (m: DecodedMessage) => m is DecodedMessage<Reaction>;
386
- declare const isReply: (m: DecodedMessage) => m is DecodedMessage<EnrichedReply>;
387
- declare const isTextReply: (m: DecodedMessage) => m is DecodedMessage<EnrichedReply<string>>;
388
- declare const isText: (m: DecodedMessage) => m is DecodedMessage<string>;
389
- declare const isRemoteAttachment: (m: DecodedMessage) => m is DecodedMessage<RemoteAttachment>;
390
- declare const isAttachment: (m: DecodedMessage) => m is DecodedMessage<Attachment>;
391
- declare const isMultiRemoteAttachment: (m: DecodedMessage) => m is DecodedMessage<MultiRemoteAttachment>;
392
- declare const isTransactionReference: (m: DecodedMessage) => m is DecodedMessage<TransactionReference>;
393
- declare const isGroupUpdated: (m: DecodedMessage) => m is DecodedMessage<GroupUpdated>;
394
- declare const isReadReceipt: (m: DecodedMessage) => m is DecodedMessage<ReadReceipt>;
395
- declare const isLeaveRequest: (m: DecodedMessage) => m is DecodedMessage<LeaveRequest>;
396
- declare const isWalletSendCalls: (m: DecodedMessage) => m is DecodedMessage<WalletSendCalls>;
397
- declare const isIntent: (m: DecodedMessage) => m is DecodedMessage<Intent>;
398
- declare const isActions: (m: DecodedMessage) => m is DecodedMessage<Actions>;
399
- declare const isMarkdown: (m: DecodedMessage) => m is DecodedMessage<string>;
400
-
393
+ //#endregion
394
+ //#region src/utils/messages.d.ts
395
+ export declare const isReaction: (m: DecodedMessage) => m is DecodedMessage<Reaction$1>;
396
+ export declare const isReply: (m: DecodedMessage) => m is DecodedMessage<EnrichedReply>;
397
+ export declare const isTextReply: (m: DecodedMessage) => m is DecodedMessage<EnrichedReply<string>>;
398
+ export declare const isText: (m: DecodedMessage) => m is DecodedMessage<string>;
399
+ export declare const isRemoteAttachment: (m: DecodedMessage) => m is DecodedMessage<RemoteAttachment$1>;
400
+ export declare const isAttachment: (m: DecodedMessage) => m is DecodedMessage<Attachment$1>;
401
+ export declare const isMultiRemoteAttachment: (m: DecodedMessage) => m is DecodedMessage<MultiRemoteAttachment$1>;
402
+ export declare const isTransactionReference: (m: DecodedMessage) => m is DecodedMessage<TransactionReference$1>;
403
+ export declare const isGroupUpdated: (m: DecodedMessage) => m is DecodedMessage<GroupUpdated$1>;
404
+ export declare const isReadReceipt: (m: DecodedMessage) => m is DecodedMessage<ReadReceipt$1>;
405
+ export declare const isLeaveRequest: (m: DecodedMessage) => m is DecodedMessage<LeaveRequest$1>;
406
+ export declare const isWalletSendCalls: (m: DecodedMessage) => m is DecodedMessage<WalletSendCalls$1>;
407
+ export declare const isIntent: (m: DecodedMessage) => m is DecodedMessage<Intent$1>;
408
+ export declare const isActions: (m: DecodedMessage) => m is DecodedMessage<Actions$1>;
409
+ export declare const isMarkdown: (m: DecodedMessage) => m is DecodedMessage<string>;
410
+ //#endregion
411
+ //#region src/MessageStream.d.ts
401
412
  type MessageAcknowledgement = {
402
- checkOwner(): boolean | Promise<boolean>;
403
- acknowledge(): void | Promise<void>;
404
- reject(): void | Promise<void>;
413
+ checkOwner(): boolean | Promise<boolean>;
414
+ acknowledge(): void | Promise<void>;
415
+ enrichedMessage(): DecodedMessage$1 | null;
416
+ reject(): void | Promise<void>;
405
417
  };
406
418
  type MessageDelivery<T> = {
407
- message: T;
408
- cursor: DeliveryCursor;
409
- acknowledgement: MessageAcknowledgement;
419
+ message: T;
420
+ cursor: DeliveryCursor$1;
421
+ acknowledgement: MessageAcknowledgement;
410
422
  };
411
423
  type MessageReaderSource<T> = {
412
- nextDelivery(): Promise<MessageDelivery<T> | null | undefined>;
413
- close(): void | Promise<void>;
414
- updateScope(groupIds?: string[]): void | Promise<void>;
415
- updateFilter(conversationType?: ConversationType, consentStates?: ConsentState[]): void | Promise<void>;
416
- catchUpSnapshot(): MessageCatchUp | Promise<MessageCatchUp>;
417
- catchUpChanged(): Promise<MessageCatchUp>;
424
+ nextDelivery(): Promise<MessageDelivery<T> | null | undefined>;
425
+ close(): void | Promise<void>;
426
+ updateScope(groupIds?: string[]): void | Promise<void>;
427
+ updateFilter(conversationType?: ConversationType$1, consentStates?: ConsentState$1[]): void | Promise<void>;
428
+ catchUpSnapshot(): MessageCatchUp$1 | Promise<MessageCatchUp$1>;
429
+ catchUpChanged(): Promise<MessageCatchUp$1>;
418
430
  };
419
431
  /** One pending item. Construction selects callback mode or next-request acknowledgement. */
420
- declare class MessageStream<T, V> implements AsyncIterable<V> {
421
- #private;
422
- constructor(reader: MessageReaderSource<T>, convert: (message: T, cursor: DeliveryCursor) => V | undefined | Promise<V | undefined>, options?: StreamOptions<T, V>);
423
- get isDone(): boolean;
424
- get deliveredCursor(): DeliveryCursor | undefined;
425
- next: () => Promise<IteratorResult<V, undefined>>;
426
- return: () => Promise<IteratorReturnResult<undefined>>;
427
- end: () => Promise<IteratorReturnResult<undefined>>;
428
- updateScope: (groupIds?: string[]) => void | Promise<void>;
429
- updateFilter: (conversationType?: ConversationType, consentStates?: ConsentState[]) => void | Promise<void>;
430
- catchUpSnapshot: () => MessageCatchUp | Promise<MessageCatchUp>;
431
- catchUpChanged: () => Promise<MessageCatchUp>;
432
- [Symbol.asyncIterator](): this;
432
+ export declare class MessageStream<T, V> implements AsyncIterable<V> {
433
+ #private;
434
+ constructor(reader: MessageReaderSource<T>, convert: (message: T, cursor: DeliveryCursor$1, acknowledgement: MessageAcknowledgement) => V | undefined | Promise<V | undefined>, options?: StreamOptions<T, V>);
435
+ get isDone(): boolean;
436
+ get deliveredCursor(): DeliveryCursor$1 | undefined;
437
+ next: () => Promise<IteratorResult<V, undefined>>;
438
+ return: () => Promise<IteratorReturnResult<undefined>>;
439
+ end: () => Promise<IteratorReturnResult<undefined>>;
440
+ updateScope: (groupIds?: string[]) => void | Promise<void>;
441
+ updateFilter: (conversationType?: ConversationType$1, consentStates?: ConsentState$1[]) => void | Promise<void>;
442
+ catchUpSnapshot: () => MessageCatchUp$1 | Promise<MessageCatchUp$1>;
443
+ catchUpChanged: () => Promise<MessageCatchUp$1>;
444
+ [Symbol.asyncIterator](): this;
433
445
  }
434
-
446
+ //#endregion
447
+ //#region src/Notifications.d.ts
435
448
  /** Delivery channel for this installation. */
436
449
  type NotificationChannel = {
437
- type: "apns";
438
- token: string;
450
+ type: "apns";
451
+ token: string;
439
452
  } | {
440
- type: "fcm";
441
- token: string;
453
+ type: "fcm";
454
+ token: string;
442
455
  } | {
443
- type: "http";
444
- url: string;
445
- signingKey: Uint8Array;
456
+ type: "http";
457
+ url: string;
458
+ signingKey: Uint8Array;
446
459
  };
447
460
  /** Notification delivery and conversation rules. */
448
461
  type NotificationConfig = {
449
- channel: NotificationChannel;
450
- /** Defaults to Allowed. An empty list selects no consent states. */
451
- consentStates?: ConsentState[];
452
- /** Defaults to true. */
453
- includeWelcomes?: boolean;
454
- /** Defaults to false. */
455
- includeSyncGroups?: boolean;
456
- /** Defaults to false. */
457
- includeCommits?: boolean;
462
+ channel: NotificationChannel;
463
+ /** Defaults to Allowed. An empty list selects no consent states. */
464
+ consentStates?: ConsentState$1[];
465
+ /** Defaults to true. */
466
+ includeWelcomes?: boolean;
467
+ /** Defaults to false. */
468
+ includeSyncGroups?: boolean;
469
+ /** Defaults to false. */
470
+ includeCommits?: boolean;
458
471
  };
459
472
  /** Reset to the configured consent rules with "default". */
460
473
  type NotificationOverride = "enabled" | "disabled" | "default";
461
474
  /** A notification failure with a stable error code. */
462
- declare class NotificationError extends Error {
463
- readonly code: string;
464
- constructor(code: string, options?: ErrorOptions);
475
+ export declare class NotificationError extends Error {
476
+ readonly code: string;
477
+ constructor(code: string, options?: ErrorOptions);
465
478
  }
466
479
  /** Local notification state. Reading it makes no backend request. */
467
480
  type NotificationState = {
468
- state: "disabled";
481
+ state: "disabled";
469
482
  } | {
470
- state: "enabled";
483
+ state: "enabled";
471
484
  } | {
472
- state: "failed";
473
- error: NotificationError;
485
+ state: "failed";
486
+ error: NotificationError;
474
487
  };
475
-
488
+ //#endregion
489
+ //#region src/Conversation.d.ts
476
490
  /**
477
491
  * Represents a conversation
478
492
  *
479
493
  * This class is not intended to be initialized directly.
480
494
  */
481
- declare class Conversation<ContentTypes = unknown> {
482
- #private;
483
- /**
484
- * Creates a new conversation instance
485
- *
486
- * @param client - The client instance managing the conversation
487
- * @param codecRegistry - The codec registry instance
488
- * @param conversation - The underlying conversation instance
489
- */
490
- constructor(client: Client<ContentTypes>, codecRegistry: CodecRegistry, conversation: Conversation$1);
491
- /**
492
- * Gets the unique identifier for this conversation
493
- */
494
- get id(): string;
495
- /**
496
- * Gets whether this conversation is currently active
497
- */
498
- get isActive(): boolean;
499
- /** Override notification rules, or reset the override with "default". */
500
- setNotifications(value: NotificationOverride): Promise<void>;
501
- /** Read the effective notification value for this conversation. */
502
- notificationsEnabled(): Promise<boolean>;
503
- /**
504
- * Gets the inbox ID that added this client's inbox to the conversation
505
- */
506
- get addedByInboxId(): string;
507
- /**
508
- * Gets the timestamp when the conversation was created in nanoseconds
509
- */
510
- get createdAtNs(): bigint;
511
- /**
512
- * Gets the date when the conversation was created
513
- */
514
- get createdAt(): Date;
515
- get topic(): string;
516
- pausedForVersion(): string | undefined;
517
- /**
518
- * Gets HMAC keys for this conversation
519
- *
520
- * @returns The HMAC keys for this conversation
521
- */
522
- hmacKeys(): Record<string, _xmtp_node_bindings.HmacKey[]>;
523
- /**
524
- * Gets the metadata for this conversation
525
- *
526
- * @returns Promise that resolves with the conversation metadata
527
- */
528
- metadata(): Promise<{
529
- creatorInboxId: string;
530
- conversationType: _xmtp_node_bindings.ConversationType;
531
- }>;
532
- /**
533
- * Gets the members of this conversation
534
- *
535
- * @returns Promise that resolves with the conversation members
536
- */
537
- members(): Promise<_xmtp_node_bindings.GroupMember[]>;
538
- /**
539
- * Synchronizes conversation data from the network
540
- *
541
- * @returns Promise that resolves when synchronization is complete
542
- */
543
- sync(): Promise<void>;
544
- /**
545
- * Reads retained messages after the default acknowledgement position.
546
- * Set `from` to replay after a cursor without changing default progress.
547
- * Set `onValue` for callback mode, or request items with the iterator.
548
- * Core owns network recovery. Legacy retry options and `disableSync` do not apply.
549
- *
550
- * @param options - Optional delivery callbacks and replay cursor
551
- * @returns Stream instance for new messages
552
- */
553
- stream(options?: StreamOptions<Message, DecodedMessage<ContentTypes>> & {
554
- from?: DeliveryCursor;
555
- }): Promise<MessageStream<Message, DecodedMessage<ContentTypes>>>;
556
- messageHistorySnapshot(limit: number): _xmtp_node_bindings.MessageHistorySnapshot;
557
- beginningDeliveryCursor(): DeliveryCursor;
558
- /**
559
- * Decodes, decrypts, and persists a raw envelope from a group message stream.
560
- *
561
- * @param envelopeBytes - Raw protobuf-encoded envelope bytes from the stream
562
- * @returns The processed and stored messages
563
- */
564
- processStreamedMessage(envelopeBytes: Uint8Array): Promise<Message[]>;
565
- /**
566
- * Publishes pending messages that were sent optimistically
567
- *
568
- * @returns Promise that resolves when publishing is complete
569
- */
570
- publishMessages(): Promise<void>;
571
- /**
572
- * Sends a message with configurable delivery behavior
573
- *
574
- * @param encodedContent - The encoded content to send
575
- * @param sendOptions - Options for sending the message
576
- * @param sendOptions.shouldPush - Indicates whether this message should be
577
- * included in push notifications
578
- * @param sendOptions.optimistic - Indicates whether this message should be
579
- * sent optimistically and published later via `publishMessages`
580
- * @param sendOptions.idempotencyKey - Optional idempotency key; re-sending
581
- * identical content with the same key produces the same deduplicated message id
582
- * @returns Promise that resolves with the message ID after it has been sent
583
- */
584
- send(encodedContent: EncodedContent, sendOptions?: SendMessageOpts): Promise<string>;
585
- /**
586
- * Sends a text message
587
- *
588
- * @param text - The text to send
589
- * @param opts - Send options (optimistic delivery, idempotency key)
590
- * @returns Promise that resolves with the message ID after it has been sent
591
- */
592
- sendText(text: string, opts?: SendOpts): Promise<string>;
593
- /**
594
- * Sends a markdown message
595
- *
596
- * @param markdown - The markdown to send
597
- * @param opts - Send options (optimistic delivery, idempotency key)
598
- * @returns Promise that resolves with the message ID after it has been sent
599
- */
600
- sendMarkdown(markdown: string, opts?: SendOpts): Promise<string>;
601
- /**
602
- * Sends a reaction message
603
- *
604
- * @param reaction - The reaction to send
605
- * @param opts - Send options (optimistic delivery, idempotency key)
606
- * @returns Promise that resolves with the message ID after it has been sent
607
- */
608
- sendReaction(reaction: Reaction, opts?: SendOpts): Promise<string>;
609
- /**
610
- * Sends a read receipt message
611
- *
612
- * @param opts - Send options (optimistic delivery, idempotency key)
613
- * @returns Promise that resolves with the message ID after it has been sent
614
- */
615
- sendReadReceipt(opts?: SendOpts): Promise<string>;
616
- /**
617
- * Sends a reply message
618
- *
619
- * @param reply - The reply to send
620
- * @param opts - Send options (optimistic delivery, idempotency key)
621
- * @returns Promise that resolves with the message ID after it has been sent
622
- */
623
- sendReply(reply: Reply, opts?: SendOpts): Promise<string>;
624
- /**
625
- * Sends a transaction reference message
626
- *
627
- * @param transactionReference - The transaction reference to send
628
- * @param opts - Send options (optimistic delivery, idempotency key)
629
- * @returns Promise that resolves with the message ID after it has been sent
630
- */
631
- sendTransactionReference(transactionReference: TransactionReference, opts?: SendOpts): Promise<string>;
632
- /**
633
- * Sends a wallet send calls message
634
- *
635
- * @param walletSendCalls - The wallet send calls to send
636
- * @param opts - Send options (optimistic delivery, idempotency key)
637
- * @returns Promise that resolves with the message ID after it has been sent
638
- */
639
- sendWalletSendCalls(walletSendCalls: WalletSendCalls, opts?: SendOpts): Promise<string>;
640
- /**
641
- * Sends a actions message
642
- *
643
- * @param actions - The actions to send
644
- * @param opts - Send options (optimistic delivery, idempotency key)
645
- * @returns Promise that resolves with the message ID after it has been sent
646
- */
647
- sendActions(actions: Actions, opts?: SendOpts): Promise<string>;
648
- /**
649
- * Sends a intent message
650
- *
651
- * @param intent - The intent to send
652
- * @param opts - Send options (optimistic delivery, idempotency key)
653
- * @returns Promise that resolves with the message ID after it has been sent
654
- */
655
- sendIntent(intent: Intent, opts?: SendOpts): Promise<string>;
656
- /**
657
- * Sends an attachment message
658
- *
659
- * @param attachment - The attachment to send
660
- * @param opts - Send options (optimistic delivery, idempotency key)
661
- * @returns Promise that resolves with the message ID after it has been sent
662
- */
663
- sendAttachment(attachment: Attachment, opts?: SendOpts): Promise<string>;
664
- /**
665
- * Sends a multi remote attachment message
666
- *
667
- * @param multiRemoteAttachment - The multi remote attachment to send
668
- * @param opts - Send options (optimistic delivery, idempotency key)
669
- * @returns Promise that resolves with the message ID after it has been sent
670
- */
671
- sendMultiRemoteAttachment(multiRemoteAttachment: MultiRemoteAttachment, opts?: SendOpts): Promise<string>;
672
- /**
673
- * Sends a remote attachment message
674
- *
675
- * @param remoteAttachment - The remote attachment to send
676
- * @param opts - Send options (optimistic delivery, idempotency key)
677
- * @returns Promise that resolves with the message ID after it has been sent
678
- */
679
- sendRemoteAttachment(remoteAttachment: RemoteAttachment, opts?: SendOpts): Promise<string>;
680
- /**
681
- * Lists messages in this conversation
682
- *
683
- * @param options - Optional filtering and pagination options
684
- * @returns Promise that resolves with an array of decoded messages
685
- */
686
- messages(options?: ListMessagesOptions): Promise<DecodedMessage<ContentTypes>[]>;
687
- /**
688
- * Counts messages in this conversation
689
- *
690
- * @param options - Optional filtering options
691
- * @returns Promise that resolves with the count of messages
692
- */
693
- countMessages(options?: Omit<ListMessagesOptions, "limit" | "direction">): Promise<number>;
694
- /**
695
- * Gets the last message in this conversation
696
- *
697
- * @returns Promise that resolves with the last message or undefined if none exists
698
- */
699
- lastMessage(): Promise<DecodedMessage<ContentTypes> | undefined>;
700
- /**
701
- * Gets the consent state for this conversation
702
- */
703
- consentState(): ConsentState;
704
- /**
705
- * Updates the consent state for this conversation
706
- *
707
- * @param consentState - The new consent state to set
708
- */
709
- updateConsentState(consentState: ConsentState): void;
710
- /**
711
- * Gets the message disappearing settings for this conversation
712
- *
713
- * @returns The current message disappearing settings or undefined if not set
714
- */
715
- messageDisappearingSettings(): _xmtp_node_bindings.MessageDisappearingSettings | undefined;
716
- /**
717
- * Updates message disappearing settings for this conversation
718
- *
719
- * @param fromNs - The timestamp from which messages should start disappearing
720
- * @param inNs - The duration after which messages should disappear
721
- * @returns Promise that resolves when the update is complete
722
- */
723
- updateMessageDisappearingSettings(fromNs: bigint, inNs: bigint): Promise<void>;
724
- /**
725
- * Removes message disappearing settings from this conversation
726
- *
727
- * @returns Promise that resolves when the settings are removed
728
- */
729
- removeMessageDisappearingSettings(): Promise<void>;
730
- /**
731
- * Checks if message disappearing is enabled for this conversation
732
- *
733
- * @returns Whether message disappearing is enabled
734
- */
735
- isMessageDisappearingEnabled(): boolean;
736
- /**
737
- * Retrieves information for this conversation to help with debugging
738
- *
739
- * @returns The debug information for this conversation
740
- */
741
- debugInfo(): Promise<_xmtp_node_bindings.ConversationDebugInfo>;
742
- /**
743
- * Retrieves the last read times for this conversation
744
- *
745
- * @returns A map keyed by inbox ID with the last read timestamp
746
- * (nanoseconds since epoch)
747
- */
748
- lastReadTimes(): Promise<Record<string, number>>;
495
+ export declare class Conversation<ContentTypes = unknown> {
496
+ #private;
497
+ /**
498
+ * Creates a new conversation instance
499
+ *
500
+ * @param _client - The client instance managing the conversation
501
+ * @param codecRegistry - The codec registry instance
502
+ * @param conversation - The underlying conversation instance
503
+ */
504
+ constructor(_client: Client<ContentTypes>, codecRegistry: CodecRegistry, conversation: Conversation$1);
505
+ /**
506
+ * Gets the unique identifier for this conversation
507
+ */
508
+ get id(): string;
509
+ /**
510
+ * Gets whether this conversation is currently active
511
+ */
512
+ get isActive(): boolean;
513
+ /** Override notification rules, or reset the override with "default". */
514
+ setNotifications(value: NotificationOverride): Promise<void>;
515
+ /** Read the effective notification value for this conversation. */
516
+ notificationsEnabled(): Promise<boolean>;
517
+ /**
518
+ * Gets the inbox ID that added this client's inbox to the conversation
519
+ */
520
+ get addedByInboxId(): string;
521
+ /**
522
+ * Gets the timestamp when the conversation was created in nanoseconds
523
+ */
524
+ get createdAtNs(): bigint;
525
+ /**
526
+ * Gets the date when the conversation was created
527
+ */
528
+ get createdAt(): Date;
529
+ get topic(): string;
530
+ pausedForVersion(): string | undefined;
531
+ /**
532
+ * Gets HMAC keys for this conversation
533
+ *
534
+ * @returns The HMAC keys for this conversation
535
+ */
536
+ hmacKeys(): Record<string, import("@xmtp/node-bindings").HmacKey[]>;
537
+ /**
538
+ * Gets the metadata for this conversation
539
+ *
540
+ * @returns Promise that resolves with the conversation metadata
541
+ */
542
+ metadata(): Promise<{
543
+ creatorInboxId: string;
544
+ conversationType: import("@xmtp/node-bindings").ConversationType;
545
+ }>;
546
+ /**
547
+ * Gets the members of this conversation
548
+ *
549
+ * @returns Promise that resolves with the conversation members
550
+ */
551
+ members(): Promise<import("@xmtp/node-bindings").GroupMember[]>;
552
+ /**
553
+ * Synchronizes conversation data from the network
554
+ *
555
+ * @returns Promise that resolves when synchronization is complete
556
+ */
557
+ sync(): Promise<void>;
558
+ /**
559
+ * Reads retained messages after the default acknowledgement position.
560
+ * Set `from` to replay after a cursor without changing default progress.
561
+ * Set `onValue` for callback mode, or request items with the iterator.
562
+ * Core owns network recovery. Legacy retry options and `disableSync` do not apply.
563
+ *
564
+ * @param options - Optional delivery callbacks and replay cursor
565
+ * @returns Stream instance for new messages
566
+ */
567
+ stream(options?: StreamOptions<Message$1, DecodedMessage<ContentTypes>> & {
568
+ from?: DeliveryCursor$1;
569
+ }): Promise<MessageStream<Message$1, DecodedMessage<ContentTypes>>>;
570
+ messageHistorySnapshot(limit: number): import("@xmtp/node-bindings").MessageHistorySnapshot;
571
+ beginningDeliveryCursor(): DeliveryCursor$1;
572
+ /**
573
+ * Decodes, decrypts, and persists a raw envelope from a group message stream.
574
+ *
575
+ * @param envelopeBytes - Raw protobuf-encoded envelope bytes from the stream
576
+ * @returns The processed and stored messages
577
+ */
578
+ processStreamedMessage(envelopeBytes: Uint8Array): Promise<Message$1[]>;
579
+ /**
580
+ * Publishes pending messages that were sent optimistically
581
+ *
582
+ * @returns Promise that resolves when publishing is complete
583
+ */
584
+ publishMessages(): Promise<void>;
585
+ /**
586
+ * Sends a message with configurable delivery behavior
587
+ *
588
+ * @param encodedContent - The encoded content to send
589
+ * @param sendOptions - Options for sending the message
590
+ * @param sendOptions.shouldPush - Indicates whether this message should be
591
+ * included in push notifications
592
+ * @param sendOptions.optimistic - Indicates whether this message should be
593
+ * sent optimistically and published later via `publishMessages`
594
+ * @param sendOptions.idempotencyKey - Optional idempotency key; re-sending
595
+ * identical content with the same key produces the same deduplicated message id
596
+ * @returns Promise that resolves with the message ID after it has been sent
597
+ */
598
+ send(encodedContent: EncodedContent, sendOptions?: SendMessageOpts$1): Promise<string>;
599
+ /**
600
+ * Sends a text message
601
+ *
602
+ * @param text - The text to send
603
+ * @param opts - Send options (optimistic delivery, idempotency key)
604
+ * @returns Promise that resolves with the message ID after it has been sent
605
+ */
606
+ sendText(text: string, opts?: SendOpts$1): Promise<string>;
607
+ /**
608
+ * Sends a markdown message
609
+ *
610
+ * @param markdown - The markdown to send
611
+ * @param opts - Send options (optimistic delivery, idempotency key)
612
+ * @returns Promise that resolves with the message ID after it has been sent
613
+ */
614
+ sendMarkdown(markdown: string, opts?: SendOpts$1): Promise<string>;
615
+ /**
616
+ * Sends a reaction message
617
+ *
618
+ * @param reaction - The reaction to send
619
+ * @param opts - Send options (optimistic delivery, idempotency key)
620
+ * @returns Promise that resolves with the message ID after it has been sent
621
+ */
622
+ sendReaction(reaction: Reaction$1, opts?: SendOpts$1): Promise<string>;
623
+ /**
624
+ * Sends a read receipt message
625
+ *
626
+ * @param opts - Send options (optimistic delivery, idempotency key)
627
+ * @returns Promise that resolves with the message ID after it has been sent
628
+ */
629
+ sendReadReceipt(opts?: SendOpts$1): Promise<string>;
630
+ /**
631
+ * Sends a reply message
632
+ *
633
+ * @param reply - The reply to send
634
+ * @param opts - Send options (optimistic delivery, idempotency key)
635
+ * @returns Promise that resolves with the message ID after it has been sent
636
+ */
637
+ sendReply(reply: Reply$1, opts?: SendOpts$1): Promise<string>;
638
+ /**
639
+ * Sends a transaction reference message
640
+ *
641
+ * @param transactionReference - The transaction reference to send
642
+ * @param opts - Send options (optimistic delivery, idempotency key)
643
+ * @returns Promise that resolves with the message ID after it has been sent
644
+ */
645
+ sendTransactionReference(transactionReference: TransactionReference$1, opts?: SendOpts$1): Promise<string>;
646
+ /**
647
+ * Sends a wallet send calls message
648
+ *
649
+ * @param walletSendCalls - The wallet send calls to send
650
+ * @param opts - Send options (optimistic delivery, idempotency key)
651
+ * @returns Promise that resolves with the message ID after it has been sent
652
+ */
653
+ sendWalletSendCalls(walletSendCalls: WalletSendCalls$1, opts?: SendOpts$1): Promise<string>;
654
+ /**
655
+ * Sends a actions message
656
+ *
657
+ * @param actions - The actions to send
658
+ * @param opts - Send options (optimistic delivery, idempotency key)
659
+ * @returns Promise that resolves with the message ID after it has been sent
660
+ */
661
+ sendActions(actions: Actions$1, opts?: SendOpts$1): Promise<string>;
662
+ /**
663
+ * Sends a intent message
664
+ *
665
+ * @param intent - The intent to send
666
+ * @param opts - Send options (optimistic delivery, idempotency key)
667
+ * @returns Promise that resolves with the message ID after it has been sent
668
+ */
669
+ sendIntent(intent: Intent$1, opts?: SendOpts$1): Promise<string>;
670
+ /**
671
+ * Sends an attachment message
672
+ *
673
+ * @param attachment - The attachment to send
674
+ * @param opts - Send options (optimistic delivery, idempotency key)
675
+ * @returns Promise that resolves with the message ID after it has been sent
676
+ */
677
+ sendAttachment(attachment: Attachment$1, opts?: SendOpts$1): Promise<string>;
678
+ /**
679
+ * Sends a multi remote attachment message
680
+ *
681
+ * @param multiRemoteAttachment - The multi remote attachment to send
682
+ * @param opts - Send options (optimistic delivery, idempotency key)
683
+ * @returns Promise that resolves with the message ID after it has been sent
684
+ */
685
+ sendMultiRemoteAttachment(multiRemoteAttachment: MultiRemoteAttachment$1, opts?: SendOpts$1): Promise<string>;
686
+ /**
687
+ * Sends a remote attachment message
688
+ *
689
+ * @param remoteAttachment - The remote attachment to send
690
+ * @param opts - Send options (optimistic delivery, idempotency key)
691
+ * @returns Promise that resolves with the message ID after it has been sent
692
+ */
693
+ sendRemoteAttachment(remoteAttachment: RemoteAttachment$1, opts?: SendOpts$1): Promise<string>;
694
+ /**
695
+ * Lists messages in this conversation
696
+ *
697
+ * @param options - Optional filtering and pagination options
698
+ * @returns Promise that resolves with an array of decoded messages
699
+ */
700
+ messages(options?: ListMessagesOptions$1): Promise<DecodedMessage<ContentTypes>[]>;
701
+ /**
702
+ * Counts messages in this conversation
703
+ *
704
+ * @param options - Optional filtering options
705
+ * @returns Promise that resolves with the count of messages
706
+ */
707
+ countMessages(options?: Omit<ListMessagesOptions$1, "limit" | "direction">): Promise<number>;
708
+ /**
709
+ * Gets the last message in this conversation
710
+ *
711
+ * @returns Promise that resolves with the last message or undefined if none exists
712
+ */
713
+ lastMessage(): Promise<DecodedMessage<ContentTypes> | undefined>;
714
+ /**
715
+ * Gets the consent state for this conversation
716
+ */
717
+ consentState(): ConsentState$1;
718
+ /**
719
+ * Updates the consent state for this conversation
720
+ *
721
+ * @param consentState - The new consent state to set
722
+ */
723
+ updateConsentState(consentState: ConsentState$1): void;
724
+ /**
725
+ * Gets the message disappearing settings for this conversation
726
+ *
727
+ * @returns The current message disappearing settings or undefined if not set
728
+ */
729
+ messageDisappearingSettings(): import("@xmtp/node-bindings").MessageDisappearingSettings | undefined;
730
+ /**
731
+ * Updates message disappearing settings for this conversation
732
+ *
733
+ * @param fromNs - The timestamp from which messages should start disappearing
734
+ * @param inNs - The duration after which messages should disappear
735
+ * @returns Promise that resolves when the update is complete
736
+ */
737
+ updateMessageDisappearingSettings(fromNs: bigint, inNs: bigint): Promise<void>;
738
+ /**
739
+ * Removes message disappearing settings from this conversation
740
+ *
741
+ * @returns Promise that resolves when the settings are removed
742
+ */
743
+ removeMessageDisappearingSettings(): Promise<void>;
744
+ /**
745
+ * Checks if message disappearing is enabled for this conversation
746
+ *
747
+ * @returns Whether message disappearing is enabled
748
+ */
749
+ isMessageDisappearingEnabled(): boolean;
750
+ /**
751
+ * Retrieves information for this conversation to help with debugging
752
+ *
753
+ * @returns The debug information for this conversation
754
+ */
755
+ debugInfo(): Promise<import("@xmtp/node-bindings").ConversationDebugInfo>;
756
+ /**
757
+ * Retrieves the last read times for this conversation
758
+ *
759
+ * @returns A map keyed by inbox ID with the last read timestamp
760
+ * (nanoseconds since epoch)
761
+ */
762
+ lastReadTimes(): Promise<Record<string, number>>;
749
763
  }
750
-
764
+ //#endregion
765
+ //#region src/Dm.d.ts
751
766
  /**
752
767
  * Represents a direct message conversation between two inboxes
753
768
  *
754
769
  * This class is not intended to be initialized directly.
755
770
  */
756
- declare class Dm<ContentTypes = unknown> extends Conversation<ContentTypes> {
757
- #private;
758
- /**
759
- * Creates a new direct message conversation instance
760
- *
761
- * @param client - The client instance managing this direct message conversation
762
- * @param codecRegistry - The codec registry instance
763
- * @param conversation - The underlying conversation instance
764
- */
765
- constructor(client: Client<ContentTypes>, codecRegistry: CodecRegistry, conversation: Conversation$1);
766
- /**
767
- * Retrieves the inbox ID of the other participant in the DM
768
- *
769
- * @returns Promise that resolves with the peer's inbox ID
770
- */
771
- get peerInboxId(): string;
772
- duplicateDms(): Promise<Dm<ContentTypes>[]>;
771
+ export declare class Dm<ContentTypes = unknown> extends Conversation<ContentTypes> {
772
+ #private;
773
+ /**
774
+ * Creates a new direct message conversation instance
775
+ *
776
+ * @param client - The client instance managing this direct message conversation
777
+ * @param codecRegistry - The codec registry instance
778
+ * @param conversation - The underlying conversation instance
779
+ */
780
+ constructor(client: Client<ContentTypes>, codecRegistry: CodecRegistry, conversation: Conversation$1);
781
+ /**
782
+ * Retrieves the inbox ID of the other participant in the DM
783
+ *
784
+ * @returns Promise that resolves with the peer's inbox ID
785
+ */
786
+ get peerInboxId(): string;
787
+ duplicateDms(): Promise<Dm<ContentTypes>[]>;
773
788
  }
774
-
789
+ //#endregion
790
+ //#region src/Group.d.ts
775
791
  /**
776
792
  * Represents a group conversation between multiple inboxes
777
793
  *
778
794
  * This class is not intended to be initialized directly.
779
795
  */
780
- declare class Group<ContentTypes = unknown> extends Conversation<ContentTypes> {
781
- #private;
782
- /**
783
- * Creates a new group conversation instance
784
- *
785
- * @param client - The client instance managing this group conversation
786
- * @param codecRegistry - The codec registry instance
787
- * @param conversation - The underlying conversation object
788
- */
789
- constructor(client: Client<ContentTypes>, codecRegistry: CodecRegistry, conversation: Conversation$1);
790
- /**
791
- * The name of the group
792
- */
793
- get name(): string;
794
- /**
795
- * Updates the group's name
796
- *
797
- * @param name The new name for the group
798
- */
799
- updateName(name: string): Promise<void>;
800
- /**
801
- * The image URL of the group
802
- */
803
- get imageUrl(): string;
804
- /**
805
- * Updates the group's image URL
806
- *
807
- * @param imageUrl The new image URL for the group
808
- */
809
- updateImageUrl(imageUrl: string): Promise<void>;
810
- /**
811
- * The description of the group
812
- */
813
- get description(): string;
814
- /**
815
- * Updates the group's description
816
- *
817
- * @param description The new description for the group
818
- */
819
- updateDescription(description: string): Promise<void>;
820
- /**
821
- * The app data of the group
822
- */
823
- get appData(): string;
824
- /**
825
- * Updates the group's app data (max 8192 bytes)
826
- *
827
- * @param appData The new app data for the group
828
- * @param expectedAppData Optional compare-and-swap guard. When provided, the
829
- * update is abandoned — rather than overwriting — if the committed value is
830
- * no longer this, including when another member's commit wins the race after
831
- * this update was published. Callers reconciling structured state should
832
- * pass the value they merged against, so a concurrent write surfaces as an
833
- * error instead of silently discarding someone else's change. Omit for
834
- * last-writer-wins.
835
- */
836
- updateAppData(appData: string, expectedAppData?: string): Promise<void>;
837
- /**
838
- * The permissions of the group
839
- */
840
- permissions(): {
841
- policyType: _xmtp_node_bindings.GroupPermissionsOptions;
842
- policySet: _xmtp_node_bindings.PermissionPolicySet;
843
- };
844
- /**
845
- * Updates a specific permission policy for the group
846
- *
847
- * @param permissionType The type of permission to update
848
- * @param policy The new permission policy
849
- * @param metadataField Optional metadata field for the permission
850
- */
851
- updatePermission(permissionType: PermissionUpdateType, policy: PermissionPolicy, metadataField?: MetadataField): Promise<void>;
852
- /**
853
- * The list of admins of the group
854
- */
855
- listAdmins(): string[];
856
- /**
857
- * The list of super admins of the group
858
- */
859
- listSuperAdmins(): string[];
860
- /**
861
- * Checks if an inbox is an admin of the group
862
- *
863
- * @param inboxId The inbox ID to check
864
- * @returns Boolean indicating if the inbox is an admin
865
- */
866
- isAdmin(inboxId: string): boolean;
867
- /**
868
- * Checks if an inbox is a super admin of the group
869
- *
870
- * @param inboxId The inbox ID to check
871
- * @returns Boolean indicating if the inbox is a super admin
872
- */
873
- isSuperAdmin(inboxId: string): boolean;
874
- /**
875
- * Adds members to the group using identifiers
876
- *
877
- * @param identifiers Array of member identifiers to add
878
- */
879
- addMembersByIdentifiers(identifiers: Identifier[]): Promise<_xmtp_node_bindings.UpdateGroupMembershipResult>;
880
- /**
881
- * Adds members to the group using inbox IDs
882
- *
883
- * @param inboxIds Array of inbox IDs to add
884
- */
885
- addMembers(inboxIds: string[]): Promise<_xmtp_node_bindings.UpdateGroupMembershipResult>;
886
- /**
887
- * Removes members from the group using identifiers
888
- *
889
- * @param identifiers Array of member identifiers to remove
890
- */
891
- removeMembersByIdentifiers(identifiers: Identifier[]): Promise<void>;
892
- /**
893
- * Removes members from the group using inbox IDs
894
- *
895
- * @param inboxIds Array of inbox IDs to remove
896
- */
897
- removeMembers(inboxIds: string[]): Promise<void>;
898
- /**
899
- * Promotes a group member to admin status
900
- *
901
- * @param inboxId The inbox ID of the member to promote
902
- */
903
- addAdmin(inboxId: string): Promise<void>;
904
- /**
905
- * Removes admin status from a group member
906
- *
907
- * @param inboxId The inbox ID of the admin to demote
908
- */
909
- removeAdmin(inboxId: string): Promise<void>;
910
- /**
911
- * Promotes a group member to super admin status
912
- *
913
- * @param inboxId The inbox ID of the member to promote
914
- */
915
- addSuperAdmin(inboxId: string): Promise<void>;
916
- /**
917
- * Removes super admin status from a group member
918
- *
919
- * @param inboxId The inbox ID of the super admin to demote
920
- */
921
- removeSuperAdmin(inboxId: string): Promise<void>;
922
- /**
923
- * Request to leave the group
924
- */
925
- requestRemoval(): Promise<void>;
926
- /**
927
- * Checks if the current user has requested to leave the group
928
- *
929
- * @returns Boolean
930
- */
931
- isPendingRemoval(): boolean;
796
+ export declare class Group<ContentTypes = unknown> extends Conversation<ContentTypes> {
797
+ #private;
798
+ /**
799
+ * Creates a new group conversation instance
800
+ *
801
+ * @param client - The client instance managing this group conversation
802
+ * @param codecRegistry - The codec registry instance
803
+ * @param conversation - The underlying conversation object
804
+ */
805
+ constructor(client: Client<ContentTypes>, codecRegistry: CodecRegistry, conversation: Conversation$1);
806
+ /**
807
+ * The name of the group
808
+ */
809
+ get name(): string;
810
+ /**
811
+ * Updates the group's name
812
+ *
813
+ * @param name The new name for the group
814
+ */
815
+ updateName(name: string): Promise<void>;
816
+ /**
817
+ * The image URL of the group
818
+ */
819
+ get imageUrl(): string;
820
+ /**
821
+ * Updates the group's image URL
822
+ *
823
+ * @param imageUrl The new image URL for the group
824
+ */
825
+ updateImageUrl(imageUrl: string): Promise<void>;
826
+ /**
827
+ * The description of the group
828
+ */
829
+ get description(): string;
830
+ /**
831
+ * Updates the group's description
832
+ *
833
+ * @param description The new description for the group
834
+ */
835
+ updateDescription(description: string): Promise<void>;
836
+ /**
837
+ * The app data of the group
838
+ */
839
+ get appData(): string;
840
+ /**
841
+ * Updates the group's app data (max 8192 bytes)
842
+ *
843
+ * @param appData The new app data for the group
844
+ * @param expectedAppData Optional compare-and-swap guard. When provided, the
845
+ * update is abandoned — rather than overwriting — if the committed value is
846
+ * no longer this, including when another member's commit wins the race after
847
+ * this update was published. Callers reconciling structured state should
848
+ * pass the value they merged against, so a concurrent write surfaces as an
849
+ * error instead of silently discarding someone else's change. Omit for
850
+ * last-writer-wins.
851
+ */
852
+ updateAppData(appData: string, expectedAppData?: string): Promise<void>;
853
+ /**
854
+ * The permissions of the group
855
+ */
856
+ permissions(): {
857
+ policyType: import("@xmtp/node-bindings").GroupPermissionsOptions;
858
+ policySet: import("@xmtp/node-bindings").PermissionPolicySet;
859
+ };
860
+ /**
861
+ * Updates a specific permission policy for the group
862
+ *
863
+ * @param permissionType The type of permission to update
864
+ * @param policy The new permission policy
865
+ * @param metadataField Optional metadata field for the permission
866
+ */
867
+ updatePermission(permissionType: PermissionUpdateType$1, policy: PermissionPolicy$1, metadataField?: MetadataField$1): Promise<void>;
868
+ /**
869
+ * The list of admins of the group
870
+ */
871
+ listAdmins(): string[];
872
+ /**
873
+ * The list of super admins of the group
874
+ */
875
+ listSuperAdmins(): string[];
876
+ /**
877
+ * Checks if an inbox is an admin of the group
878
+ *
879
+ * @param inboxId The inbox ID to check
880
+ * @returns Boolean indicating if the inbox is an admin
881
+ */
882
+ isAdmin(inboxId: string): boolean;
883
+ /**
884
+ * Checks if an inbox is a super admin of the group
885
+ *
886
+ * @param inboxId The inbox ID to check
887
+ * @returns Boolean indicating if the inbox is a super admin
888
+ */
889
+ isSuperAdmin(inboxId: string): boolean;
890
+ /**
891
+ * Adds members to the group using identifiers
892
+ *
893
+ * @param identifiers Array of member identifiers to add
894
+ */
895
+ addMembersByIdentifiers(identifiers: Identifier$1[]): Promise<import("@xmtp/node-bindings").UpdateGroupMembershipResult>;
896
+ /**
897
+ * Adds members to the group using inbox IDs
898
+ *
899
+ * @param inboxIds Array of inbox IDs to add
900
+ */
901
+ addMembers(inboxIds: string[]): Promise<import("@xmtp/node-bindings").UpdateGroupMembershipResult>;
902
+ /**
903
+ * Removes members from the group using identifiers
904
+ *
905
+ * @param identifiers Array of member identifiers to remove
906
+ */
907
+ removeMembersByIdentifiers(identifiers: Identifier$1[]): Promise<void>;
908
+ /**
909
+ * Removes members from the group using inbox IDs
910
+ *
911
+ * @param inboxIds Array of inbox IDs to remove
912
+ */
913
+ removeMembers(inboxIds: string[]): Promise<void>;
914
+ /**
915
+ * Promotes a group member to admin status
916
+ *
917
+ * @param inboxId The inbox ID of the member to promote
918
+ */
919
+ addAdmin(inboxId: string): Promise<void>;
920
+ /**
921
+ * Removes admin status from a group member
922
+ *
923
+ * @param inboxId The inbox ID of the admin to demote
924
+ */
925
+ removeAdmin(inboxId: string): Promise<void>;
926
+ /**
927
+ * Promotes a group member to super admin status
928
+ *
929
+ * @param inboxId The inbox ID of the member to promote
930
+ */
931
+ addSuperAdmin(inboxId: string): Promise<void>;
932
+ /**
933
+ * Removes super admin status from a group member
934
+ *
935
+ * @param inboxId The inbox ID of the super admin to demote
936
+ */
937
+ removeSuperAdmin(inboxId: string): Promise<void>;
938
+ /**
939
+ * Request to leave the group
940
+ */
941
+ requestRemoval(): Promise<void>;
942
+ /**
943
+ * Checks if the current user has requested to leave the group
944
+ *
945
+ * @returns Boolean
946
+ */
947
+ isPendingRemoval(): boolean;
932
948
  }
933
-
949
+ //#endregion
950
+ //#region src/Conversations.d.ts
934
951
  /**
935
952
  * Manages conversations
936
953
  *
937
954
  * This class is not intended to be initialized directly.
938
955
  */
939
- declare class Conversations<ContentTypes = unknown> {
940
- #private;
941
- /**
942
- * Creates a new conversations instance
943
- *
944
- * @param client - The client instance managing the conversations
945
- * @param codecRegistry - The codec registry instance
946
- * @param conversations - The underlying conversations instance
947
- */
948
- constructor(client: Client<ContentTypes>, codecRegistry: CodecRegistry, conversations: Conversations$1);
949
- get topic(): string;
950
- /**
951
- * Retrieves a conversation by its ID
952
- *
953
- * @param id - The conversation ID to look up
954
- * @returns The conversation if found, undefined otherwise
955
- * @see https://docs.xmtp.org/sdk/conversations/
956
- */
957
- getConversationById(id: string): Promise<Group<ContentTypes> | Dm<ContentTypes> | undefined>;
958
- /**
959
- * Retrieves a DM by inbox ID
960
- *
961
- * @param inboxId - The inbox ID to look up
962
- * @returns The DM if found, undefined otherwise
963
- * @see https://docs.xmtp.org/sdk/conversations/
964
- */
965
- getDmByInboxId(inboxId: string): Dm<ContentTypes> | undefined;
966
- /**
967
- * Retrieves a DM by identifier
968
- *
969
- * @param identifier - The identifier to look up
970
- * @returns Promise that resolves with the DM, if found
971
- * @see https://docs.xmtp.org/sdk/conversations/
972
- */
973
- fetchDmByIdentifier(identifier: Identifier): Promise<Dm<ContentTypes> | undefined>;
974
- /**
975
- * Retrieves a message by its ID
976
- *
977
- * @param id - The message ID to look up
978
- * @returns The decoded message if found, undefined otherwise
979
- * @see https://docs.xmtp.org/sdk/conversations/
980
- */
981
- getMessageById(id: string): DecodedMessage<ContentTypes> | undefined;
982
- /**
983
- * Creates a new group conversation without publishing to the network
984
- *
985
- * @param options - Optional group creation options
986
- * @returns The new group
987
- * @see https://docs.xmtp.org/sdk/conversations/#optimistically-create-a-group
988
- */
989
- createGroupOptimistic(options?: CreateGroupOptions): Group<ContentTypes>;
990
- /**
991
- * Creates a new group conversation with the specified identifiers
992
- *
993
- * @param identifiers - Array of identifiers for group members
994
- * @param options - Optional group creation options
995
- * @returns The new group
996
- * @see https://docs.xmtp.org/sdk/conversations/#create-a-group
997
- */
998
- createGroupWithIdentifiers(identifiers: Identifier[], options?: CreateGroupOptions): Promise<Group<ContentTypes>>;
999
- /**
1000
- * Creates a new group conversation with the specified inbox IDs
1001
- *
1002
- * @param inboxIds - Array of inbox IDs for group members
1003
- * @param options - Optional group creation options
1004
- * @returns The new group
1005
- * @see https://docs.xmtp.org/sdk/conversations/#create-a-group
1006
- */
1007
- createGroup(inboxIds: string[], options?: CreateGroupOptions): Promise<Group<ContentTypes>>;
1008
- /**
1009
- * Creates a new DM conversation with the specified identifier
1010
- *
1011
- * @param identifier - Identifier for the DM recipient
1012
- * @param options - Optional DM creation options
1013
- * @returns The new DM
1014
- * @see https://docs.xmtp.org/sdk/conversations/#create-a-dm
1015
- */
1016
- createDmWithIdentifier(identifier: Identifier, options?: CreateDmOptions): Promise<Dm<ContentTypes>>;
1017
- /**
1018
- * Creates a new DM conversation with the specified inbox ID
1019
- *
1020
- * @param inboxId - Inbox ID for the DM recipient
1021
- * @param options - Optional DM creation options
1022
- * @returns The new DM
1023
- * @see https://docs.xmtp.org/sdk/conversations/#create-a-dm
1024
- */
1025
- createDm(inboxId: string, options?: CreateDmOptions): Promise<Dm<ContentTypes>>;
1026
- /**
1027
- * Lists all conversations with optional filtering
1028
- *
1029
- * @param options - Optional filtering and pagination options
1030
- * @returns Array of conversations
1031
- * @see https://docs.xmtp.org/sdk/conversations/
1032
- */
1033
- list(options?: ListConversationsOptions): Promise<(Group<ContentTypes> | Dm<ContentTypes>)[]>;
1034
- /**
1035
- * Lists all groups with optional filtering
1036
- *
1037
- * @param options - Optional filtering and pagination options
1038
- * @returns Array of groups
1039
- * @see https://docs.xmtp.org/sdk/conversations/
1040
- */
1041
- listGroups(options?: Omit<ListConversationsOptions, "conversationType">): Group<ContentTypes>[];
1042
- /**
1043
- * Lists all DMs with optional filtering
1044
- *
1045
- * @param options - Optional filtering and pagination options
1046
- * @returns Array of DMs
1047
- * @see https://docs.xmtp.org/sdk/conversations/
1048
- */
1049
- listDms(options?: Omit<ListConversationsOptions, "conversationType">): Dm<ContentTypes>[];
1050
- /**
1051
- * Synchronizes conversations for the current client from the network
1052
- *
1053
- * @returns Promise that resolves when sync is complete
1054
- * @see https://docs.xmtp.org/sdk/sync/
1055
- */
1056
- sync(): Promise<void>;
1057
- /**
1058
- * Synchronizes all conversations and messages from the network with optional
1059
- * consent state filtering
1060
- *
1061
- * @param consentStates - Optional array of consent states to filter by
1062
- * @returns Promise that resolves when sync is complete
1063
- * @see https://docs.xmtp.org/sdk/sync/
1064
- */
1065
- syncAll(consentStates?: ConsentState[]): Promise<_xmtp_node_bindings.GroupSyncSummary>;
1066
- /**
1067
- * Creates a stream for new conversations
1068
- *
1069
- * @param options - Optional stream options
1070
- * @param options.conversationType - Optional conversation type to filter by
1071
- * @returns Stream instance for new conversations
1072
- * @see https://docs.xmtp.org/sdk/stream/#stream-methods
1073
- */
1074
- stream(options?: StreamOptions<Conversation$1, Group<ContentTypes> | Dm<ContentTypes> | undefined> & {
1075
- conversationType?: ConversationType;
1076
- }): Promise<AsyncStreamProxy<Group<ContentTypes> | Dm<ContentTypes>>>;
1077
- /**
1078
- * Creates a stream for new group conversations
1079
- *
1080
- * @param options - Optional stream options
1081
- * @returns Stream instance for new group conversations
1082
- * @see https://docs.xmtp.org/sdk/stream/#stream-methods
1083
- */
1084
- streamGroups(options?: StreamOptions<Conversation$1, Group<ContentTypes>>): Promise<AsyncStreamProxy<Group<ContentTypes>>>;
1085
- /**
1086
- * Creates a stream for new DM conversations
1087
- *
1088
- * @param options - Optional stream options
1089
- * @returns Stream instance for new DM conversations
1090
- * @see https://docs.xmtp.org/sdk/stream/#stream-methods
1091
- */
1092
- streamDms(options?: StreamOptions<Conversation$1, Dm<ContentTypes>>): Promise<AsyncStreamProxy<Dm<ContentTypes>>>;
1093
- /**
1094
- * Reads retained messages after each group's default acknowledgement position.
1095
- * Set `from` to replay after a cursor without changing default progress.
1096
- * Set `onValue` for callback mode, or request items with the iterator.
1097
- * Core owns network recovery. Legacy retry options and `disableSync` do not apply.
1098
- *
1099
- * @param options - Optional stream options
1100
- * @param options.conversationType - Optional conversation type to filter by
1101
- * @param options.consentStates - Optional array of consent states to filter by
1102
- * @returns Stream instance for new messages
1103
- * @see https://docs.xmtp.org/sdk/stream/#stream-methods
1104
- */
1105
- streamAllMessages(options?: StreamOptions<Message, DecodedMessage<ContentTypes>> & {
1106
- conversationType?: ConversationType;
1107
- consentStates?: ConsentState[];
1108
- groupIds?: string[];
1109
- from?: DeliveryCursor;
1110
- }): Promise<MessageStream<Message, DecodedMessage<ContentTypes>>>;
1111
- messageHistorySnapshot(limit: number, options?: {
1112
- groupIds?: string[];
1113
- conversationType?: ConversationType;
1114
- consentStates?: ConsentState[];
1115
- }): _xmtp_node_bindings.MessageHistorySnapshot;
1116
- beginningDeliveryCursor(): DeliveryCursor;
1117
- /**
1118
- * Reads retained group messages with default progress or an explicit replay cursor.
1119
- *
1120
- * @param options - Optional stream options
1121
- * @param options.consentStates - Optional array of consent states to filter by
1122
- * @returns Stream instance for new group messages
1123
- * @see https://docs.xmtp.org/sdk/stream/#stream-methods
1124
- */
1125
- streamAllGroupMessages(options?: StreamOptions<Message, DecodedMessage<ContentTypes>> & {
1126
- consentStates?: ConsentState[];
1127
- groupIds?: string[];
1128
- from?: DeliveryCursor;
1129
- }): Promise<MessageStream<Message, DecodedMessage<ContentTypes>>>;
1130
- /**
1131
- * Reads retained DM messages with default progress or an explicit replay cursor.
1132
- *
1133
- * @param options - Optional stream options
1134
- * @param options.consentStates - Optional array of consent states to filter by
1135
- * @returns Stream instance for new DM messages
1136
- * @see https://docs.xmtp.org/sdk/stream/#stream-methods
1137
- */
1138
- streamAllDmMessages(options?: StreamOptions<Message, DecodedMessage<ContentTypes>> & {
1139
- consentStates?: ConsentState[];
1140
- groupIds?: string[];
1141
- from?: DeliveryCursor;
1142
- }): Promise<MessageStream<Message, DecodedMessage<ContentTypes>>>;
1143
- /**
1144
- * Creates a stream for message deletions that streams the message IDs of
1145
- * deleted messages
1146
- *
1147
- * This is a local stream, does not require network sync, and will not fail
1148
- * like other streams.
1149
- *
1150
- * @param options - Optional stream options
1151
- * @returns Stream instance for message deletions
1152
- * @deprecated Use streamDeletedMessages instead
1153
- */
1154
- streamMessageDeletions(options?: Omit<StreamOptions<DecodedMessage$1, string>, "disableSync" | "onFail" | "onRetry" | "onRestart" | "retryAttempts" | "retryDelay" | "retryOnFail">): Promise<AsyncStreamProxy<string>>;
1155
- /**
1156
- * Creates a stream for message deletions that streams the deleted messages
1157
- *
1158
- * This is a local stream, does not require network sync, and will not fail
1159
- * like other streams.
1160
- *
1161
- * @param options - Optional stream options
1162
- * @returns Stream instance for message deletions
1163
- */
1164
- streamDeletedMessages(options?: Omit<StreamOptions<DecodedMessage$1, DecodedMessage<ContentTypes>>, "disableSync" | "onFail" | "onRetry" | "onRestart" | "retryAttempts" | "retryDelay" | "retryOnFail">): Promise<AsyncStreamProxy<DecodedMessage<ContentTypes>>>;
1165
- /**
1166
- * Gets the HMAC keys for all conversations
1167
- *
1168
- * @returns The HMAC keys for all conversations
1169
- * @see https://docs.xmtp.org/sdk/push-notifications/
1170
- */
1171
- hmacKeys(): Record<string, _xmtp_node_bindings.HmacKey[]>;
956
+ export declare class Conversations<ContentTypes = unknown> {
957
+ #private;
958
+ /**
959
+ * Creates a new conversations instance
960
+ *
961
+ * @param client - The client instance managing the conversations
962
+ * @param codecRegistry - The codec registry instance
963
+ * @param conversations - The underlying conversations instance
964
+ */
965
+ constructor(client: Client<ContentTypes>, codecRegistry: CodecRegistry, conversations: Conversations$1);
966
+ get topic(): string;
967
+ /**
968
+ * Retrieves a conversation by its ID
969
+ *
970
+ * @param id - The conversation ID to look up
971
+ * @returns The conversation if found, undefined otherwise
972
+ * @see https://docs.xmtp.org/sdk/conversations/
973
+ */
974
+ getConversationById(id: string): Promise<Dm<ContentTypes> | Group<ContentTypes> | undefined>;
975
+ /**
976
+ * Retrieves a DM by inbox ID
977
+ *
978
+ * @param inboxId - The inbox ID to look up
979
+ * @returns The DM if found, undefined otherwise
980
+ * @see https://docs.xmtp.org/sdk/conversations/
981
+ */
982
+ getDmByInboxId(inboxId: string): Dm<ContentTypes> | undefined;
983
+ /**
984
+ * Retrieves a DM by identifier
985
+ *
986
+ * @param identifier - The identifier to look up
987
+ * @returns Promise that resolves with the DM, if found
988
+ * @see https://docs.xmtp.org/sdk/conversations/
989
+ */
990
+ fetchDmByIdentifier(identifier: Identifier$1): Promise<Dm<ContentTypes> | undefined>;
991
+ /**
992
+ * Retrieves a message by its ID
993
+ *
994
+ * @param id - The message ID to look up
995
+ * @returns The decoded message if found, undefined otherwise
996
+ * @see https://docs.xmtp.org/sdk/conversations/
997
+ */
998
+ getMessageById(id: string): DecodedMessage<ContentTypes> | undefined;
999
+ /**
1000
+ * Creates a new group conversation without publishing to the network
1001
+ *
1002
+ * @param options - Optional group creation options
1003
+ * @returns The new group
1004
+ * @see https://docs.xmtp.org/sdk/conversations/#optimistically-create-a-group
1005
+ */
1006
+ createGroupOptimistic(options?: CreateGroupOptions$1): Group<ContentTypes>;
1007
+ /**
1008
+ * Creates a new group conversation with the specified identifiers
1009
+ *
1010
+ * @param identifiers - Array of identifiers for group members
1011
+ * @param options - Optional group creation options
1012
+ * @returns The new group
1013
+ * @see https://docs.xmtp.org/sdk/conversations/#create-a-group
1014
+ */
1015
+ createGroupWithIdentifiers(identifiers: Identifier$1[], options?: CreateGroupOptions$1): Promise<Group<ContentTypes>>;
1016
+ /**
1017
+ * Creates a new group conversation with the specified inbox IDs
1018
+ *
1019
+ * @param inboxIds - Array of inbox IDs for group members
1020
+ * @param options - Optional group creation options
1021
+ * @returns The new group
1022
+ * @see https://docs.xmtp.org/sdk/conversations/#create-a-group
1023
+ */
1024
+ createGroup(inboxIds: string[], options?: CreateGroupOptions$1): Promise<Group<ContentTypes>>;
1025
+ /**
1026
+ * Creates a new DM conversation with the specified identifier
1027
+ *
1028
+ * @param identifier - Identifier for the DM recipient
1029
+ * @param options - Optional DM creation options
1030
+ * @returns The new DM
1031
+ * @see https://docs.xmtp.org/sdk/conversations/#create-a-dm
1032
+ */
1033
+ createDmWithIdentifier(identifier: Identifier$1, options?: CreateDmOptions$1): Promise<Dm<ContentTypes>>;
1034
+ /**
1035
+ * Creates a new DM conversation with the specified inbox ID
1036
+ *
1037
+ * @param inboxId - Inbox ID for the DM recipient
1038
+ * @param options - Optional DM creation options
1039
+ * @returns The new DM
1040
+ * @see https://docs.xmtp.org/sdk/conversations/#create-a-dm
1041
+ */
1042
+ createDm(inboxId: string, options?: CreateDmOptions$1): Promise<Dm<ContentTypes>>;
1043
+ /**
1044
+ * Lists all conversations with optional filtering
1045
+ *
1046
+ * @param options - Optional filtering and pagination options
1047
+ * @returns Array of conversations
1048
+ * @see https://docs.xmtp.org/sdk/conversations/
1049
+ */
1050
+ list(options?: ListConversationsOptions$1): Promise<(Dm<ContentTypes> | Group<ContentTypes>)[]>;
1051
+ /**
1052
+ * Lists all groups with optional filtering
1053
+ *
1054
+ * @param options - Optional filtering and pagination options
1055
+ * @returns Array of groups
1056
+ * @see https://docs.xmtp.org/sdk/conversations/
1057
+ */
1058
+ listGroups(options?: Omit<ListConversationsOptions$1, "conversationType">): Group<ContentTypes>[];
1059
+ /**
1060
+ * Lists all DMs with optional filtering
1061
+ *
1062
+ * @param options - Optional filtering and pagination options
1063
+ * @returns Array of DMs
1064
+ * @see https://docs.xmtp.org/sdk/conversations/
1065
+ */
1066
+ listDms(options?: Omit<ListConversationsOptions$1, "conversationType">): Dm<ContentTypes>[];
1067
+ /**
1068
+ * Synchronizes conversations for the current client from the network
1069
+ *
1070
+ * @returns Promise that resolves when sync is complete
1071
+ * @see https://docs.xmtp.org/sdk/sync/
1072
+ */
1073
+ sync(): Promise<void>;
1074
+ /**
1075
+ * Synchronizes all conversations and messages from the network with optional
1076
+ * consent state filtering
1077
+ *
1078
+ * @param consentStates - Optional array of consent states to filter by
1079
+ * @returns Promise that resolves when sync is complete
1080
+ * @see https://docs.xmtp.org/sdk/sync/
1081
+ */
1082
+ syncAll(consentStates?: ConsentState$1[]): Promise<import("@xmtp/node-bindings").GroupSyncSummary>;
1083
+ /**
1084
+ * Creates a stream for new conversations
1085
+ *
1086
+ * @param options - Optional stream options
1087
+ * @param options.conversationType - Optional conversation type to filter by
1088
+ * @returns Stream instance for new conversations
1089
+ * @see https://docs.xmtp.org/sdk/stream/#stream-methods
1090
+ */
1091
+ stream(options?: StreamOptions<Conversation$1, Group<ContentTypes> | Dm<ContentTypes> | undefined> & {
1092
+ conversationType?: ConversationType$1;
1093
+ }): Promise<AsyncStreamProxy<Dm<ContentTypes> | Group<ContentTypes>>>;
1094
+ /**
1095
+ * Creates a stream for new group conversations
1096
+ *
1097
+ * @param options - Optional stream options
1098
+ * @returns Stream instance for new group conversations
1099
+ * @see https://docs.xmtp.org/sdk/stream/#stream-methods
1100
+ */
1101
+ streamGroups(options?: StreamOptions<Conversation$1, Group<ContentTypes>>): Promise<AsyncStreamProxy<Group<ContentTypes>>>;
1102
+ /**
1103
+ * Creates a stream for new DM conversations
1104
+ *
1105
+ * @param options - Optional stream options
1106
+ * @returns Stream instance for new DM conversations
1107
+ * @see https://docs.xmtp.org/sdk/stream/#stream-methods
1108
+ */
1109
+ streamDms(options?: StreamOptions<Conversation$1, Dm<ContentTypes>>): Promise<AsyncStreamProxy<Dm<ContentTypes>>>;
1110
+ /**
1111
+ * Reads retained messages after each group's default acknowledgement position.
1112
+ * Set `from` to replay after a cursor without changing default progress.
1113
+ * Set `onValue` for callback mode, or request items with the iterator.
1114
+ * Core owns network recovery. Legacy retry options and `disableSync` do not apply.
1115
+ *
1116
+ * @param options - Optional stream options
1117
+ * @param options.conversationType - Optional conversation type to filter by
1118
+ * @param options.consentStates - Optional array of consent states to filter by
1119
+ * @returns Stream instance for new messages
1120
+ * @see https://docs.xmtp.org/sdk/stream/#stream-methods
1121
+ */
1122
+ streamAllMessages(options?: StreamOptions<Message$1, DecodedMessage<ContentTypes>> & {
1123
+ conversationType?: ConversationType$1;
1124
+ consentStates?: ConsentState$1[];
1125
+ groupIds?: string[];
1126
+ from?: DeliveryCursor$1;
1127
+ }): Promise<MessageStream<Message$1, DecodedMessage<ContentTypes>>>;
1128
+ messageHistorySnapshot(limit: number, options?: {
1129
+ groupIds?: string[];
1130
+ conversationType?: ConversationType$1;
1131
+ consentStates?: ConsentState$1[];
1132
+ }): import("@xmtp/node-bindings").MessageHistorySnapshot;
1133
+ beginningDeliveryCursor(): DeliveryCursor$1;
1134
+ /**
1135
+ * Reads retained group messages with default progress or an explicit replay cursor.
1136
+ *
1137
+ * @param options - Optional stream options
1138
+ * @param options.consentStates - Optional array of consent states to filter by
1139
+ * @returns Stream instance for new group messages
1140
+ * @see https://docs.xmtp.org/sdk/stream/#stream-methods
1141
+ */
1142
+ streamAllGroupMessages(options?: StreamOptions<Message$1, DecodedMessage<ContentTypes>> & {
1143
+ consentStates?: ConsentState$1[];
1144
+ groupIds?: string[];
1145
+ from?: DeliveryCursor$1;
1146
+ }): Promise<MessageStream<Message$1, DecodedMessage<ContentTypes>>>;
1147
+ /**
1148
+ * Reads retained DM messages with default progress or an explicit replay cursor.
1149
+ *
1150
+ * @param options - Optional stream options
1151
+ * @param options.consentStates - Optional array of consent states to filter by
1152
+ * @returns Stream instance for new DM messages
1153
+ * @see https://docs.xmtp.org/sdk/stream/#stream-methods
1154
+ */
1155
+ streamAllDmMessages(options?: StreamOptions<Message$1, DecodedMessage<ContentTypes>> & {
1156
+ consentStates?: ConsentState$1[];
1157
+ groupIds?: string[];
1158
+ from?: DeliveryCursor$1;
1159
+ }): Promise<MessageStream<Message$1, DecodedMessage<ContentTypes>>>;
1160
+ /**
1161
+ * Creates a stream for message deletions that streams the message IDs of
1162
+ * deleted messages
1163
+ *
1164
+ * This is a local stream, does not require network sync, and will not fail
1165
+ * like other streams.
1166
+ *
1167
+ * @param options - Optional stream options
1168
+ * @returns Stream instance for message deletions
1169
+ * @deprecated Use streamDeletedMessages instead
1170
+ */
1171
+ streamMessageDeletions(options?: Omit<StreamOptions<DecodedMessage$1, string>, "disableSync" | "onFail" | "onRetry" | "onRestart" | "retryAttempts" | "retryDelay" | "retryOnFail">): Promise<AsyncStreamProxy<string>>;
1172
+ /**
1173
+ * Creates a stream for message deletions that streams the deleted messages
1174
+ *
1175
+ * This is a local stream, does not require network sync, and will not fail
1176
+ * like other streams.
1177
+ *
1178
+ * @param options - Optional stream options
1179
+ * @returns Stream instance for message deletions
1180
+ */
1181
+ streamDeletedMessages(options?: Omit<StreamOptions<DecodedMessage$1, DecodedMessage<ContentTypes>>, "disableSync" | "onFail" | "onRetry" | "onRestart" | "retryAttempts" | "retryDelay" | "retryOnFail">): Promise<AsyncStreamProxy<DecodedMessage<ContentTypes>>>;
1182
+ /**
1183
+ * Gets the HMAC keys for all conversations
1184
+ *
1185
+ * @returns The HMAC keys for all conversations
1186
+ * @see https://docs.xmtp.org/sdk/push-notifications/
1187
+ */
1188
+ hmacKeys(): Record<string, import("@xmtp/node-bindings").HmacKey[]>;
1172
1189
  }
1173
-
1190
+ //#endregion
1191
+ //#region src/DebugInformation.d.ts
1174
1192
  /**
1175
1193
  * Debug information helpers for the client
1176
1194
  *
1177
1195
  * This class is not intended to be initialized directly.
1178
1196
  */
1179
- declare class DebugInformation {
1180
- #private;
1181
- constructor(client: Client$1);
1182
- apiStatistics(): _xmtp_node_bindings.ApiStats;
1183
- apiIdentityStatistics(): _xmtp_node_bindings.IdentityStats;
1184
- apiAggregateStatistics(): string;
1185
- clearAllStatistics(): void;
1197
+ export declare class DebugInformation {
1198
+ #private;
1199
+ constructor(client: Client$1);
1200
+ apiStatistics(): import("@xmtp/node-bindings").ApiStats;
1201
+ apiIdentityStatistics(): import("@xmtp/node-bindings").IdentityStats;
1202
+ apiAggregateStatistics(): string;
1203
+ clearAllStatistics(): void;
1186
1204
  }
1187
-
1205
+ //#endregion
1206
+ //#region src/Preferences.d.ts
1188
1207
  /**
1189
1208
  * Manages user preferences and consent states
1190
1209
  *
1191
1210
  * This class is not intended to be initialized directly.
1192
1211
  */
1193
- declare class Preferences {
1194
- #private;
1195
- /**
1196
- * Creates a new preferences instance
1197
- *
1198
- * @param client - The client instance managing preferences
1199
- * @param conversations - The underlying conversations instance
1200
- */
1201
- constructor(client: Client$1, conversations: Conversations$1);
1202
- sync(): Promise<_xmtp_node_bindings.GroupSyncSummary>;
1203
- /**
1204
- * Retrieves the current inbox state of this client from the local database
1205
- *
1206
- * @returns Promise that resolves with the inbox state
1207
- */
1208
- inboxState(): Promise<_xmtp_node_bindings.InboxState>;
1209
- /**
1210
- * Retrieves the latest inbox state of this clientfrom the network
1211
- *
1212
- * @returns Promise that resolves with the inbox state
1213
- */
1214
- fetchInboxState(): Promise<_xmtp_node_bindings.InboxState>;
1215
- /**
1216
- * Retrieves the current inbox states for specified inbox IDs from the local
1217
- * database
1218
- *
1219
- * @param inboxIds - Array of inbox IDs to get state for
1220
- * @returns Promise that resolves with the inbox states for the inbox IDs
1221
- */
1222
- getInboxStates(inboxIds: string[]): Promise<_xmtp_node_bindings.InboxState[]>;
1223
- /**
1224
- * Retrieves the latest inbox states for specified inbox IDs from the network
1225
- *
1226
- * @param inboxIds - Array of inbox IDs to get state for
1227
- * @returns Promise that resolves with the inbox states for the inbox IDs
1228
- */
1229
- fetchInboxStates(inboxIds: string[]): Promise<_xmtp_node_bindings.InboxState[]>;
1230
- /**
1231
- * Updates consent states for multiple records
1232
- *
1233
- * @param consentStates - Array of consent records to update
1234
- * @returns Promise that resolves when consent states are updated
1235
- */
1236
- setConsentStates(consentStates: Consent[]): Promise<void>;
1237
- /**
1238
- * Retrieves consent state for a specific entity
1239
- *
1240
- * @param entityType - Type of entity to get consent for
1241
- * @param entity - Entity identifier
1242
- * @returns Promise that resolves with the consent state
1243
- */
1244
- getConsentState(entityType: ConsentEntityType, entity: string): Promise<_xmtp_node_bindings.ConsentState>;
1245
- /**
1246
- * Creates a stream of consent state updates
1247
- *
1248
- * @param options - Optional stream options
1249
- * @returns Stream instance for consent updates
1250
- */
1251
- streamConsent(options?: StreamOptions<Consent[]>): Promise<AsyncStreamProxy<Consent[]>>;
1252
- /**
1253
- * Creates a stream of user preference updates
1254
- *
1255
- * @param options - Optional stream options
1256
- * @returns Stream instance for preference updates
1257
- */
1258
- streamPreferences(options?: StreamOptions<UserPreferenceUpdate[]>): Promise<AsyncStreamProxy<UserPreferenceUpdate[]>>;
1212
+ export declare class Preferences {
1213
+ #private;
1214
+ /**
1215
+ * Creates a new preferences instance
1216
+ *
1217
+ * @param client - The client instance managing preferences
1218
+ * @param conversations - The underlying conversations instance
1219
+ */
1220
+ constructor(client: Client$1, conversations: Conversations$1);
1221
+ sync(): Promise<import("@xmtp/node-bindings").GroupSyncSummary>;
1222
+ /**
1223
+ * Retrieves the current inbox state of this client from the local database
1224
+ *
1225
+ * @returns Promise that resolves with the inbox state
1226
+ */
1227
+ inboxState(): Promise<import("@xmtp/node-bindings").InboxState>;
1228
+ /**
1229
+ * Retrieves the latest inbox state of this clientfrom the network
1230
+ *
1231
+ * @returns Promise that resolves with the inbox state
1232
+ */
1233
+ fetchInboxState(): Promise<import("@xmtp/node-bindings").InboxState>;
1234
+ /**
1235
+ * Retrieves the current inbox states for specified inbox IDs from the local
1236
+ * database
1237
+ *
1238
+ * @param inboxIds - Array of inbox IDs to get state for
1239
+ * @returns Promise that resolves with the inbox states for the inbox IDs
1240
+ */
1241
+ getInboxStates(inboxIds: string[]): Promise<import("@xmtp/node-bindings").InboxState[]>;
1242
+ /**
1243
+ * Retrieves the latest inbox states for specified inbox IDs from the network
1244
+ *
1245
+ * @param inboxIds - Array of inbox IDs to get state for
1246
+ * @returns Promise that resolves with the inbox states for the inbox IDs
1247
+ */
1248
+ fetchInboxStates(inboxIds: string[]): Promise<import("@xmtp/node-bindings").InboxState[]>;
1249
+ /**
1250
+ * Updates consent states for multiple records
1251
+ *
1252
+ * @param consentStates - Array of consent records to update
1253
+ * @returns Promise that resolves when consent states are updated
1254
+ */
1255
+ setConsentStates(consentStates: Consent$1[]): Promise<void>;
1256
+ /**
1257
+ * Retrieves consent state for a specific entity
1258
+ *
1259
+ * @param entityType - Type of entity to get consent for
1260
+ * @param entity - Entity identifier
1261
+ * @returns Promise that resolves with the consent state
1262
+ */
1263
+ getConsentState(entityType: ConsentEntityType$1, entity: string): Promise<import("@xmtp/node-bindings").ConsentState>;
1264
+ /**
1265
+ * Creates a stream of consent state updates
1266
+ *
1267
+ * @param options - Optional stream options
1268
+ * @returns Stream instance for consent updates
1269
+ */
1270
+ streamConsent(options?: StreamOptions<Consent$1[]>): Promise<AsyncStreamProxy<Consent$1[]>>;
1271
+ /**
1272
+ * Creates a stream of user preference updates
1273
+ *
1274
+ * @param options - Optional stream options
1275
+ * @returns Stream instance for preference updates
1276
+ */
1277
+ streamPreferences(options?: StreamOptions<UserPreferenceUpdate$1[]>): Promise<AsyncStreamProxy<UserPreferenceUpdate$1[]>>;
1259
1278
  }
1260
-
1279
+ //#endregion
1280
+ //#region src/Client.d.ts
1261
1281
  /**
1262
1282
  * Client for interacting with the XMTP network
1263
1283
  */
1264
- declare class Client<ContentTypes = ExtractCodecContentTypes> {
1265
- #private;
1266
- /**
1267
- * Creates a new XMTP client instance
1268
- *
1269
- * This class is not intended to be initialized directly.
1270
- * Use `Client.create` or `Client.build` instead.
1271
- *
1272
- * @param options - Optional configuration for the client
1273
- */
1274
- constructor(options?: ClientOptions);
1275
- /**
1276
- * Initializes the client with the provided identifier
1277
- *
1278
- * This is not meant to be called directly.
1279
- * Use `Client.create` or `Client.build` instead.
1280
- *
1281
- * @param identifier - The identifier to initialize the client with
1282
- */
1283
- init(identifier: Identifier): Promise<void>;
1284
- /**
1285
- * Creates a new client instance with a signer
1286
- *
1287
- * @param signer - The signer to use for authentication
1288
- * @param options - Optional configuration for the client
1289
- * @returns A new client instance
1290
- */
1291
- static create<ContentCodecs extends ContentCodec[] = []>(signer: Signer, options: DistributiveOmit<ClientOptions, "codecs"> & {
1292
- codecs?: ContentCodecs;
1293
- }): Promise<Client<ExtractCodecContentTypes<ContentCodecs>>>;
1294
- /**
1295
- * Creates a new client instance with an identifier
1296
- *
1297
- * Clients created with this method must already be registered.
1298
- * Any methods called that require a signer will throw an error.
1299
- *
1300
- * @param identifier - The identifier to use
1301
- * @param options - Optional configuration for the client
1302
- * @returns A new client instance
1303
- */
1304
- static build<ContentCodecs extends ContentCodec[] = []>(identifier: Identifier, options: DistributiveOmit<ClientOptions, "codecs"> & {
1305
- codecs?: ContentCodecs;
1306
- }): Promise<Client<ExtractCodecContentTypes<ContentCodecs>>>;
1307
- /**
1308
- * Gets the version of libxmtp used in the bindings
1309
- */
1310
- get libxmtpVersion(): string | undefined;
1311
- /**
1312
- * Gets the app version used by the client
1313
- */
1314
- get appVersion(): string | undefined;
1315
- /**
1316
- * Gets the label used for the default database file name
1317
- *
1318
- * @throws {ClientNotInitializedError} if the client is not initialized
1319
- */
1320
- get env(): string;
1321
- /**
1322
- * Gets the client options
1323
- */
1324
- get options(): ClientOptions | undefined;
1325
- /**
1326
- * Gets the signer associated with this client
1327
- */
1328
- get signer(): Signer | undefined;
1329
- /**
1330
- * Gets the account identifier for this client
1331
- */
1332
- get accountIdentifier(): Identifier | undefined;
1333
- /**
1334
- * Gets the inbox ID associated with this client
1335
- */
1336
- get inboxId(): string;
1337
- /**
1338
- * Gets the installation ID for this client
1339
- */
1340
- get installationId(): string;
1341
- /**
1342
- * Gets the installation ID bytes for this client
1343
- */
1344
- get installationIdBytes(): Uint8Array<ArrayBufferLike>;
1345
- /**
1346
- * Gets whether the client is registered with the XMTP network
1347
- *
1348
- * @throws {ClientNotInitializedError} if the client is not initialized
1349
- */
1350
- get isRegistered(): boolean;
1351
- /**
1352
- * Gets the conversations manager for this client
1353
- *
1354
- * @throws {ClientNotInitializedError} if the client is not initialized
1355
- */
1356
- get conversations(): Conversations<ContentTypes>;
1357
- /**
1358
- * Gets the debug information helpersfor this client
1359
- *
1360
- * @throws {ClientNotInitializedError} if the client is not initialized
1361
- */
1362
- get debugInformation(): DebugInformation;
1363
- /**
1364
- * Gets the preferences manager for this client
1365
- *
1366
- * @throws {ClientNotInitializedError} if the client is not initialized
1367
- */
1368
- get preferences(): Preferences;
1369
- /**
1370
- * Cleanly shuts down the client: cancels in-flight workers and detached
1371
- * streams, then releases the database connection.
1372
- *
1373
- * This is idempotent — calling it more than once resolves without error.
1374
- * Await this before deleting the database file or dropping the client
1375
- * reference to avoid log noise from background tasks running against a
1376
- * closed database.
1377
- *
1378
- * @throws {ClientNotInitializedError} if the client is not initialized
1379
- * @returns Promise that resolves when the client has shut down
1380
- */
1381
- close(): Promise<void>;
1382
- /**
1383
- * Adds a signature to a signature request using the client's signer (or the
1384
- * provided signer)
1385
- *
1386
- * WARNING: This function should be used with caution. It is only provided
1387
- * for use in special cases where the provided workflows do not meet the
1388
- * requirements of an application.
1389
- *
1390
- * It is highly recommended to use the `register`, `unsafe_addAccount`,
1391
- * `removeAccount`, `revokeAllOtherInstallations`, or `revokeInstallations`
1392
- * methods instead.
1393
- *
1394
- * @param signatureRequest - The signature request to add the signature to
1395
- * @throws {ClientNotInitializedError} if the client is not initialized
1396
- * @throws {SignerUnavailableError} if no signer is available
1397
- */
1398
- unsafe_addSignature(signatureRequest: SignatureRequestHandle, signer?: Signer): Promise<void>;
1399
- /**
1400
- * Returns a signature request handler for creating a new inbox
1401
- *
1402
- * WARNING: This function should be used with caution. It is only provided
1403
- * for use in special cases where the provided workflows do not meet the
1404
- * requirements of an application.
1405
- *
1406
- * It is highly recommended to use the `register` method instead.
1407
- *
1408
- * @returns The signature text
1409
- * @throws {ClientNotInitializedError} if the client is not initialized
1410
- */
1411
- unsafe_createInboxSignatureRequest(): Promise<SignatureRequestHandle | null>;
1412
- /**
1413
- * Returns a signature request handler for adding a new account to the
1414
- * client's inbox
1415
- *
1416
- * WARNING: This function should be used with caution. It is only provided
1417
- * for use in special cases where the provided workflows do not meet the
1418
- * requirements of an application.
1419
- *
1420
- * It is highly recommended to use the `unsafe_addAccount` method instead.
1421
- *
1422
- * The `allowInboxReassign` parameter must be true or this function will
1423
- * throw an error.
1424
- *
1425
- * @param newAccountIdentifier - The identifier of the new account
1426
- * @param allowInboxReassign - Whether to allow inbox reassignment
1427
- * @returns The signature text
1428
- * @throws {ClientNotInitializedError} if the client is not initialized
1429
- */
1430
- unsafe_addAccountSignatureRequest(newAccountIdentifier: Identifier, allowInboxReassign?: boolean): Promise<SignatureRequestHandle>;
1431
- /**
1432
- * Returns a signature request handler for removing an account from the
1433
- * client's inbox
1434
- *
1435
- * WARNING: This function should be used with caution. It is only provided
1436
- * for use in special cases where the provided workflows do not meet the
1437
- * requirements of an application.
1438
- *
1439
- * It is highly recommended to use the `removeAccount` method instead.
1440
- *
1441
- * @param identifier - The identifier of the account to remove
1442
- * @returns The signature text
1443
- * @throws {ClientNotInitializedError} if the client is not initialized
1444
- */
1445
- unsafe_removeAccountSignatureRequest(identifier: Identifier): Promise<SignatureRequestHandle>;
1446
- /**
1447
- * Returns a signature request handler for revoking all other installations
1448
- * of the client's inbox
1449
- *
1450
- * WARNING: This function should be used with caution. It is only provided
1451
- * for use in special cases where the provided workflows do not meet the
1452
- * requirements of an application.
1453
- *
1454
- * It is highly recommended to use the `revokeAllOtherInstallations` method instead.
1455
- *
1456
- * @returns The signature text
1457
- * @throws {ClientNotInitializedError} if the client is not initialized
1458
- */
1459
- unsafe_revokeAllOtherInstallationsSignatureRequest(): Promise<SignatureRequestHandle | null>;
1460
- /**
1461
- * Returns a signature request handler for revoking specific installations
1462
- * of the client's inbox
1463
- *
1464
- * WARNING: This function should be used with caution. It is only provided
1465
- * for use in special cases where the provided workflows do not meet the
1466
- * requirements of an application.
1467
- *
1468
- * It is highly recommended to use the `revokeInstallations` method instead.
1469
- *
1470
- * @param installationIds - The installation IDs to revoke
1471
- * @returns The signature text
1472
- * @throws {ClientNotInitializedError} if the client is not initialized
1473
- */
1474
- unsafe_revokeInstallationsSignatureRequest(installationIds: Uint8Array[]): Promise<SignatureRequestHandle>;
1475
- /**
1476
- * Returns a signature request handler for changing the recovery identifier
1477
- * for this client's inbox
1478
- *
1479
- * WARNING: This function should be used with caution. It is only provided
1480
- * for use in special cases where the provided workflows do not meet the
1481
- * requirements of an application.
1482
- *
1483
- * It is highly recommended to use the `changeRecoveryIdentifier` method instead.
1484
- *
1485
- * @param identifier - The new recovery identifier
1486
- * @returns The signature text
1487
- * @throws {ClientNotInitializedError} if the client is not initialized
1488
- */
1489
- unsafe_changeRecoveryIdentifierSignatureRequest(identifier: Identifier): Promise<SignatureRequestHandle>;
1490
- /**
1491
- * Applies a signature request to the client
1492
- *
1493
- * WARNING: This function should be used with caution. It is only provided
1494
- * for use in special cases where the provided workflows do not meet the
1495
- * requirements of an application.
1496
- *
1497
- * It is highly recommended to use the `register`, `unsafe_addAccount`,
1498
- * `removeAccount`, `revokeAllOtherInstallations`, or `revokeInstallations`
1499
- * methods instead.
1500
- *
1501
- * @throws {ClientNotInitializedError} if the client is not initialized
1502
- */
1503
- unsafe_applySignatureRequest(signatureRequest: SignatureRequestHandle): Promise<void>;
1504
- /**
1505
- * Registers the client with the XMTP network
1506
- *
1507
- * Requires a signer, use `Client.create` to create a client with a signer.
1508
- *
1509
- * @throws {ClientNotInitializedError} if the client is not initialized
1510
- * @throws {SignerUnavailableError} if no signer is available
1511
- */
1512
- register(): Promise<void>;
1513
- /**
1514
- * Adds a new account to the client inbox
1515
- *
1516
- * WARNING: This function should be used with caution. Adding a wallet already
1517
- * associated with an inbox ID will cause the wallet to lose access to
1518
- * that inbox.
1519
- *
1520
- * The `allowInboxReassign` parameter must be true to reassign an inbox
1521
- * already associated with a different account.
1522
- *
1523
- * Requires a signer, use `Client.create` to create a client with a signer.
1524
- *
1525
- * @param newAccountSigner - The signer for the new account
1526
- * @param allowInboxReassign - Whether to allow inbox reassignment
1527
- * @throws {AccountAlreadyAssociatedError} if the account is already associated with an inbox ID
1528
- * @throws {ClientNotInitializedError} if the client is not initialized
1529
- * @throws {SignerUnavailableError} if no signer is available
1530
- */
1531
- unsafe_addAccount(newAccountSigner: Signer, allowInboxReassign?: boolean): Promise<void>;
1532
- /**
1533
- * Removes an account from the client's inbox
1534
- *
1535
- * Requires a signer, use `Client.create` to create a client with a signer.
1536
- *
1537
- * @param identifier - The identifier of the account to remove
1538
- * @throws {ClientNotInitializedError} if the client is not initialized
1539
- * @throws {SignerUnavailableError} if no signer is available
1540
- */
1541
- removeAccount(identifier: Identifier): Promise<void>;
1542
- /**
1543
- * Revokes all other installations of the client's inbox
1544
- *
1545
- * Requires a signer, use `Client.create` to create a client with a signer.
1546
- *
1547
- * @throws {ClientNotInitializedError} if the client is not initialized
1548
- * @throws {SignerUnavailableError} if no signer is available
1549
- */
1550
- revokeAllOtherInstallations(): Promise<void>;
1551
- /**
1552
- * Revokes specific installations of the client's inbox
1553
- *
1554
- * Requires a signer, use `Client.create` to create a client with a signer.
1555
- *
1556
- * @param installationIds - The installation IDs to revoke
1557
- * @throws {ClientNotInitializedError} if the client is not initialized
1558
- * @throws {SignerUnavailableError} if no signer is available
1559
- */
1560
- revokeInstallations(installationIds: Uint8Array[]): Promise<void>;
1561
- /** Revoke installations with an explicit backend or network options. */
1562
- static revokeInstallations(signer: Signer, inboxId: string, installationIds: Uint8Array[], optionsOrBackend: NetworkOptions | Backend): Promise<void>;
1563
- /**
1564
- * Changes the recovery identifier for the client's inbox
1565
- *
1566
- * Requires a signer, use `Client.create` to create a client with a signer.
1567
- *
1568
- * @param identifier - The new recovery identifier
1569
- * @throws {ClientNotInitializedError} if the client is not initialized
1570
- * @throws {SignerUnavailableError} if no signer is available
1571
- */
1572
- changeRecoveryIdentifier(identifier: Identifier): Promise<void>;
1573
- /**
1574
- * Checks if the client can message the specified identifiers
1575
- *
1576
- * @param identifiers - The identifiers to check
1577
- * @returns Whether the client can message the identifiers
1578
- * @throws {ClientNotInitializedError} if the client is not initialized
1579
- */
1580
- canMessage(identifiers: Identifier[]): Promise<Map<string, boolean>>;
1581
- /**
1582
- * Fetches the latest inbox updates count for the specified inbox IDs
1583
- *
1584
- * @param inboxIds - The inbox IDs to check
1585
- * @returns Map of inbox IDs to their updates count
1586
- * @throws {ClientNotInitializedError} if the client is not initialized
1587
- */
1588
- fetchLatestInboxUpdatesCount(inboxIds: string[]): Promise<Map<string, number>>;
1589
- /**
1590
- * Fetches the latest inbox updates count for the client's inbox
1591
- *
1592
- * @returns The latest inbox updates count
1593
- * @throws {ClientNotInitializedError} if the client is not initialized
1594
- */
1595
- fetchOwnInboxUpdatesCount(): Promise<number>;
1596
- /**
1597
- * Fetches the key package statuses from the network for the specified
1598
- * installation IDs
1599
- *
1600
- * @param installationIds - The installation IDs to check
1601
- * @returns The key package statuses
1602
- * @throws {ClientNotInitializedError} if the client is not initialized
1603
- */
1604
- fetchKeyPackageStatuses(installationIds: string[]): Promise<Record<string, _xmtp_node_bindings.KeyPackageStatus>>;
1605
- /**
1606
- * Fetches the inbox ID for a given identifier from the local database
1607
- * If not found, fetches from the network
1608
- *
1609
- * @param identifier - The identifier to look up
1610
- * @returns The inbox ID, if found
1611
- * @throws {ClientNotInitializedError} if the client is not initialized
1612
- */
1613
- fetchInboxIdByIdentifier(identifier: Identifier): Promise<string | null>;
1614
- /**
1615
- * Signs a message with the installation key
1616
- *
1617
- * @param signatureText - The text to sign
1618
- * @returns The signature
1619
- * @throws {ClientNotInitializedError} if the client is not initialized
1620
- */
1621
- signWithInstallationKey(signatureText: string): Uint8Array<ArrayBufferLike>;
1622
- /**
1623
- * Verifies a signature was made with the installation key
1624
- *
1625
- * @param signatureText - The text that was signed
1626
- * @param signatureBytes - The signature bytes to verify
1627
- * @returns Whether the signature is valid
1628
- * @throws {ClientNotInitializedError} if the client is not initialized
1629
- */
1630
- verifySignedWithInstallationKey(signatureText: string, signatureBytes: Uint8Array): boolean;
1631
- /** Fetch inbox states with an explicit backend or network options. */
1632
- static fetchInboxStates(inboxIds: string[], optionsOrBackend: NetworkOptions | Backend): Promise<_xmtp_node_bindings.InboxState[]>;
1633
- /** Fetch inbox update counts with an explicit backend or network options. */
1634
- static fetchLatestInboxUpdatesCount(inboxIds: string[], optionsOrBackend: NetworkOptions | Backend): Promise<Map<string, number>>;
1635
- /** Check identifiers with an explicit backend or network options. */
1636
- static canMessage(identifiers: Identifier[], optionsOrBackend: NetworkOptions | Backend): Promise<Map<string, boolean>>;
1637
- /**
1638
- * Verifies a signature was made with a public key
1639
- *
1640
- * @param signatureText - The text that was signed
1641
- * @param signatureBytes - The signature bytes to verify
1642
- * @param publicKey - The public key to verify against
1643
- * @returns Whether the signature is valid
1644
- */
1645
- static verifySignedWithPublicKey(signatureText: string, signatureBytes: Uint8Array, publicKey: Uint8Array): boolean;
1646
- /** Check address authorization with an explicit backend or network options. */
1647
- static isAddressAuthorized(inboxId: string, address: string, optionsOrBackend: NetworkOptions | Backend): Promise<boolean>;
1648
- /** Check installation authorization with an explicit backend or network options. */
1649
- static isInstallationAuthorized(inboxId: string, installation: Uint8Array, optionsOrBackend: NetworkOptions | Backend): Promise<boolean>;
1650
- /**
1651
- * Archive application elements to file for later restoration
1652
- *
1653
- * @param path - The file path to save the archive
1654
- * @param key - Encryption key for the archive
1655
- * @param opts - Archive options specifying what to include (defaults to consent and messages)
1656
- * @returns Promise that resolves when the archive is created
1657
- */
1658
- createArchive(path: string, key: Uint8Array, opts?: ArchiveOptions): Promise<void>;
1659
- /**
1660
- * Import a previous archive from a file
1661
- *
1662
- * @param path - The file path to the archive
1663
- * @param key - Encryption key for the archive
1664
- * @returns Promise that resolves when the archive is imported
1665
- */
1666
- importArchive(path: string, key: Uint8Array): Promise<void>;
1667
- /**
1668
- * Load the metadata for an archive to see what it contains
1669
- *
1670
- * Reads only the metadata without loading the entire file, so this function is quick.
1671
- *
1672
- * @param path - The file path to the archive
1673
- * @param key - Encryption key for the archive
1674
- * @returns Promise that resolves with the archive metadata
1675
- */
1676
- archiveMetadata(path: string, key: Uint8Array): Promise<ArchiveMetadata>;
1677
- /**
1678
- * Manually sync all device sync groups
1679
- *
1680
- * @returns Promise that resolves with a summary of the sync operation
1681
- */
1682
- syncAllDeviceSyncGroups(): Promise<GroupSyncSummary>;
1683
- /** Enable notifications and register the delivery channel. */
1684
- enableNotifications(config: NotificationConfig): Promise<NotificationState>;
1685
- /** Disable notifications. Per-conversation overrides remain stored. */
1686
- disableNotifications(): Promise<void>;
1687
- /** Read the local state without a backend request. */
1688
- notificationState(): Promise<NotificationState>;
1689
- /**
1690
- * What the deployment published about itself, as this client resolved it
1691
- * when it was built.
1692
- *
1693
- * Reads memory and makes no backend request. The value never changes for the
1694
- * life of the client: a background refresh rewrites the stored copy, and a
1695
- * new value takes effect at the next build.
1696
- *
1697
- * @throws {ClientNotInitializedError} if the client is not initialized
1698
- */
1699
- serverConfiguration(): ServerConfiguration;
1700
- /**
1701
- * Fetch the deployment configuration now, rewrite the stored copy, and
1702
- * return what was fetched.
1703
- *
1704
- * The snapshot this client holds is unchanged; use it to observe a change an
1705
- * operator has made without restarting.
1706
- *
1707
- * @throws {ClientNotInitializedError} if the client is not initialized
1708
- * @throws {ConfigurationUnavailableError} if the deployment did not answer
1709
- * @throws {ConfigurationInvalidError} if it published an unusable configuration
1710
- * @throws {BackendMismatchError} if it published a different identifier
1711
- * @throws {ClientVersionTooOldError} if it now requires a newer libxmtp
1712
- */
1713
- refreshServerConfiguration(): Promise<ServerConfiguration>;
1714
- /**
1715
- * Read what a deployment publishes about itself with no database, no client,
1716
- * and no credential.
1717
- *
1718
- * Lets an app learn `auth.enabled`, `auth.requiredScopes`, and the accepted
1719
- * smart contract wallet chains before it decides how to build a client.
1720
- * Nothing is stored and no identifier binding is applied.
1721
- *
1722
- * @param target - A backend URL, network options, or an existing backend
1723
- * @throws {ConfigurationUnavailableError} if the deployment did not answer
1724
- * @throws {ConfigurationInvalidError} if it published an unusable configuration
1725
- */
1726
- static fetchServerConfiguration(target: string | NetworkOptions | Backend): Promise<ServerConfiguration>;
1284
+ export declare class Client<ContentTypes = ExtractCodecContentTypes> {
1285
+ #private;
1286
+ /**
1287
+ * Creates a new XMTP client instance
1288
+ *
1289
+ * This class is not intended to be initialized directly.
1290
+ * Use `Client.create` or `Client.build` instead.
1291
+ *
1292
+ * @param options - Optional configuration for the client
1293
+ */
1294
+ constructor(options?: ClientOptions);
1295
+ /**
1296
+ * Initializes the client with the provided identifier
1297
+ *
1298
+ * This is not meant to be called directly.
1299
+ * Use `Client.create` or `Client.build` instead.
1300
+ *
1301
+ * @param identifier - The identifier to initialize the client with
1302
+ */
1303
+ init(identifier: Identifier$1): Promise<void>;
1304
+ /**
1305
+ * Creates a new client instance with a signer
1306
+ *
1307
+ * @param signer - The signer to use for authentication
1308
+ * @param options - Optional configuration for the client
1309
+ * @returns A new client instance
1310
+ */
1311
+ static create<ContentCodecs extends ContentCodec[] = []>(signer: Signer, options: DistributiveOmit<ClientOptions, "codecs"> & {
1312
+ codecs?: ContentCodecs;
1313
+ }): Promise<Client<ExtractCodecContentTypes<ContentCodecs>>>;
1314
+ /**
1315
+ * Creates a new client instance with an identifier
1316
+ *
1317
+ * Clients created with this method must already be registered.
1318
+ * Any methods called that require a signer will throw an error.
1319
+ *
1320
+ * @param identifier - The identifier to use
1321
+ * @param options - Optional configuration for the client
1322
+ * @returns A new client instance
1323
+ */
1324
+ static build<ContentCodecs extends ContentCodec[] = []>(identifier: Identifier$1, options: DistributiveOmit<ClientOptions, "codecs"> & {
1325
+ codecs?: ContentCodecs;
1326
+ }): Promise<Client<ExtractCodecContentTypes<ContentCodecs>>>;
1327
+ /**
1328
+ * Gets the version of libxmtp used in the bindings
1329
+ */
1330
+ get libxmtpVersion(): string | undefined;
1331
+ /**
1332
+ * Gets the app version used by the client
1333
+ */
1334
+ get appVersion(): string | undefined;
1335
+ /**
1336
+ * Gets the label used for the default database file name
1337
+ *
1338
+ * @throws {ClientNotInitializedError} if the client is not initialized
1339
+ */
1340
+ get env(): string;
1341
+ /**
1342
+ * Gets the client options
1343
+ */
1344
+ get options(): ClientOptions | undefined;
1345
+ /**
1346
+ * Gets the signer associated with this client
1347
+ */
1348
+ get signer(): Signer | undefined;
1349
+ /**
1350
+ * Gets the account identifier for this client
1351
+ */
1352
+ get accountIdentifier(): Identifier$1 | undefined;
1353
+ /**
1354
+ * Gets the inbox ID associated with this client
1355
+ */
1356
+ get inboxId(): string;
1357
+ /**
1358
+ * Gets the installation ID for this client
1359
+ */
1360
+ get installationId(): string;
1361
+ /**
1362
+ * Gets the installation ID bytes for this client
1363
+ */
1364
+ get installationIdBytes(): Uint8Array<ArrayBufferLike>;
1365
+ /**
1366
+ * Gets whether the client is registered with the XMTP network
1367
+ *
1368
+ * @throws {ClientNotInitializedError} if the client is not initialized
1369
+ */
1370
+ get isRegistered(): boolean;
1371
+ /**
1372
+ * Gets the conversations manager for this client
1373
+ *
1374
+ * @throws {ClientNotInitializedError} if the client is not initialized
1375
+ */
1376
+ get conversations(): Conversations<ContentTypes>;
1377
+ /**
1378
+ * Gets the debug information helpersfor this client
1379
+ *
1380
+ * @throws {ClientNotInitializedError} if the client is not initialized
1381
+ */
1382
+ get debugInformation(): DebugInformation;
1383
+ /**
1384
+ * Gets the preferences manager for this client
1385
+ *
1386
+ * @throws {ClientNotInitializedError} if the client is not initialized
1387
+ */
1388
+ get preferences(): Preferences;
1389
+ /**
1390
+ * Cleanly shuts down the client: cancels in-flight workers and detached
1391
+ * streams, then releases the database connection.
1392
+ *
1393
+ * This is idempotent — calling it more than once resolves without error.
1394
+ * Await this before deleting the database file or dropping the client
1395
+ * reference to avoid log noise from background tasks running against a
1396
+ * closed database.
1397
+ *
1398
+ * @throws {ClientNotInitializedError} if the client is not initialized
1399
+ * @returns Promise that resolves when the client has shut down
1400
+ */
1401
+ close(): Promise<void>;
1402
+ /**
1403
+ * Adds a signature to a signature request using the client's signer (or the
1404
+ * provided signer)
1405
+ *
1406
+ * WARNING: This function should be used with caution. It is only provided
1407
+ * for use in special cases where the provided workflows do not meet the
1408
+ * requirements of an application.
1409
+ *
1410
+ * It is highly recommended to use the `register`, `unsafe_addAccount`,
1411
+ * `removeAccount`, `revokeAllOtherInstallations`, or `revokeInstallations`
1412
+ * methods instead.
1413
+ *
1414
+ * @param signatureRequest - The signature request to add the signature to
1415
+ * @throws {ClientNotInitializedError} if the client is not initialized
1416
+ * @throws {SignerUnavailableError} if no signer is available
1417
+ */
1418
+ unsafe_addSignature(signatureRequest: SignatureRequestHandle$1, signer?: Signer): Promise<void>;
1419
+ /**
1420
+ * Returns a signature request handler for creating a new inbox
1421
+ *
1422
+ * WARNING: This function should be used with caution. It is only provided
1423
+ * for use in special cases where the provided workflows do not meet the
1424
+ * requirements of an application.
1425
+ *
1426
+ * It is highly recommended to use the `register` method instead.
1427
+ *
1428
+ * @returns The signature text
1429
+ * @throws {ClientNotInitializedError} if the client is not initialized
1430
+ */
1431
+ unsafe_createInboxSignatureRequest(): Promise<SignatureRequestHandle$1 | null>;
1432
+ /**
1433
+ * Returns a signature request handler for adding a new account to the
1434
+ * client's inbox
1435
+ *
1436
+ * WARNING: This function should be used with caution. It is only provided
1437
+ * for use in special cases where the provided workflows do not meet the
1438
+ * requirements of an application.
1439
+ *
1440
+ * It is highly recommended to use the `unsafe_addAccount` method instead.
1441
+ *
1442
+ * The `allowInboxReassign` parameter must be true or this function will
1443
+ * throw an error.
1444
+ *
1445
+ * @param newAccountIdentifier - The identifier of the new account
1446
+ * @param allowInboxReassign - Whether to allow inbox reassignment
1447
+ * @returns The signature text
1448
+ * @throws {ClientNotInitializedError} if the client is not initialized
1449
+ */
1450
+ unsafe_addAccountSignatureRequest(newAccountIdentifier: Identifier$1, allowInboxReassign?: boolean): Promise<SignatureRequestHandle$1>;
1451
+ /**
1452
+ * Returns a signature request handler for removing an account from the
1453
+ * client's inbox
1454
+ *
1455
+ * WARNING: This function should be used with caution. It is only provided
1456
+ * for use in special cases where the provided workflows do not meet the
1457
+ * requirements of an application.
1458
+ *
1459
+ * It is highly recommended to use the `removeAccount` method instead.
1460
+ *
1461
+ * @param identifier - The identifier of the account to remove
1462
+ * @returns The signature text
1463
+ * @throws {ClientNotInitializedError} if the client is not initialized
1464
+ */
1465
+ unsafe_removeAccountSignatureRequest(identifier: Identifier$1): Promise<SignatureRequestHandle$1>;
1466
+ /**
1467
+ * Returns a signature request handler for revoking all other installations
1468
+ * of the client's inbox
1469
+ *
1470
+ * WARNING: This function should be used with caution. It is only provided
1471
+ * for use in special cases where the provided workflows do not meet the
1472
+ * requirements of an application.
1473
+ *
1474
+ * It is highly recommended to use the `revokeAllOtherInstallations` method instead.
1475
+ *
1476
+ * @returns The signature text
1477
+ * @throws {ClientNotInitializedError} if the client is not initialized
1478
+ */
1479
+ unsafe_revokeAllOtherInstallationsSignatureRequest(): Promise<SignatureRequestHandle$1 | null>;
1480
+ /**
1481
+ * Returns a signature request handler for revoking specific installations
1482
+ * of the client's inbox
1483
+ *
1484
+ * WARNING: This function should be used with caution. It is only provided
1485
+ * for use in special cases where the provided workflows do not meet the
1486
+ * requirements of an application.
1487
+ *
1488
+ * It is highly recommended to use the `revokeInstallations` method instead.
1489
+ *
1490
+ * @param installationIds - The installation IDs to revoke
1491
+ * @returns The signature text
1492
+ * @throws {ClientNotInitializedError} if the client is not initialized
1493
+ */
1494
+ unsafe_revokeInstallationsSignatureRequest(installationIds: Uint8Array[]): Promise<SignatureRequestHandle$1>;
1495
+ /**
1496
+ * Returns a signature request handler for changing the recovery identifier
1497
+ * for this client's inbox
1498
+ *
1499
+ * WARNING: This function should be used with caution. It is only provided
1500
+ * for use in special cases where the provided workflows do not meet the
1501
+ * requirements of an application.
1502
+ *
1503
+ * It is highly recommended to use the `changeRecoveryIdentifier` method instead.
1504
+ *
1505
+ * @param identifier - The new recovery identifier
1506
+ * @returns The signature text
1507
+ * @throws {ClientNotInitializedError} if the client is not initialized
1508
+ */
1509
+ unsafe_changeRecoveryIdentifierSignatureRequest(identifier: Identifier$1): Promise<SignatureRequestHandle$1>;
1510
+ /**
1511
+ * Applies a signature request to the client
1512
+ *
1513
+ * WARNING: This function should be used with caution. It is only provided
1514
+ * for use in special cases where the provided workflows do not meet the
1515
+ * requirements of an application.
1516
+ *
1517
+ * It is highly recommended to use the `register`, `unsafe_addAccount`,
1518
+ * `removeAccount`, `revokeAllOtherInstallations`, or `revokeInstallations`
1519
+ * methods instead.
1520
+ *
1521
+ * @throws {ClientNotInitializedError} if the client is not initialized
1522
+ */
1523
+ unsafe_applySignatureRequest(signatureRequest: SignatureRequestHandle$1): Promise<void>;
1524
+ /**
1525
+ * Registers the client with the XMTP network
1526
+ *
1527
+ * Requires a signer, use `Client.create` to create a client with a signer.
1528
+ *
1529
+ * @throws {ClientNotInitializedError} if the client is not initialized
1530
+ * @throws {SignerUnavailableError} if no signer is available
1531
+ */
1532
+ register(): Promise<void>;
1533
+ /**
1534
+ * Adds a new account to the client inbox
1535
+ *
1536
+ * WARNING: This function should be used with caution. Adding a wallet already
1537
+ * associated with an inbox ID will cause the wallet to lose access to
1538
+ * that inbox.
1539
+ *
1540
+ * The `allowInboxReassign` parameter must be true to reassign an inbox
1541
+ * already associated with a different account.
1542
+ *
1543
+ * Requires a signer, use `Client.create` to create a client with a signer.
1544
+ *
1545
+ * @param newAccountSigner - The signer for the new account
1546
+ * @param allowInboxReassign - Whether to allow inbox reassignment
1547
+ * @throws {AccountAlreadyAssociatedError} if the account is already associated with an inbox ID
1548
+ * @throws {ClientNotInitializedError} if the client is not initialized
1549
+ * @throws {SignerUnavailableError} if no signer is available
1550
+ */
1551
+ unsafe_addAccount(newAccountSigner: Signer, allowInboxReassign?: boolean): Promise<void>;
1552
+ /**
1553
+ * Removes an account from the client's inbox
1554
+ *
1555
+ * Requires a signer, use `Client.create` to create a client with a signer.
1556
+ *
1557
+ * @param identifier - The identifier of the account to remove
1558
+ * @throws {ClientNotInitializedError} if the client is not initialized
1559
+ * @throws {SignerUnavailableError} if no signer is available
1560
+ */
1561
+ removeAccount(identifier: Identifier$1): Promise<void>;
1562
+ /**
1563
+ * Revokes all other installations of the client's inbox
1564
+ *
1565
+ * Requires a signer, use `Client.create` to create a client with a signer.
1566
+ *
1567
+ * @throws {ClientNotInitializedError} if the client is not initialized
1568
+ * @throws {SignerUnavailableError} if no signer is available
1569
+ */
1570
+ revokeAllOtherInstallations(): Promise<void>;
1571
+ /**
1572
+ * Revokes specific installations of the client's inbox
1573
+ *
1574
+ * Requires a signer, use `Client.create` to create a client with a signer.
1575
+ *
1576
+ * @param installationIds - The installation IDs to revoke
1577
+ * @throws {ClientNotInitializedError} if the client is not initialized
1578
+ * @throws {SignerUnavailableError} if no signer is available
1579
+ */
1580
+ revokeInstallations(installationIds: Uint8Array[]): Promise<void>;
1581
+ /** Revoke installations with an explicit backend or network options. */
1582
+ static revokeInstallations(signer: Signer, inboxId: string, installationIds: Uint8Array[], optionsOrBackend: NetworkOptions | Backend$1): Promise<void>;
1583
+ /**
1584
+ * Changes the recovery identifier for the client's inbox
1585
+ *
1586
+ * Requires a signer, use `Client.create` to create a client with a signer.
1587
+ *
1588
+ * @param identifier - The new recovery identifier
1589
+ * @throws {ClientNotInitializedError} if the client is not initialized
1590
+ * @throws {SignerUnavailableError} if no signer is available
1591
+ */
1592
+ changeRecoveryIdentifier(identifier: Identifier$1): Promise<void>;
1593
+ /**
1594
+ * Checks if the client can message the specified identifiers
1595
+ *
1596
+ * @param identifiers - The identifiers to check
1597
+ * @returns Whether the client can message the identifiers
1598
+ * @throws {ClientNotInitializedError} if the client is not initialized
1599
+ */
1600
+ canMessage(identifiers: Identifier$1[]): Promise<Map<string, boolean>>;
1601
+ /**
1602
+ * Fetches the latest inbox updates count for the specified inbox IDs
1603
+ *
1604
+ * @param inboxIds - The inbox IDs to check
1605
+ * @returns Map of inbox IDs to their updates count
1606
+ * @throws {ClientNotInitializedError} if the client is not initialized
1607
+ */
1608
+ fetchLatestInboxUpdatesCount(inboxIds: string[]): Promise<Map<string, number>>;
1609
+ /**
1610
+ * Fetches the latest inbox updates count for the client's inbox
1611
+ *
1612
+ * @returns The latest inbox updates count
1613
+ * @throws {ClientNotInitializedError} if the client is not initialized
1614
+ */
1615
+ fetchOwnInboxUpdatesCount(): Promise<number>;
1616
+ /**
1617
+ * Fetches the key package statuses from the network for the specified
1618
+ * installation IDs
1619
+ *
1620
+ * @param installationIds - The installation IDs to check
1621
+ * @returns The key package statuses
1622
+ * @throws {ClientNotInitializedError} if the client is not initialized
1623
+ */
1624
+ fetchKeyPackageStatuses(installationIds: string[]): Promise<Record<string, import("@xmtp/node-bindings").KeyPackageStatus>>;
1625
+ /**
1626
+ * Fetches the inbox ID for a given identifier from the local database
1627
+ * If not found, fetches from the network
1628
+ *
1629
+ * @param identifier - The identifier to look up
1630
+ * @returns The inbox ID, if found
1631
+ * @throws {ClientNotInitializedError} if the client is not initialized
1632
+ */
1633
+ fetchInboxIdByIdentifier(identifier: Identifier$1): Promise<string | null>;
1634
+ /**
1635
+ * Signs a message with the installation key
1636
+ *
1637
+ * @param signatureText - The text to sign
1638
+ * @returns The signature
1639
+ * @throws {ClientNotInitializedError} if the client is not initialized
1640
+ */
1641
+ signWithInstallationKey(signatureText: string): Uint8Array<ArrayBufferLike>;
1642
+ /**
1643
+ * Verifies a signature was made with the installation key
1644
+ *
1645
+ * @param signatureText - The text that was signed
1646
+ * @param signatureBytes - The signature bytes to verify
1647
+ * @returns Whether the signature is valid
1648
+ * @throws {ClientNotInitializedError} if the client is not initialized
1649
+ */
1650
+ verifySignedWithInstallationKey(signatureText: string, signatureBytes: Uint8Array): boolean;
1651
+ /** Fetch inbox states with an explicit backend or network options. */
1652
+ static fetchInboxStates(inboxIds: string[], optionsOrBackend: NetworkOptions | Backend$1): Promise<import("@xmtp/node-bindings").InboxState[]>;
1653
+ /** Fetch inbox update counts with an explicit backend or network options. */
1654
+ static fetchLatestInboxUpdatesCount(inboxIds: string[], optionsOrBackend: NetworkOptions | Backend$1): Promise<Map<string, number>>;
1655
+ /** Check identifiers with an explicit backend or network options. */
1656
+ static canMessage(identifiers: Identifier$1[], optionsOrBackend: NetworkOptions | Backend$1): Promise<Map<string, boolean>>;
1657
+ /**
1658
+ * Verifies a signature was made with a public key
1659
+ *
1660
+ * @param signatureText - The text that was signed
1661
+ * @param signatureBytes - The signature bytes to verify
1662
+ * @param publicKey - The public key to verify against
1663
+ * @returns Whether the signature is valid
1664
+ */
1665
+ static verifySignedWithPublicKey(signatureText: string, signatureBytes: Uint8Array, publicKey: Uint8Array): boolean;
1666
+ /** Check address authorization with an explicit backend or network options. */
1667
+ static isAddressAuthorized(inboxId: string, address: string, optionsOrBackend: NetworkOptions | Backend$1): Promise<boolean>;
1668
+ /** Check installation authorization with an explicit backend or network options. */
1669
+ static isInstallationAuthorized(inboxId: string, installation: Uint8Array, optionsOrBackend: NetworkOptions | Backend$1): Promise<boolean>;
1670
+ /**
1671
+ * Archive application elements to file for later restoration
1672
+ *
1673
+ * @param path - The file path to save the archive
1674
+ * @param key - Encryption key for the archive
1675
+ * @param opts - Archive options specifying what to include (defaults to consent and messages)
1676
+ * @returns Promise that resolves when the archive is created
1677
+ */
1678
+ createArchive(path: string, key: Uint8Array, opts?: ArchiveOptions$1): Promise<void>;
1679
+ /**
1680
+ * Import a previous archive from a file
1681
+ *
1682
+ * @param path - The file path to the archive
1683
+ * @param key - Encryption key for the archive
1684
+ * @returns Promise that resolves when the archive is imported
1685
+ */
1686
+ importArchive(path: string, key: Uint8Array): Promise<void>;
1687
+ /**
1688
+ * Load the metadata for an archive to see what it contains
1689
+ *
1690
+ * Reads only the metadata without loading the entire file, so this function is quick.
1691
+ *
1692
+ * @param path - The file path to the archive
1693
+ * @param key - Encryption key for the archive
1694
+ * @returns Promise that resolves with the archive metadata
1695
+ */
1696
+ archiveMetadata(path: string, key: Uint8Array): Promise<ArchiveMetadata$1>;
1697
+ /**
1698
+ * Manually sync all device sync groups
1699
+ *
1700
+ * @returns Promise that resolves with a summary of the sync operation
1701
+ */
1702
+ syncAllDeviceSyncGroups(): Promise<GroupSyncSummary$1>;
1703
+ /** Enable notifications and register the delivery channel. */
1704
+ enableNotifications(config: NotificationConfig): Promise<NotificationState>;
1705
+ /** Disable notifications. Per-conversation overrides remain stored. */
1706
+ disableNotifications(): Promise<void>;
1707
+ /** Read the local state without a backend request. */
1708
+ notificationState(): Promise<NotificationState>;
1709
+ /**
1710
+ * What the deployment published about itself, as this client resolved it
1711
+ * when it was built.
1712
+ *
1713
+ * Reads memory and makes no backend request. The value never changes for the
1714
+ * life of the client: a background refresh rewrites the stored copy, and a
1715
+ * new value takes effect at the next build.
1716
+ *
1717
+ * @throws {ClientNotInitializedError} if the client is not initialized
1718
+ */
1719
+ serverConfiguration(): ServerConfiguration$1;
1720
+ /**
1721
+ * Fetch the deployment configuration now, rewrite the stored copy, and
1722
+ * return what was fetched.
1723
+ *
1724
+ * The snapshot this client holds is unchanged; use it to observe a change an
1725
+ * operator has made without restarting.
1726
+ *
1727
+ * @throws {ClientNotInitializedError} if the client is not initialized
1728
+ * @throws {ConfigurationUnavailableError} if the deployment did not answer
1729
+ * @throws {ConfigurationInvalidError} if it published an unusable configuration
1730
+ * @throws {BackendMismatchError} if it published a different identifier
1731
+ * @throws {ClientVersionTooOldError} if it now requires a newer libxmtp
1732
+ */
1733
+ refreshServerConfiguration(): Promise<ServerConfiguration$1>;
1734
+ /**
1735
+ * Read what a deployment publishes about itself with no database, no client,
1736
+ * and no credential.
1737
+ *
1738
+ * Lets an app learn `auth.enabled`, `auth.requiredScopes`, and the accepted
1739
+ * smart contract wallet chains before it decides how to build a client.
1740
+ * Nothing is stored and no identifier binding is applied.
1741
+ *
1742
+ * @param target - A backend URL, network options, or an existing backend
1743
+ * @throws {ConfigurationUnavailableError} if the deployment did not answer
1744
+ * @throws {ConfigurationInvalidError} if it published an unusable configuration
1745
+ */
1746
+ static fetchServerConfiguration(target: string | NetworkOptions | Backend$1): Promise<ServerConfiguration$1>;
1727
1747
  }
1728
-
1729
- type StreamFailureCause = {
1730
- kind: "target_pending" | "receipt_pending" | "processing_pending" | "blocked" | "storage" | "receiver" | "invalid_topic";
1731
- code: string | null;
1732
- message: string;
1733
- retryable: boolean;
1748
+ //#endregion
1749
+ //#region src/utils/streamFailure.d.ts
1750
+ export type StreamFailureCause = {
1751
+ kind: "target_pending" | "receipt_pending" | "processing_pending" | "blocked" | "storage" | "receiver" | "invalid_topic";
1752
+ code: string | null;
1753
+ message: string;
1754
+ retryable: boolean;
1734
1755
  };
1735
- type UnfinishedStreamTopic = {
1736
- topic: Uint8Array;
1737
- /** Null means that target capture did not complete. */
1738
- target: bigint | null;
1739
- received: bigint;
1740
- processed: bigint;
1741
- unresolvedWelcomes: bigint[];
1742
- inactive: boolean;
1743
- cause: StreamFailureCause | null;
1756
+ export type UnfinishedStreamTopic = {
1757
+ topic: Uint8Array;
1758
+ /** Null means that target capture did not complete. */
1759
+ target: bigint | null;
1760
+ received: bigint;
1761
+ processed: bigint;
1762
+ unresolvedWelcomes: bigint[];
1763
+ inactive: boolean;
1764
+ cause: StreamFailureCause | null;
1744
1765
  };
1745
- type StreamBarrierFailure = {
1746
- reason: "blocked" | "deadline" | "cancelled";
1747
- unfinished: UnfinishedStreamTopic[];
1766
+ export type StreamBarrierFailure = {
1767
+ reason: "blocked" | "deadline" | "cancelled";
1768
+ unfinished: UnfinishedStreamTopic[];
1748
1769
  };
1749
- type StreamFailureDetails = {
1750
- kind: "barrier" | "published_but_unconfirmed" | "catch_up";
1751
- code: string;
1752
- message: string;
1753
- retryable: boolean;
1754
- intentId: number | null;
1755
- publishedIntentIds: number[];
1756
- summary: {
1757
- messages: bigint;
1758
- conversations: bigint;
1759
- failed: bigint;
1760
- completed: boolean;
1761
- } | null;
1762
- barriers: StreamBarrierFailure[];
1770
+ export type StreamFailureDetails = {
1771
+ kind: "barrier" | "published_but_unconfirmed" | "catch_up";
1772
+ code: string;
1773
+ message: string;
1774
+ retryable: boolean;
1775
+ intentId: number | null;
1776
+ publishedIntentIds: number[];
1777
+ summary: {
1778
+ messages: bigint;
1779
+ conversations: bigint;
1780
+ failed: bigint;
1781
+ completed: boolean;
1782
+ } | null;
1783
+ barriers: StreamBarrierFailure[];
1763
1784
  };
1764
1785
  /**
1765
1786
  * Reads structured progress from a stream, sync, or publication error.
1766
1787
  * All sequence values are exact bigints. Invalid or absent details return undefined.
1767
1788
  * A published-but-unconfirmed error does not mean that publication failed.
1768
1789
  */
1769
- declare const getStreamFailureDetails: (error: unknown) => StreamFailureDetails | undefined;
1770
-
1790
+ export declare const getStreamFailureDetails: (error: unknown) => StreamFailureDetails | undefined;
1791
+ //#endregion
1792
+ //#region src/ServerConfiguration.d.ts
1771
1793
  /**
1772
1794
  * Typed failures for the deployment configuration a backend publishes
1773
1795
  * (spec 006 §7).
@@ -1786,55 +1808,55 @@ declare const getStreamFailureDetails: (error: unknown) => StreamFailureDetails
1786
1808
  * Base class of the six configuration failures. Catch this to handle any of
1787
1809
  * them; catch a subclass to handle one.
1788
1810
  */
1789
- declare class ServerConfigurationError extends Error {
1790
- /** The stable code the bindings reported, e.g. `ClientError::AuthRequired`. */
1791
- readonly code: string;
1792
- constructor(
1793
- /** The stable code the bindings reported, e.g. `ClientError::AuthRequired`. */
1794
- code: string, message: string, options?: ErrorOptions);
1811
+ export declare class ServerConfigurationError extends Error {
1812
+ /** The stable code the bindings reported, e.g. `ClientError::AuthRequired`. */
1813
+ readonly code: string;
1814
+ constructor(
1815
+ /** The stable code the bindings reported, e.g. `ClientError::AuthRequired`. */
1816
+ code: string, message: string, options?: ErrorOptions);
1795
1817
  }
1796
1818
  /**
1797
1819
  * The configuration could not be read: the deployment did not answer, answered
1798
1820
  * `UNIMPLEMENTED` because it predates spec 006, or the copy could not be
1799
1821
  * stored.
1800
1822
  */
1801
- declare class ConfigurationUnavailableError extends ServerConfigurationError {
1802
- constructor(message: string, options?: ErrorOptions);
1823
+ export declare class ConfigurationUnavailableError extends ServerConfigurationError {
1824
+ constructor(message: string, options?: ErrorOptions);
1803
1825
  }
1804
1826
  /**
1805
1827
  * The deployment answered with a configuration no client can use: an empty or
1806
1828
  * malformed identifier, an unparseable minimum version, or a chain that is not
1807
1829
  * a CAIP-2 identifier. Nothing is stored.
1808
1830
  */
1809
- declare class ConfigurationInvalidError extends ServerConfigurationError {
1810
- constructor(message: string, options?: ErrorOptions);
1831
+ export declare class ConfigurationInvalidError extends ServerConfigurationError {
1832
+ constructor(message: string, options?: ErrorOptions);
1811
1833
  }
1812
1834
  /**
1813
1835
  * This database is bound to a different deployment. The identifier the backend
1814
1836
  * published is not the one the database was created against. Recovery is a
1815
1837
  * database created for the deployment the app now uses.
1816
1838
  */
1817
- declare class BackendMismatchError extends ServerConfigurationError {
1818
- constructor(message: string, options?: ErrorOptions);
1839
+ export declare class BackendMismatchError extends ServerConfigurationError {
1840
+ constructor(message: string, options?: ErrorOptions);
1819
1841
  }
1820
1842
  /** The deployment requires a newer libxmtp than this SDK is built on. */
1821
- declare class ClientVersionTooOldError extends ServerConfigurationError {
1822
- constructor(message: string, options?: ErrorOptions);
1843
+ export declare class ClientVersionTooOldError extends ServerConfigurationError {
1844
+ constructor(message: string, options?: ErrorOptions);
1823
1845
  }
1824
1846
  /**
1825
1847
  * The deployment requires authentication and no credential source was
1826
1848
  * configured. The message carries the scopes it requires.
1827
1849
  */
1828
- declare class AuthRequiredError extends ServerConfigurationError {
1829
- constructor(message: string, options?: ErrorOptions);
1850
+ export declare class AuthRequiredError extends ServerConfigurationError {
1851
+ constructor(message: string, options?: ErrorOptions);
1830
1852
  }
1831
1853
  /**
1832
1854
  * A smart contract wallet signature names a chain the deployment does not
1833
1855
  * verify on. Raised before any network call, and only for signatures the app
1834
1856
  * supplied.
1835
1857
  */
1836
- declare class ChainNotAcceptedError extends ServerConfigurationError {
1837
- constructor(message: string, options?: ErrorOptions);
1858
+ export declare class ChainNotAcceptedError extends ServerConfigurationError {
1859
+ constructor(message: string, options?: ErrorOptions);
1838
1860
  }
1839
1861
  /**
1840
1862
  * Classifies an error from any SDK call as one of the six configuration
@@ -1844,12 +1866,12 @@ declare class ChainNotAcceptedError extends ServerConfigurationError {
1844
1866
  * `ChainNotAcceptedError` raised deep inside a call that supplies a smart
1845
1867
  * contract wallet signature.
1846
1868
  */
1847
- declare const toServerConfigurationError: (error: unknown) => ServerConfigurationError | undefined;
1869
+ export declare const toServerConfigurationError: (error: unknown) => ServerConfigurationError | undefined;
1848
1870
  /**
1849
1871
  * Rethrows an error as its typed configuration failure, or unchanged when it
1850
1872
  * is not one.
1851
1873
  */
1852
- declare const throwServerConfigurationError: (error: unknown) => never;
1853
-
1854
- export { AccountAlreadyAssociatedError, AuthRequiredError, BackendMismatchError, ChainNotAcceptedError, Client, ClientNotInitializedError, ClientVersionTooOldError, CodecRegistry, ConfigurationInvalidError, ConfigurationUnavailableError, Conversation, Conversations, DEFAULT_RETRY_ATTEMPTS, DEFAULT_RETRY_DELAY, DebugInformation, DecodedMessage, Dm, Group, InboxReassignError, MessageStream, MissingContentTypeError, NotificationError, Preferences, ServerConfigurationError, SignerUnavailableError, StreamFailedError, StreamInvalidRetryAttemptsError, createBackend, createStream, generateInboxId, getInboxIdForIdentifier, getStreamFailureDetails, isActions, isAttachment, isGroupUpdated, isHexString, isIntent, isLeaveRequest, isMarkdown, isMultiRemoteAttachment, isReaction, isReadReceipt, isRemoteAttachment, isReply, isText, isTextReply, isTransactionReference, isWalletSendCalls, throwServerConfigurationError, toServerConfigurationError, validHex };
1855
- export type { AsyncStreamProxy, AuthCallback, BuiltInContentTypes, ClientOptions, ContentOptions, Credential, DeviceSyncOptions, DistributiveOmit, EOASigner, EnrichedReply, ExtractCodecContentTypes, GetBlockNumber, GetChainId, GetIdentifier, HexString, MessageAcknowledgement, MessageDelivery, MessageReaderSource, NetworkOptions, NotificationChannel, NotificationConfig, NotificationOverride, NotificationState, OtherOptions, ResolveValue, SCWSigner, SignMessage, Signer, StorageOptions, StreamBarrierFailure, StreamCallback, StreamFailureCause, StreamFailureDetails, StreamFunction, StreamOptions, StreamValueMutator, UnfinishedStreamTopic };
1874
+ export declare const throwServerConfigurationError: (error: unknown) => never;
1875
+ //#endregion
1876
+ export { type Action, ActionStyle, type Actions, type ApiStats, type AppDataChange, type ArchiveMetadata, type ArchiveOptions, type AsyncStreamProxy, type Attachment, type AuthCallback, type AuthConfiguration, type Backend, type BackendBuilder, BackupElementSelectionOption, type BuiltInContentTypes, type ClientOptions, type Consent, ConsentEntityType, ConsentState, type ContentOptions, ContentType, type ConversationDebugInfo, type ConversationListItem, ConversationType, type CreateDmOptions, type CreateGroupOptions, type Credential, type Cursor, type DEFAULT_RETRY_ATTEMPTS, type DEFAULT_RETRY_DELAY, type DeliveryCursor, DeliveryStatus, type DeviceSyncOptions, type DistributiveOmit, type EOASigner, type EncryptedAttachment, type EnrichedReply, type ExtractCodecContentTypes, type GetBlockNumber, type GetChainId, type GetIdentifier, type GroupMember, GroupMembershipState, GroupMessageKind, type GroupMetadata, type GroupPermissions, GroupPermissionsOptions, type GroupSyncSummary, type GroupUpdated, type HmacKey, type Identifier, IdentifierKind, type IdentityStats, type Inbox, type InboxState, type Installation, type Intent, type KeyPackageStatus, type LeaveRequest, type Lifetime, type LimitsConfiguration, type ListConversationsOptions, ListConversationsOrderBy, type ListMessagesOptions, LogLevel, type LogOptions, type Message, type MessageAcknowledgement, type MessageCatchUp, type MessageCatchUpGeneration, type MessageDelivery, type MessageDisappearingSettings, type MessageHistorySnapshot, type MessageReaderSource, MessageSortBy, type MessageTopicStatus, MetadataField, type MetadataFieldChange, type MlsConfiguration, type MultiRemoteAttachment, type NetworkOptions, type NotificationChannel, type NotificationConfig, type NotificationOverride, type NotificationState, type OtherOptions, PermissionLevel, PermissionPolicy, type PermissionPolicySet, PermissionUpdateType, type Reaction, ReactionAction, ReactionSchema, type ReadReceipt, type RemoteAttachment, type Reply, type ResolveValue, type RetentionConfiguration, type SCWSigner, type SendMessageOpts, type SendOpts, type ServerConfiguration, type SignMessage, type SignatureRequestHandle, type Signer, type SigningKeyDescription, SortDirection, type StorageOptions, type StreamCallback, type StreamFunction, type StreamOptions, type StreamValueMutator, type TransactionMetadata, type TransactionReference, type UserPreferenceUpdate, type VisibilityConfirmationOptions, type WalletCall, type WalletSendCalls, type WorkerConfigOptions, type WorkerIntervalOverride, type WorkerJitterOverride, WorkerKind, contentTypeActions, contentTypeAttachment, contentTypeGroupUpdated, contentTypeIntent, contentTypeLeaveRequest, contentTypeMarkdown, contentTypeMultiRemoteAttachment, contentTypeReaction, contentTypeReadReceipt, contentTypeRemoteAttachment, contentTypeReply, contentTypeText, contentTypeTransactionReference, contentTypeWalletSendCalls, type createStream, decryptAttachment, encodeActions, encodeAttachment, encodeIntent, encodeMarkdown, encodeMultiRemoteAttachment, encodeReaction, encodeReadReceipt, encodeRemoteAttachment, encodeText, encodeTransactionReference, encodeWalletSendCalls, encryptAttachment, flushTelemetry, initLogging };
1877
+ //# sourceMappingURL=index.d.ts.map