ts-algochat
    Preparing search index...

    Class AlgorandService

    Index

    Constructors

    Methods

    • Discovers a user's encryption public key from their transaction history

      Parameters

      • address: string

        Algorand address to discover key for

      • searchDepth: number = 200

        Maximum transactions to search (default: 200)

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • Discovers a user's encryption public key with full metadata

      Parameters

      • address: string

        Algorand address to discover key for

      • searchDepth: number = 200

        Maximum transactions to search (default: 200)

      Returns Promise<DiscoveredKey>

    • Fetches messages with a participant

      Parameters

      • chatAccount: ChatAccount

        The user's chat account

      • participantAddress: string

        Address of the conversation participant

      • OptionalafterRound: number

        Only fetch messages after this round (for polling new messages)

      • limit: number = 50

        Maximum number of messages to fetch

      • OptionalbeforeRound: number

        Only fetch messages before this round (for pagination/loading older)

      Returns Promise<Message[]>

    • Sends an encrypted message to a recipient

      Parameters

      • chatAccount: ChatAccount

        The sender's chat account

      • recipientAddress: string

        Recipient's Algorand address

      • recipientPublicKey: Uint8Array

        Recipient's encryption public key

      • message: string

        Message content

      • options: SendOptions = {}

        Send options (waitForConfirmation, waitForIndexer, etc.)

      Returns Promise<SendResult>

    • Sends a reply to a message

      Parameters

      • chatAccount: ChatAccount

        The sender's chat account

      • recipientAddress: string

        Recipient's Algorand address

      • recipientPublicKey: Uint8Array

        Recipient's encryption public key

      • message: string

        Message content

      • replyToTxid: string

        Transaction ID of the message being replied to

      • replyToPreview: string

        Preview text of the message being replied to

      • options: SendOptions = {}

        Send options (waitForConfirmation, waitForIndexer, etc.)

      Returns Promise<SendResult>

    • Checks if a transaction exists in the indexer

      Parameters

      • txid: string

        Transaction ID to check

      Returns Promise<boolean>

    • Waits for transaction confirmation

      Parameters

      • txid: string

        Transaction ID to wait for

      • timeout: number = 10

        Timeout in rounds (default: 10)

      Returns Promise<number>

      Confirmed round number

    • Waits for a transaction to be indexed

      Uses exponential backoff with jitter for efficient polling.

      Parameters

      • txid: string

        Transaction ID to wait for

      • timeout: number = 30000

        Timeout in milliseconds (default: 30000)

      • initialInterval: number = 500

        Initial polling interval (default: 500ms)

      • maxInterval: number = 5000

        Maximum polling interval (default: 5000ms)

      • backoffMultiplier: number = 1.5

        Backoff multiplier (default: 1.5)

      Returns Promise<boolean>

      true if indexed, false if timeout