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

  • new Client(keys: PrivateKeyBundleV1, apiClient: default): Client

Properties

address: string
apiClient: default
contacts: Set<string>
keys: PrivateKeyBundleV2
legacyKeys: PrivateKeyBundleV1

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>
  • encodeContent(content: any, options?: SendOptions): Promise<Uint8Array>
  • forgetContact(peerAddress: string): void
  • Parameters

    • peerAddress: string

    Returns void

  • listEnvelopes<Out>(topics: string[], mapper: EnvelopeMapper<Out>, opts?: ListMessagesOptions): Promise<Out[]>
  • listEnvelopesPaginated<Out>(contentTopics: string[], mapper: EnvelopeMapper<Out>, opts?: ListMessagesPaginatedOptions): AsyncGenerator<Out[], any, unknown>
  • List messages on a given set of content topics, yielding one page at a time

    Type parameters

    • Out

    Parameters

    • contentTopics: string[]
    • mapper: EnvelopeMapper<Out>
    • Optional opts: ListMessagesPaginatedOptions

    Returns AsyncGenerator<Out[], any, unknown>

  • publishEnvelopes(envelopes: PublishParams[]): Promise<void>
  • Parameters

    • envelopes: PublishParams[]

    Returns Promise<void>

  • publishUserContact(legacy?: boolean): Promise<void>
  • Parameters

    • legacy: boolean = true

    Returns Promise<void>

  • 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