UNPKG

@metamask/keyring-internal-snap-client

Version:
40 lines 1.71 kB
import { KeyringClient } from "@metamask/keyring-snap-client/v2"; import type { SnapId } from "@metamask/snaps-sdk"; import type { HandlerType } from "@metamask/snaps-utils"; import type { KeyringInternalSnapClientMessenger } from "../KeyringInternalSnapClient.mjs"; /** * A `KeyringClient` that allows the communication with a Snap through a * `Messenger`. */ export declare class KeyringInternalSnapClient extends KeyringClient { #private; /** * Create a new instance of `KeyringInternalSnapClient`. * * The `handlerType` argument has a hard-coded default `string` value instead * of a `HandlerType` value to prevent the `@metamask/snaps-utils` module * from being required at runtime. * * @param args - Constructor arguments. * @param args.messenger - The `KeyringInternalSnapClientMessenger` instance to use. * @param args.snapId - The ID of the Snap to use (default: `'undefined'`). * @param args.origin - The sender's origin (default: `'metamask'`). * @param args.handler - The handler type (default: `'onKeyringRequest'`). */ constructor({ messenger, snapId, origin, handler, }: { messenger: KeyringInternalSnapClientMessenger; snapId?: SnapId; origin?: string; handler?: HandlerType; }); /** * Create a new instance of `KeyringInternalSnapClient` with the specified * `snapId`. * * @param snapId - The ID of the Snap to use in the new instance. * @returns A new instance of `KeyringInternalSnapClient` with the * specified Snap ID. */ withSnapId(snapId: SnapId): KeyringInternalSnapClient; } //# sourceMappingURL=KeyringInternalSnapClient.d.mts.map