import type { JsonRpcEngine } from "@metamask/json-rpc-engine";
import { JsonRpcEngineV2 } from "@metamask/json-rpc-engine/v2";
import type { HandleOptions, ContextConstraint, MiddlewareContext } from "@metamask/json-rpc-engine/v2";
import type { Json, JsonRpcId, JsonRpcParams, JsonRpcRequest, JsonRpcVersion2 } from "@metamask/utils";
/**
 * A JSON-RPC request conforming to the EIP-1193 specification.
 */
type Eip1193Request<Params extends JsonRpcParams = JsonRpcParams> = {
    id?: JsonRpcId;
    jsonrpc?: JsonRpcVersion2;
    method: string;
    params?: Params;
};
type Options<Request extends JsonRpcRequest = JsonRpcRequest, Context extends ContextConstraint = MiddlewareContext> = {
    engine: JsonRpcEngine | JsonRpcEngineV2<Request, Context>;
};
/**
 * An Ethereum provider.
 *
 * This provider loosely follows conventions that pre-date EIP-1193.
 * It is not compliant with any Ethereum provider standard.
 */
export declare class InternalProvider<Context extends ContextConstraint = MiddlewareContext> {
    #private;
    /**
     * Construct a InternalProvider from a JSON-RPC server or legacy engine.
     *
     * @param options - Options.
     * @param options.engine - The JSON-RPC engine used to process requests.
     */
    constructor({ engine }: Options<JsonRpcRequest, Context>);
    /**
     * Send a provider request asynchronously.
     *
     * @param eip1193Request - The request to send.
     * @param options - The options for the request operation.
     * @param options.context - The context to include with the request.
     * @returns The JSON-RPC response.
     */
    request<Params extends JsonRpcParams, Result extends Json>(eip1193Request: Eip1193Request<Params>, options?: HandleOptions<Context>): Promise<Result>;
    /**
     * Send a provider request asynchronously.
     *
     * This method serves the same purpose as `request`. It only exists for
     * legacy reasons.
     *
     * @param eip1193Request - The request to send.
     * @param callback - A function that is called upon the success or failure of the request.
     * @deprecated Use {@link request} instead. This method is retained solely for backwards
     * compatibility with certain libraries.
     */
    sendAsync: <Params extends JsonRpcParams>(eip1193Request: Eip1193Request<Params>, callback: (error: unknown, providerRes?: any) => void) => void;
    /**
     * Send a provider request asynchronously.
     *
     * This method serves the same purpose as `request`. It only exists for
     * legacy reasons.
     *
     * @param eip1193Request - The request to send.
     * @param callback - A function that is called upon the success or failure of the request.
     * @deprecated Use {@link request} instead. This method is retained solely for backwards
     * compatibility with certain libraries.
     */
    send: <Params extends JsonRpcParams>(eip1193Request: Eip1193Request<Params>, callback: (error: unknown, providerRes?: any) => void) => void;
}
/**
 * Convert an EIP-1193 request to a JSON-RPC request.
 *
 * @param eip1193Request - The EIP-1193 request to convert.
 * @returns The JSON-RPC request.
 */
export declare function convertEip1193RequestToJsonRpcRequest(eip1193Request: Eip1193Request): JsonRpcRequest;
export {};
//# sourceMappingURL=internal-provider.d.cts.map