UNPKG

@metamask/snaps-rpc-methods

Version:
32 lines 1.61 kB
import type { PermittedHandlerExport } from "@metamask/permission-controller"; import { type ScheduleBackgroundEventParams, type ScheduleBackgroundEventResult } from "@metamask/snaps-sdk"; import type { CronjobRpcRequest, InferMatching } from "@metamask/snaps-utils"; type ScheduleBackgroundEventHookParams = { schedule: string; request: CronjobRpcRequest; }; export type ScheduleBackgroundEventMethodHooks = { scheduleBackgroundEvent: (snapEvent: ScheduleBackgroundEventHookParams) => string; hasPermission: (permissionName: string) => boolean; }; export declare const scheduleBackgroundEventHandler: PermittedHandlerExport<ScheduleBackgroundEventMethodHooks, ScheduleBackgroundEventParameters, ScheduleBackgroundEventResult>; declare const ScheduleBackgroundEventParametersStruct: import("@metamask/superstruct").Struct<{ date: string; request: { method: string; jsonrpc?: "2.0" | undefined; id?: string | number | null | undefined; params?: import("@metamask/snaps-sdk").Json[] | Record<string, import("@metamask/snaps-sdk").Json> | undefined; }; } | { request: { method: string; jsonrpc?: "2.0" | undefined; id?: string | number | null | undefined; params?: import("@metamask/snaps-sdk").Json[] | Record<string, import("@metamask/snaps-sdk").Json> | undefined; }; duration: string; }, null>; export type ScheduleBackgroundEventParameters = InferMatching<typeof ScheduleBackgroundEventParametersStruct, ScheduleBackgroundEventParams>; export {}; //# sourceMappingURL=scheduleBackgroundEvent.d.mts.map