import { EclesiaIndexer } from "../indexer/index.cjs"; import { CircularBuffer } from "../promise-queue/index.cjs"; import { BlockResponse, BlockResultsResponse } from "@cosmjs/tendermint-rpc"; import { BlockResultsResponse as BlockResultsResponse$1, Event } from "@cosmjs/tendermint-rpc/build/comet38/responses"; import { Validator } from "cosmjs-types/cosmos/staking/v1beta1/staking"; import { TxBody } from "cosmjs-types/cosmos/tx/v1beta1/tx"; //#region src/types/index.d.ts declare namespace index_d_exports { export { BlockQueue, EcleciaIndexerConfig, EclesiaIndexerConfig, EmitFunc, Events, FullBlockQueue, IndexingModule, LogEvent, MinimalBlockQueue, TxResult, UUIDEvent, WithHeightAndUUID }; } /** Configuration interface for the Eclesia indexer */ type EclesiaIndexerConfig = { startHeight?: number; endHeight?: number; batchSize: number; modules: string[]; getNextHeight: () => number | PromiseLike; logLevel: "error" | "warn" | "info" | "http" | "verbose" | "debug" | "silly"; rpcUrl: string; chainId?: string; shouldProcessGenesis: () => Promise; genesisPath?: string; usePolling?: boolean; pollingInterval?: number; minimal?: boolean; enableHealthcheck?: boolean; healthCheckPort?: number; enablePrometheus?: boolean; prometheusPort?: number; healthCheckHost?: string; prometheusHost?: string; logFormat?: "text" | "json"; maxRetries?: number; maxFailuresPerBlock?: number; onGenesisStart?: () => Promise; onGenesisComplete?: () => Promise; init?: () => Promise; beginTransaction: () => Promise; endTransaction: (status: boolean) => Promise; }; /** @deprecated Misspelling kept for compatibility, use EclesiaIndexerConfig. Removed in 3.0. */ type EcleciaIndexerConfig = EclesiaIndexerConfig; /** Queue for full indexing mode with validator data */ type FullBlockQueue = CircularBuffer<[BlockResponse, BlockResultsResponse, Uint8Array]>; /** Queue for minimal indexing mode without validator data */ type MinimalBlockQueue = CircularBuffer<[BlockResponse, BlockResultsResponse]>; /** Union type for block queues */ type BlockQueue = FullBlockQueue | MinimalBlockQueue; /** Utility type to add height, timestamp, and UUID to event types */ type WithHeightAndUUID = { [K in keyof T]: T[K] & { uuid?: string; height?: number; timestamp?: string; } }; /** Function signature for emitting events asynchronously */ type EmitFunc> = (t: K$1, e: WithHeightAndUUID[K$1]) => Promise; type LogEvent = { type: "log" | "info" | "warning" | "error" | "verbose" | "transient"; message: string; }; type UUIDEvent = { uuid: string; error?: string; status: boolean; }; type Events = { log: LogEvent; uuid: UUIDEvent; "fatal-error": { error: Error; message: string; retryCount?: number; height?: number; }; begin_block: { value: { events: BlockResultsResponse["beginBlockEvents"] | BlockResultsResponse$1["finalizeBlockEvents"]; validators: Validator[] | undefined; }; }; block: { value: { block: BlockResponse; block_results: BlockResultsResponse | BlockResultsResponse$1; }; }; end_block: { value: BlockResultsResponse["endBlockEvents"] | BlockResultsResponse$1["finalizeBlockEvents"]; }; tx_events: { value: BlockResultsResponse["results"] | BlockResultsResponse$1["results"]; }; tx_memo: { value: { txHash: string; txBody: TxBody; }; }; _unhandled: { type: string; event: unknown; }; "periodic/small": { value: null; }; "periodic/medium": { value: null; }; "periodic/large": { value: null; }; }; type TxResult = { tx: T; events: Event[]; }; /** Interface that all indexing modules must implement */ interface IndexingModule { indexer: EclesiaIndexer; name: string; depends: string[]; provides: string[]; setup: () => Promise; init: (...args: any[]) => void; } /** * Global event map. Modules add their own events through declaration merging: * * declare global { interface EventMap extends MyModule.Events {} } * * Declared in a regular module (not an ambient .d.ts) so it is emitted into the * published declarations and consumers get typed events without extra setup. */ declare global { interface EventMap extends Events {} } //# sourceMappingURL=index.d.ts.map //#endregion export { EclesiaIndexerConfig, EmitFunc, WithHeightAndUUID, index_d_exports }; //# sourceMappingURL=index.d.cts.map