@metamask/snaps-simulation
Version:
A simulation framework for MetaMask Snaps, enabling headless testing of Snaps in a controlled environment
37 lines • 1.67 kB
text/typescript
import type { Json } from "@metamask/utils";
import type { PayloadAction } from "@reduxjs/toolkit";
import type { ApplicationState } from "./store.cjs";
export type JsonRpcMock = {
method: string;
result: Json;
};
export type MocksState = {
jsonRpc: Record<string, Json>;
};
export declare const mocksSlice: import("@reduxjs/toolkit").Slice<MocksState, {
addJsonRpcMock: (state: import("immer/dist/internal.js").WritableDraft<MocksState>, action: PayloadAction<JsonRpcMock>) => void;
removeJsonRpcMock: (state: import("immer/dist/internal.js").WritableDraft<MocksState>, action: PayloadAction<string>) => void;
}, "mocks">;
export declare const addJsonRpcMock: import("@reduxjs/toolkit").ActionCreatorWithPayload<JsonRpcMock, "mocks/addJsonRpcMock">, removeJsonRpcMock: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "mocks/removeJsonRpcMock">;
/**
* Get the JSON-RPC mocks from the state.
*
* @param state - The application state.
* @returns The JSON-RPC mocks.
*/
export declare const getJsonRpcMocks: (state: ApplicationState) => Record<string, Json>;
/**
* Get the JSON-RPC mock for a given method from the state.
*/
export declare const getJsonRpcMock: ((state: {
mocks: MocksState;
notifications: import("./notifications.cjs").NotificationsState;
state: import("./state.cjs").State;
trackables: import("./trackables.cjs").TrackablesState;
ui: import("./ui.cjs").UiState;
}, method: string) => Json) & import("reselect").OutputSelectorFields<(args_0: Record<string, Json>, args_1: string) => Json, {
clearCache: () => void;
}> & {
clearCache: () => void;
};
//# sourceMappingURL=mocks.d.cts.map