import { S as StoreContext, E as ExecutionConfig } from './processor-HNY62jHs.js';
export { A as AbstractStoreContext, d as DataBindingContext, c as IDataBindingContext, I as IStoreContext, P as Plugin, b as PluginManager, t as timeoutError } from './processor-HNY62jHs.js';
import * as _sentio_protos from '@sentio/protos';
import { TemplateInstance, ProcessResult, EthCallParam, ProcessorServiceImplementation, ProcessConfigRequest, ProcessConfigResponse, StartRequest, Empty, ProcessBindingsRequest, ProcessBindingResponse, DataBinding, PreparedData, PreprocessResult, ProcessStreamRequest, HandlerType, PreprocessStreamRequest, DeepPartial, PreprocessStreamResponse, ProcessStreamResponse } from '@sentio/protos';
import { Required } from 'utility-types';
import { CallContext } from 'nice-grpc';
import { Subject } from 'rxjs';
import { Command } from '@commander-js/extra-typings';
import { JsonRpcProvider, Network } from 'ethers';
import PQueue from 'p-queue';
import { EthChainId } from '@sentio/chain';
import { AsyncLocalStorage } from 'node:async_hooks';
import { Counter, Attributes, Gauge, Histogram } from '@opentelemetry/api';
import 'protobufjs/minimal.js';

declare class State {
    stateMap: Map<string, any>;
    static INSTANCE: State;
    static reset(): void;
}
declare abstract class StateStorage<T> {
    protected constructor();
    abstract initValue(): T;
    key(): string;
    getOrRegister(): T;
    unregister(): T;
}
declare abstract class MapStateStorage<T> extends StateStorage<Map<string, T>> {
    initValue(): Map<string, T>;
    getValue(key: string): T | undefined;
    getValues(): T[];
    getOrSetValue(key: string, value: T): T;
}
declare abstract class ListStateStorage<T> extends StateStorage<T[]> {
    initValue(): never[];
    getValues(): T[];
    addValue(value: T): T;
}
declare class TemplateInstanceState extends ListStateStorage<TemplateInstance> {
    static INSTANCE: TemplateInstanceState;
    constructor();
    addValue(value: TemplateInstance): TemplateInstance;
}

declare function mergeProcessResults(results: ProcessResult[]): Required<ProcessResult, 'states'>;
declare function mergeProcessResultsInPlace(res: ProcessResult, results: ProcessResult[]): Required<ProcessResult, 'states'>;
declare function errorString(e: Error): string;
declare const USER_PROCESSOR = "user_processor";
declare function makeEthCallKey(param: EthCallParam): string;
type Semver = {
    semVer?: string;
    major: number;
    minor: number;
    patch: number;
    prerelease?: string;
    buildmetadata?: string;
};
declare function parseSemver(version: string): Semver;
declare function compareSemver(a: Semver, b: Semver): number;

declare class Endpoints {
    static INSTANCE: Endpoints;
    concurrency: number;
    chainQueryAPI: string;
    priceFeedAPI: string;
    chainServer: Map<string, string>;
    batchCount: number;
}
declare function configureEndpoints(options: any): void;

interface ChainConfig {
    ChainID: string;
    Https?: string[];
    ChainServer?: string;
}

declare const program: Command<[string], {
    port: string;
    concurrency: number;
    batchCount: number;
    chainsConfig: string;
    chainqueryServer?: string | undefined;
    pricefeedServer?: string | undefined;
    logFormat: string;
    debug?: true | undefined;
    otlpDebug?: true | undefined;
    startActionServer?: true | undefined;
    worker: number;
    processTimeout: number;
    workerTimeout: number;
    enablePartition: boolean;
}, {}>;
type ProcessorRuntimeOptions = ReturnType<typeof program.opts> & {
    target: string;
};

