{"version":3,"file":"keyring.mjs","sourceRoot":"","sources":["../../../src/types/handlers/keyring.ts"],"names":[],"mappings":"","sourcesContent":["import type { Json, JsonRpcParams, JsonRpcRequest } from '@metamask/utils';\n\n/**\n * The `onKeyringRequest` handler, which is called when a Snap receives a\n * keyring request.\n *\n * Note that using this handler requires the `endowment:keyring` permission.\n *\n * @param args - The request arguments.\n * @param args.origin - The origin of the request. This can be the ID of another\n * Snap, or the URL of a website.\n * @param args.request - The keyring request sent to the Snap. This includes\n * the method name and parameters.\n * @returns The response to the keyring request. This must be a\n * JSON-serializable value. In order to return an error, throw a `SnapError`\n * instead.\n */\nexport type OnKeyringRequestHandler<\n  Params extends JsonRpcParams = JsonRpcParams,\n> = (args: {\n  origin: string;\n  request: JsonRpcRequest<Params>;\n}) => Promise<Json>;\n"]}