@xmtp/browser-sdk 2.2.1 → 3.0.0

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,7 +1,7 @@
1
1
  import { ContentCodec, ContentTypeId as ContentTypeId$1, EncodedContent as EncodedContent$1 } from '@xmtp/content-type-primitives';
2
2
  import * as _xmtp_wasm_bindings from '@xmtp/wasm-bindings';
3
- import { Conversations as Conversations$1, ConsentState, Message, Identifier, Conversation as Conversation$1, ConversationType, Client as Client$1, ConsentEntityType, Consent, UserPreference, SignatureRequestType, KeyPackageStatus, PermissionUpdateType, PermissionPolicy, MetadataField, EncodedContent, MessageDisappearingSettings, HmacKey, ConversationDebugInfo, GroupPermissionsOptions, DeliveryStatus, GroupMessageKind, ContentType, SortDirection, PermissionLevel, ContentTypeId, ListMessagesOptions, ListConversationsOptions, PermissionPolicySet, CreateGroupOptions, CreateDMOptions, Installation, InboxState, GroupMember, ApiStats, IdentityStats } from '@xmtp/wasm-bindings';
4
- export { Consent, ConsentEntityType, ConsentState, ContentType, ContentTypeId, ConversationListItem, ConversationType, CreateDMOptions, CreateGroupOptions, DeliveryStatus, EncodedContent, GroupMember, GroupMembershipState, GroupMessageKind, GroupMetadata, GroupPermissions, GroupPermissionsOptions, HmacKey, Identifier, IdentifierKind, InboxState, Installation, ListConversationsOptions, ListMessagesOptions, LogOptions, Message, MessageDisappearingSettings, MetadataField, PermissionLevel, PermissionPolicy, PermissionPolicySet, PermissionUpdateType, SignatureRequestType, SortDirection, UserPreference } from '@xmtp/wasm-bindings';
3
+ import { Identifier, Conversations as Conversations$1, ConsentState, Message, Conversation as Conversation$1, ConversationType, Client as Client$1, ConsentEntityType, Consent, UserPreference, SignatureRequestHandle, KeyPackageStatus, PermissionUpdateType, PermissionPolicy, MetadataField, EncodedContent, MessageDisappearingSettings, HmacKey, ConversationDebugInfo, GroupPermissionsOptions, DeliveryStatus, GroupMessageKind, ContentType, SortDirection, PermissionLevel, ContentTypeId, ListMessagesOptions, ListConversationsOptions, PermissionPolicySet, CreateGroupOptions, CreateDMOptions, Installation, InboxState, GroupMember, ApiStats, IdentityStats } from '@xmtp/wasm-bindings';
4
+ export { Consent, ConsentEntityType, ConsentState, ContentType, ContentTypeId, ConversationListItem, ConversationType, CreateDMOptions, CreateGroupOptions, DeliveryStatus, EncodedContent, GroupMember, GroupMembershipState, GroupMessageKind, GroupMetadata, GroupPermissions, GroupPermissionsOptions, HmacKey, Identifier, IdentifierKind, InboxState, Installation, ListConversationsOptions, ListMessagesOptions, LogOptions, Message, MessageDisappearingSettings, MetadataField, PermissionLevel, PermissionPolicy, PermissionPolicySet, PermissionUpdateType, SignatureRequestHandle, SortDirection, UserPreference } from '@xmtp/wasm-bindings';
5
5
  import { GroupUpdatedCodec } from '@xmtp/content-type-group-updated';
6
6
  import { TextCodec } from '@xmtp/content-type-text';
7
7
 
@@ -134,6 +134,40 @@ type OtherOptions = {
134
134
  };
135
135
  type ClientOptions = NetworkOptions & ContentOptions & StorageOptions & OtherOptions;
136
136
 