declare class ProcessorServiceImpl implements ProcessorServiceImplementation {
    private started;
    unhandled: Error;
    private readonly loader;
    private readonly shutdownHandler?;
    private readonly enablePreprocess;
    private preparedData;
    readonly enablePartition: boolean;
    constructor(loader: () => Promise<any>, options?: ProcessorRuntimeOptions, shutdownHandler?: () => void);
    getConfig(request: ProcessConfigRequest, context: CallContext): Promise<ProcessConfigResponse>;
    start(request: StartRequest, context: CallContext): Promise<Empty>;
    stop(request: Empty, context: CallContext): Promise<Empty>;
    processBindings(request: ProcessBindingsRequest, options?: CallContext): Promise<ProcessBindingResponse>;
    preprocessBindings(bindings: DataBinding[], preprocessStore: {
        [k: string]: any;
    }, dbContext?: StoreContext, options?: CallContext): Promise<PreparedData>;
    preprocessBinding(request: DataBinding, preprocessStore: {
        [k: string]: any;
    }, dbContext?: StoreContext, options?: CallContext): Promise<PreprocessResult>;
    processBinding(request: DataBinding, preparedData: PreparedData | undefined, options?: CallContext): Promise<ProcessResult>;
    processBindingsStream(requests: AsyncIterable<ProcessStreamRequest>, context: CallContext): AsyncGenerator<{
        processId?: number | undefined;
        dbRequest?: {
            opId?: bigint | undefined;
            get?: {
                entity?: string | undefined;
                id?: string | undefined;
            } | undefined;
            upsert?: {
                entity?: string[] | undefined;
                id?: string[] | undefined;
                data?: {
                    [x: string]: any;
                }[] | undefined;
                entityData?: {
                    fields?: {
                        [x: string]: {
                            nullValue?: _sentio_protos.RichValue_NullValue | undefined;
                            intValue?: number | undefined | undefined;
                            int64Value?: bigint | undefined | undefined;
                            floatValue?: number | undefined | undefined;
                            bytesValue?: Uint8Array<ArrayBufferLike> | undefined;
                            boolValue?: boolean | undefined | undefined;
                            stringValue?: string | undefined | undefined;
                            timestampValue?: Date | undefined;
                            bigintValue?: {
                                negative?: boolean | undefined;
                                data?: Uint8Array<ArrayBufferLike> | undefined;
                            } | undefined;
                            bigdecimalValue?: {
                                value?: {
                                    negative?: boolean | undefined;
                                    data?: Uint8Array<ArrayBufferLike> | undefined;
                                } | undefined;
                                exp?: number | undefined;
                            } | undefined;
                            listValue?: {
                                values?: /*elided*/ any[] | undefined;
                            } | undefined;
                            structValue?: /*elided*/ any | undefined;
                            tokenValue?: {
                                token?: {
                                    symbol?: string | undefined | undefined;
                                    address?: {
                                        address?: string | undefined;
                                        chain?: string | undefined;
                                    } | undefined;
                                } | undefined;
                                amount?: {
                                    value?: {
                                        negative?: boolean | undefined;
                                        data?: Uint8Array<ArrayBufferLike> | undefined;
                                    } | undefined;
                                    exp?: number | undefined;
                                } | undefined;
                                specifiedAt?: Date | undefined;
                            } | undefined;
                        } | undefined;
                    } | undefined;
                }[] | undefined;
            } | undefined;
            update?: {
                entity?: string[] | undefined;
                id?: string[] | undefined;
                entityData?: {
                    fields?: {
                        [x: string]: {
                            value?: {
                                nullValue?: _sentio_protos.RichValue_NullValue | undefined;
                                intValue?: number | undefined | undefined;
                                int64Value?: bigint | undefined | undefined;
                                floatValue?: number | undefined | undefined;
                                bytesValue?: Uint8Array<ArrayBufferLike> | undefined;
                                boolValue?: boolean | undefined | undefined;
                                stringValue?: string | undefined | undefined;
                                timestampValue?: Date | undefined;
                                bigintValue?: {
                                    negative?: boolean | undefined;
                                    data?: Uint8Array<ArrayBufferLike> | undefined;
                                } | undefined;
                                bigdecimalValue?: {
                                    value?: {
                                        negative?: boolean | undefined;
                                        data?: Uint8Array<ArrayBufferLike> | undefined;
                                    } | undefined;
                                    exp?: number | undefined;
                                } | undefined;
                                listValue?: {
                                    values?: /*elided*/ any[] | undefined;
                                } | undefined;
                                structValue?: {
                                    fields?: {
                                        [x: string]: /*elided*/ any | undefined;
                                    } | undefined;
                                } | undefined;
                                tokenValue?: {
                                    token?: {
                                        symbol?: string | undefined | undefined;
                                        address?: {
                                            address?: string | undefined;
                                            chain?: string | undefined;
                                        } | undefined;
                                    } | undefined;
                                    amount?: {
                                        value?: {
                                            negative?: boolean | undefined;
                                            data?: Uint8Array<ArrayBufferLike> | undefined;
                                        } | undefined;
                                        exp?: number | undefined;
                                    } | undefined;
                                    specifiedAt?: Date | undefined;
                                } | undefined;
                            } | undefined;
                            op?: _sentio_protos.EntityUpdateData_Operator | undefined;
                        } | undefined;
                    } | undefined;
                }[] | undefined;
            } | undefined;
            delete?: {
                entity?: string[] | undefined;
                id?: string[] | undefined;
            } | undefined;
            list?: {
                entity?: string | undefined;
                filters?: {
                    field?: string | undefined;
                    op?: _sentio_protos.DBRequest_DBOperator | undefined;
                    value?: {
                        values?: {
                            nullValue?: _sentio_protos.RichValue_NullValue | undefined;
                            intValue?: number | undefined | undefined;
                            int64Value?: bigint | undefined | undefined;
                            floatValue?: number | undefined | undefined;
                            bytesValue?: Uint8Array<ArrayBufferLike> | undefined;
                            boolValue?: boolean | undefined | undefined;
                            stringValue?: string | undefined | undefined;
                            timestampValue?: Date | undefined;
                            bigintValue?: {
                                negative?: boolean | undefined;
                                data?: Uint8Array<ArrayBufferLike> | undefined;
                            } | undefined;
                            bigdecimalValue?: {
                                value?: {
                                    negative?: boolean | undefined;
                                    data?: Uint8Array<ArrayBufferLike> | undefined;
                                } | undefined;
                                exp?: number | undefined;
                            } | undefined;
                            listValue?: /*elided*/ any | undefined;
                            structValue?: {
                                fields?: {
                                    [x: string]: /*elided*/ any | undefined;
                                } | undefined;
                            } | undefined;
                            tokenValue?: {
                                token?: {
                                    symbol?: string | undefined | undefined;
                                    address?: {
                                        address?: string | undefined;
                                        chain?: string | undefined;
                                    } | undefined;
                                } | undefined;
                                amount?: {
                                    value?: {
                                        negative?: boolean | undefined;
                                        data?: Uint8Array<ArrayBufferLike> | undefined;
                                    } | undefined;
                                    exp?: number | undefined;
                                } | undefined;
                                specifiedAt?: Date | undefined;
                            } | undefined;
                        }[] | undefined;
                    } | undefined;
                }[] | undefined;
                cursor?: string | undefined;
                pageSize?: number | undefined | undefined;
            } | undefined;
        } | undefined;
        result?: {
            gauges?: {
                metadata?: {
                    address?: string | undefined;
                    contractName?: string | undefined;
                    blockNumber?: bigint | undefined;
                    transactionHash?: string | undefined;
                    chainId?: string | undefined;
                    transactionIndex?: number | undefined;
                    logIndex?: number | undefined;
                    name?: string | undefined;
                    labels?: {
                        [x: string]: string | undefined;
                    } | undefined;
                } | undefined;
                metricValue?: {
                    bigDecimal?: string | undefined | undefined;
                    doubleValue?: number | undefined | undefined;
                    bigInteger?: {
                        negative?: boolean | undefined;
                        data?: Uint8Array<ArrayBufferLike> | undefined;
                    } | undefined;
                } | undefined;
                runtimeInfo?: {
                    from?: HandlerType | undefined;
                } | undefined;
            }[] | undefined;
            counters?: {
                metadata?: {
                    address?: string | undefined;
                    contractName?: string | undefined;
                    blockNumber?: bigint | undefined;
                    transactionHash?: string | undefined;
                    chainId?: string | undefined;
                    transactionIndex?: number | undefined;
                    logIndex?: number | undefined;
                    name?: string | undefined;
                    labels?: {
                        [x: string]: string | undefined;
                    } | undefined;
                } | undefined;
                metricValue?: {
                    bigDecimal?: string | undefined | undefined;
                    doubleValue?: number | undefined | undefined;
                    bigInteger?: {
                        negative?: boolean | undefined;
                        data?: Uint8Array<ArrayBufferLike> | undefined;
                    } | undefined;
                } | undefined;
                add?: boolean | undefined;
                runtimeInfo?: {
                    from?: HandlerType | undefined;
                } | undefined;
            }[] | undefined;
            events?: {
                metadata?: {
                    address?: string | undefined;
                    contractName?: string | undefined;
                    blockNumber?: bigint | undefined;
                    transactionHash?: string | undefined;
                    chainId?: string | undefined;
                    transactionIndex?: number | undefined;
                    logIndex?: number | undefined;
                    name?: string | undefined;
                    labels?: {
                        [x: string]: string | undefined;
                    } | undefined;
                } | undefined;
                distinctEntityId?: string | undefined;
                attributes?: {
                    [x: string]: any;
                } | undefined;
                severity?: _sentio_protos.LogLevel | undefined;
                message?: string | undefined;
                runtimeInfo?: {
                    from?: HandlerType | undefined;
                } | undefined;
                attributes2?: {
                    fields?: {
                        [x: string]: {
                            nullValue?: _sentio_protos.RichValue_NullValue | undefined;
                            intValue?: number | undefined | undefined;
                            int64Value?: bigint | undefined | undefined;
                            floatValue?: number | undefined | undefined;
                            bytesValue?: Uint8Array<ArrayBufferLike> | undefined;
                            boolValue?: boolean | undefined | undefined;
                            stringValue?: string | undefined | undefined;
                            timestampValue?: Date | undefined;
                            bigintValue?: {
                                negative?: boolean | undefined;
                                data?: Uint8Array<ArrayBufferLike> | undefined;
                            } | undefined;
                            bigdecimalValue?: {
                                value?: {
                                    negative?: boolean | undefined;
                                    data?: Uint8Array<ArrayBufferLike> | undefined;
                                } | undefined;
                                exp?: number | undefined;
                            } | undefined;
                            listValue?: {
                                values?: /*elided*/ any[] | undefined;
                            } | undefined;
                            structValue?: /*elided*/ any | undefined;
                            tokenValue?: {
                                token?: {
                                    symbol?: string | undefined | undefined;
                                    address?: {
                                        address?: string | undefined;
                                        chain?: string | undefined;
                                    } | undefined;
                                } | undefined;
                                amount?: {
                                    value?: {
                                        negative?: boolean | undefined;
                                        data?: Uint8Array<ArrayBufferLike> | undefined;
                                    } | undefined;
                                    exp?: number | undefined;
                                } | undefined;
                                specifiedAt?: Date | undefined;
                            } | undefined;
                        } | undefined;
                    } | undefined;
                } | undefined;
                noMetric?: boolean | undefined;
            }[] | undefined;
            exports?: {
                metadata?: {
                    address?: string | undefined;
                    contractName?: string | undefined;
                    blockNumber?: bigint | undefined;
                    transactionHash?: string | undefined;
                    chainId?: string | undefined;
                    transactionIndex?: number | undefined;
                    logIndex?: number | undefined;
                    name?: string | undefined;
                    labels?: {
                        [x: string]: string | undefined;
                    } | undefined;
                } | undefined;
                payload?: string | undefined;
                runtimeInfo?: {
                    from?: HandlerType | undefined;
                } | undefined;
            }[] | undefined;
            states?: {
                configUpdated?: boolean | undefined;
                error?: string | undefined | undefined;
            } | undefined;
            timeseriesResult?: {
                metadata?: {
                    address?: string | undefined;
                    contractName?: string | undefined;
                    blockNumber?: bigint | undefined;
                    transactionHash?: string | undefined;
                    chainId?: string | undefined;
                    transactionIndex?: number | undefined;
                    logIndex?: number | undefined;
                    name?: string | undefined;
                    labels?: {
                        [x: string]: string | undefined;
                    } | undefined;
                } | undefined;
                type?: _sentio_protos.TimeseriesResult_TimeseriesType | undefined;
                data?: {
                    fields?: {
                        [x: string]: {
                            nullValue?: _sentio_protos.RichValue_NullValue | undefined;
                            intValue?: number | undefined | undefined;
                            int64Value?: bigint | undefined | undefined;
                            floatValue?: number | undefined | undefined;
                            bytesValue?: Uint8Array<ArrayBufferLike> | undefined;
                            boolValue?: boolean | undefined | undefined;
                            stringValue?: string | undefined | undefined;
                            timestampValue?: Date | undefined;
                            bigintValue?: {
                                negative?: boolean | undefined;
                                data?: Uint8Array<ArrayBufferLike> | undefined;
                            } | undefined;
                            bigdecimalValue?: {
                                value?: {
                                    negative?: boolean | undefined;
                                    data?: Uint8Array<ArrayBufferLike> | undefined;
                                } | undefined;
                                exp?: number | undefined;
                            } | undefined;
                            listValue?: {
                                values?: /*elided*/ any[] | undefined;
                            } | undefined;
                            structValue?: /*elided*/ any | undefined;
                            tokenValue?: {
                                token?: {
                                    symbol?: string | undefined | undefined;
                                    address?: {
                                        address?: string | undefined;
                                        chain?: string | undefined;
                                    } | undefined;
                                } | undefined;
                                amount?: {
                                    value?: {
                                        negative?: boolean | undefined;
                                        data?: Uint8Array<ArrayBufferLike> | undefined;
                                    } | undefined;
                                    exp?: number | undefined;
                                } | undefined;
                                specifiedAt?: Date | undefined;
                            } | undefined;
                        } | undefined;
                    } | undefined;
                } | undefined;
                runtimeInfo?: {
                    from?: HandlerType | undefined;
                } | undefined;
            }[] | undefined;
        } | undefined;
        partitions?: {
            partitions?: {
                [x: number]: {
                    userValue?: string | undefined | undefined;
                    sysValue?: _sentio_protos.ProcessStreamResponse_Partitions_Partition_SysValue | undefined;
                } | undefined;
            } | undefined;
        } | undefined;
    }, void, any>;
    handlePreprocessRequests(requests: AsyncIterable<PreprocessStreamRequest>, subject: Subject<DeepPartial<PreprocessStreamResponse>>): Promise<void>;
    preprocessBindingsStream(requests: AsyncIterable<PreprocessStreamRequest>, context: CallContext): AsyncGenerator<{
        processId?: number | undefined;
        dbRequest?: {
            opId?: bigint | undefined;
            get?: {
                entity?: string | undefined;
                id?: string | undefined;
            } | undefined;
            upsert?: {
                entity?: string[] | undefined;
                id?: string[] | undefined;
                data?: {
                    [x: string]: any;
                }[] | undefined;
                entityData?: {
                    fields?: {
                        [x: string]: {
                            nullValue?: _sentio_protos.RichValue_NullValue | undefined;
                            intValue?: number | undefined | undefined;
                            int64Value?: bigint | undefined | undefined;
                            floatValue?: number | undefined | undefined;
                            bytesValue?: Uint8Array<ArrayBufferLike> | undefined;
                            boolValue?: boolean | undefined | undefined;
                            stringValue?: string | undefined | undefined;
                            timestampValue?: Date | undefined;
                            bigintValue?: {
                                negative?: boolean | undefined;
                                data?: Uint8Array<ArrayBufferLike> | undefined;
                            } | undefined;
                            bigdecimalValue?: {
                                value?: {
                                    negative?: boolean | undefined;
                                    data?: Uint8Array<ArrayBufferLike> | undefined;
                                } | undefined;
                                exp?: number | undefined;
                            } | undefined;
                            listValue?: {
                                values?: /*elided*/ any[] | undefined;
                            } | undefined;
                            structValue?: /*elided*/ any | undefined;
                            tokenValue?: {
                                token?: {
                                    symbol?: string | undefined | undefined;
                                    address?: {
                                        address?: string | undefined;
                                        chain?: string | undefined;
                                    } | undefined;
                                } | undefined;
                                amount?: {
                                    value?: {
                                        negative?: boolean | undefined;
                                        data?: Uint8Array<ArrayBufferLike> | undefined;
                                    } | undefined;
                                    exp?: number | undefined;
                                } | undefined;
                                specifiedAt?: Date | undefined;
                            } | undefined;
                        } | undefined;
                    } | undefined;
                }[] | undefined;
            } | undefined;
            update?: {
                entity?: string[] | undefined;
                id?: string[] | undefined;
                entityData?: {
                    fields?: {
                        [x: string]: {
                            value?: {
                                nullValue?: _sentio_protos.RichValue_NullValue | undefined;
                                intValue?: number | undefined | undefined;
                                int64Value?: bigint | undefined | undefined;
                                floatValue?: number | undefined | undefined;
                                bytesValue?: Uint8Array<ArrayBufferLike> | undefined;
                                boolValue?: boolean | undefined | undefined;
                                stringValue?: string | undefined | undefined;
                                timestampValue?: Date | undefined;
                                bigintValue?: {
                                    negative?: boolean | undefined;
                                    data?: Uint8Array<ArrayBufferLike> | undefined;
                                } | undefined;
                                bigdecimalValue?: {
                                    value?: {
                                        negative?: boolean | undefined;
                                        data?: Uint8Array<ArrayBufferLike> | undefined;
                                    } | undefined;
                                    exp?: number | undefined;
                                } | undefined;
                                listValue?: {
                                    values?: /*elided*/ any[] | undefined;
                                } | undefined;
                                structValue?: {
                                    fields?: {
                                        [x: string]: /*elided*/ any | undefined;
                                    } | undefined;
                                } | undefined;
                                tokenValue?: {
                                    token?: {
                                        symbol?: string | undefined | undefined;
                                        address?: {
                                            address?: string | undefined;
                                            chain?: string | undefined;
                                        } | undefined;
                                    } | undefined;
                                    amount?: {
                                        value?: {
                                            negative?: boolean | undefined;
                                            data?: Uint8Array<ArrayBufferLike> | undefined;
                                        } | undefined;
                                        exp?: number | undefined;
                                    } | undefined;
                                    specifiedAt?: Date | undefined;
                                } | undefined;
                            } | undefined;
                            op?: _sentio_protos.EntityUpdateData_Operator | undefined;
                        } | undefined;
                    } | undefined;
                }[] | undefined;
            } | undefined;
            delete?: {
                entity?: string[] | undefined;
                id?: string[] | undefined;
            } | undefined;
            list?: {
                entity?: string | undefined;
                filters?: {
                    field?: string | undefined;
                    op?: _sentio_protos.DBRequest_DBOperator | undefined;
                    value?: {
                        values?: {
                            nullValue?: _sentio_protos.RichValue_NullValue | undefined;
                            intValue?: number | undefined | undefined;
                            int64Value?: bigint | undefined | undefined;
                            floatValue?: number | undefined | undefined;
                            bytesValue?: Uint8Array<ArrayBufferLike> | undefined;
                            boolValue?: boolean | undefined | undefined;
                            stringValue?: string | undefined | undefined;
                            timestampValue?: Date | undefined;
                            bigintValue?: {
                                negative?: boolean | undefined;
                                data?: Uint8Array<ArrayBufferLike> | undefined;
                            } | undefined;
                            bigdecimalValue?: {
                                value?: {
                                    negative?: boolean | undefined;
                                    data?: Uint8Array<ArrayBufferLike> | undefined;
                                } | undefined;
                                exp?: number | undefined;
                            } | undefined;
                            listValue?: /*elided*/ any | undefined;
                            structValue?: {
                                fields?: {
                                    [x: string]: /*elided*/ any | undefined;
                                } | undefined;
                            } | undefined;
                            tokenValue?: {
                                token?: {
                                    symbol?: string | undefined | undefined;
                                    address?: {
                                        address?: string | undefined;
                                        chain?: string | undefined;
                                    } | undefined;
                                } | undefined;
                                amount?: {
                                    value?: {
                                        negative?: boolean | undefined;
                                        data?: Uint8Array<ArrayBufferLike> | undefined;
                                    } | undefined;
                                    exp?: number | undefined;
                                } | undefined;
                                specifiedAt?: Date | undefined;
                            } | undefined;
                        }[] | undefined;
                    } | undefined;
                }[] | undefined;
                cursor?: string | undefined;
                pageSize?: number | undefined | undefined;
            } | undefined;
        } | undefined;
    }, void, any>;
    private dbContexts;
    protected handleRequests(requests: AsyncIterable<ProcessStreamRequest>, subject: Subject<DeepPartial<ProcessStreamResponse>>): Promise<void>;
    handleRequest(request: ProcessStreamRequest, lastBinding: DataBinding | undefined, subject: Subject<DeepPartial<ProcessStreamResponse>>): Promise<void>;
    private startProcess;
}
declare function recordRuntimeInfo(results: ProcessResult, handlerType: HandlerType): void;

