sorokeep
    Preparing search index...

    Function runMonitorCycle

    • One complete monitoring polling cycle.

      Responsibilities:

      1. Load all contracts for the given network from the DB.
      2. For each contract, fetch fresh TTLs from the RPC in a single batched call.
      3. Persist updated TTL values back to the DB.
      4. Detect alert threshold crossings and record them (deduplication aware).
      5. Auto-resolve open alerts whose TTL has recovered above the threshold.

      Contract: pure logic — no timers, no CLI concerns, no side-effects beyond the provided db handle. Errors from individual contracts are collected and returned rather than propagated so that one bad contract cannot abort the entire cycle.

      Parameters

      • db: Database

        An open better-sqlite3 Database handle.

      • network: string

        The Stellar network to monitor ("testnet" | "mainnet" | …).

      • OptionalrpcUrl: string

        Optional override for the RPC endpoint URL.

      • OptionalfeeSponsorSecret: string

        Optional fee sponsor secret key source string.

      • OptionalpredictiveOpts: PredictiveOptions

        Optional predictive scheduling options (issue #492).

      Returns Promise<MonitorCycleResult>