137
+ type SignMessage = (message: string) => Promise<Uint8Array> | Uint8Array;
138
+ type GetIdentifier = () => Promise<Identifier> | Identifier;
139
+ type GetChainId = () => bigint;
140
+ type GetBlockNumber = () => bigint;
141
+ type Signer = {
142
+ type: "EOA";
143
+ getIdentifier: GetIdentifier;
144
+ signMessage: SignMessage;
145
+ } | {
146
+ type: "SCW";
147
+ getIdentifier: GetIdentifier;
148
+ signMessage: SignMessage;
149
+ getBlockNumber?: GetBlockNumber;
150
+ getChainId: GetChainId;
151
+ };
152
+ type EOASigner = Extract<Signer, {
153
+ type: "EOA";
154
+ }>;
155
+ type SCWSigner = Extract<Signer, {
156
+ type: "SCW";
157
+ }>;
158
+ type SafeSigner = {
159
+ type: "EOA";
160
+ identifier: Identifier;
161
+ signature: Uint8Array;
162
+ } | {
163
+ type: "SCW";
164
+ identifier: Identifier;
165
+ signature: Uint8Array;
166
+ chainId: bigint;
167
+ blockNumber?: bigint;
168
+ };
169
+ declare const toSafeSigner: (signer: Signer, signature: Uint8Array) => Promise<SafeSigner>;
170
+
137
171
  declare class WorkerConversations {
138
172
  #private;
139
173
  constructor(client: WorkerClient, conversations: Conversations$1);
@@ -157,6 +191,21 @@ declare class WorkerConversations {
157
191
  streamAllMessages(callback?: StreamCallback<Message>, conversationType?: ConversationType, consentStates?: ConsentState[]): _xmtp_wasm_bindings.StreamCloser;
158
192
  }
159
193
 
194
+ /**
195
+ * Debug information helpers for the client
196
+ *
197
+ * This class is not intended to be initialized directly.
198
+ */
199
+ declare class WorkerDebugInformation {
200
+ #private;
201
+ constructor(client: Client$1, options?: ClientOptions);
202
+ apiStatistics(): _xmtp_wasm_bindings.ApiStats;
203
+ apiIdentityStatistics(): _xmtp_wasm_bindings.IdentityStats;
204
+ apiAggregateStatistics(): string;
205
+ clearAllStatistics(): void;
206
+ uploadDebugArchive(serverUrl?: string): Promise<string>;
207
+ }
208
+
160
209
  declare class WorkerPreferences {
161
210
  #private;
162
211
  constructor(client: Client$1, conversations: Conversations$1);
@@ -180,28 +229,24 @@ declare class WorkerClient {
180
229
  get installationIdBytes(): Uint8Array<ArrayBufferLike>;
181
230
  get isRegistered(): boolean;
182
231
  get conversations(): WorkerConversations;
232
+ get debugInformation(): WorkerDebugInformation;
183
233
  get preferences(): WorkerPreferences;
184
- createInboxSignatureText(): string | undefined;
185
- addAccountSignatureText(identifier: Identifier): Promise<string | undefined>;
186
- removeAccountSignatureText(identifier: Identifier): Promise<string | undefined>;
187
- revokeAllAOtherInstallationsSignatureText(): Promise<string | undefined>;
188
- revokeInstallationsSignatureText(installationIds: Uint8Array[]): Promise<string | undefined>;
189
- changeRecoveryIdentifierSignatureText(identifier: Identifier): Promise<string | undefined>;
190
- addEcdsaSignature(type: SignatureRequestType, bytes: Uint8Array): Promise<void>;
191
- addScwSignature(type: SignatureRequestType, bytes: Uint8Array, chainId: bigint, blockNumber?: bigint): Promise<void>;
192
- applySignatures(): Promise<void>;
193
234
  canMessage(identifiers: Identifier[]): Promise<Map<string, boolean>>;
194
- registerIdentity(): Promise<void>;
235
+ addSignature(signatureRequest: SignatureRequestHandle, signer: SafeSigner): Promise<void>;
236
+ applySignatureRequest(signatureRequest: SignatureRequestHandle): Promise<void>;
237
+ processSignatureRequest(signer: SafeSigner, signatureRequest: SignatureRequestHandle): Promise<void>;
238
+ createInboxSignatureRequest(): SignatureRequestHandle | undefined;
239
+ addAccountSignatureRequest(newAccountIdentifier: Identifier): Promise<SignatureRequestHandle>;
240
+ removeAccountSignatureRequest(identifier: Identifier): Promise<SignatureRequestHandle>;
241
+ revokeAllOtherInstallationsSignatureRequest(): Promise<SignatureRequestHandle>;
242
+ revokeInstallationsSignatureRequest(installationIds: Uint8Array[]): Promise<SignatureRequestHandle>;
243
+ changeRecoveryIdentifierSignatureRequest(identifier: Identifier): Promise<SignatureRequestHandle>;
244
+ registerIdentity(signer: SafeSigner, signatureRequest: SignatureRequestHandle): Promise<void>;
195
245
  findInboxIdByIdentifier(identifier: Identifier): Promise<string | undefined>;
196
246
  signWithInstallationKey(signatureText: string): Uint8Array<ArrayBufferLike>;
197
247
  verifySignedWithInstallationKey(signatureText: string, signatureBytes: Uint8Array): boolean;
198
248
  verifySignedWithPublicKey(signatureText: string, signatureBytes: Uint8Array, publicKey: Uint8Array): boolean;
199
249
  getKeyPackageStatusesForInstallationIds(installationIds: string[]): Promise<Map<string, KeyPackageStatus>>;
200
- apiStatistics(): _xmtp_wasm_bindings.ApiStats;
201
- apiIdentityStatistics(): _xmtp_wasm_bindings.IdentityStats;
202
- apiAggregateStatistics(): string;
203
- clearAllStatistics(): void;
204
- uploadDebugArchive(serverUrl?: string): Promise<string>;
205
250
  }
206
251
 
207
252
  declare class WorkerConversation {
@@ -372,7 +417,7 @@ type SafeInstallation = {
372
417
  };
373
418
  declare const toSafeInstallation: (installation: Installation) => SafeInstallation;
374
419
  type SafeInboxState = {
375
- accountIdentifiers: Identifier[];
420
+ identifiers: Identifier[];
376
421
  inboxId: string;
377
422
  installations: SafeInstallation[];
378
423
  recoveryIdentifier: Identifier;
@@ -452,72 +497,130 @@ type ClientAction = {
452
497
  identifier: Identifier;
453
498
  options?: ClientOptions;
454
499
  };
500
+ } | {
501
+ action: "client.applySignatureRequest";
502
+ id: string;
503
+ result: undefined;
504
+ data: {
505
+ signer: SafeSigner;
506
+ signatureRequestId: string;
507
+ };
455
508
  } | {
456
509
  action: "client.createInboxSignatureText";
457
510
  id: string;
458
- result: string | undefined;
459
- data: undefined;
511
+ result: {
512
+ signatureText?: string;
513
+ signatureRequestId?: string;
514
+ };
515
+ data: {
516
+ signatureRequestId: string;
517
+ };
460
518
  } | {
461
519
  action: "client.addAccountSignatureText";
462
520
  id: string;
463
- result: string | undefined;
521
+ result: {
522
+ signatureText: string;
523
+ signatureRequestId: string;
524
+ };
464
525
  data: {
465
526
  newIdentifier: Identifier;
527
+ signatureRequestId: string;
466
528
  };
467
529
  } | {
468
530
  action: "client.removeAccountSignatureText";
469
531
  id: string;
470
- result: string | undefined;
532
+ result: {
533
+ signatureText: string;
534
+ signatureRequestId: string;
535
+ };
471
536
  data: {
472
537
  identifier: Identifier;
538
+ signatureRequestId: string;
473
539
  };
474
540
  } | {
475
541
  action: "client.revokeAllOtherInstallationsSignatureText";
476
542
  id: string;
477
- result: string | undefined;
478
- data: undefined;
543
+ result: {
544
+ signatureText: string;
545
+ signatureRequestId: string;
546
+ };
547
+ data: {
548
+ signatureRequestId: string;
549
+ };
479
550
  } | {
480
551
  action: "client.revokeInstallationsSignatureText";
481
552
  id: string;
482
- result: string | undefined;
553
+ result: {
554
+ signatureText: string;
555
+ signatureRequestId: string;
556
+ };
483
557
  data: {
484
558
  installationIds: Uint8Array[];
559
+ signatureRequestId: string;
485
560
  };
486
561
  } | {
487
562
  action: "client.changeRecoveryIdentifierSignatureText";
488
563
  id: string;
489
- result: string | undefined;
564
+ result: {
565
+ signatureText: string;
566
+ signatureRequestId: string;
567
+ };
490
568
  data: {
491
569
  identifier: Identifier;
570
+ signatureRequestId: string;
492
571
  };
493
572
  } | {
494
- action: "client.addEcdsaSignature";
573
+ action: "client.registerIdentity";
495
574
  id: string;
496
575
  result: undefined;
497
576
  data: {
498
- type: SignatureRequestType;
499
- bytes: Uint8Array;
577
+ signer: SafeSigner;
578
+ signatureRequestId: string;
500
579
  };
501
580
  } | {
502
- action: "client.addScwSignature";
581
+ action: "client.addAccount";
503
582
  id: string;
504
583
  result: undefined;
505
584
  data: {
506
- type: SignatureRequestType;
507
- bytes: Uint8Array;
508
- chainId: bigint;
509
- blockNumber?: bigint;
585
+ identifier: Identifier;
586
+ signer: SafeSigner;
587
+ signatureRequestId: string;
510
588
  };
511
589
  } | {
512
- action: "client.applySignatures";
590
+ action: "client.removeAccount";
513
591
  id: string;
514
592
  result: undefined;
515
- data: undefined;
593
+ data: {
594
+ identifier: Identifier;
595
+ signer: SafeSigner;
596
+ signatureRequestId: string;
597
+ };
516
598
  } | {
517
- action: "client.registerIdentity";
599
+ action: "client.revokeAllOtherInstallations";
518
600
  id: string;
519
601
  result: undefined;
520
- data: undefined;
602
+ data: {
603
+ signer: SafeSigner;
604
+ signatureRequestId: string;
605
+ };
606
+ } | {
607
+ action: "client.changeRecoveryIdentifier";
608
+ id: string;
609
+ result: undefined;
610
+ data: {
611
+ identifier: Identifier;
612
+ signer: SafeSigner;
613
+ signatureRequestId: string;
614
+ };
615
+ } | {
616
+ action: "client.revokeInstallations";
617
+ id: string;
618
+ result: undefined;
619
+ data: {
620
+ installationIds: Uint8Array[];
621
+ signer: SafeSigner;
622
+ signatureRequestId: string;
623
+ };
521
624
  } | {
522
625
  action: "client.isRegistered";
523
626
  id: string;
@@ -568,33 +671,6 @@ type ClientAction = {
568
671
  data: {
569
672
  installationIds: string[];
570
673
  };
571
- } | {
572
- action: "client.apiStatistics";
573
- id: string;
574
- result: SafeApiStats;
575
- data: undefined;
576
- } | {
577
- action: "client.apiIdentityStatistics";
578
- id: string;
579
- result: SafeIdentityStats;
580
- data: undefined;
581
- } | {
582
- action: "client.apiAggregateStatistics";
583
- id: string;
584
- result: string;
585
- data: undefined;
586
- } | {
587
- action: "client.clearAllStatistics";
588
- id: string;
589
- result: undefined;
590
- data: undefined;
591
- } | {
592
- action: "client.uploadDebugArchive";
593
- id: string;
594
- result: string;
595
- data: {
596
- serverUrl?: string;
597
- };
598
674
  };
599
675
 
600
676
  type ConversationAction = {
@@ -833,6 +909,35 @@ type ConversationsAction = {
833
909
  };
834
910
  };
835
911
 
912
+ type DebugInformationAction = {
913
+ action: "debugInformation.apiStatistics";
914
+ id: string;
915
+ result: SafeApiStats;
916
+ data: undefined;
917
+ } | {
918
+ action: "debugInformation.apiIdentityStatistics";
919
+ id: string;
920
+ result: SafeIdentityStats;
921
+ data: undefined;
922
+ } | {
923
+ action: "debugInformation.apiAggregateStatistics";
924
+ id: string;
925
+ result: string;
926
+ data: undefined;
927
+ } | {
928
+ action: "debugInformation.clearAllStatistics";
929
+ id: string;
930
+ result: undefined;
931
+ data: undefined;
932
+ } | {
933
+ action: "debugInformation.uploadDebugArchive";
934
+ id: string;
935
+ result: string;
936
+ data: {
937
+ serverUrl?: string;
938
+ };
939
+ };
940
+
836
941
  type DmAction = {
837
942
  action: "dm.peerInboxId";
838
943
  id: string;
@@ -1057,7 +1162,7 @@ type ClientWorkerAction = {
1057
1162
  data: {
1058
1163
  streamId: string;
1059
1164
  };
1060
- } | ClientAction | ConversationAction | ConversationsAction | DmAction | GroupAction | PreferencesAction;
1165
+ } | ClientAction | ConversationAction | ConversationsAction | DmAction | GroupAction | PreferencesAction | DebugInformationAction;
1061
1166
  type ActionName<T extends UnknownAction> = T["action"];
1062
1167
  type ExtractAction<T extends UnknownAction, A extends ActionName<T>> = Extract<T, {
1063
1168
  action: A;
@@ -1647,6 +1752,21 @@ declare class Conversations<ContentTypes = unknown> {
1647
1752
  streamAllDmMessages(callback?: StreamCallback<DecodedMessage<ContentTypes>>, consentStates?: ConsentState[]): Promise<AsyncStream<DecodedMessage<ContentTypes>>>;
1648
1753
  }
1649
1754
 
1755
+ /**
1756
+ * Debug information helpers for the client
1757
+ *
1758
+ * This class is not intended to be initialized directly.
1759
+ */
1760
+ declare class DebugInformation<ContentTypes = unknown> {
1761
+ #private;
1762
+ constructor(client: Client<ContentTypes>);
1763
+ apiStatistics(): Promise<SafeApiStats>;
1764
+ apiIdentityStatistics(): Promise<SafeIdentityStats>;
1765
+ apiAggregateStatistics(): Promise<string>;
1766
+ clearAllStatistics(): Promise<void>;
1767
+ uploadDebugArchive(serverUrl?: string): Promise<string>;
1768
+ }
1769
+
1650
1770
  /**
1651
1771
  * Manages user preferences and consent states
1652
1772
  *
@@ -1714,22 +1834,6 @@ declare class Preferences<ContentTypes = unknown> {
1714
1834
  streamPreferences(callback?: StreamCallback<UserPreference[]>): Promise<AsyncStream<UserPreference[]>>;
1715
1835
  }
1716
1836
 
1717
- type SignMessage = (message: string) => Promise<Uint8Array> | Uint8Array;
1718
- type GetIdentifier = () => Promise<Identifier> | Identifier;
1719
- type GetChainId = () => bigint;
1720
- type GetBlockNumber = () => bigint;
1721
- type Signer = {
1722
- type: "EOA";
1723
- getIdentifier: GetIdentifier;
1724
- signMessage: SignMessage;
1725
- } | {
1726
- type: "SCW";
1727
- getIdentifier: GetIdentifier;
1728
- signMessage: SignMessage;
1729
- getBlockNumber?: GetBlockNumber;
1730
- getChainId: GetChainId;
1731
- };
1732
-
1733
1837
  type ExtractCodecContentTypes<C extends ContentCodec[] = []> = [
1734
1838
  ...C,
1735
1839
  GroupUpdatedCodec,
@@ -1813,6 +1917,10 @@ declare class Client<ContentTypes = ExtractCodecContentTypes> extends ClientWork
1813
1917
  * Gets the conversations manager for this client
1814
1918
  */
1815
1919
  get conversations(): Conversations<ContentTypes>;
1920
+ /**
1921
+ * Gets the debug information helpers for this client
1922
+ */
1923
+ get debugInformation(): DebugInformation<ContentTypes>;
1816
1924
  /**
1817
1925
  * Gets the preferences manager for this client
1818
1926
  */
@@ -1826,9 +1934,12 @@ declare class Client<ContentTypes = ExtractCodecContentTypes> extends ClientWork
1826
1934
  *
1827
1935
  * It is highly recommended to use the `register` method instead.
1828
1936
  *
1829
- * @returns The signature text
1937
+ * @returns The signature text and signature request ID
1830
1938
  */
1831
- unsafe_createInboxSignatureText(): Promise<string | undefined>;
1939
+ unsafe_createInboxSignatureText(): Promise<{
1940
+ signatureText?: string;
1941
+ signatureRequestId?: string;
1942
+ }>;
1832
1943
  /**
1833
1944
  * Creates signature text for adding a new account to the client's inbox
1834
1945
  *
@@ -1840,9 +1951,13 @@ declare class Client<ContentTypes = ExtractCodecContentTypes> extends ClientWork
1840
1951
  *
1841
1952
  * @param newIdentifier - The identifier of the new account
1842
1953
  * @param allowInboxReassign - Whether to allow inbox reassignment
1843
- * @returns The signature text
1954
+ * @throws {InboxReassignError} if `allowInboxReassign` is false
1955
+ * @returns The signature text and signature request ID
1844
1956
  */
1845
- unsafe_addAccountSignatureText(newIdentifier: Identifier, allowInboxReassign?: boolean): Promise<string | undefined>;
1957
+ unsafe_addAccountSignatureText(newIdentifier: Identifier, allowInboxReassign?: boolean): Promise<{
1958
+ signatureText: string;
1959
+ signatureRequestId: string;
1960
+ }>;
1846
1961
  /**
1847
1962
  * Creates signature text for removing an account from the client's inbox
1848
1963
  *
@@ -1853,9 +1968,12 @@ declare class Client<ContentTypes = ExtractCodecContentTypes> extends ClientWork
1853
1968
  * It is highly recommended to use the `removeAccount` method instead.
1854
1969
  *
1855
1970
  * @param identifier - The identifier of the account to remove
1856
- * @returns The signature text
1971
+ * @returns The signature text and signature request ID
1857
1972
  */
1858
- unsafe_removeAccountSignatureText(identifier: Identifier): Promise<string | undefined>;
1973
+ unsafe_removeAccountSignatureText(identifier: Identifier): Promise<{
1974
+ signatureText: string;
1975
+ signatureRequestId: string;
1976
+ }>;
1859
1977
  /**
1860
1978
  * Creates signature text for revoking all other installations of the
1861
1979
  * client's inbox
@@ -1866,9 +1984,12 @@ declare class Client<ContentTypes = ExtractCodecContentTypes> extends ClientWork
1866
1984
  *
1867
1985
  * It is highly recommended to use the `revokeAllOtherInstallations` method instead.
1868
1986
  *
1869
- * @returns The signature text
1987
+ * @returns The signature text and signature request ID
1870
1988
  */
1871
- unsafe_revokeAllOtherInstallationsSignatureText(): Promise<string | undefined>;
1989
+ unsafe_revokeAllOtherInstallationsSignatureText(): Promise<{
1990
+ signatureText: string;
1991
+ signatureRequestId: string;
1992
+ }>;
1872
1993
  /**
1873
1994
  * Creates signature text for revoking specific installations of the
1874
1995
  * client's inbox
@@ -1880,9 +2001,12 @@ declare class Client<ContentTypes = ExtractCodecContentTypes> extends ClientWork
1880
2001
  * It is highly recommended to use the `revokeInstallations` method instead.
1881
2002
  *
1882
2003
  * @param installationIds - The installation IDs to revoke
1883
- * @returns The signature text
2004
+ * @returns The signature text and signature request ID
1884
2005
  */
1885
- unsafe_revokeInstallationsSignatureText(installationIds: Uint8Array[]): Promise<string | undefined>;
2006
+ unsafe_revokeInstallationsSignatureText(installationIds: Uint8Array[]): Promise<{
2007
+ signatureText: string;
2008
+ signatureRequestId: string;
2009
+ }>;
1886
2010
  /**
1887
2011
  * Creates signature text for changing the recovery identifier for this
1888
2012
  * client's inbox
@@ -1894,38 +2018,27 @@ declare class Client<ContentTypes = ExtractCodecContentTypes> extends ClientWork
1894
2018
  * It is highly recommended to use the `changeRecoveryIdentifier` method instead.
1895
2019
  *
1896
2020
  * @param identifier - The new recovery identifier
1897
- * @returns The signature text
2021
+ * @returns The signature text and signature request ID
1898
2022
  */
1899
- unsafe_changeRecoveryIdentifierSignatureText(identifier: Identifier): Promise<string | undefined>;
2023
+ unsafe_changeRecoveryIdentifierSignatureText(identifier: Identifier): Promise<{
2024
+ signatureText: string;
2025
+ signatureRequestId: string;
2026
+ }>;
1900
2027
  /**
1901
- * Adds a signature for a specific request type
2028
+ * Applies a signature request to the client
1902
2029
  *
1903
2030
  * WARNING: This function should be used with caution. It is only provided
1904
2031
  * for use in special cases where the provided workflows do not meet the
1905
2032
  * requirements of an application.
1906
2033
  *
1907
2034
  * It is highly recommended to use the `register`, `unsafe_addAccount`,
1908
- * `removeAccount`, `revokeAllOtherInstallations`, or `revokeInstallations`
1909
- * methods instead.
2035
+ * `removeAccount`, `revokeAllOtherInstallations`, `revokeInstallations`,
2036
+ * or `changeRecoveryIdentifier` method instead.
1910
2037
  *
1911
- * @param signatureType - The type of signature request
1912
- * @param signatureText - The text to sign
1913
2038
  * @param signer - The signer to use
1914
- * @warning This is an unsafe operation and should be used with caution
1915
- */
1916
- unsafe_addSignature(signatureType: SignatureRequestType, signatureText: string, signer: Signer): Promise<void>;
1917
- /**
1918
- * Applies all pending signatures
1919
- *
1920
- * WARNING: This function should be used with caution. It is only provided
1921
- * for use in special cases where the provided workflows do not meet the
1922
- * requirements of an application.
1923
- *
1924
- * It is highly recommended to use the `register`, `unsafe_addAccount`,
1925
- * `removeAccount`, `revokeAllOtherInstallations`, or `revokeInstallations`
1926
- * methods instead.
2039
+ * @param signatureRequestId - The ID of the signature request to apply
1927
2040
  */
1928
- unsafe_applySignatures(): Promise<void>;
2041
+ unsafe_applySignatureRequest(signer: SafeSigner, signatureRequestId: string): Promise<void>;
1929
2042
  /**
1930
2043
  * Registers the client with the XMTP network
1931
2044
  *
@@ -1948,9 +2061,9 @@ declare class Client<ContentTypes = ExtractCodecContentTypes> extends ClientWork
1948
2061
  *
1949
2062
  * @param newAccountSigner - The signer for the new account
1950
2063
  * @param allowInboxReassign - Whether to allow inbox reassignment
1951
- * @throws {AccountAlreadyAssociatedError} if the account is already associated with an inbox ID
1952
- * @throws {GenerateSignatureError} if the signature cannot be generated
1953
2064
  * @throws {SignerUnavailableError} if no signer is available
2065
+ * @throws {InboxReassignError} if `allowInboxReassign` is false
2066
+ * @throws {AccountAlreadyAssociatedError} if the account is already associated with an inbox ID
1954
2067
  */
1955
2068
  unsafe_addAccount(newAccountSigner: Signer, allowInboxReassign?: boolean): Promise<void>;
1956
2069
  /**
@@ -1959,16 +2072,14 @@ declare class Client<ContentTypes = ExtractCodecContentTypes> extends ClientWork
1959
2072
  * Requires a signer, use `Client.create` to create a client with a signer.
1960
2073
  *
1961
2074
  * @param accountIdentifier - The identifier of the account to remove
1962
- * @throws {GenerateSignatureError} if the signature cannot be generated
1963
2075
  * @throws {SignerUnavailableError} if no signer is available
1964
2076
  */
1965
- removeAccount(accountIdentifier: Identifier): Promise<void>;
2077
+ removeAccount(identifier: Identifier): Promise<void>;
1966
2078
  /**
1967
2079
  * Revokes all other installations of the client's inbox
1968
2080
  *
1969
2081
  * Requires a signer, use `Client.create` to create a client with a signer.
1970
2082
  *
1971
- * @throws {GenerateSignatureError} if the signature cannot be generated
1972
2083
  * @throws {SignerUnavailableError} if no signer is available
1973
2084
  */
1974
2085
  revokeAllOtherInstallations(): Promise<void>;
@@ -1978,17 +2089,32 @@ declare class Client<ContentTypes = ExtractCodecContentTypes> extends ClientWork
1978
2089
  * Requires a signer, use `Client.create` to create a client with a signer.
1979
2090
  *
1980
2091
  * @param installationIds - The installation IDs to revoke
1981
- * @throws {GenerateSignatureError} if the signature cannot be generated
1982
2092
  * @throws {SignerUnavailableError} if no signer is available
1983
2093
  */
1984
2094
  revokeInstallations(installationIds: Uint8Array[]): Promise<void>;
2095
+ /**
2096
+ * Revokes specific installations of the client's inbox without a client
2097
+ *
2098
+ * @param env - The environment to use
2099
+ * @param signer - The signer to use
2100
+ * @param inboxId - The inbox ID to revoke installations for
2101
+ * @param installationIds - The installation IDs to revoke
2102
+ */
2103
+ static revokeInstallations(signer: Signer, inboxId: string, installationIds: Uint8Array[], env?: XmtpEnv): Promise<void>;
2104
+ /**
2105
+ * Gets the inbox state for the specified inbox IDs without a client
2106
+ *
2107
+ * @param inboxIds - The inbox IDs to get the state for
2108
+ * @param env - The environment to use
2109
+ * @returns The inbox state for the specified inbox IDs
2110
+ */
2111
+ static inboxStateFromInboxIds(inboxIds: string[], env?: XmtpEnv): Promise<SafeInboxState[]>;
1985
2112
  /**
1986
2113
  * Changes the recovery identifier for the client's inbox
1987
2114
  *
1988
2115
  * Requires a signer, use `Client.create` to create a client with a signer.
1989
2116
  *
1990
2117
  * @param identifier - The new recovery identifier
1991
- * @throws {GenerateSignatureError} if the signature cannot be generated
1992
2118
  * @throws {SignerUnavailableError} if no signer is available
1993
2119
  */
1994
2120
  changeRecoveryIdentifier(identifier: Identifier): Promise<void>;
@@ -2077,11 +2203,6 @@ declare class Client<ContentTypes = ExtractCodecContentTypes> extends ClientWork
2077
2203
  * @returns The key package statuses
2078
2204
  */
2079
2205
  getKeyPackageStatusesForInstallationIds(installationIds: string[]): Promise<Map<string, SafeKeyPackageStatus>>;
2080
- apiStatistics(): Promise<SafeApiStats>;
2081
- apiIdentityStatistics(): Promise<SafeIdentityStats>;
2082
- apiAggregateStatistics(): Promise<string>;
2083
- clearAllStatistics(): Promise<void>;
2084
- uploadDebugArchive(serverUrl?: string): Promise<string>;
2085
2206
  }
2086
2207
 
2087
2208
  type UtilsWorkerAction = {
@@ -2106,6 +2227,34 @@ type UtilsWorkerAction = {
2106
2227
  identifier: Identifier;
2107
2228
  env?: XmtpEnv;
2108
2229
  };
2230
+ } | {
2231
+ action: "utils.revokeInstallationsSignatureText";
2232
+ id: string;
2233
+ result: string;
2234
+ data: {
2235
+ env?: XmtpEnv;
2236
+ identifier: Identifier;
2237
+ inboxId: string;
2238
+ installationIds: Uint8Array[];
2239
+ };
2240
+ } | {
2241
+ action: "utils.revokeInstallations";
2242
+ id: string;
2243
+ result: undefined;
2244
+ data: {
2245
+ env?: XmtpEnv;
2246
+ signer: SafeSigner;
2247
+ inboxId: string;
2248
+ installationIds: Uint8Array[];
2249
+ };
2250
+ } | {
2251
+ action: "utils.inboxStateFromInboxIds";
2252
+ id: string;
2253
+ result: SafeInboxState[];
2254
+ data: {
2255
+ inboxIds: string[];
2256
+ env?: XmtpEnv;
2257
+ };
2109
2258
  };
2110
2259
 
2111
2260
  /**
@@ -2173,6 +2322,40 @@ declare class Utils extends UtilsWorkerClass {
2173
2322
  * @returns Promise that resolves with the inbox ID for the identifier
2174
2323
  */
2175
2324
  getInboxIdForIdentifier(identifier: Identifier, env?: XmtpEnv): Promise<string | undefined>;
2325
+ /**
2326
+ * Creates signature text for revoking installations
2327
+ *
2328
+ * WARNING: This function should be used with caution. It is only provided
2329
+ * for use in special cases where the provided workflows do not meet the
2330
+ * requirements of an application.
2331
+ *
2332
+ * It is highly recommended to use the `revokeInstallations` method instead.
2333
+ *
2334
+ * @param env - The environment to use
2335
+ * @param identifier - The identifier to revoke installations for
2336
+ * @param inboxId - The inbox ID to revoke installations for
2337
+ * @param installationIds - The installation IDs to revoke
2338
+ * @returns The signature text
2339
+ */
2340
+ revokeInstallationsSignatureText(identifier: Identifier, inboxId: string, installationIds: Uint8Array[], env?: XmtpEnv): Promise<string>;
2341
+ /**
2342
+ * Revokes installations for a given inbox ID
2343
+ *
2344
+ * @param env - The environment to use
2345
+ * @param signer - The signer to use
2346
+ * @param inboxId - The inbox ID to revoke installations for
2347
+ * @param installationIds - The installation IDs to revoke
2348
+ * @returns Promise that resolves with the result of the revoke installations operation
2349
+ */
2350
+ revokeInstallations(signer: Signer, inboxId: string, installationIds: Uint8Array[], env?: XmtpEnv): Promise<void>;
2351
+ /**
2352
+ * Gets the inbox state for the specified inbox IDs without a client
2353
+ *
2354
+ * @param inboxIds - The inbox IDs to get the state for
2355
+ * @param env - The environment to use
2356
+ * @returns The inbox state for the specified inbox IDs
2357
+ */
2358
+ inboxStateFromInboxIds(inboxIds: string[], env?: XmtpEnv): Promise<SafeInboxState[]>;
2176
2359
  }
2177
2360
 
2178
2361
  declare class ClientNotInitializedError extends Error {
@@ -2190,9 +2373,6 @@ declare class InboxReassignError extends Error {
2190
2373
  declare class AccountAlreadyAssociatedError extends Error {
2191
2374
  constructor(inboxId: string);
2192
2375
  }
2193
- declare class GenerateSignatureError extends Error {
2194
- constructor(signatureType: SignatureRequestType);
2195
- }
2196
2376
  declare class GroupNotFoundError extends Error {
2197
2377
  constructor(groupId: string);
2198
2378
  }
@@ -2206,4 +2386,4 @@ declare class MissingContentTypeError extends Error {
2206
2386
  constructor();
2207
2387
  }
2208
2388
 
2209
- export { AccountAlreadyAssociatedError, ApiUrls, AsyncStream, Client, ClientNotInitializedError, type ClientOptions, CodecNotFoundError, type ContentOptions, Conversation, Conversations, DecodedMessage, Dm, type ExtractCodecContentTypes, GenerateSignatureError, Group, GroupNotFoundError, HistorySyncUrls, type HmacKeys, InboxReassignError, InvalidGroupMembershipChangeError, type MessageDeliveryStatus, type MessageKind, MissingContentTypeError, type NetworkOptions, type OtherOptions, type SafeApiStats, type SafeConsent, type SafeContentTypeId, type SafeConversation, type SafeConversationDebugInfo, type SafeCreateDmOptions, type SafeCreateGroupOptions, type SafeEncodedContent, type SafeGroupMember, type SafeHmacKey, type SafeHmacKeys, type SafeIdentityStats, type SafeInboxState, type SafeInstallation, type SafeKeyPackageStatus, type SafeListConversationsOptions, type SafeListMessagesOptions, type SafeMessage, type SafeMessageDisappearingSettings, type SafePermissionPolicySet, type Signer, SignerUnavailableError, type StorageOptions, type StreamCallback, StreamNotFoundError, Utils, type XmtpEnv, fromContentTypeId, fromEncodedContent, fromSafeConsent, fromSafeContentTypeId, fromSafeCreateDmOptions, fromSafeCreateGroupOptions, fromSafeEncodedContent, fromSafeGroupMember, fromSafeListConversationsOptions, fromSafeListMessagesOptions, fromSafeMessageDisappearingSettings, fromSafePermissionPolicySet, toContentTypeId, toEncodedContent, toSafeApiStats, toSafeConsent, toSafeContentTypeId, toSafeConversation, toSafeConversationDebugInfo, toSafeCreateDmOptions, toSafeCreateGroupOptions, toSafeEncodedContent, toSafeGroupMember, toSafeHmacKey, toSafeIdentityStats, toSafeInboxState, toSafeInstallation, toSafeKeyPackageStatus, toSafeListConversationsOptions, toSafeListMessagesOptions, toSafeMessage, toSafeMessageDisappearingSettings, toSafePermissionPolicySet };
2389
+ export { AccountAlreadyAssociatedError, ApiUrls, AsyncStream, Client, ClientNotInitializedError, type ClientOptions, CodecNotFoundError, type ContentOptions, Conversation, Conversations, DecodedMessage, Dm, type EOASigner, type ExtractCodecContentTypes, Group, GroupNotFoundError, HistorySyncUrls, type HmacKeys, InboxReassignError, InvalidGroupMembershipChangeError, type MessageDeliveryStatus, type MessageKind, MissingContentTypeError, type NetworkOptions, type OtherOptions, type SCWSigner, type SafeApiStats, type SafeConsent, type SafeContentTypeId, type SafeConversation, type SafeConversationDebugInfo, type SafeCreateDmOptions, type SafeCreateGroupOptions, type SafeEncodedContent, type SafeGroupMember, type SafeHmacKey, type SafeHmacKeys, type SafeIdentityStats, type SafeInboxState, type SafeInstallation, type SafeKeyPackageStatus, type SafeListConversationsOptions, type SafeListMessagesOptions, type SafeMessage, type SafeMessageDisappearingSettings, type SafePermissionPolicySet, type SafeSigner, type Signer, SignerUnavailableError, type StorageOptions, type StreamCallback, StreamNotFoundError, Utils, type XmtpEnv, fromContentTypeId, fromEncodedContent, fromSafeConsent, fromSafeContentTypeId, fromSafeCreateDmOptions, fromSafeCreateGroupOptions, fromSafeEncodedContent, fromSafeGroupMember, fromSafeListConversationsOptions, fromSafeListMessagesOptions, fromSafeMessageDisappearingSettings, fromSafePermissionPolicySet, toContentTypeId, toEncodedContent, toSafeApiStats, toSafeConsent, toSafeContentTypeId, toSafeConversation, toSafeConversationDebugInfo, toSafeCreateDmOptions, toSafeCreateGroupOptions, toSafeEncodedContent, toSafeGroupMember, toSafeHmacKey, toSafeIdentityStats, toSafeInboxState, toSafeInstallation, toSafeKeyPackageStatus, toSafeListConversationsOptions, toSafeListMessagesOptions, toSafeMessage, toSafeMessageDisappearingSettings, toSafePermissionPolicySet, toSafeSigner };