interface GlobalConfig {
    execution: Partial<ExecutionConfig>;
}
declare const GLOBAL_CONFIG: GlobalConfig;

declare const DummyProvider: JsonRpcProvider;
declare function getProvider(chainId?: EthChainId): JsonRpcProvider;
declare class QueuedStaticJsonRpcProvider extends JsonRpcProvider {
    #private;
    executor: PQueue;
    constructor(url: string, network: Network, concurrency: number, batchCount?: number);
    send(method: string, params: Array<any>): Promise<any>;
    toString(): string;
}

declare class C {
    private name;
    private _counter;
    private value;
    constructor(name: string);
    get counter(): Counter<Attributes>;
    add(value: number, attributes?: Attributes): void;
    get(): number;
}
declare class G {
    private name;
    private _gauge;
    private value;
    constructor(name: string);
    get gauge(): Gauge<Attributes>;
    record(value: number, attributes?: Attributes): void;
    get(): number;
}
declare class H {
    private name;
    private _histogram;
    private value;
    constructor(name: string);
    get histogram(): Histogram<Attributes>;
    record(value: number, attributes?: Attributes): void;
    get(): number;
}
declare const dbMetrics: {
    send_counts: {
        get: C;
        upsert: C;
        list: C;
        delete: C;
        update: C;
    };
    recv_counts: {
        get: C;
        upsert: C;
        list: C;
        delete: C;
        update: C;
    };
    request_times: {
        get: C;
        upsert: C;
        list: C;
        delete: C;
        update: C;
    };
    request_errors: {
        get: C;
        upsert: C;
        list: C;
        delete: C;
        update: C;
    };
    batched_total_count: C;
    batched_request_count: C;
    unsolved_requests: G;
    stats(): {
        send_counts: {
            get: number;
            upsert: number;
            list: number;
            delete: number;
        };
        recv_counts: {
            get: number;
            upsert: number;
            list: number;
            delete: number;
        };
        request_times: {
            get: number;
            upsert: number;
            list: number;
            delete: number;
        };
        request_errors: {
            get: number;
            upsert: number;
            list: number;
            delete: number;
        };
        batched_total_count: number;
        batched_request_count: number;
        unsolved_requests: number;
        average_request_time: {
            get: number;
            upsert: number;
            list: number;
        };
    };
};
declare const providerMetrics: {
    hit_count: C;
    miss_count: C;
    queue_size: G;
    total_duration: C;
    total_queued: C;
    stats(): {
        hit_count: number;
        miss_count: number;
        queue_size: number;
        total_duration: number;
        total_queued: number;
        average_queue_time: number;
        average_duration: number;
    };
};
declare const processMetrics: {
    process_binding_count: C;
    process_binding_time: C;
    process_binding_error: C;
    process_ethcall_count: C;
    process_eventemit_count: C;
    process_metricrecord_count: C;
    process_pricecall_count: C;
    process_template_count: C;
    process_handler_duration: G;
    processor_handler_duration: H;
    processor_rpc_duration: H;
    processor_rpc_queue_duration: H;
    processor_template_instance_count: C;
    processor_worker_run_time: C;
    processor_worker_wait_time: C;
    processor_worker_queue_size: G;
    processor_worker_completed: C;
    stats(): {
        process_binding_count: number;
        process_binding_time: number;
        process_binding_error: number;
        process_ethcall_count: number;
        process_eventemit_count: number;
        process_metricrecord_count: number;
        process_pricecall_count: number;
        process_template_count: number;
        process_handler_duration: number;
        processor_handler_duration: number;
        processor_rpc_duration: number;
        processor_rpc_queue_duration: number;
        processor_template_instance_count: number;
        processor_worker_run_time: number;
        processor_worker_wait_time: number;
        processor_worker_queue_size: number;
        processor_worker_completed: number;
    };
};
declare const metricsStorage: AsyncLocalStorage<string>;

export { type ChainConfig, DummyProvider, Endpoints, GLOBAL_CONFIG, type GlobalConfig, ListStateStorage, MapStateStorage, ProcessorServiceImpl, QueuedStaticJsonRpcProvider, type Semver, State, StateStorage, StoreContext, TemplateInstanceState, USER_PROCESSOR, compareSemver, configureEndpoints, dbMetrics, errorString, getProvider, makeEthCallKey, mergeProcessResults, mergeProcessResultsInPlace, metricsStorage, parseSemver, processMetrics, providerMetrics, recordRuntimeInfo };
