import type { Logger, SpanConfig } from '@ariestools/sdk';
import { AbstractCreatable } from '@ariestools/sdk';
import type { AccountInstance } from '@xyo-network/sdk';
import type { Provider, ProviderMoniker } from '@xyo-network/xl1-protocol/protocol-lib';
import type { ConnectionBinding, ConnectionBindingFields } from '../config/connectionBindings.js';
import type { PrimeCachesMode } from '../config/PrimeCaches.js';
import type { ConnectionHandleCache } from '../model/ConnectionHandleCache.js';
import type { CreatableProvider, CreatableProviderEventData, CreatableProviderInstance, CreatableProviderParams, ProviderMap } from './CreatableProvider.js';
import { ProviderFactory } from './ProviderFactory.js';
/** Abstract base class for CreatableProvider implementations. */
export declare abstract class AbstractCreatableProvider<TParams extends CreatableProviderParams = CreatableProviderParams, TEventData extends CreatableProviderEventData = CreatableProviderEventData> extends AbstractCreatable<TParams, TEventData> implements Omit<CreatableProviderInstance, 'moniker'> {
    /** Provider monikers that must resolve before this provider can be created. */
    dependencies: ProviderMap;
    protected _contextCache: TParams['context'] | undefined;
    protected _logger: Logger | undefined | null;
    protected _primed: Promise<void>;
    /** Moniker implemented by this provider instance. */
    abstract readonly moniker: ProviderMoniker;
    /** Returns the logger result exposed by this provider. */
    get logger(): Logger | undefined;
    /** Returns the meter result exposed by this provider. */
    get meter(): import("@opentelemetry/api").Meter | undefined;
    /**
     * Awaitable completion of any startup cache priming run through `runPrime`.
     * Resolves immediately when the mode is `off` or nothing has primed yet;
     * under `lazy` it settles (never rejects) once the background warm-up finishes.
     */
    get primed(): Promise<void>;
    /** Returns the tracer result exposed by this provider. */
    get tracer(): import("@opentelemetry/api").Tracer | undefined;
    /** This provider's bound connection from config, when one is declared. */
    protected get boundConnection(): ConnectionBinding | undefined;
    protected get config(): {
        chain: {
            id?: import("@ariestools/sdk").BrandedHex | undefined;
            genesisRewardAddress?: (Lowercase<string> & {
                readonly __hex: true;
            } & {
                readonly __address: true;
            }) | import("@xyo-network/sdk").XyoQuantAddress | undefined;
            deploymentBlock?: number | undefined;
        };
        log: {
            logLevel: "info" | "error" | "warn" | "log" | "debug" | "trace";
            silent: boolean;
        };
        connections: Record<string, {
            root: string;
            type: "lmdb";
            access?: "read" | "write" | undefined;
            store?: string | undefined;
        } | {
            type: "mongo";
            connectionString?: string | undefined;
            database?: string | undefined;
            domain?: string | undefined;
            password?: string | undefined;
            username?: string | undefined;
            collection?: string | undefined;
        } | {
            type: "rpc";
            protocol: string;
            url?: string | undefined;
            networkId?: string | undefined;
            sessionId?: string | undefined;
        } | {
            type: "rest";
            baseUrl: string;
        } | {
            type: "s3";
            bucket?: string | undefined;
            caFile?: string | undefined;
            endpoint?: string | undefined;
            prefix?: string | undefined;
            readUrl?: string | undefined;
            accessKeyId?: string | undefined;
            accountId?: string | undefined;
            secretAccessKey?: string | undefined;
        } | {
            type: "evm-rpc";
            url: string;
            chainId?: string | undefined;
            eventQueryBlockChunkSize?: number | undefined;
        } | {
            type: "memory";
        }>;
        providerBindings: Record<string, {
            connection?: string | undefined;
            primeCaches?: "lazy" | "block" | "off" | undefined;
            provider?: string | undefined;
        }>;
        providers: {
            [x: string]: unknown;
            moniker: string;
            labels?: string[] | undefined;
        }[];
        telemetry: {
            metrics?: {
                scrape: {
                    path: string;
                    port?: number | undefined;
                };
            } | undefined;
            otel?: {
                otlpEndpoint?: string | undefined;
            } | undefined;
        };
        validation: {
            signerAuthorizations: ({
                type: "completedStepReward";
                signers: (import("@xyo-network/sdk").XyoQuantAddress | (Lowercase<string> & {
                    readonly __hex: true;
                } & {
                    readonly __address: true;
                }))[];
            } | {
                type: "derivedReceive";
                scope: string;
                signers: (import("@xyo-network/sdk").XyoQuantAddress | (Lowercase<string> & {
                    readonly __hex: true;
                } & {
                    readonly __address: true;
                }))[];
            })[];
            minCandidates: number;
            backoffMs: number;
        };
        primeCaches?: "lazy" | "block" | "off" | undefined;
    };
    /**
     * The explicitly configured priming mode for this provider, or undefined when
     * config is silent — lets subclasses honor deprecated legacy flags before the
     * `off` default applies.
     */
    protected get configuredPrimeCaches(): PrimeCachesMode | undefined;
    /**
     * Shared runtime connection handles for this context — lazily attached so all providers
     * on the same context share one handle per connection name.
     */
    protected get connectionHandles(): ConnectionHandleCache;
    protected get context(): import('../model/CreatableProviderContext.zod.js').CreatableProviderContextType;
    /** Signing account for this provider: keyed by moniker, falling back to `DefaultSignerKey`. */
    protected get contextSigner(): AccountInstance | undefined;
    protected get locator(): import('./ProviderFactoryLocatorInstance.js').ProviderFactoryLocatorInstance<import('../model/CreatableProviderContext.zod.js').CreatableProviderContextType>;
    /**
     * Resolved startup cache-priming mode: the per-moniker
     * `providerBindings.<moniker>.primeCaches` override wins, then the top-level
     * `primeCaches` config, then `off`.
     */
    protected get primeCaches(): PrimeCachesMode;
    /** Creates a provider factory with the supplied dependencies and default parameters. */
    static factory<TInstance extends CreatableProviderInstance, TDependencies extends ProviderMoniker[] = ProviderMoniker[]>(this: CreatableProvider<TInstance>, dependencies: TDependencies, params?: Partial<Omit<TInstance['params'], 'context'>>): ProviderFactory<TInstance, TDependencies>;
    /** Returns the params handler result exposed by this provider. */
    static paramsHandler<T extends CreatableProviderInstance>(params?: Partial<T['params']>): Promise<T["params"]>;
    /**
     * Resolve this provider class's bound connection from config or throw, enforcing the
     * class's `connectionTypes`. For static `paramsHandler` overrides — config-driven
     * self-resolution instead of params injection.
     */
    static requireBoundConnection(config: ConnectionBindingFields): ConnectionBinding;
    /**
     * Resolve a connection in a static `paramsHandler`: an explicitly injected
     * `params.connection` wins (deprecated path), otherwise the class's bound connection
     * from `params.context.config`.
     */
    static resolveConnection(params?: {
        connection?: ConnectionBinding;
        context?: {
            config?: ConnectionBindingFields;
        };
    }): ConnectionBinding | undefined;
    /**
     * Resolve this provider class's bound connection from config, checking each of the
     * class's monikers in order; undefined when no moniker is bound.
     */
    static tryBoundConnection(config: ConnectionBindingFields): ConnectionBinding | undefined;
    /** Creates the provider instance after its dependencies and configuration have resolved. */
    createHandler(): Promise<void>;
    /** Returns the locate and create result exposed by this provider. */
    locateAndCreate<TProvider extends Provider<ProviderMoniker>>(moniker: TProvider['moniker']): Promise<CreatableProviderInstance<TProvider>>;
    /**
     * Execute `fn` inside a root tracing span using this provider's tracer. Restores the
     * instance method that @ariestools/sdk's AbstractCreatable removed in 8.1.1 (span/spanRoot
     * remain available only as standalone functions there).
     */
    span<T>(name: string, fn: () => T): T;
    /**
     * Execute `fn` inside a root tracing span, defaulting the tracer and logger from this
     * provider. Restores the instance method that @ariestools/sdk's AbstractCreatable
     * removed in 8.1.1 (spanAsync/spanRootAsync remain available only as standalone
     * functions there).
     */
    spanAsync<T>(name: string, fn: () => Promise<T>, config?: SpanConfig): Promise<T>;
    /** Attempts to locate and create and returns `undefined` when it cannot be resolved. */
    tryLocateAndCreate<TProvider extends Provider<ProviderMoniker>>(moniker: TProvider['moniker']): Promise<CreatableProviderInstance<TProvider> | undefined>;
    /**
     * Run an optional startup cache warm-up according to the resolved
     * `primeCaches` mode: `block` awaits it (a failure fails start), `lazy` runs
     * it in the background (failures are logged, never thrown; `primed` settles
     * on completion), `off` skips it. Only optional warm-ups belong here —
     * materialized-state sync (an index that is the sole data source for reads)
     * must run unconditionally, since skipping it would corrupt reads rather
     * than slow them.
     */
    protected runPrime(prime: () => Promise<void>): Promise<void>;
}
//# sourceMappingURL=AbstractCreatableProvider.d.ts.map