Other types and variables
Type Aliases
ClientOptions
ClientOptions: Flatten
<NetworkOptions
& KeyStoreOptions
& ContentOptions
& LegacyOptions
& PreEventCallbackOptions
>
Aggregate type for client options. Optional properties are used when the default value is calculated on invocation, and are computed as needed by each function. All other defaults are specified in defaultOptions.
Defined in
Composite
Composite: { content
: any
; type
: ContentTypeId
} | { parts
: Composite
[] }
Defined in
ContentOptions
ContentOptions: Object
Type declaration
Name | Type | Description |
---|---|---|
codecs | ContentCodec <any >[] | Allow configuring codecs for additional content types |
maxContentSize | number | Set the maximum content size in bytes that is allowed by the Client. Currently only checked when decompressing compressed content. |
Defined in
InvitationContext
InvitationContext: Object
Type declaration
Name | Type |
---|---|
conversationId | string |
metadata | { [k: string] : string ; } |
Defined in
KeyStoreOptions
KeyStoreOptions: Object
Type declaration
Name | Type | Description |
---|---|---|
keystoreProviders | KeystoreProvider [] | Provide an array of KeystoreProviders. The client will attempt to use each one in sequence until one successfully returns a Keystore instance |
persistConversations | boolean | Enable the Keystore to persist conversations in the provided storage interface |
privateKeyOverride? | Uint8Array | Provide a XMTP PrivateKeyBundle encoded as a Uint8Array. A bundle can be retried using Client.getKeys(...) |
Defined in
LegacyOptions
LegacyOptions: Object
Type declaration
Name | Type |
---|---|
publishLegacyContact? | boolean |
Defined in
ListMessagesOptions
ListMessagesOptions: Object
Type declaration
Name | Type |
---|---|
checkAddresses? | boolean |
direction? | messageApi.SortDirection |
endTime? | Date |
limit? | number |
startTime? | Date |
Defined in
Message
Message: MessageV1
| MessageV2
Defined in
NetworkOptions
NetworkOptions: Object
Network startup options
Type declaration
Name | Type | Description |
---|---|---|
apiUrl | string | undefined | apiUrl can be used to override the env flag and connect to a specific endpoint |
appVersion? | string | identifier that's included with API requests. For example, you can use the following format: appVersion: APP_NAME + '/' + APP_VERSION . Setting this value provides telemetry that shows which apps are using the XMTP client SDK. This information can help XMTP developers provide app support, especially around communicating important SDK updates, including deprecations and required upgrades. |
env | XmtpEnv | Specify which XMTP environment to connect to. (default: dev ) |
skipContactPublishing | boolean | Skip publishing the user's contact bundle as part of Client startup. This flag should be used with caution, as we rely on contact publishing to let other users know your public key and periodically run migrations on this data with new SDK versions. Your application should have this flag set to false at least some of the time. The most common use-case for setting this to true is cases where the Client instance is very short-lived. For example, spinning up a Client to decrypt a push notification. |
Defined in
PrivateKeyBundle
PrivateKeyBundle: PrivateKeyBundleV1
| PrivateKeyBundleV2
Defined in
crypto/PrivateKeyBundle.ts:248
SendOptions
SendOptions: Object
Type declaration
Name | Type |
---|---|
compression? | proto.Compression |
contentFallback? | string |
contentType? | ContentTypeId |
ephemeral? | boolean |
timestamp? | Date |
Defined in
TopicData
TopicData: WithoutUndefined
<keystore.TopicMap_TopicData
>
Defined in
TypingNotification
TypingNotification: Object
Type declaration
Name | Type |
---|---|
isFinished | boolean |
timestamp | Date |
typerAddress | string |
Defined in
codecs/TypingNotification.ts:13
Variables
ApiUrls
Const
ApiUrls: Object
Type declaration
Name | Type |
---|---|
dev | "https://dev.xmtp.network" |
local | "http://localhost:5555" |
production | "https://production.xmtp.network" |
Defined in
Compression
Compression: typeof Compression
Defined in
ContentTypeComposite
Const
ContentTypeComposite: ContentTypeId
Defined in
ContentTypeFallback
Const
ContentTypeFallback: ContentTypeId
Defined in
ContentTypeText
Const
ContentTypeText: ContentTypeId
Defined in
ContentTypeTypingNotification
Const
ContentTypeTypingNotification: ContentTypeId
Defined in
codecs/TypingNotification.ts:6
SortDirection
SortDirection: typeof SortDirection
Defined in
Functions
buildContentTopic
buildContentTopic(name
): string
Parameters
Name | Type |
---|---|
name | string |
Returns
string
Defined in
buildDirectMessageTopic
buildDirectMessageTopic(sender
, recipient
): string
Parameters
Name | Type |
---|---|
sender | string |
recipient | string |
Returns
string
Defined in
buildDirectMessageTopicV2
buildDirectMessageTopicV2(randomString
): string
Parameters
Name | Type |
---|---|
randomString | string |
Returns
string
Defined in
buildUserContactTopic
buildUserContactTopic(walletAddr
): string
Parameters
Name | Type |
---|---|
walletAddr | string |
Returns
string
Defined in
buildUserIntroTopic
buildUserIntroTopic(walletAddr
): string
Parameters
Name | Type |
---|---|
walletAddr | string |
Returns
string
Defined in
buildUserInviteTopic
buildUserInviteTopic(walletAddr
): string
Parameters
Name | Type |
---|---|
walletAddr | string |
Returns
string
Defined in
buildUserPrivateStoreTopic
buildUserPrivateStoreTopic(addrPrefixedKey
): string
Parameters
Name | Type |
---|---|
addrPrefixedKey | string |
Returns
string
Defined in
dateToNs
dateToNs(date
): Long
Parameters
Name | Type |
---|---|
date | Date |
Returns
Long
Defined in
decodeContactBundle
decodeContactBundle(bytes
): PublicKeyBundle
| SignedPublicKeyBundle
Parameters
Name | Type |
---|---|
bytes | Uint8Array |
Returns
PublicKeyBundle
| SignedPublicKeyBundle
Defined in
decodeContent
decodeContent(contentBytes
, client
): Promise
<{ content
: any
; contentType
: ContentTypeId
; error
: undefined
| Error
}>
Parameters
Name | Type |
---|---|
contentBytes | Uint8Array |
client | Client |
Returns
Promise
<{ content
: any
; contentType
: ContentTypeId
; error
: undefined
| Error
}>
Defined in
decrypt
decrypt(encrypted
, secret
, additionalData?
): Promise
<Uint8Array
>
Parameters
Name | Type |
---|---|
encrypted | Ciphertext | Ciphertext |
secret | Uint8Array |
additionalData? | Uint8Array |
Returns
Promise
<Uint8Array
>
Defined in
encrypt
encrypt(plain
, secret
, additionalData?
): Promise
<Ciphertext
>
Parameters
Name | Type |
---|---|
plain | Uint8Array |
secret | Uint8Array |
additionalData? | Uint8Array |
Returns
Promise
<Ciphertext
>
Defined in
fromNanoString
fromNanoString(s
): undefined
| Date
Parameters
Name | Type |
---|---|
s | undefined | string |
Returns
undefined
| Date
Defined in
mapPaginatedStream
mapPaginatedStream<Out
>(gen
, mapper
): AsyncGenerator
<Out
[]>
Type parameters
Name |
---|
Out |
Parameters
Name | Type |
---|---|
gen | AsyncGenerator <Envelope [], any , unknown > |
mapper | EnvelopeMapper <Out > |
Returns
AsyncGenerator
<Out
[]>
Defined in
nsToDate
nsToDate(ns
): Date
Parameters
Name | Type |
---|---|
ns | Long |
Returns
Date
Defined in
toNanoString
toNanoString(d
): undefined
| string
Parameters
Name | Type |
---|---|
d | undefined | Date |
Returns
undefined
| string