import type { Json, JsonRpcMiddleware, JsonRpcRequest, MiddlewareContext } from '@metamask/json-rpc-engine/v2';
import type { RequestResponseSchemas } from '../../types/index.js';
/**
 * Keys that validation middleware stamps into the per-request context.
 *
 * Must be a type alias (not an interface): `MiddlewareContext<K>` constrains
 * `K extends Record<PropertyKey, unknown>`, which interfaces can't satisfy
 * because they're open to declaration merging.
 */
export type RpcContextKeyValues = {
    /** Pre-validated, deserialized params; safe for handlers to consume. */
    params: unknown;
    /** The schema entry for the dispatched method; used to encode the result. */
    schema: RequestResponseSchemas;
};
/** Typed MiddlewareContext used throughout the RPC engine. */
export type RpcContext = MiddlewareContext<RpcContextKeyValues>;
/**
 * Middleware shape used throughout the RPC engine. We only handle
 * {@link JsonRpcRequest}s (no notifications), so Result is constrained to
 * {@link JSON}. This matches what `createScaffoldMiddleware` and a sub-engine
 * built purely from request-handling middleware will produce.
 */
export type RpcMiddleware = JsonRpcMiddleware<JsonRpcRequest, Json, RpcContext>;
//# sourceMappingURL=RpcContext.d.ts.map