import type { RequestArguments } from "@metamask/providers"; import type { Json } from "@metamask/utils"; /** * Make proxy for Promise and handle the teardown process properly. * If the teardown is called in the meanwhile, Promise result will not be * exposed to the snap anymore and warning will be logged to the console. * * @param originalPromise - Original promise. * @param teardownRef - Reference containing teardown count. * @param teardownRef.lastTeardown - Number of the last teardown. * @returns New proxy promise. */ export declare function withTeardown(originalPromise: Promise, teardownRef: { lastTeardown: number; }): Promise; export declare const BLOCKED_RPC_METHODS: readonly string[]; export declare const MULTICHAIN_API_METHODS: readonly string[]; export declare const BLOCKED_MULTICHAIN_RPC_METHODS: readonly string[]; /** * Check whether a validated request should be routed to the multichain API. * * @param args - The request arguments. * @returns True if the request is a multichain request, otherwise false. */ export declare function isMultichainRequest(args: RequestArguments): boolean; /** * Asserts the validity of request arguments for a multichain outbound request using the `snap.request` API. * * @param args - The arguments to validate. */ export declare function assertMultichainOutboundRequest(args: RequestArguments): void; /** * Asserts the validity of request arguments for a snap outbound request using the `snap.request` API. * * @param args - The arguments to validate. */ export declare function assertSnapOutboundRequest(args: RequestArguments): void; /** * Asserts the validity of request arguments for an ethereum outbound request using the `ethereum.request` API. * * @param args - The arguments to validate. */ export declare function assertEthereumOutboundRequest(args: RequestArguments): void; /** * Gets a sanitized value to be used for passing to the underlying MetaMask provider. * * @param value - An unsanitized value from a snap. * @returns A sanitized value ready to be passed to a MetaMask provider. */ export declare function sanitizeRequestArguments(value: unknown): RequestArguments; /** * Check if the input is a valid response. * * @param response - The response. * @returns True if the response is valid, otherwise false. */ export declare function isValidResponse(response: Record): boolean; //# sourceMappingURL=utils.d.mts.map