Options
All
  • Public
  • Public/Protected
  • All
Menu

Client class initiates connection to the XMTP network. Should be created with await Client.create(options)

Hierarchy

  • Client

Index

Constructors

Properties

address: string
apiClient: default

Accessors

Methods

  • canMessage(peerAddress: string): Promise<boolean>
  • Check if @peerAddress can be messaged, specifically it checks that a PublicKeyBundle can be found for the given address

    Parameters

    • peerAddress: string

    Returns Promise<boolean>

  • close(): Promise<void>
  • decodeMessage(payload: Uint8Array, contentTopic: undefined | string): Promise<Message>
  • Parameters

    • payload: Uint8Array
    • contentTopic: undefined | string

    Returns Promise<Message>

  • Returns the cached PublicKeyBundle if one is known for the given address or fetches one from the network

    Parameters

    • peerAddress: string

    Returns Promise<undefined | PublicKeyBundle>

  • listConversationMessagesPaginated(peerAddress: string, opts?: ListMessagesPaginatedOptions): AsyncGenerator<Message[], any, unknown>
  • Parameters

    • peerAddress: string
    • Optional opts: ListMessagesPaginatedOptions

    Returns AsyncGenerator<Message[], any, unknown>

  • listMessagesPaginated(contentTopics: string[], opts?: ListMessagesPaginatedOptions): AsyncGenerator<Message[], any, unknown>
  • List messages on a given set of content topics, yielding one page at a time

    Parameters

    • contentTopics: string[]
    • Optional opts: ListMessagesPaginatedOptions

    Returns AsyncGenerator<Message[], any, unknown>

  • publishEnvelope(env: { contentTopic: string; message: Uint8Array; timestamp?: Date }): Promise<void>
  • Parameters

    • env: { contentTopic: string; message: Uint8Array; timestamp?: Date }
      • contentTopic: string
      • message: Uint8Array
      • Optional timestamp?: Date

    Returns Promise<void>

  • Send a message to the wallet identified by @peerAddress

    Parameters

    • peerAddress: string
    • content: any
    • Optional options: SendOptions

    Returns Promise<Message>

  • streamConversationMessages(peerAddress: string): Promise<Stream<Message>>
  • canMessage(peerAddress: string, opts?: Partial<NetworkOptions>): Promise<boolean>
  • Parameters

    • peerAddress: string
    • Optional opts: Partial<NetworkOptions>

    Returns Promise<boolean>

  • Create and start a client associated with given wallet.

    Parameters

    • wallet: null | Signer

      the wallet as a Signer instance

    • Optional opts: Partial<ClientOptions>

      specify how to to connect to the network

    Returns Promise<Client>

  • getKeys(wallet: null | Signer, opts?: Partial<ClientOptions>): Promise<Uint8Array>

Generated using TypeDoc