Skip to main content

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

Client.ts:168


Composite

Composite: { content: any ; type: ContentTypeId } | { parts: Composite[] }

Defined in

codecs/Composite.ts:24


ContentOptions

ContentOptions: Object

Type declaration

NameTypeDescription
codecsContentCodec<any>[]Allow configuring codecs for additional content types
maxContentSizenumberSet the maximum content size in bytes that is allowed by the Client. Currently only checked when decompressing compressed content.

Defined in

Client.ts:109


InvitationContext

InvitationContext: Object

Type declaration

NameType
conversationIdstring
metadata{ [k: string]: string; }

Defined in

Invitation.ts:11


KeyStoreOptions

KeyStoreOptions: Object

Type declaration

NameTypeDescription
keystoreProvidersKeystoreProvider[]Provide an array of KeystoreProviders. The client will attempt to use each one in sequence until one successfully returns a Keystore instance
persistConversationsbooleanEnable the Keystore to persist conversations in the provided storage interface
privateKeyOverride?Uint8ArrayProvide a XMTP PrivateKeyBundle encoded as a Uint8Array. A bundle can be retried using Client.getKeys(...)

Defined in

Client.ts:123


LegacyOptions

LegacyOptions: Object

Type declaration

NameType
publishLegacyContact?boolean

Defined in

Client.ts:141


ListMessagesOptions

ListMessagesOptions: Object

Type declaration

NameType
checkAddresses?boolean
direction?messageApi.SortDirection
endTime?Date
limit?number
startTime?Date

Defined in

Client.ts:40


Message

Message: MessageV1 | MessageV2

Defined in

Message.ts:229


NetworkOptions

NetworkOptions: Object

Network startup options

Type declaration

NameTypeDescription
apiUrlstring | undefinedapiUrl can be used to override the env flag and connect to a specific endpoint
appVersion?stringidentifier 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.
envXmtpEnvSpecify which XMTP environment to connect to. (default: dev)
skipContactPublishingbooleanSkip 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

Client.ts:71


PrivateKeyBundle

PrivateKeyBundle: PrivateKeyBundleV1 | PrivateKeyBundleV2

Defined in

crypto/PrivateKeyBundle.ts:248


SendOptions

SendOptions: Object

Type declaration

NameType
compression?proto.Compression
contentFallback?string
contentType?ContentTypeId
ephemeral?boolean
timestamp?Date

Defined in

Client.ts:57


TopicData

TopicData: WithoutUndefined<keystore.TopicMap_TopicData>

Defined in

keystore/interfaces.ts:71


TypingNotification

TypingNotification: Object

Type declaration

NameType
isFinishedboolean
timestampDate
typerAddressstring

Defined in

codecs/TypingNotification.ts:13

Variables

ApiUrls

Const ApiUrls: Object

Type declaration

NameType
dev"https://dev.xmtp.network"
local"http://localhost:5555"
production"https://production.xmtp.network"

Defined in

ApiClient.ts:17


Compression

Compression: typeof Compression

Defined in

Client.ts:30


ContentTypeComposite

Const ContentTypeComposite: ContentTypeId

Defined in

codecs/Composite.ts:15


ContentTypeFallback

Const ContentTypeFallback: ContentTypeId

Defined in

MessageContent.ts:56


ContentTypeText

Const ContentTypeText: ContentTypeId

Defined in

codecs/Text.ts:6


ContentTypeTypingNotification

Const ContentTypeTypingNotification: ContentTypeId

Defined in

codecs/TypingNotification.ts:6


SortDirection

SortDirection: typeof SortDirection

Defined in

ApiClient.ts:9

Functions

buildContentTopic

buildContentTopic(name): string

Parameters

NameType
namestring

Returns

string

Defined in

utils/topic.ts:3


buildDirectMessageTopic

buildDirectMessageTopic(sender, recipient): string

Parameters

NameType
senderstring
recipientstring

Returns

string

Defined in

utils/topic.ts:6


buildDirectMessageTopicV2

buildDirectMessageTopicV2(randomString): string

Parameters

NameType
randomStringstring

Returns

string

Defined in

utils/topic.ts:16


buildUserContactTopic

buildUserContactTopic(walletAddr): string

Parameters

NameType
walletAddrstring

Returns

string

Defined in

utils/topic.ts:20


buildUserIntroTopic

buildUserIntroTopic(walletAddr): string

Parameters

NameType
walletAddrstring

Returns

string

Defined in

utils/topic.ts:25


buildUserInviteTopic

buildUserInviteTopic(walletAddr): string

Parameters

NameType
walletAddrstring

Returns

string

Defined in

utils/topic.ts:30


buildUserPrivateStoreTopic

buildUserPrivateStoreTopic(addrPrefixedKey): string

Parameters

NameType
addrPrefixedKeystring

Returns

string

Defined in

utils/topic.ts:34


dateToNs

dateToNs(date): Long

Parameters

NameType
dateDate

Returns

Long

Defined in

utils/date.ts:3


decodeContactBundle

decodeContactBundle(bytes): PublicKeyBundle | SignedPublicKeyBundle

Parameters

NameType
bytesUint8Array

Returns

PublicKeyBundle | SignedPublicKeyBundle

Defined in

ContactBundle.ts:5


decodeContent

decodeContent(contentBytes, client): Promise<{ content: any ; contentType: ContentTypeId ; error: undefined | Error }>

Parameters

NameType
contentBytesUint8Array
clientClient

Returns

Promise<{ content: any ; contentType: ContentTypeId ; error: undefined | Error }>

Defined in

Message.ts:373


decrypt

decrypt(encrypted, secret, additionalData?): Promise<Uint8Array>

Parameters

NameType
encryptedCiphertext | Ciphertext
secretUint8Array
additionalData?Uint8Array

Returns

Promise<Uint8Array>

Defined in

crypto/encryption.ts:40


encrypt

encrypt(plain, secret, additionalData?): Promise<Ciphertext>

Parameters

NameType
plainUint8Array
secretUint8Array
additionalData?Uint8Array

Returns

Promise<Ciphertext>

Defined in

crypto/encryption.ts:17


fromNanoString

fromNanoString(s): undefined | Date

Parameters

NameType
sundefined | string

Returns

undefined | Date

Defined in

utils/date.ts:15


mapPaginatedStream

mapPaginatedStream<Out>(gen, mapper): AsyncGenerator<Out[]>

Type parameters

Name
Out

Parameters

NameType
genAsyncGenerator<Envelope[], any, unknown>
mapperEnvelopeMapper<Out>

Returns

AsyncGenerator<Out[]>

Defined in

utils/async.ts:56


nsToDate

nsToDate(ns): Date

Parameters

NameType
nsLong

Returns

Date

Defined in

utils/date.ts:7


toNanoString

toNanoString(d): undefined | string

Parameters

NameType
dundefined | Date

Returns

undefined | string

Defined in

utils/date.ts:11

Was the information on this page helpful?