hoodkit
    Preparing search index...

    Interface LogCursorOptions<TLog, TEvent>

    Options for runLogCursor.

    interface LogCursorOptions<TLog, TEvent> {
        chunkSize?: bigint;
        confirmations?: bigint;
        decode: (log: TLog) => TEvent | null;
        fromBlock?: bigint;
        getLogs: (from: bigint, to: bigint) => Promise<readonly TLog[]>;
        onError?: (error: Error) => void;
        pollingIntervalMs?: number;
        source: LogSource;
        stream: Stream<TEvent>;
    }

    Type Parameters

    • TLog
    • TEvent
    Index
    chunkSize?: bigint

    Max blocks per getLogs request (public-RPC friendly).

    5000n

    confirmations?: bigint

    Confirmations to wait before treating a block as final. Reorg-safe streaming re-reads the last confirmations blocks each tick.

    1

    decode: (log: TLog) => TEvent | null

    Decode a raw log into an event, or null to skip it.

    fromBlock?: bigint

    First block to scan. undefined starts at the current head (only new events). A concrete value backfills history from there first.

    getLogs: (from: bigint, to: bigint) => Promise<readonly TLog[]>

    Fetch confirmed logs in [from, to] inclusive. Throwing triggers gap-fill on the next tick.

    onError?: (error: Error) => void

    Called when a poll errors (the cursor does NOT advance, so the range is retried).

    pollingIntervalMs?: number

    Poll interval in ms.

    1500

    source: LogSource

    Head/height source (a viem public client works directly).

    stream: Stream<TEvent>

    The stream to push decoded events into.