import { BaseContract, DeferredTopicFilter, LogParams, TransactionResponseParams } from 'ethers'; import { BoundContractView, ContractContext, ContractView, GlobalContext } from './context.js'; import { AddressType, Data_EthBlock, Data_EthLog, Data_EthTrace, Data_EthTransaction, EthFetchConfig, HandleInterval, PreprocessResult, ProcessResult } from '@sentio/protos'; import { BindOptions, TimeOrBlock } from './bind-options.js'; import { PromiseOrVoid } from '../core/promises.js'; import { RichBlock, Trace, TypedCallTrace, TypedEvent } from './eth.js'; import { ListStateStorage } from '@sentio/runtime'; import { EthChainId } from '@sentio/chain'; import { HandlerOptions } from '../core/index.js'; export interface AddressOrTypeEventFilter extends DeferredTopicFilter { addressType?: AddressType; address?: string; } export declare const defaultPreprocessHandler: () => any; export declare class EventsHandler { filters: AddressOrTypeEventFilter[]; handlerName: string; handler: (event: Data_EthLog) => Promise; preprocessHandler?: (event: Data_EthLog, preprocessStore: { [k: string]: any; }) => Promise; fetchConfig: EthFetchConfig; partitionHandler?: (event: Data_EthLog) => Promise; } export declare class TraceHandler { signatures: string[]; handlerName: string; handler: (trace: Data_EthTrace) => Promise; preprocessHandler?: (event: Data_EthTrace, preprocessStore: { [k: string]: any; }) => Promise; fetchConfig: EthFetchConfig; partitionHandler?: (trace: Data_EthTrace) => Promise; } export declare class BlockHandler { blockInterval?: HandleInterval; timeIntervalInMinutes?: HandleInterval; handlerName: string; handler: (block: Data_EthBlock) => Promise; preprocessHandler?: (event: Data_EthBlock, preprocessStore: { [k: string]: any; }) => Promise; fetchConfig: EthFetchConfig; partitionHandler?: (block: Data_EthBlock) => Promise; } export declare class TransactionHandler { handler: (tx: Data_EthTransaction) => Promise; handlerName: string; preprocessHandler?: (event: Data_EthTransaction, preprocessStore: { [k: string]: any; }) => Promise; fetchConfig: EthFetchConfig; partitionHandler?: (tx: Data_EthTransaction) => Promise; } declare class BindInternalOptions { address: string; network: EthChainId; name: string; start: TimeOrBlock; end?: TimeOrBlock; baseLabels?: { [key: string]: string; }; } export declare class GlobalProcessorState extends ListStateStorage { static INSTANCE: GlobalProcessorState; } export declare class GlobalProcessor { config: BindInternalOptions; blockHandlers: BlockHandler[]; transactionHandler: TransactionHandler[]; traceHandlers: TraceHandler[]; eventHandlers: EventsHandler[]; static bind(config: Omit): GlobalProcessor; constructor(config: Omit); onBlockInterval(handler: (block: RichBlock, ctx: GlobalContext) => PromiseOrVoid, blockInterval?: number, backfillBlockInterval?: number, handlerOptions?: HandlerOptions, preprocessHandler?: (block: RichBlock, ctx: GlobalContext, preprocessStore: { [k: string]: any; }) => Promise): this; onTimeInterval(handler: (block: RichBlock, ctx: GlobalContext) => PromiseOrVoid, timeIntervalInMinutes?: number, backfillTimeIntervalInMinutes?: number, handlerOptions?: HandlerOptions, preprocessHandler?: (block: RichBlock, ctx: GlobalContext, preprocessStore: { [k: string]: any; }) => Promise): this; getChainId(): EthChainId; onInterval(handler: (block: RichBlock, ctx: GlobalContext) => PromiseOrVoid, timeInterval: HandleInterval | undefined, blockInterval: HandleInterval | undefined, handlerOptions?: HandlerOptions, preprocessHandler?: (block: RichBlock, ctx: GlobalContext, preprocessStore: { [k: string]: any; }) => Promise): this; onTransaction(handler: (transaction: TransactionResponseParams, ctx: GlobalContext) => PromiseOrVoid, handlerOptions?: HandlerOptions, preprocessHandler?: (transaction: TransactionResponseParams, ctx: GlobalContext, preprocessStore: { [k: string]: any; }) => Promise): this; onEvent(handler: (rawLog: LogParams, ctx: GlobalContext) => PromiseOrVoid, filter?: AddressOrTypeEventFilter | AddressOrTypeEventFilter[], handlerOptions?: HandlerOptions): this; onTrace(signatures: string | string[], handler: (trace: Trace, ctx: GlobalContext) => PromiseOrVoid, handlerOptions?: HandlerOptions, preprocessHandler?: (trace: Trace, ctx: GlobalContext, preprocessStore: { [k: string]: any; }) => Promise): this; } export declare abstract class BaseProcessor>> { blockHandlers: BlockHandler[]; eventHandlers: EventsHandler[]; traceHandlers: TraceHandler[]; config: BindInternalOptions; constructor(config: BindOptions); protected abstract CreateBoundContractView(): TBoundContractView; getChainId(): EthChainId; onEvent(handler: (event: TypedEvent, ctx: ContractContext) => PromiseOrVoid, handlerOptions?: HandlerOptions, preprocessHandler?: (event: TypedEvent, ctx: ContractContext, preprocessStore: { [k: string]: any; }) => Promise): this; protected onEthEvent(handler: (event: TypedEvent, ctx: ContractContext) => PromiseOrVoid, filter: DeferredTopicFilter | DeferredTopicFilter[], handlerOptions?: HandlerOptions, preprocessHandler?: (event: TypedEvent, ctx: ContractContext, preprocessStore: { [k: string]: any; }) => Promise, handlerName?: string): this; onBlockInterval(handler: (block: RichBlock, ctx: ContractContext) => PromiseOrVoid, blockInterval?: number, backfillBlockInterval?: number, handlerOptions?: HandlerOptions, preprocessHandler?: (block: RichBlock, ctx: ContractContext, preprocessStore: { [k: string]: any; }) => Promise): this; onTimeInterval(handler: (block: RichBlock, ctx: ContractContext) => PromiseOrVoid, timeIntervalInMinutes?: number, backfillTimeIntervalInMinutes?: number, handlerOptions?: HandlerOptions, preprocessHandler?: (block: RichBlock, ctx: ContractContext, preprocessStore: { [k: string]: any; }) => Promise): this; onInterval(handler: (block: RichBlock, ctx: ContractContext) => PromiseOrVoid, timeInterval: HandleInterval | undefined, blockInterval: HandleInterval | undefined, handlerOptions?: HandlerOptions, preprocessHandler?: (block: RichBlock, ctx: ContractContext, preprocessStore: { [k: string]: any; }) => Promise, handlerName?: string): this; protected onEthTrace(signatures: string | string[], handler: (trace: TypedCallTrace, ctx: ContractContext) => PromiseOrVoid, handlerOptions?: HandlerOptions, preprocessHandler?: (trace: TypedCallTrace, ctx: ContractContext, preprocessStore: { [k: string]: any; }) => Promise, handlerName?: string): this; onTrace(handler: (event: TypedCallTrace, ctx: ContractContext) => PromiseOrVoid, handlerOptions?: HandlerOptions, preprocessHandler?: (trace: TypedCallTrace, ctx: ContractContext, preprocessStore: { [k: string]: any; }) => Promise): this; } export {}; //# sourceMappingURL=base-processor.d.ts.map