Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConversationV2

ConversationV2

Hierarchy

  • ConversationV2

Implements

Index

Constructors

Properties

client: Client

Optional field containing the conversationId and metadata for V2 conversations. Will always be undefined on V1 conversations

conversationVersion: "v2" = ...
createdAt: Date

Timestamp the conversation was created at

peerAddress: string

The wallet address of the other party in the conversation

topic: string

A unique identifier for a conversation. Each conversation is stored on the network on one topic

Accessors

  • get clientAddress(): string
  • get ephemeralTopic(): string

Methods

  • createMessage(payload: Uint8Array, timestamp?: Date): Promise<MessageV2>
  • prepareMessage(content: any, options?: SendOptions): Promise<PreparedMessage>
  • processEnvelope(env: Envelope): Promise<MessageV2>
  • Return a Stream of new ephemeral messages from this conversation's ephemeral topic.

    Stream instances are async generators and can be used in for await statements.

    for await (const message of await conversation.streamEphemeral()) {
    console.log(message.content)
    }

    Parameters

    • Optional onConnectionLost: OnConnectionLostCallback

    Returns Promise<Stream<DecodedMessage>>

Generated using TypeDoc