UNPKG

@metamask/snaps-rpc-methods

Version:
55 lines 2.53 kB
import type { JsonRpcEngineEndCallback } from "@metamask/json-rpc-engine"; import type { Messenger } from "@metamask/messenger"; import type { EndTraceParams, EndTraceRequest } from "@metamask/snaps-sdk"; import type { InferMatching } from "@metamask/snaps-utils"; import type { PendingJsonRpcResponse } from "@metamask/utils"; import type { JsonRpcRequestWithOrigin, SnapControllerGetSnapAction } from "../types.mjs"; import type { MethodHooksObject } from "../utils.mjs"; export type EndTraceMethodHooks = { /** * End a performance trace in Sentry. * * @param request - The trace request object. * @returns The performance trace context. */ endTrace: (request: EndTraceRequest) => void; }; export type EndTraceMethodActions = SnapControllerGetSnapAction; declare const EndTraceParametersStruct: import("@metamask/superstruct").Struct<{ name: string; id?: string | undefined; timestamp?: number | undefined; }, { id: import("@metamask/superstruct").ExactOptionalStruct<string, null>; name: import("@metamask/superstruct").Struct<string, null>; timestamp: import("@metamask/superstruct").ExactOptionalStruct<number, null>; }>; export type EndTraceParameters = InferMatching<typeof EndTraceParametersStruct, EndTraceParams>; /** * End a performance trace in Sentry. This method is only available to * preinstalled Snaps. * * @internal */ export declare const endTraceHandler: { implementation: typeof getEndTraceImplementation; hookNames: MethodHooksObject<EndTraceMethodHooks>; actionNames: "SnapController:getSnap"[]; }; /** * The `snap_endTrace` method implementation. This method is used to end a * performance trace in Sentry. It is only available to preinstalled Snaps. * * @param request - The JSON-RPC request object. * @param response - The JSON-RPC response object. * @param _next - The `json-rpc-engine` "next" callback. Not used by this * function. * @param end - The `json-rpc-engine` "end" callback. * @param hooks - The RPC method hooks. * @param hooks.endTrace - The hook function to end a performance trace. * @param messenger - The messenger used to call controller actions. * @returns Nothing. */ declare function getEndTraceImplementation(request: JsonRpcRequestWithOrigin<EndTraceParameters>, response: PendingJsonRpcResponse, _next: unknown, end: JsonRpcEngineEndCallback, { endTrace }: EndTraceMethodHooks, messenger: Messenger<string, EndTraceMethodActions>): void; export {}; //# sourceMappingURL=endTrace.d.mts.map