ts-algochat
    Preparing search index...

    Function discoverEncryptionKeyFromMessages

    • Discover encryption key from a chat message transaction.

      Extracts the sender's public key from the envelope header of any AlgoChat message they've sent.

      When the indexer supports paginated search, this iterates through the full transaction history page by page. Otherwise it falls back to a single batch.

      Parameters

      • indexer: IndexerClient

        The indexer client to use

      • address: string

        The Algorand address to find the key for

      • isChatMessage: (note: Uint8Array) => boolean

        Function to check if a note is an AlgoChat message

      • decodeEnvelope: (note: Uint8Array) => { senderPublicKey: Uint8Array }

        Function to decode envelope and extract public key

      • OptionaloptionsOrDepth: number | DiscoverKeyOptions

        Discovery options, or a numeric search depth for backward compatibility

      Returns Promise<DiscoveredKey | undefined>

      DiscoveredKey if found, undefined otherwise