ts-algochat
    Preparing search index...

    Class MessageIndexer

    Message Indexer Service

    Provides advanced indexer operations including:

    • Paginated message fetching (afterRound, beforeRound)
    • Transaction waiting with exponential backoff
    • Public key discovery with metadata
    Index

    Constructors

    Methods

    • Fetches newer messages (after a certain round)

      Useful for syncing new messages.

      Parameters

      • chatAccount: ChatAccount

        The current user's chat account

      • participantAddress: string

        Address of the conversation participant

      • afterRound: number

        Minimum round (exclusive)

      • limit: number = 50

        Number of messages to fetch

      Returns Promise<Message[]>

    • Fetches older messages (before a certain round)

      Useful for "load more" functionality.

      Parameters

      • chatAccount: ChatAccount

        The current user's chat account

      • participantAddress: string

        Address of the conversation participant

      • beforeRound: number

        Maximum round (exclusive)

      • limit: number = 20

        Number of messages to fetch

      Returns Promise<Message[]>

    • Discovers a user's encryption public key

      Returns full metadata about where the key was discovered.

      Parameters

      • address: string

        Algorand address to discover key for

      • searchDepth: number = 200

        Maximum transactions to search (default: 200)

      Returns Promise<DiscoveredKey>

    • Checks if a transaction exists in the indexer

      Parameters

      • txid: string

        Transaction ID to check

      Returns Promise<boolean>