/** * Optional FeeSplitter release keeper (OFF by default). * * When `KEEPER_ENABLED=true`, periodically reads USDC balances of merchant * FeeSplitter addresses (`payTo` from the registry) and calls `release()` when * balance >= `KEEPER_MIN_USDC` (default 1_000_000 = $1 USDC). * * Never enable on Render by default — gas for `release()` can exceed the 0.1% * fee on sub-cent payments; the min-balance gate exists for that reason. * Do not put private keys in the repo. * * Dry-run: `KEEPER_DRY_RUN=true` logs would-release without sending txs. * Live release needs `KEEPER_PRIVATE_KEY` + RPC (`KEEPER_RPC_URL` or public Base default). */ import { type Hex } from "viem"; import type { TollgateConfig } from "./config.js"; import type { MerchantRegistry } from "./merchants.js"; /** Default: $1 USDC (6 decimals). */ export declare const DEFAULT_KEEPER_MIN_USDC = 1000000n; /** Default poll interval: 1 hour. */ export declare const DEFAULT_KEEPER_INTERVAL_MS = 3600000; export interface KeeperConfig { enabled: boolean; dryRun: boolean; privateKey: Hex | undefined; rpcUrl: string | undefined; intervalMs: number; minUsdc: bigint; network: string; merchants: MerchantRegistry; } export interface KeeperHandle { /** Stop the interval timer. */ stop: () => void; /** Run one tick immediately (tests / ops). */ tick: () => Promise; } export declare function loadKeeperConfig(env: NodeJS.ProcessEnv, tollgate: Pick): KeeperConfig; export interface KeeperLogger { info: (msg: Record) => void; error: (msg: Record) => void; } /** * Start the optional release keeper. Returns null when disabled or misconfigured. */ export declare function startFeeSplitterKeeper(config: KeeperConfig, logger?: KeeperLogger): KeeperHandle | null;