@metamask/snaps-rpc-methods
Version:
MetaMask Snaps JSON-RPC method implementations
14 lines • 839 B
text/typescript
import { type JsonRpcMiddleware } from "@metamask/json-rpc-engine";
import type { Messenger } from "@metamask/messenger";
import type { Json, JsonRpcParams } from "@metamask/utils";
import type { PermittedRpcMethodActions, PermittedRpcMethodHooks } from "./index.cjs";
/**
* Creates a middleware that handles permitted snap RPC methods.
*
* @param isSnap - A flag that should indicate whether the requesting origin is a snap or not.
* @param hooks - An object containing the hooks made available to the permitted RPC methods.
* @param messenger - The messenger.
* @returns The middleware.
*/
export declare function createSnapsMethodMiddleware(isSnap: boolean, hooks: PermittedRpcMethodHooks, messenger: Messenger<string, PermittedRpcMethodActions>): JsonRpcMiddleware<JsonRpcParams, Json>;
//# sourceMappingURL=middleware.d.cts.map