@xmtp/node-sdk 3.2.1-dev.cb2628c → 3.2.2
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/README.md +1 -1
- package/dist/index.d.ts +127 -70
- package/dist/index.js +268 -264
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ To keep up with the latest SDK developments, see the [Issues tab](https://githu
|
|
|
9
9
|
|
|
10
10
|
## Documentation
|
|
11
11
|
|
|
12
|
-
To learn how to use the XMTP client SDK for Node
|
|
12
|
+
To learn how to use the XMTP client SDK for Node, see [Get started with the XMTP Node SDK](https://docs.xmtp.org/sdks/node).
|
|
13
13
|
|
|
14
14
|
## SDK reference
|
|
15
15
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ContentCodec, ContentTypeId, EncodedContent } from '@xmtp/content-type-primitives';
|
|
2
2
|
import * as _xmtp_node_bindings from '@xmtp/node-bindings';
|
|
3
|
-
import { LogLevel, Message, Conversation as Conversation$1, ListMessagesOptions, ConsentState, PermissionUpdateType, PermissionPolicy, MetadataField, Identifier, Conversations as Conversations$1, CreateGroupOptions, CreateDmOptions, ListConversationsOptions, ConversationType, Client as Client$1, Consent, ConsentEntityType,
|
|
4
|
-
export { Consent, ConsentEntityType, ConsentState, ContentType, ContentTypeId, ConversationListItem, ConversationType, CreateDmOptions, CreateGroupOptions, DeliveryStatus, EncodedContent, GroupMember, GroupMembershipState, GroupMessageKind, GroupMetadata, GroupPermissions, GroupPermissionsOptions, HmacKey, Identifier, IdentifierKind, InboxState, Installation, KeyPackageStatus, Lifetime, ListConversationsOptions, ListMessagesOptions, LogLevel, LogOptions, Message, MessageDisappearingSettings, MetadataField, PermissionLevel, PermissionPolicy, PermissionPolicySet, PermissionUpdateType,
|
|
3
|
+
import { LogLevel, Message, Conversation as Conversation$1, ListMessagesOptions, ConsentState, PermissionUpdateType, PermissionPolicy, MetadataField, Identifier, Conversations as Conversations$1, CreateGroupOptions, CreateDmOptions, ListConversationsOptions, ConversationType, Client as Client$1, Consent, ConsentEntityType, SignatureRequestHandle } from '@xmtp/node-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, KeyPackageStatus, Lifetime, ListConversationsOptions, ListMessagesOptions, LogLevel, LogOptions, Message, MessageDisappearingSettings, MetadataField, PermissionLevel, PermissionPolicy, PermissionPolicySet, PermissionUpdateType, SignatureRequestHandle, SortDirection } from '@xmtp/node-bindings';
|
|
5
5
|
import { GroupUpdatedCodec } from '@xmtp/content-type-group-updated';
|
|
6
6
|
import { TextCodec } from '@xmtp/content-type-text';
|
|
7
7
|
|
|
@@ -115,21 +115,16 @@ type ResolveValue<T> = {
|
|
|
115
115
|
type StreamCallback<T> = (err: Error | null, value: T | undefined) => void;
|
|
116
116
|
declare class AsyncStream<T> {
|
|
117
117
|
#private;
|
|
118
|
-
onReturn: (() => void) | undefined;
|
|
119
|
-
onError: ((error: Error) => void) | undefined;
|
|
120
118
|
constructor();
|
|
121
|
-
get error(): Error |
|
|
119
|
+
get error(): Error | undefined;
|
|
122
120
|
get isDone(): boolean;
|
|
121
|
+
set onReturn(callback: () => void);
|
|
122
|
+
set onError(callback: (error: Error) => void);
|
|
123
|
+
set onDone(callback: () => void);
|
|
123
124
|
callback: StreamCallback<T>;
|
|
124
125
|
next: () => Promise<ResolveValue<T>>;
|
|
125
|
-
return: (value?: T) => Promise<
|
|
126
|
-
|
|
127
|
-
value: T | undefined;
|
|
128
|
-
}>;
|
|
129
|
-
end: () => Promise<{
|
|
130
|
-
done: boolean;
|
|
131
|
-
value: T | undefined;
|
|
132
|
-
}>;
|
|
126
|
+
return: (value?: T) => Promise<ResolveValue<T>>;
|
|
127
|
+
end: () => Promise<ResolveValue<T>>;
|
|
133
128
|
[Symbol.asyncIterator](): this;
|
|
134
129
|
}
|
|
135
130
|
|
|
@@ -234,7 +229,7 @@ declare class Conversation<ContentTypes = unknown> {
|
|
|
234
229
|
* @param callback - Optional callback function for handling new stream values
|
|
235
230
|
* @returns Stream instance for new messages
|
|
236
231
|
*/
|
|
237
|
-
stream(callback?: StreamCallback<DecodedMessage<ContentTypes
|
|
232
|
+
stream(callback?: StreamCallback<DecodedMessage<ContentTypes>>, onFail?: () => void): AsyncStream<DecodedMessage<ContentTypes>>;
|
|
238
233
|
/**
|
|
239
234
|
* Publishes pending messages that were sent optimistically
|
|
240
235
|
*
|
|
@@ -314,7 +309,7 @@ declare class Conversation<ContentTypes = unknown> {
|
|
|
314
309
|
*
|
|
315
310
|
* @returns The HMAC keys for this conversation
|
|
316
311
|
*/
|
|
317
|
-
getHmacKeys(): _xmtp_node_bindings.HmacKey[]
|
|
312
|
+
getHmacKeys(): Record<string, _xmtp_node_bindings.HmacKey[]>;
|
|
318
313
|
/**
|
|
319
314
|
* Retrieves information for this conversation to help with debugging
|
|
320
315
|
*
|
|
@@ -594,42 +589,42 @@ declare class Conversations<ContentTypes = unknown> {
|
|
|
594
589
|
* @param callback - Optional callback function for handling new stream value
|
|
595
590
|
* @returns Stream instance for new conversations
|
|
596
591
|
*/
|
|
597
|
-
stream(callback?: StreamCallback<Group<ContentTypes> | Dm<ContentTypes
|
|
592
|
+
stream(callback?: StreamCallback<Group<ContentTypes> | Dm<ContentTypes>>, onFail?: () => void): AsyncStream<Group<ContentTypes> | Dm<ContentTypes>>;
|
|
598
593
|
/**
|
|
599
594
|
* Creates a stream for new group conversations
|
|
600
595
|
*
|
|
601
596
|
* @param callback - Optional callback function for handling new stream value
|
|
602
597
|
* @returns Stream instance for new group conversations
|
|
603
598
|
*/
|
|
604
|
-
streamGroups(callback?: StreamCallback<Group<ContentTypes
|
|
599
|
+
streamGroups(callback?: StreamCallback<Group<ContentTypes>>, onFail?: () => void): AsyncStream<Group<ContentTypes>>;
|
|
605
600
|
/**
|
|
606
601
|
* Creates a stream for new DM conversations
|
|
607
602
|
*
|
|
608
603
|
* @param callback - Optional callback function for handling new stream value
|
|
609
604
|
* @returns Stream instance for new DM conversations
|
|
610
605
|
*/
|
|
611
|
-
streamDms(callback?: StreamCallback<Dm<ContentTypes
|
|
606
|
+
streamDms(callback?: StreamCallback<Dm<ContentTypes>>, onFail?: () => void): AsyncStream<Dm<ContentTypes>>;
|
|
612
607
|
/**
|
|
613
608
|
* Creates a stream for all new messages
|
|
614
609
|
*
|
|
615
610
|
* @param callback - Optional callback function for handling new stream value
|
|
616
611
|
* @returns Stream instance for new messages
|
|
617
612
|
*/
|
|
618
|
-
streamAllMessages(callback?: StreamCallback<DecodedMessage<ContentTypes>>, conversationType?: ConversationType, consentStates?: ConsentState[]): Promise<AsyncStream<DecodedMessage<ContentTypes>>>;
|
|
613
|
+
streamAllMessages(callback?: StreamCallback<DecodedMessage<ContentTypes>>, conversationType?: ConversationType, consentStates?: ConsentState[], onFail?: () => void): Promise<AsyncStream<DecodedMessage<ContentTypes>>>;
|
|
619
614
|
/**
|
|
620
615
|
* Creates a stream for all new group messages
|
|
621
616
|
*
|
|
622
617
|
* @param callback - Optional callback function for handling new stream value
|
|
623
618
|
* @returns Stream instance for new group messages
|
|
624
619
|
*/
|
|
625
|
-
streamAllGroupMessages(callback?: StreamCallback<DecodedMessage<ContentTypes>>, consentStates?: ConsentState[]): Promise<AsyncStream<DecodedMessage<ContentTypes>>>;
|
|
620
|
+
streamAllGroupMessages(callback?: StreamCallback<DecodedMessage<ContentTypes>>, consentStates?: ConsentState[], onFail?: () => void): Promise<AsyncStream<DecodedMessage<ContentTypes>>>;
|
|
626
621
|
/**
|
|
627
622
|
* Creates a stream for all new DM messages
|
|
628
623
|
*
|
|
629
624
|
* @param callback - Optional callback function for handling new stream value
|
|
630
625
|
* @returns Stream instance for new DM messages
|
|
631
626
|
*/
|
|
632
|
-
streamAllDmMessages(callback?: StreamCallback<DecodedMessage<ContentTypes>>, consentStates?: ConsentState[]): Promise<AsyncStream<DecodedMessage<ContentTypes>>>;
|
|
627
|
+
streamAllDmMessages(callback?: StreamCallback<DecodedMessage<ContentTypes>>, consentStates?: ConsentState[], onFail?: () => void): Promise<AsyncStream<DecodedMessage<ContentTypes>>>;
|
|
633
628
|
/**
|
|
634
629
|
* Retrieves HMAC keys for all conversations
|
|
635
630
|
*
|
|
@@ -638,6 +633,21 @@ declare class Conversations<ContentTypes = unknown> {
|
|
|
638
633
|
hmacKeys(): Record<string, _xmtp_node_bindings.HmacKey[]>;
|
|
639
634
|
}
|
|
640
635
|
|
|
636
|
+
/**
|
|
637
|
+
* Debug information helpers for the client
|
|
638
|
+
*
|
|
639
|
+
* This class is not intended to be initialized directly.
|
|
640
|
+
*/
|
|
641
|
+
declare class DebugInformation {
|
|
642
|
+
#private;
|
|
643
|
+
constructor(client: Client$1, options?: ClientOptions);
|
|
644
|
+
apiStatistics(): _xmtp_node_bindings.ApiStats;
|
|
645
|
+
apiIdentityStatistics(): _xmtp_node_bindings.IdentityStats;
|
|
646
|
+
apiAggregateStatistics(): string;
|
|
647
|
+
clearAllStatistics(): void;
|
|
648
|
+
uploadDebugArchive(serverUrl?: string): Promise<string>;
|
|
649
|
+
}
|
|
650
|
+
|
|
641
651
|
type PreferenceUpdate = {
|
|
642
652
|
type: string;
|
|
643
653
|
HmacKeyUpdate?: {
|
|
@@ -702,14 +712,14 @@ declare class Preferences {
|
|
|
702
712
|
* @param callback - Optional callback function for handling stream updates
|
|
703
713
|
* @returns Stream instance for consent updates
|
|
704
714
|
*/
|
|
705
|
-
streamConsent(callback?: StreamCallback<Consent[]
|
|
715
|
+
streamConsent(callback?: StreamCallback<Consent[]>, onFail?: () => void): AsyncStream<Consent[]>;
|
|
706
716
|
/**
|
|
707
717
|
* Creates a stream of user preference updates
|
|
708
718
|
*
|
|
709
719
|
* @param callback - Optional callback function for handling stream updates
|
|
710
720
|
* @returns Stream instance for preference updates
|
|
711
721
|
*/
|
|
712
|
-
streamPreferences(callback?: StreamCallback<PreferenceUpdate
|
|
722
|
+
streamPreferences(callback?: StreamCallback<PreferenceUpdate>, onFail?: () => void): AsyncStream<PreferenceUpdate>;
|
|
713
723
|
}
|
|
714
724
|
|
|
715
725
|
type SignMessage = (message: string) => Promise<Uint8Array> | Uint8Array;
|
|
@@ -728,11 +738,15 @@ type Signer = {
|
|
|
728
738
|
getChainId: GetChainId;
|
|
729
739
|
};
|
|
730
740
|
|
|
731
|
-
type
|
|
741
|
+
type ExtractCodecContentTypes<C extends ContentCodec[] = []> = [
|
|
742
|
+
...C,
|
|
743
|
+
GroupUpdatedCodec,
|
|
744
|
+
TextCodec
|
|
745
|
+
][number] extends ContentCodec<infer T> ? T : never;
|
|
732
746
|
/**
|
|
733
747
|
* Client for interacting with the XMTP network
|
|
734
748
|
*/
|
|
735
|
-
declare class Client<ContentTypes =
|
|
749
|
+
declare class Client<ContentTypes = ExtractCodecContentTypes> {
|
|
736
750
|
#private;
|
|
737
751
|
/**
|
|
738
752
|
* Creates a new XMTP client instance
|
|
@@ -761,7 +775,7 @@ declare class Client<ContentTypes = unknown> {
|
|
|
761
775
|
*/
|
|
762
776
|
static create<ContentCodecs extends ContentCodec[] = []>(signer: Signer, options?: Omit<ClientOptions, "codecs"> & {
|
|
763
777
|
codecs?: ContentCodecs;
|
|
764
|
-
}): Promise<Client<
|
|
778
|
+
}): Promise<Client<ExtractCodecContentTypes<ContentCodecs>>>;
|
|
765
779
|
/**
|
|
766
780
|
* Creates a new client instance with an identifier
|
|
767
781
|
*
|
|
@@ -774,7 +788,7 @@ declare class Client<ContentTypes = unknown> {
|
|
|
774
788
|
*/
|
|
775
789
|
static build<ContentCodecs extends ContentCodec[] = []>(identifier: Identifier, options?: Omit<ClientOptions, "codecs"> & {
|
|
776
790
|
codecs?: ContentCodecs;
|
|
777
|
-
}): Promise<Client<
|
|
791
|
+
}): Promise<Client<ExtractCodecContentTypes<ContentCodecs>>>;
|
|
778
792
|
/**
|
|
779
793
|
* Gets the client options
|
|
780
794
|
*/
|
|
@@ -811,6 +825,12 @@ declare class Client<ContentTypes = unknown> {
|
|
|
811
825
|
* @throws {ClientNotInitializedError} if the client is not initialized
|
|
812
826
|
*/
|
|
813
827
|
get conversations(): Conversations<ContentTypes>;
|
|
828
|
+
/**
|
|
829
|
+
* Gets the debug information helpersfor this client
|
|
830
|
+
*
|
|
831
|
+
* @throws {ClientNotInitializedError} if the client is not initialized
|
|
832
|
+
*/
|
|
833
|
+
get debugInformation(): DebugInformation;
|
|
814
834
|
/**
|
|
815
835
|
* Gets the preferences manager for this client
|
|
816
836
|
*
|
|
@@ -818,7 +838,24 @@ declare class Client<ContentTypes = unknown> {
|
|
|
818
838
|
*/
|
|
819
839
|
get preferences(): Preferences;
|
|
820
840
|
/**
|
|
821
|
-
*
|
|
841
|
+
* Adds a signature to a signature request using the client's signer (or the
|
|
842
|
+
* provided signer)
|
|
843
|
+
*
|
|
844
|
+
* WARNING: This function should be used with caution. It is only provided
|
|
845
|
+
* for use in special cases where the provided workflows do not meet the
|
|
846
|
+
* requirements of an application.
|
|
847
|
+
*
|
|
848
|
+
* It is highly recommended to use the `register`, `unsafe_addAccount`,
|
|
849
|
+
* `removeAccount`, `revokeAllOtherInstallations`, or `revokeInstallations`
|
|
850
|
+
* methods instead.
|
|
851
|
+
*
|
|
852
|
+
* @param signatureRequest - The signature request to add the signature to
|
|
853
|
+
* @throws {ClientNotInitializedError} if the client is not initialized
|
|
854
|
+
* @throws {SignerUnavailableError} if no signer is available
|
|
855
|
+
*/
|
|
856
|
+
unsafe_addSignature(signatureRequest: SignatureRequestHandle, signer?: Signer): Promise<void>;
|
|
857
|
+
/**
|
|
858
|
+
* Returns a signature request handler for creating a new inbox
|
|
822
859
|
*
|
|
823
860
|
* WARNING: This function should be used with caution. It is only provided
|
|
824
861
|
* for use in special cases where the provided workflows do not meet the
|
|
@@ -829,9 +866,10 @@ declare class Client<ContentTypes = unknown> {
|
|
|
829
866
|
* @returns The signature text
|
|
830
867
|
* @throws {ClientNotInitializedError} if the client is not initialized
|
|
831
868
|
*/
|
|
832
|
-
|
|
869
|
+
unsafe_createInboxSignatureRequest(): Promise<SignatureRequestHandle | null>;
|
|
833
870
|
/**
|
|
834
|
-
*
|
|
871
|
+
* Returns a signature request handler for adding a new account to the
|
|
872
|
+
* client's inbox
|
|
835
873
|
*
|
|
836
874
|
* WARNING: This function should be used with caution. It is only provided
|
|
837
875
|
* for use in special cases where the provided workflows do not meet the
|
|
@@ -847,9 +885,10 @@ declare class Client<ContentTypes = unknown> {
|
|
|
847
885
|
* @returns The signature text
|
|
848
886
|
* @throws {ClientNotInitializedError} if the client is not initialized
|
|
849
887
|
*/
|
|
850
|
-
|
|
888
|
+
unsafe_addAccountSignatureRequest(newAccountIdentifier: Identifier, allowInboxReassign?: boolean): Promise<SignatureRequestHandle>;
|
|
851
889
|
/**
|
|
852
|
-
*
|
|
890
|
+
* Returns a signature request handler for removing an account from the
|
|
891
|
+
* client's inbox
|
|
853
892
|
*
|
|
854
893
|
* WARNING: This function should be used with caution. It is only provided
|
|
855
894
|
* for use in special cases where the provided workflows do not meet the
|
|
@@ -861,10 +900,10 @@ declare class Client<ContentTypes = unknown> {
|
|
|
861
900
|
* @returns The signature text
|
|
862
901
|
* @throws {ClientNotInitializedError} if the client is not initialized
|
|
863
902
|
*/
|
|
864
|
-
|
|
903
|
+
unsafe_removeAccountSignatureRequest(identifier: Identifier): Promise<SignatureRequestHandle>;
|
|
865
904
|
/**
|
|
866
|
-
*
|
|
867
|
-
* client's inbox
|
|
905
|
+
* Returns a signature request handler for revoking all other installations
|
|
906
|
+
* of the client's inbox
|
|
868
907
|
*
|
|
869
908
|
* WARNING: This function should be used with caution. It is only provided
|
|
870
909
|
* for use in special cases where the provided workflows do not meet the
|
|
@@ -875,10 +914,10 @@ declare class Client<ContentTypes = unknown> {
|
|
|
875
914
|
* @returns The signature text
|
|
876
915
|
* @throws {ClientNotInitializedError} if the client is not initialized
|
|
877
916
|
*/
|
|
878
|
-
|
|
917
|
+
unsafe_revokeAllOtherInstallationsSignatureRequest(): Promise<SignatureRequestHandle>;
|
|
879
918
|
/**
|
|
880
|
-
*
|
|
881
|
-
* client's inbox
|
|
919
|
+
* Returns a signature request handler for revoking specific installations
|
|
920
|
+
* of the client's inbox
|
|
882
921
|
*
|
|
883
922
|
* WARNING: This function should be used with caution. It is only provided
|
|
884
923
|
* for use in special cases where the provided workflows do not meet the
|
|
@@ -890,10 +929,10 @@ declare class Client<ContentTypes = unknown> {
|
|
|
890
929
|
* @returns The signature text
|
|
891
930
|
* @throws {ClientNotInitializedError} if the client is not initialized
|
|
892
931
|
*/
|
|
893
|
-
|
|
932
|
+
unsafe_revokeInstallationsSignatureRequest(installationIds: Uint8Array[]): Promise<SignatureRequestHandle>;
|
|
894
933
|
/**
|
|
895
|
-
*
|
|
896
|
-
* client's inbox
|
|
934
|
+
* Returns a signature request handler for changing the recovery identifier
|
|
935
|
+
* for this client's inbox
|
|
897
936
|
*
|
|
898
937
|
* WARNING: This function should be used with caution. It is only provided
|
|
899
938
|
* for use in special cases where the provided workflows do not meet the
|
|
@@ -905,9 +944,9 @@ declare class Client<ContentTypes = unknown> {
|
|
|
905
944
|
* @returns The signature text
|
|
906
945
|
* @throws {ClientNotInitializedError} if the client is not initialized
|
|
907
946
|
*/
|
|
908
|
-
|
|
947
|
+
unsafe_changeRecoveryIdentifierSignatureRequest(identifier: Identifier): Promise<SignatureRequestHandle>;
|
|
909
948
|
/**
|
|
910
|
-
*
|
|
949
|
+
* Applies a signature request to the client
|
|
911
950
|
*
|
|
912
951
|
* WARNING: This function should be used with caution. It is only provided
|
|
913
952
|
* for use in special cases where the provided workflows do not meet the
|
|
@@ -917,26 +956,9 @@ declare class Client<ContentTypes = unknown> {
|
|
|
917
956
|
* `removeAccount`, `revokeAllOtherInstallations`, or `revokeInstallations`
|
|
918
957
|
* methods instead.
|
|
919
958
|
*
|
|
920
|
-
* @param signatureType - The type of signature request
|
|
921
|
-
* @param signatureText - The text to sign
|
|
922
|
-
* @param signer - The signer to use
|
|
923
959
|
* @throws {ClientNotInitializedError} if the client is not initialized
|
|
924
960
|
*/
|
|
925
|
-
|
|
926
|
-
/**
|
|
927
|
-
* Applies all pending signatures
|
|
928
|
-
*
|
|
929
|
-
* WARNING: This function should be used with caution. It is only provided
|
|
930
|
-
* for use in special cases where the provided workflows do not meet the
|
|
931
|
-
* requirements of an application.
|
|
932
|
-
*
|
|
933
|
-
* It is highly recommended to use the `register`, `unsafe_addAccount`,
|
|
934
|
-
* `removeAccount`, `revokeAllOtherInstallations`, or `revokeInstallations`
|
|
935
|
-
* methods instead.
|
|
936
|
-
*
|
|
937
|
-
* @throws {ClientNotInitializedError} if the client is not initialized
|
|
938
|
-
*/
|
|
939
|
-
unsafe_applySignatures(): Promise<void>;
|
|
961
|
+
unsafe_applySignatureRequest(signatureRequest: SignatureRequestHandle): Promise<void>;
|
|
940
962
|
/**
|
|
941
963
|
* Registers the client with the XMTP network
|
|
942
964
|
*
|
|
@@ -960,9 +982,8 @@ declare class Client<ContentTypes = unknown> {
|
|
|
960
982
|
*
|
|
961
983
|
* @param newAccountSigner - The signer for the new account
|
|
962
984
|
* @param allowInboxReassign - Whether to allow inbox reassignment
|
|
963
|
-
* @throws {ClientNotInitializedError} if the client is not initialized
|
|
964
985
|
* @throws {AccountAlreadyAssociatedError} if the account is already associated with an inbox ID
|
|
965
|
-
* @throws {
|
|
986
|
+
* @throws {ClientNotInitializedError} if the client is not initialized
|
|
966
987
|
* @throws {SignerUnavailableError} if no signer is available
|
|
967
988
|
*/
|
|
968
989
|
unsafe_addAccount(newAccountSigner: Signer, allowInboxReassign?: boolean): Promise<void>;
|
|
@@ -973,7 +994,6 @@ declare class Client<ContentTypes = unknown> {
|
|
|
973
994
|
*
|
|
974
995
|
* @param identifier - The identifier of the account to remove
|
|
975
996
|
* @throws {ClientNotInitializedError} if the client is not initialized
|
|
976
|
-
* @throws {GenerateSignatureError} if the signature cannot be generated
|
|
977
997
|
* @throws {SignerUnavailableError} if no signer is available
|
|
978
998
|
*/
|
|
979
999
|
removeAccount(identifier: Identifier): Promise<void>;
|
|
@@ -983,7 +1003,6 @@ declare class Client<ContentTypes = unknown> {
|
|
|
983
1003
|
* Requires a signer, use `Client.create` to create a client with a signer.
|
|
984
1004
|
*
|
|
985
1005
|
* @throws {ClientNotInitializedError} if the client is not initialized
|
|
986
|
-
* @throws {GenerateSignatureError} if the signature cannot be generated
|
|
987
1006
|
* @throws {SignerUnavailableError} if no signer is available
|
|
988
1007
|
*/
|
|
989
1008
|
revokeAllOtherInstallations(): Promise<void>;
|
|
@@ -995,9 +1014,25 @@ declare class Client<ContentTypes = unknown> {
|
|
|
995
1014
|
* @param installationIds - The installation IDs to revoke
|
|
996
1015
|
* @throws {ClientNotInitializedError} if the client is not initialized
|
|
997
1016
|
* @throws {SignerUnavailableError} if no signer is available
|
|
998
|
-
* @throws {GenerateSignatureError} if the signature cannot be generated
|
|
999
1017
|
*/
|
|
1000
1018
|
revokeInstallations(installationIds: Uint8Array[]): Promise<void>;
|
|
1019
|
+
/**
|
|
1020
|
+
* Revokes specific installations of the client's inbox without a client
|
|
1021
|
+
*
|
|
1022
|
+
* @param env - The environment to use
|
|
1023
|
+
* @param signer - The signer to use
|
|
1024
|
+
* @param inboxId - The inbox ID to revoke installations for
|
|
1025
|
+
* @param installationIds - The installation IDs to revoke
|
|
1026
|
+
*/
|
|
1027
|
+
static revokeInstallations(signer: Signer, inboxId: string, installationIds: Uint8Array[], env?: XmtpEnv): Promise<void>;
|
|
1028
|
+
/**
|
|
1029
|
+
* Gets the inbox state for the specified inbox IDs without a client
|
|
1030
|
+
*
|
|
1031
|
+
* @param env - The environment to use
|
|
1032
|
+
* @param inboxIds - The inbox IDs to get the state for
|
|
1033
|
+
* @returns The inbox state for the specified inbox IDs
|
|
1034
|
+
*/
|
|
1035
|
+
static inboxStateFromInboxIds(inboxIds: string[], env?: XmtpEnv): Promise<_xmtp_node_bindings.InboxState[]>;
|
|
1001
1036
|
/**
|
|
1002
1037
|
* Changes the recovery identifier for the client's inbox
|
|
1003
1038
|
*
|
|
@@ -1006,7 +1041,6 @@ declare class Client<ContentTypes = unknown> {
|
|
|
1006
1041
|
* @param identifier - The new recovery identifier
|
|
1007
1042
|
* @throws {ClientNotInitializedError} if the client is not initialized
|
|
1008
1043
|
* @throws {SignerUnavailableError} if no signer is available
|
|
1009
|
-
* @throws {GenerateSignatureError} if the signature cannot be generated
|
|
1010
1044
|
*/
|
|
1011
1045
|
changeRecoveryIdentifier(identifier: Identifier): Promise<void>;
|
|
1012
1046
|
/**
|
|
@@ -1101,7 +1135,7 @@ declare class Client<ContentTypes = unknown> {
|
|
|
1101
1135
|
* @param options - Optional network options
|
|
1102
1136
|
* @returns Whether the address is authorized
|
|
1103
1137
|
*/
|
|
1104
|
-
static isAddressAuthorized(inboxId: string, address: string,
|
|
1138
|
+
static isAddressAuthorized(inboxId: string, address: string, env?: XmtpEnv): Promise<boolean>;
|
|
1105
1139
|
/**
|
|
1106
1140
|
* Checks if an installation is authorized for an inbox
|
|
1107
1141
|
*
|
|
@@ -1110,7 +1144,7 @@ declare class Client<ContentTypes = unknown> {
|
|
|
1110
1144
|
* @param options - Optional network options
|
|
1111
1145
|
* @returns Whether the installation is authorized
|
|
1112
1146
|
*/
|
|
1113
|
-
static isInstallationAuthorized(inboxId: string, installation: Uint8Array,
|
|
1147
|
+
static isInstallationAuthorized(inboxId: string, installation: Uint8Array, env?: XmtpEnv): Promise<boolean>;
|
|
1114
1148
|
/**
|
|
1115
1149
|
* Gets the version of the Node bindings
|
|
1116
1150
|
*/
|
|
@@ -1120,4 +1154,27 @@ declare class Client<ContentTypes = unknown> {
|
|
|
1120
1154
|
declare const generateInboxId: (identifier: Identifier) => string;
|
|
1121
1155
|
declare const getInboxIdForIdentifier: (identifier: Identifier, env?: XmtpEnv) => Promise<string | null>;
|
|
1122
1156
|
|
|
1123
|
-
|
|
1157
|
+
declare class CodecNotFoundError extends Error {
|
|
1158
|
+
constructor(contentType: ContentTypeId);
|
|
1159
|
+
}
|
|
1160
|
+
declare class InboxReassignError extends Error {
|
|
1161
|
+
constructor();
|
|
1162
|
+
}
|
|
1163
|
+
declare class AccountAlreadyAssociatedError extends Error {
|
|
1164
|
+
constructor(inboxId: string);
|
|
1165
|
+
}
|
|
1166
|
+
declare class InvalidGroupMembershipChangeError extends Error {
|
|
1167
|
+
constructor(messageId: string);
|
|
1168
|
+
}
|
|
1169
|
+
declare class MissingContentTypeError extends Error {
|
|
1170
|
+
constructor();
|
|
1171
|
+
}
|
|
1172
|
+
declare class SignerUnavailableError extends Error {
|
|
1173
|
+
constructor();
|
|
1174
|
+
}
|
|
1175
|
+
declare class ClientNotInitializedError extends Error {
|
|
1176
|
+
constructor();
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
export { AccountAlreadyAssociatedError, ApiUrls, AsyncStream, Client, ClientNotInitializedError, CodecNotFoundError, Conversation, Conversations, DecodedMessage, Dm, Group, HistorySyncUrls, InboxReassignError, InvalidGroupMembershipChangeError, MissingContentTypeError, SignerUnavailableError, generateInboxId, getInboxIdForIdentifier };
|
|
1180
|
+
export type { ClientOptions, ExtractCodecContentTypes, NetworkOptions, OtherOptions, PreferenceUpdate, Signer, StorageOptions, StreamCallback, XmtpEnv };
|