Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@metamask/snaps-controllers

Package Overview
Dependencies
Maintainers
4
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metamask/snaps-controllers - npm Package Compare versions

Comparing version
19.0.1
to
20.0.0
+1
-1
dist/snaps/registry/index.cjs.map

@@ -1,1 +0,1 @@

{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/snaps/registry/index.ts"],"names":[],"mappings":";;;AASA,uEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAa/B,qCAA6C;AAApC,2GAAA,kBAAkB,OAAA","sourcesContent":["export type {\n SnapRegistryControllerActions,\n SnapRegistryControllerEvents,\n SnapRegistryControllerArgs,\n SnapRegistryControllerGetStateAction,\n SnapRegistryControllerMessenger,\n SnapRegistryControllerState,\n SnapRegistryControllerStateChangeEvent,\n} from './SnapRegistryController';\nexport { SnapRegistryController } from './SnapRegistryController';\nexport type {\n SnapRegistryControllerGetAction,\n SnapRegistryControllerGetMetadataAction,\n SnapRegistryControllerRequestUpdateAction,\n SnapRegistryControllerResolveVersionAction,\n} from './SnapRegistryController-method-action-types';\nexport type {\n SnapRegistryInfo,\n SnapRegistryMetadata,\n SnapRegistryRequest,\n SnapRegistryResult,\n} from './types';\nexport { SnapRegistryStatus } from './types';\n"]}
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/snaps/registry/index.ts"],"names":[],"mappings":";;;AAUA,uEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAa/B,qCAA6C;AAApC,2GAAA,kBAAkB,OAAA","sourcesContent":["export type {\n SnapRegistryControllerActions,\n SnapRegistryControllerEvents,\n SnapRegistryControllerArgs,\n SnapRegistryControllerGetStateAction,\n SnapRegistryControllerMessenger,\n SnapRegistryControllerState,\n SnapRegistryControllerStateChangeEvent,\n SnapRegistryControllerRegistryUpdatedEvent,\n} from './SnapRegistryController';\nexport { SnapRegistryController } from './SnapRegistryController';\nexport type {\n SnapRegistryControllerGetAction,\n SnapRegistryControllerGetMetadataAction,\n SnapRegistryControllerRequestUpdateAction,\n SnapRegistryControllerResolveVersionAction,\n} from './SnapRegistryController-method-action-types';\nexport type {\n SnapRegistryInfo,\n SnapRegistryMetadata,\n SnapRegistryRequest,\n SnapRegistryResult,\n} from './types';\nexport { SnapRegistryStatus } from './types';\n"]}

@@ -1,2 +0,2 @@

export type { SnapRegistryControllerActions, SnapRegistryControllerEvents, SnapRegistryControllerArgs, SnapRegistryControllerGetStateAction, SnapRegistryControllerMessenger, SnapRegistryControllerState, SnapRegistryControllerStateChangeEvent, } from "./SnapRegistryController.cjs";
export type { SnapRegistryControllerActions, SnapRegistryControllerEvents, SnapRegistryControllerArgs, SnapRegistryControllerGetStateAction, SnapRegistryControllerMessenger, SnapRegistryControllerState, SnapRegistryControllerStateChangeEvent, SnapRegistryControllerRegistryUpdatedEvent, } from "./SnapRegistryController.cjs";
export { SnapRegistryController } from "./SnapRegistryController.cjs";

@@ -3,0 +3,0 @@ export type { SnapRegistryControllerGetAction, SnapRegistryControllerGetMetadataAction, SnapRegistryControllerRequestUpdateAction, SnapRegistryControllerResolveVersionAction, } from "./SnapRegistryController-method-action-types.cjs";

@@ -1,1 +0,1 @@

{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/snaps/registry/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,6BAA6B,EAC7B,4BAA4B,EAC5B,0BAA0B,EAC1B,oCAAoC,EACpC,+BAA+B,EAC/B,2BAA2B,EAC3B,sCAAsC,GACvC,qCAAiC;AAClC,OAAO,EAAE,sBAAsB,EAAE,qCAAiC;AAClE,YAAY,EACV,+BAA+B,EAC/B,uCAAuC,EACvC,yCAAyC,EACzC,0CAA0C,GAC3C,yDAAqD;AACtD,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,GACnB,oBAAgB;AACjB,OAAO,EAAE,kBAAkB,EAAE,oBAAgB"}
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/snaps/registry/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,6BAA6B,EAC7B,4BAA4B,EAC5B,0BAA0B,EAC1B,oCAAoC,EACpC,+BAA+B,EAC/B,2BAA2B,EAC3B,sCAAsC,EACtC,0CAA0C,GAC3C,qCAAiC;AAClC,OAAO,EAAE,sBAAsB,EAAE,qCAAiC;AAClE,YAAY,EACV,+BAA+B,EAC/B,uCAAuC,EACvC,yCAAyC,EACzC,0CAA0C,GAC3C,yDAAqD;AACtD,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,GACnB,oBAAgB;AACjB,OAAO,EAAE,kBAAkB,EAAE,oBAAgB"}

@@ -1,2 +0,2 @@

export type { SnapRegistryControllerActions, SnapRegistryControllerEvents, SnapRegistryControllerArgs, SnapRegistryControllerGetStateAction, SnapRegistryControllerMessenger, SnapRegistryControllerState, SnapRegistryControllerStateChangeEvent, } from "./SnapRegistryController.mjs";
export type { SnapRegistryControllerActions, SnapRegistryControllerEvents, SnapRegistryControllerArgs, SnapRegistryControllerGetStateAction, SnapRegistryControllerMessenger, SnapRegistryControllerState, SnapRegistryControllerStateChangeEvent, SnapRegistryControllerRegistryUpdatedEvent, } from "./SnapRegistryController.mjs";
export { SnapRegistryController } from "./SnapRegistryController.mjs";

@@ -3,0 +3,0 @@ export type { SnapRegistryControllerGetAction, SnapRegistryControllerGetMetadataAction, SnapRegistryControllerRequestUpdateAction, SnapRegistryControllerResolveVersionAction, } from "./SnapRegistryController-method-action-types.mjs";

@@ -1,1 +0,1 @@

{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/snaps/registry/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,6BAA6B,EAC7B,4BAA4B,EAC5B,0BAA0B,EAC1B,oCAAoC,EACpC,+BAA+B,EAC/B,2BAA2B,EAC3B,sCAAsC,GACvC,qCAAiC;AAClC,OAAO,EAAE,sBAAsB,EAAE,qCAAiC;AAClE,YAAY,EACV,+BAA+B,EAC/B,uCAAuC,EACvC,yCAAyC,EACzC,0CAA0C,GAC3C,yDAAqD;AACtD,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,GACnB,oBAAgB;AACjB,OAAO,EAAE,kBAAkB,EAAE,oBAAgB"}
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/snaps/registry/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,6BAA6B,EAC7B,4BAA4B,EAC5B,0BAA0B,EAC1B,oCAAoC,EACpC,+BAA+B,EAC/B,2BAA2B,EAC3B,sCAAsC,EACtC,0CAA0C,GAC3C,qCAAiC;AAClC,OAAO,EAAE,sBAAsB,EAAE,qCAAiC;AAClE,YAAY,EACV,+BAA+B,EAC/B,uCAAuC,EACvC,yCAAyC,EACzC,0CAA0C,GAC3C,yDAAqD;AACtD,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,GACnB,oBAAgB;AACjB,OAAO,EAAE,kBAAkB,EAAE,oBAAgB"}

@@ -1,1 +0,1 @@

{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/snaps/registry/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,sBAAsB,EAAE,qCAAiC;AAalE,OAAO,EAAE,kBAAkB,EAAE,oBAAgB","sourcesContent":["export type {\n SnapRegistryControllerActions,\n SnapRegistryControllerEvents,\n SnapRegistryControllerArgs,\n SnapRegistryControllerGetStateAction,\n SnapRegistryControllerMessenger,\n SnapRegistryControllerState,\n SnapRegistryControllerStateChangeEvent,\n} from './SnapRegistryController';\nexport { SnapRegistryController } from './SnapRegistryController';\nexport type {\n SnapRegistryControllerGetAction,\n SnapRegistryControllerGetMetadataAction,\n SnapRegistryControllerRequestUpdateAction,\n SnapRegistryControllerResolveVersionAction,\n} from './SnapRegistryController-method-action-types';\nexport type {\n SnapRegistryInfo,\n SnapRegistryMetadata,\n SnapRegistryRequest,\n SnapRegistryResult,\n} from './types';\nexport { SnapRegistryStatus } from './types';\n"]}
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/snaps/registry/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,sBAAsB,EAAE,qCAAiC;AAalE,OAAO,EAAE,kBAAkB,EAAE,oBAAgB","sourcesContent":["export type {\n SnapRegistryControllerActions,\n SnapRegistryControllerEvents,\n SnapRegistryControllerArgs,\n SnapRegistryControllerGetStateAction,\n SnapRegistryControllerMessenger,\n SnapRegistryControllerState,\n SnapRegistryControllerStateChangeEvent,\n SnapRegistryControllerRegistryUpdatedEvent,\n} from './SnapRegistryController';\nexport { SnapRegistryController } from './SnapRegistryController';\nexport type {\n SnapRegistryControllerGetAction,\n SnapRegistryControllerGetMetadataAction,\n SnapRegistryControllerRequestUpdateAction,\n SnapRegistryControllerResolveVersionAction,\n} from './SnapRegistryController-method-action-types';\nexport type {\n SnapRegistryInfo,\n SnapRegistryMetadata,\n SnapRegistryRequest,\n SnapRegistryResult,\n} from './types';\nexport { SnapRegistryStatus } from './types';\n"]}

@@ -110,2 +110,3 @@ "use strict";

if (this.#wasRecentlyFetched()) {
this.messenger.publish('SnapRegistryController:registryUpdated', false);
return;

@@ -125,2 +126,3 @@ }

});
this.messenger.publish('SnapRegistryController:registryUpdated', false);
return;

@@ -135,2 +137,3 @@ }

});
this.messenger.publish('SnapRegistryController:registryUpdated', true);
}

@@ -137,0 +140,0 @@ catch {

@@ -1,1 +0,1 @@

{"version":3,"file":"SnapRegistryController.cjs","sourceRoot":"","sources":["../../../src/snaps/registry/SnapRegistryController.ts"],"names":[],"mappings":";;;AAIA,+DAA2D;AAM3D,6DAAkD;AAClD,uDAAyD;AAGzD,2CAMyB;AASzB,uCAA6C;AAE7C,MAAM,iBAAiB,GACrB,wDAAwD,CAAC;AAE3D,MAAM,2BAA2B,GAC/B,yDAAyD,CAA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6D;QAC7D,IAAA,2BAAmB,EAAC,aAAa,CAAC,CAAC;QACnC,OAAO,aAAa,CAAC;IACvB,CAAC;IAED;;;;;;OAMG;IACH,WAAW,CAAC,MAAc;QACxB,OAAO,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,QAAQ,IAAI,IAAI,CAAC;IACvE,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,gBAAgB,CACpB,QAAgB,EAChB,SAAwC;QAExC,IAAA,cAAM,EAAC,IAAI,CAAC,UAAU,EAAE,yBAAyB,CAAC,CAAC;QAEnD,MAAM,KAAK,GAAG,MAAM,IAAA,uBAAM,EAAC;YACzB,QAAQ,EAAE,QAAQ;YAClB,SAAS;YACT,SAAS,EAAE,IAAI,CAAC,UAAU;SAC3B,CAAC,CAAC;QAEH,IAAA,cAAM,EAAC,KAAK,EAAE,6BAA6B,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,UAAU,CAAC,GAAW;QAC1B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;QACvE,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,mBAAmB,GAAG,GAAG,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC;CACF;AAnUD,wDAmUC","sourcesContent":["import type {\n ControllerGetStateAction,\n ControllerStateChangeEvent,\n} from '@metamask/base-controller';\nimport { BaseController } from '@metamask/base-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type {\n SnapsRegistryDatabase,\n SignatureStruct,\n} from '@metamask/snaps-registry';\nimport { verify } from '@metamask/snaps-registry';\nimport { getTargetVersion } from '@metamask/snaps-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport type { Hex, SemVerRange, SemVerVersion } from '@metamask/utils';\nimport {\n assert,\n assertIsSemVerRange,\n Duration,\n inMilliseconds,\n satisfiesVersionRange,\n} from '@metamask/utils';\n\nimport type { SnapRegistryControllerMethodActions } from './SnapRegistryController-method-action-types';\nimport type {\n SnapRegistryInfo,\n SnapRegistryMetadata,\n SnapRegistryRequest,\n SnapRegistryResult,\n} from './types';\nimport { SnapRegistryStatus } from './types';\n\nconst SNAP_REGISTRY_URL =\n 'https://acl.execution.metamask.io/latest/registry.json';\n\nconst SNAP_REGISTRY_SIGNATURE_URL =\n 'https://acl.execution.metamask.io/latest/signature.json';\n\nconst DEFAULT_PUBLIC_KEY =\n '0x025b65308f0f0fb8bc7f7ff87bfc296e0330eee5d3c1d1ee4a048b2fd6a86fa0a6';\n\ntype JsonSnapsRegistryUrl = {\n registry: string;\n signature: string;\n};\n\nexport type ClientConfig = {\n type: 'extension' | 'mobile';\n version: SemVerVersion;\n};\n\nexport type SnapRegistryControllerArgs = {\n messenger: SnapRegistryControllerMessenger;\n state?: SnapRegistryControllerState;\n fetchFunction?: typeof fetch;\n url?: JsonSnapsRegistryUrl;\n recentFetchThreshold?: number;\n refetchOnAllowlistMiss?: boolean;\n publicKey?: Hex;\n clientConfig: ClientConfig;\n};\n\nexport type SnapRegistryControllerGetStateAction = ControllerGetStateAction<\n typeof controllerName,\n SnapRegistryControllerState\n>;\n\nexport type SnapRegistryControllerActions =\n | SnapRegistryControllerGetStateAction\n | SnapRegistryControllerMethodActions;\n\nexport type SnapRegistryControllerStateChangeEvent = ControllerStateChangeEvent<\n typeof controllerName,\n SnapRegistryControllerState\n>;\n\nexport type SnapRegistryControllerEvents =\n SnapRegistryControllerStateChangeEvent;\n\nexport type SnapRegistryControllerMessenger = Messenger<\n typeof controllerName,\n SnapRegistryControllerActions,\n SnapRegistryControllerEvents\n>;\n\nexport type SnapRegistryControllerState = {\n database: SnapsRegistryDatabase | null;\n signature: string | null;\n lastUpdated: number | null;\n databaseUnavailable: boolean;\n};\n\nconst controllerName = 'SnapRegistryController';\n\nconst MESSENGER_EXPOSED_METHODS = [\n 'get',\n 'getMetadata',\n 'resolveVersion',\n 'requestUpdate',\n] as const;\n\nconst defaultState = {\n database: null,\n signature: null,\n lastUpdated: null,\n databaseUnavailable: false,\n};\n\nexport class SnapRegistryController extends BaseController<\n typeof controllerName,\n SnapRegistryControllerState,\n SnapRegistryControllerMessenger\n> {\n readonly #url: JsonSnapsRegistryUrl;\n\n readonly #publicKey: Hex;\n\n readonly #clientConfig: ClientConfig;\n\n readonly #fetchFunction: typeof fetch;\n\n readonly #recentFetchThreshold: number;\n\n readonly #refetchOnAllowlistMiss: boolean;\n\n #currentUpdate: Promise<void> | null;\n\n constructor({\n messenger,\n state,\n url = {\n registry: SNAP_REGISTRY_URL,\n signature: SNAP_REGISTRY_SIGNATURE_URL,\n },\n publicKey = DEFAULT_PUBLIC_KEY,\n clientConfig,\n fetchFunction = globalThis.fetch.bind(undefined),\n recentFetchThreshold = inMilliseconds(5, Duration.Minute),\n refetchOnAllowlistMiss = true,\n }: SnapRegistryControllerArgs) {\n super({\n messenger,\n metadata: {\n database: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: false,\n usedInUi: true,\n },\n signature: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: false,\n },\n lastUpdated: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: false,\n },\n databaseUnavailable: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: false,\n },\n },\n name: controllerName,\n state: {\n ...defaultState,\n ...state,\n },\n });\n this.#url = url;\n this.#publicKey = publicKey;\n this.#clientConfig = clientConfig;\n this.#fetchFunction = fetchFunction;\n this.#recentFetchThreshold = recentFetchThreshold;\n this.#refetchOnAllowlistMiss = refetchOnAllowlistMiss;\n this.#currentUpdate = null;\n\n this.messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n }\n\n #wasRecentlyFetched() {\n return (\n this.state.lastUpdated &&\n Date.now() - this.state.lastUpdated < this.#recentFetchThreshold\n );\n }\n\n /**\n * Triggers an update of the registry database.\n *\n * If an existing update is in progress this function will await that update.\n */\n async requestUpdate() {\n // If an update is ongoing, wait for that.\n if (this.#currentUpdate) {\n await this.#currentUpdate;\n return;\n }\n // If no update exists, create promise and store globally.\n if (this.#currentUpdate === null) {\n this.#currentUpdate = this.#update();\n }\n await this.#currentUpdate;\n this.#currentUpdate = null;\n }\n\n /**\n * Updates the registry database if the registry hasn't been updated recently.\n *\n * NOTE: SHOULD NOT be called directly, instead `triggerUpdate` should be used.\n */\n async #update() {\n // No-op if we recently fetched the registry.\n if (this.#wasRecentlyFetched()) {\n return;\n }\n\n try {\n const [database, signature] = await Promise.all([\n this.#safeFetch(this.#url.registry),\n this.#safeFetch(this.#url.signature),\n ]);\n\n const signatureJson = JSON.parse(signature);\n\n // If the signature matches the existing state, we can skip verification and don't need to update the database.\n if (signatureJson.signature === this.state.signature) {\n this.update((state) => {\n state.lastUpdated = Date.now();\n state.databaseUnavailable = false;\n });\n return;\n }\n\n await this.#verifySignature(database, signatureJson);\n\n this.update((state) => {\n state.database = JSON.parse(database);\n state.lastUpdated = Date.now();\n state.databaseUnavailable = false;\n state.signature = signatureJson.signature;\n });\n } catch {\n // Ignore\n this.update((state) => {\n state.databaseUnavailable = true;\n });\n }\n }\n\n async #getDatabase(): Promise<SnapsRegistryDatabase | null> {\n if (this.state.database === null) {\n await this.requestUpdate();\n }\n\n return this.state.database;\n }\n\n async #getSingle(\n snapId: string,\n snapInfo: SnapRegistryInfo,\n refetch = false,\n ): Promise<SnapRegistryResult> {\n const database = await this.#getDatabase();\n\n const blockedEntry = database?.blockedSnaps.find((blocked) => {\n if ('id' in blocked) {\n return (\n blocked.id === snapId &&\n satisfiesVersionRange(snapInfo.version, blocked.versionRange)\n );\n }\n\n return blocked.checksum === snapInfo.checksum;\n });\n\n if (blockedEntry) {\n return {\n status: SnapRegistryStatus.Blocked,\n reason: blockedEntry.reason,\n };\n }\n\n const verified = database?.verifiedSnaps[snapId];\n const version = verified?.versions?.[snapInfo.version];\n const clientRange = version?.clientVersions?.[this.#clientConfig.type];\n const isCompatible =\n !clientRange ||\n satisfiesVersionRange(this.#clientConfig.version, clientRange);\n if (version && version.checksum === snapInfo.checksum && isCompatible) {\n return { status: SnapRegistryStatus.Verified };\n }\n // For now, if we have an allowlist miss, we can refetch once and try again.\n if (this.#refetchOnAllowlistMiss && !refetch) {\n await this.requestUpdate();\n return this.#getSingle(snapId, snapInfo, true);\n }\n return {\n status: this.state.databaseUnavailable\n ? SnapRegistryStatus.Unavailable\n : SnapRegistryStatus.Unverified,\n };\n }\n\n async get(\n snaps: SnapRegistryRequest,\n ): Promise<Record<string, SnapRegistryResult>> {\n return Object.entries(snaps).reduce<\n Promise<Record<string, SnapRegistryResult>>\n >(async (previousPromise, [snapId, snapInfo]) => {\n const result = await this.#getSingle(snapId, snapInfo);\n const acc = await previousPromise;\n acc[snapId] = result;\n return acc;\n }, Promise.resolve({}));\n }\n\n /**\n * Find an allowlisted version within a specified version range. Otherwise return the version range itself.\n *\n * @param snapId - The ID of the snap we are trying to resolve a version for.\n * @param versionRange - The version range.\n * @param refetch - An optional flag used to determine if we are refetching the registry.\n * @returns An allowlisted version within the specified version range if available otherwise returns the input version range.\n */\n async resolveVersion(\n snapId: string,\n versionRange: SemVerRange,\n refetch = false,\n ): Promise<SemVerRange> {\n const database = await this.#getDatabase();\n const versions = database?.verifiedSnaps[snapId]?.versions ?? null;\n\n if (!versions && this.#refetchOnAllowlistMiss && !refetch) {\n await this.requestUpdate();\n return this.resolveVersion(snapId, versionRange, true);\n }\n\n // If we cannot narrow down the version range we return the unaltered version range.\n if (!versions) {\n return versionRange;\n }\n\n const compatibleVersions = Object.entries(versions).reduce<SemVerVersion[]>(\n (accumulator, [version, metadata]) => {\n const clientRange = metadata.clientVersions?.[this.#clientConfig.type];\n if (\n !clientRange ||\n satisfiesVersionRange(this.#clientConfig.version, clientRange)\n ) {\n accumulator.push(version as SemVerVersion);\n }\n\n return accumulator;\n },\n [],\n );\n\n const targetVersion = getTargetVersion(compatibleVersions, versionRange);\n\n if (!targetVersion && this.#refetchOnAllowlistMiss && !refetch) {\n await this.requestUpdate();\n return this.resolveVersion(snapId, versionRange, true);\n }\n\n // If we cannot narrow down the version range we return the unaltered version range.\n if (!targetVersion) {\n return versionRange;\n }\n\n // A semver version is technically also a valid semver range.\n assertIsSemVerRange(targetVersion);\n return targetVersion;\n }\n\n /**\n * Get metadata for the given snap ID, if available, without updating registry.\n *\n * @param snapId - The ID of the snap to get metadata for.\n * @returns The metadata for the given snap ID, or `null` if the snap is not\n * verified.\n */\n getMetadata(snapId: string): SnapRegistryMetadata | null {\n return this.state?.database?.verifiedSnaps[snapId]?.metadata ?? null;\n }\n\n /**\n * Verify the signature of the registry.\n *\n * @param database - The registry database.\n * @param signature - The signature of the registry.\n * @throws If the signature is invalid.\n */\n async #verifySignature(\n database: string,\n signature: Infer<typeof SignatureStruct>,\n ) {\n assert(this.#publicKey, 'No public key provided.');\n\n const valid = await verify({\n registry: database,\n signature,\n publicKey: this.#publicKey,\n });\n\n assert(valid, 'Invalid registry signature.');\n }\n\n /**\n * Fetch the given URL, throwing if the response is not OK.\n *\n * @param url - The URL to fetch.\n * @returns The response body.\n * @private\n */\n async #safeFetch(url: string) {\n const response = await this.#fetchFunction(url, { cache: 'no-cache' });\n if (!response.ok) {\n throw new Error(`Failed to fetch ${url}.`);\n }\n\n return await response.text();\n }\n}\n"]}
{"version":3,"file":"SnapRegistryController.cjs","sourceRoot":"","sources":["../../../src/snaps/registry/SnapRegistryController.ts"],"names":[],"mappings":";;;AAIA,+DAA2D;AAM3D,6DAAkD;AAClD,uDAAyD;AAGzD,2CAMyB;AASzB,uCAA6C;AAE7C,MAAM,iBAAiB,GACrB,wDAAwD,CAAC;AAE3D,MAAM,2BAA2B,GAC/B,yDAAyD,CAAC;AA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} from '@metamask/base-controller';\nimport { BaseController } from '@metamask/base-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type {\n SnapsRegistryDatabase,\n SignatureStruct,\n} from '@metamask/snaps-registry';\nimport { verify } from '@metamask/snaps-registry';\nimport { getTargetVersion } from '@metamask/snaps-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport type { Hex, SemVerRange, SemVerVersion } from '@metamask/utils';\nimport {\n assert,\n assertIsSemVerRange,\n Duration,\n inMilliseconds,\n satisfiesVersionRange,\n} from '@metamask/utils';\n\nimport type { SnapRegistryControllerMethodActions } from './SnapRegistryController-method-action-types';\nimport type {\n SnapRegistryInfo,\n SnapRegistryMetadata,\n SnapRegistryRequest,\n SnapRegistryResult,\n} from './types';\nimport { SnapRegistryStatus } from './types';\n\nconst SNAP_REGISTRY_URL =\n 'https://acl.execution.metamask.io/latest/registry.json';\n\nconst SNAP_REGISTRY_SIGNATURE_URL =\n 'https://acl.execution.metamask.io/latest/signature.json';\n\nconst DEFAULT_PUBLIC_KEY =\n '0x025b65308f0f0fb8bc7f7ff87bfc296e0330eee5d3c1d1ee4a048b2fd6a86fa0a6';\n\ntype JsonSnapsRegistryUrl = {\n registry: string;\n signature: string;\n};\n\nexport type ClientConfig = {\n type: 'extension' | 'mobile';\n version: SemVerVersion;\n};\n\nexport type SnapRegistryControllerArgs = {\n messenger: SnapRegistryControllerMessenger;\n state?: SnapRegistryControllerState;\n fetchFunction?: typeof fetch;\n url?: JsonSnapsRegistryUrl;\n recentFetchThreshold?: number;\n refetchOnAllowlistMiss?: boolean;\n publicKey?: Hex;\n clientConfig: ClientConfig;\n};\n\nexport type SnapRegistryControllerGetStateAction = ControllerGetStateAction<\n typeof controllerName,\n SnapRegistryControllerState\n>;\n\nexport type SnapRegistryControllerActions =\n | SnapRegistryControllerGetStateAction\n | SnapRegistryControllerMethodActions;\n\nexport type SnapRegistryControllerStateChangeEvent = ControllerStateChangeEvent<\n typeof controllerName,\n SnapRegistryControllerState\n>;\n\nexport type SnapRegistryControllerRegistryUpdatedEvent = {\n type: `${typeof controllerName}:registryUpdated`;\n payload: [databaseUpdated: boolean];\n};\n\nexport type SnapRegistryControllerEvents =\n | SnapRegistryControllerStateChangeEvent\n | SnapRegistryControllerRegistryUpdatedEvent;\n\nexport type SnapRegistryControllerMessenger = Messenger<\n typeof controllerName,\n SnapRegistryControllerActions,\n SnapRegistryControllerEvents\n>;\n\nexport type SnapRegistryControllerState = {\n database: SnapsRegistryDatabase | null;\n signature: string | null;\n lastUpdated: number | null;\n databaseUnavailable: boolean;\n};\n\nconst controllerName = 'SnapRegistryController';\n\nconst MESSENGER_EXPOSED_METHODS = [\n 'get',\n 'getMetadata',\n 'resolveVersion',\n 'requestUpdate',\n] as const;\n\nconst defaultState = {\n database: null,\n signature: null,\n lastUpdated: null,\n databaseUnavailable: false,\n};\n\nexport class SnapRegistryController extends BaseController<\n typeof controllerName,\n SnapRegistryControllerState,\n SnapRegistryControllerMessenger\n> {\n readonly #url: JsonSnapsRegistryUrl;\n\n readonly #publicKey: Hex;\n\n readonly #clientConfig: ClientConfig;\n\n readonly #fetchFunction: typeof fetch;\n\n readonly #recentFetchThreshold: number;\n\n readonly #refetchOnAllowlistMiss: boolean;\n\n #currentUpdate: Promise<void> | null;\n\n constructor({\n messenger,\n state,\n url = {\n registry: SNAP_REGISTRY_URL,\n signature: SNAP_REGISTRY_SIGNATURE_URL,\n },\n publicKey = DEFAULT_PUBLIC_KEY,\n clientConfig,\n fetchFunction = globalThis.fetch.bind(undefined),\n recentFetchThreshold = inMilliseconds(5, Duration.Minute),\n refetchOnAllowlistMiss = true,\n }: SnapRegistryControllerArgs) {\n super({\n messenger,\n metadata: {\n database: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: false,\n usedInUi: true,\n },\n signature: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: false,\n },\n lastUpdated: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: false,\n },\n databaseUnavailable: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: false,\n },\n },\n name: controllerName,\n state: {\n ...defaultState,\n ...state,\n },\n });\n this.#url = url;\n this.#publicKey = publicKey;\n this.#clientConfig = clientConfig;\n this.#fetchFunction = fetchFunction;\n this.#recentFetchThreshold = recentFetchThreshold;\n this.#refetchOnAllowlistMiss = refetchOnAllowlistMiss;\n this.#currentUpdate = null;\n\n this.messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n }\n\n #wasRecentlyFetched() {\n return (\n this.state.lastUpdated &&\n Date.now() - this.state.lastUpdated < this.#recentFetchThreshold\n );\n }\n\n /**\n * Triggers an update of the registry database.\n *\n * If an existing update is in progress this function will await that update.\n */\n async requestUpdate() {\n // If an update is ongoing, wait for that.\n if (this.#currentUpdate) {\n await this.#currentUpdate;\n return;\n }\n // If no update exists, create promise and store globally.\n if (this.#currentUpdate === null) {\n this.#currentUpdate = this.#update();\n }\n await this.#currentUpdate;\n this.#currentUpdate = null;\n }\n\n /**\n * Updates the registry database if the registry hasn't been updated recently.\n *\n * NOTE: SHOULD NOT be called directly, instead `triggerUpdate` should be used.\n */\n async #update() {\n // No-op if we recently fetched the registry.\n if (this.#wasRecentlyFetched()) {\n this.messenger.publish('SnapRegistryController:registryUpdated', false);\n return;\n }\n\n try {\n const [database, signature] = await Promise.all([\n this.#safeFetch(this.#url.registry),\n this.#safeFetch(this.#url.signature),\n ]);\n\n const signatureJson = JSON.parse(signature);\n\n // If the signature matches the existing state, we can skip verification and don't need to update the database.\n if (signatureJson.signature === this.state.signature) {\n this.update((state) => {\n state.lastUpdated = Date.now();\n state.databaseUnavailable = false;\n });\n this.messenger.publish('SnapRegistryController:registryUpdated', false);\n return;\n }\n\n await this.#verifySignature(database, signatureJson);\n\n this.update((state) => {\n state.database = JSON.parse(database);\n state.lastUpdated = Date.now();\n state.databaseUnavailable = false;\n state.signature = signatureJson.signature;\n });\n\n this.messenger.publish('SnapRegistryController:registryUpdated', true);\n } catch {\n // Ignore\n this.update((state) => {\n state.databaseUnavailable = true;\n });\n }\n }\n\n async #getDatabase(): Promise<SnapsRegistryDatabase | null> {\n if (this.state.database === null) {\n await this.requestUpdate();\n }\n\n return this.state.database;\n }\n\n async #getSingle(\n snapId: string,\n snapInfo: SnapRegistryInfo,\n refetch = false,\n ): Promise<SnapRegistryResult> {\n const database = await this.#getDatabase();\n\n const blockedEntry = database?.blockedSnaps.find((blocked) => {\n if ('id' in blocked) {\n return (\n blocked.id === snapId &&\n satisfiesVersionRange(snapInfo.version, blocked.versionRange)\n );\n }\n\n return blocked.checksum === snapInfo.checksum;\n });\n\n if (blockedEntry) {\n return {\n status: SnapRegistryStatus.Blocked,\n reason: blockedEntry.reason,\n };\n }\n\n const verified = database?.verifiedSnaps[snapId];\n const version = verified?.versions?.[snapInfo.version];\n const clientRange = version?.clientVersions?.[this.#clientConfig.type];\n const isCompatible =\n !clientRange ||\n satisfiesVersionRange(this.#clientConfig.version, clientRange);\n if (version && version.checksum === snapInfo.checksum && isCompatible) {\n return { status: SnapRegistryStatus.Verified };\n }\n // For now, if we have an allowlist miss, we can refetch once and try again.\n if (this.#refetchOnAllowlistMiss && !refetch) {\n await this.requestUpdate();\n return this.#getSingle(snapId, snapInfo, true);\n }\n return {\n status: this.state.databaseUnavailable\n ? SnapRegistryStatus.Unavailable\n : SnapRegistryStatus.Unverified,\n };\n }\n\n async get(\n snaps: SnapRegistryRequest,\n ): Promise<Record<string, SnapRegistryResult>> {\n return Object.entries(snaps).reduce<\n Promise<Record<string, SnapRegistryResult>>\n >(async (previousPromise, [snapId, snapInfo]) => {\n const result = await this.#getSingle(snapId, snapInfo);\n const acc = await previousPromise;\n acc[snapId] = result;\n return acc;\n }, Promise.resolve({}));\n }\n\n /**\n * Find an allowlisted version within a specified version range. Otherwise return the version range itself.\n *\n * @param snapId - The ID of the snap we are trying to resolve a version for.\n * @param versionRange - The version range.\n * @param refetch - An optional flag used to determine if we are refetching the registry.\n * @returns An allowlisted version within the specified version range if available otherwise returns the input version range.\n */\n async resolveVersion(\n snapId: string,\n versionRange: SemVerRange,\n refetch = false,\n ): Promise<SemVerRange> {\n const database = await this.#getDatabase();\n const versions = database?.verifiedSnaps[snapId]?.versions ?? null;\n\n if (!versions && this.#refetchOnAllowlistMiss && !refetch) {\n await this.requestUpdate();\n return this.resolveVersion(snapId, versionRange, true);\n }\n\n // If we cannot narrow down the version range we return the unaltered version range.\n if (!versions) {\n return versionRange;\n }\n\n const compatibleVersions = Object.entries(versions).reduce<SemVerVersion[]>(\n (accumulator, [version, metadata]) => {\n const clientRange = metadata.clientVersions?.[this.#clientConfig.type];\n if (\n !clientRange ||\n satisfiesVersionRange(this.#clientConfig.version, clientRange)\n ) {\n accumulator.push(version as SemVerVersion);\n }\n\n return accumulator;\n },\n [],\n );\n\n const targetVersion = getTargetVersion(compatibleVersions, versionRange);\n\n if (!targetVersion && this.#refetchOnAllowlistMiss && !refetch) {\n await this.requestUpdate();\n return this.resolveVersion(snapId, versionRange, true);\n }\n\n // If we cannot narrow down the version range we return the unaltered version range.\n if (!targetVersion) {\n return versionRange;\n }\n\n // A semver version is technically also a valid semver range.\n assertIsSemVerRange(targetVersion);\n return targetVersion;\n }\n\n /**\n * Get metadata for the given snap ID, if available, without updating registry.\n *\n * @param snapId - The ID of the snap to get metadata for.\n * @returns The metadata for the given snap ID, or `null` if the snap is not\n * verified.\n */\n getMetadata(snapId: string): SnapRegistryMetadata | null {\n return this.state?.database?.verifiedSnaps[snapId]?.metadata ?? null;\n }\n\n /**\n * Verify the signature of the registry.\n *\n * @param database - The registry database.\n * @param signature - The signature of the registry.\n * @throws If the signature is invalid.\n */\n async #verifySignature(\n database: string,\n signature: Infer<typeof SignatureStruct>,\n ) {\n assert(this.#publicKey, 'No public key provided.');\n\n const valid = await verify({\n registry: database,\n signature,\n publicKey: this.#publicKey,\n });\n\n assert(valid, 'Invalid registry signature.');\n }\n\n /**\n * Fetch the given URL, throwing if the response is not OK.\n *\n * @param url - The URL to fetch.\n * @returns The response body.\n * @private\n */\n async #safeFetch(url: string) {\n const response = await this.#fetchFunction(url, { cache: 'no-cache' });\n if (!response.ok) {\n throw new Error(`Failed to fetch ${url}.`);\n }\n\n return await response.text();\n }\n}\n"]}

@@ -29,3 +29,7 @@ import type { ControllerGetStateAction, ControllerStateChangeEvent } from "@metamask/base-controller";

export type SnapRegistryControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, SnapRegistryControllerState>;
export type SnapRegistryControllerEvents = SnapRegistryControllerStateChangeEvent;
export type SnapRegistryControllerRegistryUpdatedEvent = {
type: `${typeof controllerName}:registryUpdated`;
payload: [databaseUpdated: boolean];
};
export type SnapRegistryControllerEvents = SnapRegistryControllerStateChangeEvent | SnapRegistryControllerRegistryUpdatedEvent;
export type SnapRegistryControllerMessenger = Messenger<typeof controllerName, SnapRegistryControllerActions, SnapRegistryControllerEvents>;

@@ -32,0 +36,0 @@ export type SnapRegistryControllerState = {

@@ -1,1 +0,1 @@

{"version":3,"file":"SnapRegistryController.d.cts","sourceRoot":"","sources":["../../../src/snaps/registry/SnapRegistryController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC3B,kCAAkC;AACnC,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AACrD,OAAO,KAAK,EACV,qBAAqB,EAEtB,iCAAiC;AAIlC,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,aAAa,EAAE,wBAAwB;AASvE,OAAO,KAAK,EAAE,mCAAmC,EAAE,yDAAqD;AACxG,OAAO,KAAK,EAEV,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EACnB,oBAAgB;AAYjB,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC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AA8B,EAC9B,YAAY,EACZ,aAAgD,EAChD,oBAAyD,EACzD,sBAA6B,GAC9B,EAAE,0BAA0B;IAwD7B;;;;OAIG;IACG,aAAa;IAgHb,GAAG,CACP,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAW9C;;;;;;;OAOG;IACG,cAAc,CAClB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,WAAW,EACzB,OAAO,UAAQ,GACd,OAAO,CAAC,WAAW,CAAC;IA8CvB;;;;;;OAMG;IACH,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI;CAyCzD"}
{"version":3,"file":"SnapRegistryController.d.cts","sourceRoot":"","sources":["../../../src/snaps/registry/SnapRegistryController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC3B,kCAAkC;AACnC,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AACrD,OAAO,KAAK,EACV,qBAAqB,EAEtB,iCAAiC;AAIlC,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,aAAa,EAAE,wBAAwB;AASvE,OAAO,KAAK,EAAE,mCAAmC,EAAE,yDAAqD;AACxG,OAAO,KAAK,EAEV,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EACnB,oBAAgB;AAYjB,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,WAAW,GAAG,QAAQ,CAAC;IAC7B,OAAO,EAAE,aAAa,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,SAAS,EAAE,+BAA+B,CAAC;IAC3C,KAAK,CAAC,EAAE,2BAA2B,CAAC;IACp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AC9B,EAAE,0BAA0B;IAwD7B;;;;OAIG;IACG,aAAa;IAoHb,GAAG,CACP,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAW9C;;;;;;;OAOG;IACG,cAAc,CAClB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,WAAW,EACzB,OAAO,UAAQ,GACd,OAAO,CAAC,WAAW,CAAC;IA8CvB;;;;;;OAMG;IACH,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI;CAyCzD"}

@@ -29,3 +29,7 @@ import type { ControllerGetStateAction, ControllerStateChangeEvent } from "@metamask/base-controller";

export type SnapRegistryControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, SnapRegistryControllerState>;
export type SnapRegistryControllerEvents = SnapRegistryControllerStateChangeEvent;
export type SnapRegistryControllerRegistryUpdatedEvent = {
type: `${typeof controllerName}:registryUpdated`;
payload: [databaseUpdated: boolean];
};
export type SnapRegistryControllerEvents = SnapRegistryControllerStateChangeEvent | SnapRegistryControllerRegistryUpdatedEvent;
export type SnapRegistryControllerMessenger = Messenger<typeof controllerName, SnapRegistryControllerActions, SnapRegistryControllerEvents>;

@@ -32,0 +36,0 @@ export type SnapRegistryControllerState = {

@@ -1,1 +0,1 @@

{"version":3,"file":"SnapRegistryController.d.mts","sourceRoot":"","sources":["../../../src/snaps/registry/SnapRegistryController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC3B,kCAAkC;AACnC,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AACrD,OAAO,KAAK,EACV,qBAAqB,EAEtB,iCAAiC;AAIlC,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,aAAa,EAAE,wBAAwB;AASvE,OAAO,KAAK,EAAE,mCAAmC,EAAE,yDAAqD;AACxG,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,QAAA,MAAM,cAAc,2BAA2B,CAAC;AAgBhD,qBAAa,sBAAuB,SAAQ,cAAc,CACxD,OAAO,cAAc,EACrB,2BAA2B,EAC3B,+BAA+B,CAChC;;gBAea,EACV,SAAS,EACT,KAAK,EACL,GAGC,EACD,SAA8B,EAC9B,YAAY,EACZ,aAAgD,EAChD,oBAAyD,EACzD,sBAA6B,GAC9B,EAAE,0BAA0B;IAwD7B;;;;OAIG;IACG,aAAa;IAgHb,GAAG,CACP,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAW9C;;;;;;;OAOG;IACG,cAAc,CAClB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,WAAW,EACzB,OAAO,UAAQ,GACd,OAAO,CAAC,WAAW,CAAC;IA8CvB;;;;;;OAMG;IACH,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI;CAyCzD"}
{"version":3,"file":"SnapRegistryController.d.mts","sourceRoot":"","sources":["../../../src/snaps/registry/SnapRegistryController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC3B,kCAAkC;AACnC,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AACrD,OAAO,KAAK,EACV,qBAAqB,EAEtB,iCAAiC;AAIlC,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,aAAa,EAAE,wBAAwB;AASvE,OAAO,KAAK,EAAE,mCAAmC,EAAE,yDAAqD;AACxG,OAAO,KAAK,EAEV,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EACnB,oBAAgB;AAYjB,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,WAAW,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,cAAc,CACxD,OAAO,cAAc,EACrB,2BAA2B,EAC3B,+BAA+B,CAChC;;gBAea,EACV,SAAS,EACT,KAAK,EACL,GAGC,EACD,SAA8B,EAC9B,YAAY,EACZ,aAAgD,EAChD,oBAAyD,EACzD,sBAA6B,GAC9B,EAAE,0BAA0B;IAwD7B;;;;OAIG;IACG,aAAa;IAoHb,GAAG,CACP,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAW9C;;;;;;;OAOG;IACG,cAAc,CAClB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,WAAW,EACzB,OAAO,UAAQ,GACd,OAAO,CAAC,WAAW,CAAC;IA8CvB;;;;;;OAMG;IACH,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI;CAyCzD"}

@@ -107,2 +107,3 @@ import { BaseController } from "@metamask/base-controller";

if (this.#wasRecentlyFetched()) {
this.messenger.publish('SnapRegistryController:registryUpdated', false);
return;

@@ -122,2 +123,3 @@ }

});
this.messenger.publish('SnapRegistryController:registryUpdated', false);
return;

@@ -132,2 +134,3 @@ }

});
this.messenger.publish('SnapRegistryController:registryUpdated', true);
}

@@ -134,0 +137,0 @@ catch {

@@ -1,1 +0,1 @@

{"version":3,"file":"SnapRegistryController.mjs","sourceRoot":"","sources":["../../../src/snaps/registry/SnapRegistryController.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAM3D,OAAO,EAAE,MAAM,EAAE,iCAAiC;AAClD,OAAO,EAAE,gBAAgB,EAAE,8BAA8B;AAGzD,OAAO,EACL,MAAM,EACN,mBAAmB,EACnB,QAAQ,EACR,cAAc,EACd,qBAAqB,EACtB,wBAAwB;AASzB,OAAO,EAAE,kBAAkB,EAAE,oBAAgB;AAE7C,MAAM,iBAAiB,GACrB,wDAAwD,CAAC;AAE3D,MAAM,2BAA2B,GAC/B,yDAAyD,CAAC;AA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AAC,CAAC;QACnC,OAAO,aAAa,CAAC;IACvB,CAAC;IAED;;;;;;OAMG;IACH,WAAW,CAAC,MAAc;QACxB,OAAO,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,QAAQ,IAAI,IAAI,CAAC;IACvE,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,gBAAgB,CACpB,QAAgB,EAChB,SAAwC;QAExC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,yBAAyB,CAAC,CAAC;QAEnD,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC;YACzB,QAAQ,EAAE,QAAQ;YAClB,SAAS;YACT,SAAS,EAAE,IAAI,CAAC,UAAU;SAC3B,CAAC,CAAC;QAEH,MAAM,CAAC,KAAK,EAAE,6BAA6B,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,UAAU,CAAC,GAAW;QAC1B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;QACvE,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,mBAAmB,GAAG,GAAG,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC;CACF","sourcesContent":["import type {\n ControllerGetStateAction,\n ControllerStateChangeEvent,\n} from '@metamask/base-controller';\nimport { BaseController } from '@metamask/base-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type {\n SnapsRegistryDatabase,\n SignatureStruct,\n} from '@metamask/snaps-registry';\nimport { verify } from '@metamask/snaps-registry';\nimport { getTargetVersion } from '@metamask/snaps-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport type { Hex, SemVerRange, SemVerVersion } from '@metamask/utils';\nimport {\n assert,\n assertIsSemVerRange,\n Duration,\n inMilliseconds,\n satisfiesVersionRange,\n} from '@metamask/utils';\n\nimport type { SnapRegistryControllerMethodActions } from './SnapRegistryController-method-action-types';\nimport type {\n SnapRegistryInfo,\n SnapRegistryMetadata,\n SnapRegistryRequest,\n SnapRegistryResult,\n} from './types';\nimport { SnapRegistryStatus } from './types';\n\nconst SNAP_REGISTRY_URL =\n 'https://acl.execution.metamask.io/latest/registry.json';\n\nconst SNAP_REGISTRY_SIGNATURE_URL =\n 'https://acl.execution.metamask.io/latest/signature.json';\n\nconst DEFAULT_PUBLIC_KEY =\n '0x025b65308f0f0fb8bc7f7ff87bfc296e0330eee5d3c1d1ee4a048b2fd6a86fa0a6';\n\ntype JsonSnapsRegistryUrl = {\n registry: string;\n signature: string;\n};\n\nexport type ClientConfig = {\n type: 'extension' | 'mobile';\n version: SemVerVersion;\n};\n\nexport type SnapRegistryControllerArgs = {\n messenger: SnapRegistryControllerMessenger;\n state?: SnapRegistryControllerState;\n fetchFunction?: typeof fetch;\n url?: JsonSnapsRegistryUrl;\n recentFetchThreshold?: number;\n refetchOnAllowlistMiss?: boolean;\n publicKey?: Hex;\n clientConfig: ClientConfig;\n};\n\nexport type SnapRegistryControllerGetStateAction = ControllerGetStateAction<\n typeof controllerName,\n SnapRegistryControllerState\n>;\n\nexport type SnapRegistryControllerActions =\n | SnapRegistryControllerGetStateAction\n | SnapRegistryControllerMethodActions;\n\nexport type SnapRegistryControllerStateChangeEvent = ControllerStateChangeEvent<\n typeof controllerName,\n SnapRegistryControllerState\n>;\n\nexport type SnapRegistryControllerEvents =\n SnapRegistryControllerStateChangeEvent;\n\nexport type SnapRegistryControllerMessenger = Messenger<\n typeof controllerName,\n SnapRegistryControllerActions,\n SnapRegistryControllerEvents\n>;\n\nexport type SnapRegistryControllerState = {\n database: SnapsRegistryDatabase | null;\n signature: string | null;\n lastUpdated: number | null;\n databaseUnavailable: boolean;\n};\n\nconst controllerName = 'SnapRegistryController';\n\nconst MESSENGER_EXPOSED_METHODS = [\n 'get',\n 'getMetadata',\n 'resolveVersion',\n 'requestUpdate',\n] as const;\n\nconst defaultState = {\n database: null,\n signature: null,\n lastUpdated: null,\n databaseUnavailable: false,\n};\n\nexport class SnapRegistryController extends BaseController<\n typeof controllerName,\n SnapRegistryControllerState,\n SnapRegistryControllerMessenger\n> {\n readonly #url: JsonSnapsRegistryUrl;\n\n readonly #publicKey: Hex;\n\n readonly #clientConfig: ClientConfig;\n\n readonly #fetchFunction: typeof fetch;\n\n readonly #recentFetchThreshold: number;\n\n readonly #refetchOnAllowlistMiss: boolean;\n\n #currentUpdate: Promise<void> | null;\n\n constructor({\n messenger,\n state,\n url = {\n registry: SNAP_REGISTRY_URL,\n signature: SNAP_REGISTRY_SIGNATURE_URL,\n },\n publicKey = DEFAULT_PUBLIC_KEY,\n clientConfig,\n fetchFunction = globalThis.fetch.bind(undefined),\n recentFetchThreshold = inMilliseconds(5, Duration.Minute),\n refetchOnAllowlistMiss = true,\n }: SnapRegistryControllerArgs) {\n super({\n messenger,\n metadata: {\n database: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: false,\n usedInUi: true,\n },\n signature: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: false,\n },\n lastUpdated: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: false,\n },\n databaseUnavailable: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: false,\n },\n },\n name: controllerName,\n state: {\n ...defaultState,\n ...state,\n },\n });\n this.#url = url;\n this.#publicKey = publicKey;\n this.#clientConfig = clientConfig;\n this.#fetchFunction = fetchFunction;\n this.#recentFetchThreshold = recentFetchThreshold;\n this.#refetchOnAllowlistMiss = refetchOnAllowlistMiss;\n this.#currentUpdate = null;\n\n this.messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n }\n\n #wasRecentlyFetched() {\n return (\n this.state.lastUpdated &&\n Date.now() - this.state.lastUpdated < this.#recentFetchThreshold\n );\n }\n\n /**\n * Triggers an update of the registry database.\n *\n * If an existing update is in progress this function will await that update.\n */\n async requestUpdate() {\n // If an update is ongoing, wait for that.\n if (this.#currentUpdate) {\n await this.#currentUpdate;\n return;\n }\n // If no update exists, create promise and store globally.\n if (this.#currentUpdate === null) {\n this.#currentUpdate = this.#update();\n }\n await this.#currentUpdate;\n this.#currentUpdate = null;\n }\n\n /**\n * Updates the registry database if the registry hasn't been updated recently.\n *\n * NOTE: SHOULD NOT be called directly, instead `triggerUpdate` should be used.\n */\n async #update() {\n // No-op if we recently fetched the registry.\n if (this.#wasRecentlyFetched()) {\n return;\n }\n\n try {\n const [database, signature] = await Promise.all([\n this.#safeFetch(this.#url.registry),\n this.#safeFetch(this.#url.signature),\n ]);\n\n const signatureJson = JSON.parse(signature);\n\n // If the signature matches the existing state, we can skip verification and don't need to update the database.\n if (signatureJson.signature === this.state.signature) {\n this.update((state) => {\n state.lastUpdated = Date.now();\n state.databaseUnavailable = false;\n });\n return;\n }\n\n await this.#verifySignature(database, signatureJson);\n\n this.update((state) => {\n state.database = JSON.parse(database);\n state.lastUpdated = Date.now();\n state.databaseUnavailable = false;\n state.signature = signatureJson.signature;\n });\n } catch {\n // Ignore\n this.update((state) => {\n state.databaseUnavailable = true;\n });\n }\n }\n\n async #getDatabase(): Promise<SnapsRegistryDatabase | null> {\n if (this.state.database === null) {\n await this.requestUpdate();\n }\n\n return this.state.database;\n }\n\n async #getSingle(\n snapId: string,\n snapInfo: SnapRegistryInfo,\n refetch = false,\n ): Promise<SnapRegistryResult> {\n const database = await this.#getDatabase();\n\n const blockedEntry = database?.blockedSnaps.find((blocked) => {\n if ('id' in blocked) {\n return (\n blocked.id === snapId &&\n satisfiesVersionRange(snapInfo.version, blocked.versionRange)\n );\n }\n\n return blocked.checksum === snapInfo.checksum;\n });\n\n if (blockedEntry) {\n return {\n status: SnapRegistryStatus.Blocked,\n reason: blockedEntry.reason,\n };\n }\n\n const verified = database?.verifiedSnaps[snapId];\n const version = verified?.versions?.[snapInfo.version];\n const clientRange = version?.clientVersions?.[this.#clientConfig.type];\n const isCompatible =\n !clientRange ||\n satisfiesVersionRange(this.#clientConfig.version, clientRange);\n if (version && version.checksum === snapInfo.checksum && isCompatible) {\n return { status: SnapRegistryStatus.Verified };\n }\n // For now, if we have an allowlist miss, we can refetch once and try again.\n if (this.#refetchOnAllowlistMiss && !refetch) {\n await this.requestUpdate();\n return this.#getSingle(snapId, snapInfo, true);\n }\n return {\n status: this.state.databaseUnavailable\n ? SnapRegistryStatus.Unavailable\n : SnapRegistryStatus.Unverified,\n };\n }\n\n async get(\n snaps: SnapRegistryRequest,\n ): Promise<Record<string, SnapRegistryResult>> {\n return Object.entries(snaps).reduce<\n Promise<Record<string, SnapRegistryResult>>\n >(async (previousPromise, [snapId, snapInfo]) => {\n const result = await this.#getSingle(snapId, snapInfo);\n const acc = await previousPromise;\n acc[snapId] = result;\n return acc;\n }, Promise.resolve({}));\n }\n\n /**\n * Find an allowlisted version within a specified version range. Otherwise return the version range itself.\n *\n * @param snapId - The ID of the snap we are trying to resolve a version for.\n * @param versionRange - The version range.\n * @param refetch - An optional flag used to determine if we are refetching the registry.\n * @returns An allowlisted version within the specified version range if available otherwise returns the input version range.\n */\n async resolveVersion(\n snapId: string,\n versionRange: SemVerRange,\n refetch = false,\n ): Promise<SemVerRange> {\n const database = await this.#getDatabase();\n const versions = database?.verifiedSnaps[snapId]?.versions ?? null;\n\n if (!versions && this.#refetchOnAllowlistMiss && !refetch) {\n await this.requestUpdate();\n return this.resolveVersion(snapId, versionRange, true);\n }\n\n // If we cannot narrow down the version range we return the unaltered version range.\n if (!versions) {\n return versionRange;\n }\n\n const compatibleVersions = Object.entries(versions).reduce<SemVerVersion[]>(\n (accumulator, [version, metadata]) => {\n const clientRange = metadata.clientVersions?.[this.#clientConfig.type];\n if (\n !clientRange ||\n satisfiesVersionRange(this.#clientConfig.version, clientRange)\n ) {\n accumulator.push(version as SemVerVersion);\n }\n\n return accumulator;\n },\n [],\n );\n\n const targetVersion = getTargetVersion(compatibleVersions, versionRange);\n\n if (!targetVersion && this.#refetchOnAllowlistMiss && !refetch) {\n await this.requestUpdate();\n return this.resolveVersion(snapId, versionRange, true);\n }\n\n // If we cannot narrow down the version range we return the unaltered version range.\n if (!targetVersion) {\n return versionRange;\n }\n\n // A semver version is technically also a valid semver range.\n assertIsSemVerRange(targetVersion);\n return targetVersion;\n }\n\n /**\n * Get metadata for the given snap ID, if available, without updating registry.\n *\n * @param snapId - The ID of the snap to get metadata for.\n * @returns The metadata for the given snap ID, or `null` if the snap is not\n * verified.\n */\n getMetadata(snapId: string): SnapRegistryMetadata | null {\n return this.state?.database?.verifiedSnaps[snapId]?.metadata ?? null;\n }\n\n /**\n * Verify the signature of the registry.\n *\n * @param database - The registry database.\n * @param signature - The signature of the registry.\n * @throws If the signature is invalid.\n */\n async #verifySignature(\n database: string,\n signature: Infer<typeof SignatureStruct>,\n ) {\n assert(this.#publicKey, 'No public key provided.');\n\n const valid = await verify({\n registry: database,\n signature,\n publicKey: this.#publicKey,\n });\n\n assert(valid, 'Invalid registry signature.');\n }\n\n /**\n * Fetch the given URL, throwing if the response is not OK.\n *\n * @param url - The URL to fetch.\n * @returns The response body.\n * @private\n */\n async #safeFetch(url: string) {\n const response = await this.#fetchFunction(url, { cache: 'no-cache' });\n if (!response.ok) {\n throw new Error(`Failed to fetch ${url}.`);\n }\n\n return await response.text();\n }\n}\n"]}
{"version":3,"file":"SnapRegistryController.mjs","sourceRoot":"","sources":["../../../src/snaps/registry/SnapRegistryController.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAM3D,OAAO,EAAE,MAAM,EAAE,iCAAiC;AAClD,OAAO,EAAE,gBAAgB,EAAE,8BAA8B;AAGzD,OAAO,EACL,MAAM,EACN,mBAAmB,EACnB,QAAQ,EACR,cAAc,EACd,qBAAqB,EACtB,wBAAwB;AASzB,OAAO,EAAE,kBAAkB,EAA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erGetStateAction,\n ControllerStateChangeEvent,\n} from '@metamask/base-controller';\nimport { BaseController } from '@metamask/base-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type {\n SnapsRegistryDatabase,\n SignatureStruct,\n} from '@metamask/snaps-registry';\nimport { verify } from '@metamask/snaps-registry';\nimport { getTargetVersion } from '@metamask/snaps-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport type { Hex, SemVerRange, SemVerVersion } from '@metamask/utils';\nimport {\n assert,\n assertIsSemVerRange,\n Duration,\n inMilliseconds,\n satisfiesVersionRange,\n} from '@metamask/utils';\n\nimport type { SnapRegistryControllerMethodActions } from './SnapRegistryController-method-action-types';\nimport type {\n SnapRegistryInfo,\n SnapRegistryMetadata,\n SnapRegistryRequest,\n SnapRegistryResult,\n} from './types';\nimport { SnapRegistryStatus } from './types';\n\nconst SNAP_REGISTRY_URL =\n 'https://acl.execution.metamask.io/latest/registry.json';\n\nconst SNAP_REGISTRY_SIGNATURE_URL =\n 'https://acl.execution.metamask.io/latest/signature.json';\n\nconst DEFAULT_PUBLIC_KEY =\n '0x025b65308f0f0fb8bc7f7ff87bfc296e0330eee5d3c1d1ee4a048b2fd6a86fa0a6';\n\ntype JsonSnapsRegistryUrl = {\n registry: string;\n signature: string;\n};\n\nexport type ClientConfig = {\n type: 'extension' | 'mobile';\n version: SemVerVersion;\n};\n\nexport type SnapRegistryControllerArgs = {\n messenger: SnapRegistryControllerMessenger;\n state?: SnapRegistryControllerState;\n fetchFunction?: typeof fetch;\n url?: JsonSnapsRegistryUrl;\n recentFetchThreshold?: number;\n refetchOnAllowlistMiss?: boolean;\n publicKey?: Hex;\n clientConfig: ClientConfig;\n};\n\nexport type SnapRegistryControllerGetStateAction = ControllerGetStateAction<\n typeof controllerName,\n SnapRegistryControllerState\n>;\n\nexport type SnapRegistryControllerActions =\n | SnapRegistryControllerGetStateAction\n | SnapRegistryControllerMethodActions;\n\nexport type SnapRegistryControllerStateChangeEvent = ControllerStateChangeEvent<\n typeof controllerName,\n SnapRegistryControllerState\n>;\n\nexport type SnapRegistryControllerRegistryUpdatedEvent = {\n type: `${typeof controllerName}:registryUpdated`;\n payload: [databaseUpdated: boolean];\n};\n\nexport type SnapRegistryControllerEvents =\n | SnapRegistryControllerStateChangeEvent\n | SnapRegistryControllerRegistryUpdatedEvent;\n\nexport type SnapRegistryControllerMessenger = Messenger<\n typeof controllerName,\n SnapRegistryControllerActions,\n SnapRegistryControllerEvents\n>;\n\nexport type SnapRegistryControllerState = {\n database: SnapsRegistryDatabase | null;\n signature: string | null;\n lastUpdated: number | null;\n databaseUnavailable: boolean;\n};\n\nconst controllerName = 'SnapRegistryController';\n\nconst MESSENGER_EXPOSED_METHODS = [\n 'get',\n 'getMetadata',\n 'resolveVersion',\n 'requestUpdate',\n] as const;\n\nconst defaultState = {\n database: null,\n signature: null,\n lastUpdated: null,\n databaseUnavailable: false,\n};\n\nexport class SnapRegistryController extends BaseController<\n typeof controllerName,\n SnapRegistryControllerState,\n SnapRegistryControllerMessenger\n> {\n readonly #url: JsonSnapsRegistryUrl;\n\n readonly #publicKey: Hex;\n\n readonly #clientConfig: ClientConfig;\n\n readonly #fetchFunction: typeof fetch;\n\n readonly #recentFetchThreshold: number;\n\n readonly #refetchOnAllowlistMiss: boolean;\n\n #currentUpdate: Promise<void> | null;\n\n constructor({\n messenger,\n state,\n url = {\n registry: SNAP_REGISTRY_URL,\n signature: SNAP_REGISTRY_SIGNATURE_URL,\n },\n publicKey = DEFAULT_PUBLIC_KEY,\n clientConfig,\n fetchFunction = globalThis.fetch.bind(undefined),\n recentFetchThreshold = inMilliseconds(5, Duration.Minute),\n refetchOnAllowlistMiss = true,\n }: SnapRegistryControllerArgs) {\n super({\n messenger,\n metadata: {\n database: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: false,\n usedInUi: true,\n },\n signature: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: false,\n },\n lastUpdated: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: false,\n },\n databaseUnavailable: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: false,\n },\n },\n name: controllerName,\n state: {\n ...defaultState,\n ...state,\n },\n });\n this.#url = url;\n this.#publicKey = publicKey;\n this.#clientConfig = clientConfig;\n this.#fetchFunction = fetchFunction;\n this.#recentFetchThreshold = recentFetchThreshold;\n this.#refetchOnAllowlistMiss = refetchOnAllowlistMiss;\n this.#currentUpdate = null;\n\n this.messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n }\n\n #wasRecentlyFetched() {\n return (\n this.state.lastUpdated &&\n Date.now() - this.state.lastUpdated < this.#recentFetchThreshold\n );\n }\n\n /**\n * Triggers an update of the registry database.\n *\n * If an existing update is in progress this function will await that update.\n */\n async requestUpdate() {\n // If an update is ongoing, wait for that.\n if (this.#currentUpdate) {\n await this.#currentUpdate;\n return;\n }\n // If no update exists, create promise and store globally.\n if (this.#currentUpdate === null) {\n this.#currentUpdate = this.#update();\n }\n await this.#currentUpdate;\n this.#currentUpdate = null;\n }\n\n /**\n * Updates the registry database if the registry hasn't been updated recently.\n *\n * NOTE: SHOULD NOT be called directly, instead `triggerUpdate` should be used.\n */\n async #update() {\n // No-op if we recently fetched the registry.\n if (this.#wasRecentlyFetched()) {\n this.messenger.publish('SnapRegistryController:registryUpdated', false);\n return;\n }\n\n try {\n const [database, signature] = await Promise.all([\n this.#safeFetch(this.#url.registry),\n this.#safeFetch(this.#url.signature),\n ]);\n\n const signatureJson = JSON.parse(signature);\n\n // If the signature matches the existing state, we can skip verification and don't need to update the database.\n if (signatureJson.signature === this.state.signature) {\n this.update((state) => {\n state.lastUpdated = Date.now();\n state.databaseUnavailable = false;\n });\n this.messenger.publish('SnapRegistryController:registryUpdated', false);\n return;\n }\n\n await this.#verifySignature(database, signatureJson);\n\n this.update((state) => {\n state.database = JSON.parse(database);\n state.lastUpdated = Date.now();\n state.databaseUnavailable = false;\n state.signature = signatureJson.signature;\n });\n\n this.messenger.publish('SnapRegistryController:registryUpdated', true);\n } catch {\n // Ignore\n this.update((state) => {\n state.databaseUnavailable = true;\n });\n }\n }\n\n async #getDatabase(): Promise<SnapsRegistryDatabase | null> {\n if (this.state.database === null) {\n await this.requestUpdate();\n }\n\n return this.state.database;\n }\n\n async #getSingle(\n snapId: string,\n snapInfo: SnapRegistryInfo,\n refetch = false,\n ): Promise<SnapRegistryResult> {\n const database = await this.#getDatabase();\n\n const blockedEntry = database?.blockedSnaps.find((blocked) => {\n if ('id' in blocked) {\n return (\n blocked.id === snapId &&\n satisfiesVersionRange(snapInfo.version, blocked.versionRange)\n );\n }\n\n return blocked.checksum === snapInfo.checksum;\n });\n\n if (blockedEntry) {\n return {\n status: SnapRegistryStatus.Blocked,\n reason: blockedEntry.reason,\n };\n }\n\n const verified = database?.verifiedSnaps[snapId];\n const version = verified?.versions?.[snapInfo.version];\n const clientRange = version?.clientVersions?.[this.#clientConfig.type];\n const isCompatible =\n !clientRange ||\n satisfiesVersionRange(this.#clientConfig.version, clientRange);\n if (version && version.checksum === snapInfo.checksum && isCompatible) {\n return { status: SnapRegistryStatus.Verified };\n }\n // For now, if we have an allowlist miss, we can refetch once and try again.\n if (this.#refetchOnAllowlistMiss && !refetch) {\n await this.requestUpdate();\n return this.#getSingle(snapId, snapInfo, true);\n }\n return {\n status: this.state.databaseUnavailable\n ? SnapRegistryStatus.Unavailable\n : SnapRegistryStatus.Unverified,\n };\n }\n\n async get(\n snaps: SnapRegistryRequest,\n ): Promise<Record<string, SnapRegistryResult>> {\n return Object.entries(snaps).reduce<\n Promise<Record<string, SnapRegistryResult>>\n >(async (previousPromise, [snapId, snapInfo]) => {\n const result = await this.#getSingle(snapId, snapInfo);\n const acc = await previousPromise;\n acc[snapId] = result;\n return acc;\n }, Promise.resolve({}));\n }\n\n /**\n * Find an allowlisted version within a specified version range. Otherwise return the version range itself.\n *\n * @param snapId - The ID of the snap we are trying to resolve a version for.\n * @param versionRange - The version range.\n * @param refetch - An optional flag used to determine if we are refetching the registry.\n * @returns An allowlisted version within the specified version range if available otherwise returns the input version range.\n */\n async resolveVersion(\n snapId: string,\n versionRange: SemVerRange,\n refetch = false,\n ): Promise<SemVerRange> {\n const database = await this.#getDatabase();\n const versions = database?.verifiedSnaps[snapId]?.versions ?? null;\n\n if (!versions && this.#refetchOnAllowlistMiss && !refetch) {\n await this.requestUpdate();\n return this.resolveVersion(snapId, versionRange, true);\n }\n\n // If we cannot narrow down the version range we return the unaltered version range.\n if (!versions) {\n return versionRange;\n }\n\n const compatibleVersions = Object.entries(versions).reduce<SemVerVersion[]>(\n (accumulator, [version, metadata]) => {\n const clientRange = metadata.clientVersions?.[this.#clientConfig.type];\n if (\n !clientRange ||\n satisfiesVersionRange(this.#clientConfig.version, clientRange)\n ) {\n accumulator.push(version as SemVerVersion);\n }\n\n return accumulator;\n },\n [],\n );\n\n const targetVersion = getTargetVersion(compatibleVersions, versionRange);\n\n if (!targetVersion && this.#refetchOnAllowlistMiss && !refetch) {\n await this.requestUpdate();\n return this.resolveVersion(snapId, versionRange, true);\n }\n\n // If we cannot narrow down the version range we return the unaltered version range.\n if (!targetVersion) {\n return versionRange;\n }\n\n // A semver version is technically also a valid semver range.\n assertIsSemVerRange(targetVersion);\n return targetVersion;\n }\n\n /**\n * Get metadata for the given snap ID, if available, without updating registry.\n *\n * @param snapId - The ID of the snap to get metadata for.\n * @returns The metadata for the given snap ID, or `null` if the snap is not\n * verified.\n */\n getMetadata(snapId: string): SnapRegistryMetadata | null {\n return this.state?.database?.verifiedSnaps[snapId]?.metadata ?? null;\n }\n\n /**\n * Verify the signature of the registry.\n *\n * @param database - The registry database.\n * @param signature - The signature of the registry.\n * @throws If the signature is invalid.\n */\n async #verifySignature(\n database: string,\n signature: Infer<typeof SignatureStruct>,\n ) {\n assert(this.#publicKey, 'No public key provided.');\n\n const valid = await verify({\n registry: database,\n signature,\n publicKey: this.#publicKey,\n });\n\n assert(valid, 'Invalid registry signature.');\n }\n\n /**\n * Fetch the given URL, throwing if the response is not OK.\n *\n * @param url - The URL to fetch.\n * @returns The response body.\n * @private\n */\n async #safeFetch(url: string) {\n const response = await this.#fetchFunction(url, { cache: 'no-cache' });\n if (!response.ok) {\n throw new Error(`Failed to fetch ${url}.`);\n }\n\n return await response.text();\n }\n}\n"]}

@@ -1,1 +0,1 @@

{"version":3,"file":"SnapController-method-action-types.cjs","sourceRoot":"","sources":["../../src/snaps/SnapController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { SnapController } from './SnapController';\n\n/**\n * Initialise the SnapController.\n *\n * Currently this method sets up the controller and calls the `onStart` lifecycle hook for all\n * runnable Snaps.\n *\n * @param waitForPlatform - Whether to wait for the platform to be ready before returning.\n */\nexport type SnapControllerInitAction = {\n type: `SnapController:init`;\n handler: SnapController['init'];\n};\n\n/**\n * Trigger an update of the registry.\n *\n * As a side-effect of this, preinstalled Snaps may be updated and Snaps may be blocked/unblocked.\n */\nexport type SnapControllerUpdateRegistryAction = {\n type: `SnapController:updateRegistry`;\n handler: SnapController['updateRegistry'];\n};\n\n/**\n * Enables the given snap. A snap can only be started if it is enabled. A snap\n * can only be enabled if it isn't blocked.\n *\n * @param snapId - The id of the Snap to enable.\n */\nexport type SnapControllerEnableSnapAction = {\n type: `SnapController:enableSnap`;\n handler: SnapController['enableSnap'];\n};\n\n/**\n * Disables the given snap. A snap can only be started if it is enabled.\n *\n * @param snapId - The id of the Snap to disable.\n * @returns A promise that resolves once the snap has been disabled.\n */\nexport type SnapControllerDisableSnapAction = {\n type: `SnapController:disableSnap`;\n handler: SnapController['disableSnap'];\n};\n\n/**\n * Stops the given snap, removes all hooks, closes all connections, and\n * terminates its worker.\n *\n * @param snapId - The id of the Snap to stop.\n * @param statusEvent - The Snap status event that caused the snap to be\n * stopped.\n */\nexport type SnapControllerStopSnapAction = {\n type: `SnapController:stopSnap`;\n handler: SnapController['stopSnap'];\n};\n\n/**\n * Stops all running snaps, removes all hooks, closes all connections, and\n * terminates their workers.\n *\n * @param statusEvent - The Snap status event that caused the snap to be\n * stopped.\n */\nexport type SnapControllerStopAllSnapsAction = {\n type: `SnapController:stopAllSnaps`;\n handler: SnapController['stopAllSnaps'];\n};\n\n/**\n * Returns whether the given snap is running.\n * Throws an error if the snap doesn't exist.\n *\n * @param snapId - The id of the Snap to check.\n * @returns `true` if the snap is running, otherwise `false`.\n */\nexport type SnapControllerIsSnapRunningAction = {\n type: `SnapController:isSnapRunning`;\n handler: SnapController['isSnapRunning'];\n};\n\n/**\n * Returns whether the given snap has been added to state.\n *\n * @param snapId - The id of the Snap to check for.\n * @returns `true` if the snap exists in the controller state, otherwise `false`.\n */\nexport type SnapControllerHasSnapAction = {\n type: `SnapController:hasSnap`;\n handler: SnapController['hasSnap'];\n};\n\n/**\n * Gets the snap with the given id if it exists, including all data.\n * This should not be used if the snap is to be serializable, as e.g.\n * the snap sourceCode may be quite large.\n *\n * @param snapId - The id of the Snap to get.\n * @returns The entire snap object from the controller state.\n */\nexport type SnapControllerGetSnapAction = {\n type: `SnapController:getSnap`;\n handler: SnapController['getSnap'];\n};\n\n/**\n * Updates the own state of the snap with the given id.\n * This is distinct from the state MetaMask uses to manage snaps.\n *\n * @param snapId - The id of the Snap whose state should be updated.\n * @param newSnapState - The new state of the snap.\n * @param encrypted - A flag to indicate whether to use encrypted storage or not.\n */\nexport type SnapControllerUpdateSnapStateAction = {\n type: `SnapController:updateSnapState`;\n handler: SnapController['updateSnapState'];\n};\n\n/**\n * Clears the state of the snap with the given id.\n * This is distinct from the state MetaMask uses to manage snaps.\n *\n * @param snapId - The id of the Snap whose state should be cleared.\n * @param encrypted - A flag to indicate whether to use encrypted storage or not.\n */\nexport type SnapControllerClearSnapStateAction = {\n type: `SnapController:clearSnapState`;\n handler: SnapController['clearSnapState'];\n};\n\n/**\n * Gets the own state of the snap with the given id.\n * This is distinct from the state MetaMask uses to manage snaps.\n *\n * @param snapId - The id of the Snap whose state to get.\n * @param encrypted - A flag to indicate whether to use encrypted storage or not.\n * @returns The requested snap state or null if no state exists.\n */\nexport type SnapControllerGetSnapStateAction = {\n type: `SnapController:getSnapState`;\n handler: SnapController['getSnapState'];\n};\n\n/**\n * Gets a static auxiliary snap file in a chosen file encoding.\n *\n * @param snapId - The id of the Snap whose state to get.\n * @param path - The path to the requested file.\n * @param encoding - An optional requested file encoding.\n * @returns The file requested in the chosen file encoding or null if the file is not found.\n */\nexport type SnapControllerGetSnapFileAction = {\n type: `SnapController:getSnapFile`;\n handler: SnapController['getSnapFile'];\n};\n\n/**\n * Determine if a given Snap ID supports a given minimum version of the Snaps platform\n * by inspecting the platformVersion in the Snap manifest.\n *\n * @param snapId - The Snap ID.\n * @param version - The version.\n * @returns True if the platform version is equal or greater to the passed version, false otherwise.\n */\nexport type SnapControllerIsMinimumPlatformVersionAction = {\n type: `SnapController:isMinimumPlatformVersion`;\n handler: SnapController['isMinimumPlatformVersion'];\n};\n\n/**\n * Completely clear the controller's state: delete all associated data,\n * handlers, event listeners, and permissions; tear down all snap providers.\n * Also re-initializes the controller after clearing the state.\n */\nexport type SnapControllerClearStateAction = {\n type: `SnapController:clearState`;\n handler: SnapController['clearState'];\n};\n\n/**\n * Removes the given snap from state, and clears all associated handlers\n * and listeners.\n *\n * @param snapId - The id of the Snap.\n * @returns A promise that resolves once the snap has been removed.\n */\nexport type SnapControllerRemoveSnapAction = {\n type: `SnapController:removeSnap`;\n handler: SnapController['removeSnap'];\n};\n\n/**\n * Stops the given snaps, removes them from state, and clears all associated\n * permissions, handlers, and listeners.\n *\n * @param snapIds - The ids of the Snaps.\n */\nexport type SnapControllerRemoveSnapsAction = {\n type: `SnapController:removeSnaps`;\n handler: SnapController['removeSnaps'];\n};\n\n/**\n * Disconnect the Snap from the given origin, meaning the origin can no longer\n * interact with the Snap until it is reconnected.\n *\n * @param origin - The origin from which to remove the Snap.\n * @param snapId - The id of the snap to remove.\n */\nexport type SnapControllerDisconnectOriginAction = {\n type: `SnapController:disconnectOrigin`;\n handler: SnapController['disconnectOrigin'];\n};\n\n/**\n * Checks if a list of permissions are dynamic and allowed to be revoked, if they are they will all be revoked.\n *\n * @param snapId - The snap ID.\n * @param permissionNames - The names of the permissions.\n * @throws If non-dynamic permissions are passed.\n */\nexport type SnapControllerRevokeDynamicSnapPermissionsAction = {\n type: `SnapController:revokeDynamicSnapPermissions`;\n handler: SnapController['revokeDynamicSnapPermissions'];\n};\n\n/**\n * Gets all snaps in their truncated format.\n *\n * @returns All installed snaps in their truncated format.\n */\nexport type SnapControllerGetAllSnapsAction = {\n type: `SnapController:getAllSnaps`;\n handler: SnapController['getAllSnaps'];\n};\n\n/**\n * Gets all runnable snaps.\n *\n * @returns All runnable snaps.\n */\nexport type SnapControllerGetRunnableSnapsAction = {\n type: `SnapController:getRunnableSnaps`;\n handler: SnapController['getRunnableSnaps'];\n};\n\n/**\n * Gets the serialized permitted snaps of the given origin, if any.\n *\n * @param origin - The origin whose permitted snaps to retrieve.\n * @returns The serialized permitted snaps for the origin.\n */\nexport type SnapControllerGetPermittedSnapsAction = {\n type: `SnapController:getPermittedSnaps`;\n handler: SnapController['getPermittedSnaps'];\n};\n\n/**\n * Installs the snaps requested by the given origin, returning the snap\n * object if the origin is permitted to install it, and an authorization error\n * otherwise.\n *\n * @param origin - The origin that requested to install the snaps.\n * @param requestedSnaps - The snaps to install.\n * @returns An object of snap ids and snap objects, or errors if a\n * snap couldn't be installed.\n */\nexport type SnapControllerInstallSnapsAction = {\n type: `SnapController:installSnaps`;\n handler: SnapController['installSnaps'];\n};\n\n/**\n * Passes a JSON-RPC request object to the RPC handler function of a snap.\n *\n * @param options - A bag of options.\n * @param options.snapId - The ID of the recipient snap.\n * @param options.origin - The origin of the RPC request.\n * @param options.handler - The handler to trigger on the snap for the request.\n * @param options.request - The JSON-RPC request object.\n * @returns The result of the JSON-RPC request.\n */\nexport type SnapControllerHandleRequestAction = {\n type: `SnapController:handleRequest`;\n handler: SnapController['handleRequest'];\n};\n\n/**\n * Set the active state of the client. This will trigger the `onActive` or\n * `onInactive` lifecycle hooks for all Snaps.\n *\n * @param active - A boolean indicating whether the client is active or not.\n */\nexport type SnapControllerSetClientActiveAction = {\n type: `SnapController:setClientActive`;\n handler: SnapController['setClientActive'];\n};\n\n/**\n * Union of all SnapController action types.\n */\nexport type SnapControllerMethodActions =\n | SnapControllerInitAction\n | SnapControllerUpdateRegistryAction\n | SnapControllerEnableSnapAction\n | SnapControllerDisableSnapAction\n | SnapControllerStopSnapAction\n | SnapControllerStopAllSnapsAction\n | SnapControllerIsSnapRunningAction\n | SnapControllerHasSnapAction\n | SnapControllerGetSnapAction\n | SnapControllerUpdateSnapStateAction\n | SnapControllerClearSnapStateAction\n | SnapControllerGetSnapStateAction\n | SnapControllerGetSnapFileAction\n | SnapControllerIsMinimumPlatformVersionAction\n | SnapControllerClearStateAction\n | SnapControllerRemoveSnapAction\n | SnapControllerRemoveSnapsAction\n | SnapControllerDisconnectOriginAction\n | SnapControllerRevokeDynamicSnapPermissionsAction\n | SnapControllerGetAllSnapsAction\n | SnapControllerGetRunnableSnapsAction\n | SnapControllerGetPermittedSnapsAction\n | SnapControllerInstallSnapsAction\n | SnapControllerHandleRequestAction\n | SnapControllerSetClientActiveAction;\n"]}
{"version":3,"file":"SnapController-method-action-types.cjs","sourceRoot":"","sources":["../../src/snaps/SnapController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { SnapController } from './SnapController';\n\n/**\n * Initialise the SnapController.\n *\n * Currently this method sets up the controller and calls the `onStart` lifecycle hook for all\n * runnable Snaps.\n *\n * @param waitForPlatform - Whether to wait for the platform to be ready before returning.\n */\nexport type SnapControllerInitAction = {\n type: `SnapController:init`;\n handler: SnapController['init'];\n};\n\n/**\n * Trigger an update of the registry.\n *\n * As a side-effect, this will _always_ check if preinstalled Snaps can be updated and whether any Snaps need to be blocked/unblocked.\n */\nexport type SnapControllerUpdateRegistryAction = {\n type: `SnapController:updateRegistry`;\n handler: SnapController['updateRegistry'];\n};\n\n/**\n * Enables the given snap. A snap can only be started if it is enabled. A snap\n * can only be enabled if it isn't blocked.\n *\n * @param snapId - The id of the Snap to enable.\n */\nexport type SnapControllerEnableSnapAction = {\n type: `SnapController:enableSnap`;\n handler: SnapController['enableSnap'];\n};\n\n/**\n * Disables the given snap. A snap can only be started if it is enabled.\n *\n * @param snapId - The id of the Snap to disable.\n * @returns A promise that resolves once the snap has been disabled.\n */\nexport type SnapControllerDisableSnapAction = {\n type: `SnapController:disableSnap`;\n handler: SnapController['disableSnap'];\n};\n\n/**\n * Stops the given snap, removes all hooks, closes all connections, and\n * terminates its worker.\n *\n * @param snapId - The id of the Snap to stop.\n * @param statusEvent - The Snap status event that caused the snap to be\n * stopped.\n */\nexport type SnapControllerStopSnapAction = {\n type: `SnapController:stopSnap`;\n handler: SnapController['stopSnap'];\n};\n\n/**\n * Stops all running snaps, removes all hooks, closes all connections, and\n * terminates their workers.\n *\n * @param statusEvent - The Snap status event that caused the snap to be\n * stopped.\n */\nexport type SnapControllerStopAllSnapsAction = {\n type: `SnapController:stopAllSnaps`;\n handler: SnapController['stopAllSnaps'];\n};\n\n/**\n * Returns whether the given snap is running.\n * Throws an error if the snap doesn't exist.\n *\n * @param snapId - The id of the Snap to check.\n * @returns `true` if the snap is running, otherwise `false`.\n */\nexport type SnapControllerIsSnapRunningAction = {\n type: `SnapController:isSnapRunning`;\n handler: SnapController['isSnapRunning'];\n};\n\n/**\n * Returns whether the given snap has been added to state.\n *\n * @param snapId - The id of the Snap to check for.\n * @returns `true` if the snap exists in the controller state, otherwise `false`.\n */\nexport type SnapControllerHasSnapAction = {\n type: `SnapController:hasSnap`;\n handler: SnapController['hasSnap'];\n};\n\n/**\n * Gets the snap with the given id if it exists, including all data.\n * This should not be used if the snap is to be serializable, as e.g.\n * the snap sourceCode may be quite large.\n *\n * @param snapId - The id of the Snap to get.\n * @returns The entire snap object from the controller state.\n */\nexport type SnapControllerGetSnapAction = {\n type: `SnapController:getSnap`;\n handler: SnapController['getSnap'];\n};\n\n/**\n * Updates the own state of the snap with the given id.\n * This is distinct from the state MetaMask uses to manage snaps.\n *\n * @param snapId - The id of the Snap whose state should be updated.\n * @param newSnapState - The new state of the snap.\n * @param encrypted - A flag to indicate whether to use encrypted storage or not.\n */\nexport type SnapControllerUpdateSnapStateAction = {\n type: `SnapController:updateSnapState`;\n handler: SnapController['updateSnapState'];\n};\n\n/**\n * Clears the state of the snap with the given id.\n * This is distinct from the state MetaMask uses to manage snaps.\n *\n * @param snapId - The id of the Snap whose state should be cleared.\n * @param encrypted - A flag to indicate whether to use encrypted storage or not.\n */\nexport type SnapControllerClearSnapStateAction = {\n type: `SnapController:clearSnapState`;\n handler: SnapController['clearSnapState'];\n};\n\n/**\n * Gets the own state of the snap with the given id.\n * This is distinct from the state MetaMask uses to manage snaps.\n *\n * @param snapId - The id of the Snap whose state to get.\n * @param encrypted - A flag to indicate whether to use encrypted storage or not.\n * @returns The requested snap state or null if no state exists.\n */\nexport type SnapControllerGetSnapStateAction = {\n type: `SnapController:getSnapState`;\n handler: SnapController['getSnapState'];\n};\n\n/**\n * Gets a static auxiliary snap file in a chosen file encoding.\n *\n * @param snapId - The id of the Snap whose state to get.\n * @param path - The path to the requested file.\n * @param encoding - An optional requested file encoding.\n * @returns The file requested in the chosen file encoding or null if the file is not found.\n */\nexport type SnapControllerGetSnapFileAction = {\n type: `SnapController:getSnapFile`;\n handler: SnapController['getSnapFile'];\n};\n\n/**\n * Determine if a given Snap ID supports a given minimum version of the Snaps platform\n * by inspecting the platformVersion in the Snap manifest.\n *\n * @param snapId - The Snap ID.\n * @param version - The version.\n * @returns True if the platform version is equal or greater to the passed version, false otherwise.\n */\nexport type SnapControllerIsMinimumPlatformVersionAction = {\n type: `SnapController:isMinimumPlatformVersion`;\n handler: SnapController['isMinimumPlatformVersion'];\n};\n\n/**\n * Completely clear the controller's state: delete all associated data,\n * handlers, event listeners, and permissions; tear down all snap providers.\n * Also re-initializes the controller after clearing the state.\n */\nexport type SnapControllerClearStateAction = {\n type: `SnapController:clearState`;\n handler: SnapController['clearState'];\n};\n\n/**\n * Removes the given snap from state, and clears all associated handlers\n * and listeners.\n *\n * @param snapId - The id of the Snap.\n * @returns A promise that resolves once the snap has been removed.\n */\nexport type SnapControllerRemoveSnapAction = {\n type: `SnapController:removeSnap`;\n handler: SnapController['removeSnap'];\n};\n\n/**\n * Stops the given snaps, removes them from state, and clears all associated\n * permissions, handlers, and listeners.\n *\n * @param snapIds - The ids of the Snaps.\n */\nexport type SnapControllerRemoveSnapsAction = {\n type: `SnapController:removeSnaps`;\n handler: SnapController['removeSnaps'];\n};\n\n/**\n * Disconnect the Snap from the given origin, meaning the origin can no longer\n * interact with the Snap until it is reconnected.\n *\n * @param origin - The origin from which to remove the Snap.\n * @param snapId - The id of the snap to remove.\n */\nexport type SnapControllerDisconnectOriginAction = {\n type: `SnapController:disconnectOrigin`;\n handler: SnapController['disconnectOrigin'];\n};\n\n/**\n * Checks if a list of permissions are dynamic and allowed to be revoked, if they are they will all be revoked.\n *\n * @param snapId - The snap ID.\n * @param permissionNames - The names of the permissions.\n * @throws If non-dynamic permissions are passed.\n */\nexport type SnapControllerRevokeDynamicSnapPermissionsAction = {\n type: `SnapController:revokeDynamicSnapPermissions`;\n handler: SnapController['revokeDynamicSnapPermissions'];\n};\n\n/**\n * Gets all snaps in their truncated format.\n *\n * @returns All installed snaps in their truncated format.\n */\nexport type SnapControllerGetAllSnapsAction = {\n type: `SnapController:getAllSnaps`;\n handler: SnapController['getAllSnaps'];\n};\n\n/**\n * Gets all runnable snaps.\n *\n * @returns All runnable snaps.\n */\nexport type SnapControllerGetRunnableSnapsAction = {\n type: `SnapController:getRunnableSnaps`;\n handler: SnapController['getRunnableSnaps'];\n};\n\n/**\n * Gets the serialized permitted snaps of the given origin, if any.\n *\n * @param origin - The origin whose permitted snaps to retrieve.\n * @returns The serialized permitted snaps for the origin.\n */\nexport type SnapControllerGetPermittedSnapsAction = {\n type: `SnapController:getPermittedSnaps`;\n handler: SnapController['getPermittedSnaps'];\n};\n\n/**\n * Installs the snaps requested by the given origin, returning the snap\n * object if the origin is permitted to install it, and an authorization error\n * otherwise.\n *\n * @param origin - The origin that requested to install the snaps.\n * @param requestedSnaps - The snaps to install.\n * @returns An object of snap ids and snap objects, or errors if a\n * snap couldn't be installed.\n */\nexport type SnapControllerInstallSnapsAction = {\n type: `SnapController:installSnaps`;\n handler: SnapController['installSnaps'];\n};\n\n/**\n * Passes a JSON-RPC request object to the RPC handler function of a snap.\n *\n * @param options - A bag of options.\n * @param options.snapId - The ID of the recipient snap.\n * @param options.origin - The origin of the RPC request.\n * @param options.handler - The handler to trigger on the snap for the request.\n * @param options.request - The JSON-RPC request object.\n * @returns The result of the JSON-RPC request.\n */\nexport type SnapControllerHandleRequestAction = {\n type: `SnapController:handleRequest`;\n handler: SnapController['handleRequest'];\n};\n\n/**\n * Set the active state of the client. This will trigger the `onActive` or\n * `onInactive` lifecycle hooks for all Snaps.\n *\n * @param active - A boolean indicating whether the client is active or not.\n */\nexport type SnapControllerSetClientActiveAction = {\n type: `SnapController:setClientActive`;\n handler: SnapController['setClientActive'];\n};\n\n/**\n * Union of all SnapController action types.\n */\nexport type SnapControllerMethodActions =\n | SnapControllerInitAction\n | SnapControllerUpdateRegistryAction\n | SnapControllerEnableSnapAction\n | SnapControllerDisableSnapAction\n | SnapControllerStopSnapAction\n | SnapControllerStopAllSnapsAction\n | SnapControllerIsSnapRunningAction\n | SnapControllerHasSnapAction\n | SnapControllerGetSnapAction\n | SnapControllerUpdateSnapStateAction\n | SnapControllerClearSnapStateAction\n | SnapControllerGetSnapStateAction\n | SnapControllerGetSnapFileAction\n | SnapControllerIsMinimumPlatformVersionAction\n | SnapControllerClearStateAction\n | SnapControllerRemoveSnapAction\n | SnapControllerRemoveSnapsAction\n | SnapControllerDisconnectOriginAction\n | SnapControllerRevokeDynamicSnapPermissionsAction\n | SnapControllerGetAllSnapsAction\n | SnapControllerGetRunnableSnapsAction\n | SnapControllerGetPermittedSnapsAction\n | SnapControllerInstallSnapsAction\n | SnapControllerHandleRequestAction\n | SnapControllerSetClientActiveAction;\n"]}

@@ -21,3 +21,3 @@ /**

*
* As a side-effect of this, preinstalled Snaps may be updated and Snaps may be blocked/unblocked.
* As a side-effect, this will _always_ check if preinstalled Snaps can be updated and whether any Snaps need to be blocked/unblocked.
*/

@@ -24,0 +24,0 @@ export type SnapControllerUpdateRegistryAction = {

@@ -21,3 +21,3 @@ /**

*
* As a side-effect of this, preinstalled Snaps may be updated and Snaps may be blocked/unblocked.
* As a side-effect, this will _always_ check if preinstalled Snaps can be updated and whether any Snaps need to be blocked/unblocked.
*/

@@ -24,0 +24,0 @@ export type SnapControllerUpdateRegistryAction = {

@@ -1,1 +0,1 @@

{"version":3,"file":"SnapController-method-action-types.mjs","sourceRoot":"","sources":["../../src/snaps/SnapController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { SnapController } from './SnapController';\n\n/**\n * Initialise the SnapController.\n *\n * Currently this method sets up the controller and calls the `onStart` lifecycle hook for all\n * runnable Snaps.\n *\n * @param waitForPlatform - Whether to wait for the platform to be ready before returning.\n */\nexport type SnapControllerInitAction = {\n type: `SnapController:init`;\n handler: SnapController['init'];\n};\n\n/**\n * Trigger an update of the registry.\n *\n * As a side-effect of this, preinstalled Snaps may be updated and Snaps may be blocked/unblocked.\n */\nexport type SnapControllerUpdateRegistryAction = {\n type: `SnapController:updateRegistry`;\n handler: SnapController['updateRegistry'];\n};\n\n/**\n * Enables the given snap. A snap can only be started if it is enabled. A snap\n * can only be enabled if it isn't blocked.\n *\n * @param snapId - The id of the Snap to enable.\n */\nexport type SnapControllerEnableSnapAction = {\n type: `SnapController:enableSnap`;\n handler: SnapController['enableSnap'];\n};\n\n/**\n * Disables the given snap. A snap can only be started if it is enabled.\n *\n * @param snapId - The id of the Snap to disable.\n * @returns A promise that resolves once the snap has been disabled.\n */\nexport type SnapControllerDisableSnapAction = {\n type: `SnapController:disableSnap`;\n handler: SnapController['disableSnap'];\n};\n\n/**\n * Stops the given snap, removes all hooks, closes all connections, and\n * terminates its worker.\n *\n * @param snapId - The id of the Snap to stop.\n * @param statusEvent - The Snap status event that caused the snap to be\n * stopped.\n */\nexport type SnapControllerStopSnapAction = {\n type: `SnapController:stopSnap`;\n handler: SnapController['stopSnap'];\n};\n\n/**\n * Stops all running snaps, removes all hooks, closes all connections, and\n * terminates their workers.\n *\n * @param statusEvent - The Snap status event that caused the snap to be\n * stopped.\n */\nexport type SnapControllerStopAllSnapsAction = {\n type: `SnapController:stopAllSnaps`;\n handler: SnapController['stopAllSnaps'];\n};\n\n/**\n * Returns whether the given snap is running.\n * Throws an error if the snap doesn't exist.\n *\n * @param snapId - The id of the Snap to check.\n * @returns `true` if the snap is running, otherwise `false`.\n */\nexport type SnapControllerIsSnapRunningAction = {\n type: `SnapController:isSnapRunning`;\n handler: SnapController['isSnapRunning'];\n};\n\n/**\n * Returns whether the given snap has been added to state.\n *\n * @param snapId - The id of the Snap to check for.\n * @returns `true` if the snap exists in the controller state, otherwise `false`.\n */\nexport type SnapControllerHasSnapAction = {\n type: `SnapController:hasSnap`;\n handler: SnapController['hasSnap'];\n};\n\n/**\n * Gets the snap with the given id if it exists, including all data.\n * This should not be used if the snap is to be serializable, as e.g.\n * the snap sourceCode may be quite large.\n *\n * @param snapId - The id of the Snap to get.\n * @returns The entire snap object from the controller state.\n */\nexport type SnapControllerGetSnapAction = {\n type: `SnapController:getSnap`;\n handler: SnapController['getSnap'];\n};\n\n/**\n * Updates the own state of the snap with the given id.\n * This is distinct from the state MetaMask uses to manage snaps.\n *\n * @param snapId - The id of the Snap whose state should be updated.\n * @param newSnapState - The new state of the snap.\n * @param encrypted - A flag to indicate whether to use encrypted storage or not.\n */\nexport type SnapControllerUpdateSnapStateAction = {\n type: `SnapController:updateSnapState`;\n handler: SnapController['updateSnapState'];\n};\n\n/**\n * Clears the state of the snap with the given id.\n * This is distinct from the state MetaMask uses to manage snaps.\n *\n * @param snapId - The id of the Snap whose state should be cleared.\n * @param encrypted - A flag to indicate whether to use encrypted storage or not.\n */\nexport type SnapControllerClearSnapStateAction = {\n type: `SnapController:clearSnapState`;\n handler: SnapController['clearSnapState'];\n};\n\n/**\n * Gets the own state of the snap with the given id.\n * This is distinct from the state MetaMask uses to manage snaps.\n *\n * @param snapId - The id of the Snap whose state to get.\n * @param encrypted - A flag to indicate whether to use encrypted storage or not.\n * @returns The requested snap state or null if no state exists.\n */\nexport type SnapControllerGetSnapStateAction = {\n type: `SnapController:getSnapState`;\n handler: SnapController['getSnapState'];\n};\n\n/**\n * Gets a static auxiliary snap file in a chosen file encoding.\n *\n * @param snapId - The id of the Snap whose state to get.\n * @param path - The path to the requested file.\n * @param encoding - An optional requested file encoding.\n * @returns The file requested in the chosen file encoding or null if the file is not found.\n */\nexport type SnapControllerGetSnapFileAction = {\n type: `SnapController:getSnapFile`;\n handler: SnapController['getSnapFile'];\n};\n\n/**\n * Determine if a given Snap ID supports a given minimum version of the Snaps platform\n * by inspecting the platformVersion in the Snap manifest.\n *\n * @param snapId - The Snap ID.\n * @param version - The version.\n * @returns True if the platform version is equal or greater to the passed version, false otherwise.\n */\nexport type SnapControllerIsMinimumPlatformVersionAction = {\n type: `SnapController:isMinimumPlatformVersion`;\n handler: SnapController['isMinimumPlatformVersion'];\n};\n\n/**\n * Completely clear the controller's state: delete all associated data,\n * handlers, event listeners, and permissions; tear down all snap providers.\n * Also re-initializes the controller after clearing the state.\n */\nexport type SnapControllerClearStateAction = {\n type: `SnapController:clearState`;\n handler: SnapController['clearState'];\n};\n\n/**\n * Removes the given snap from state, and clears all associated handlers\n * and listeners.\n *\n * @param snapId - The id of the Snap.\n * @returns A promise that resolves once the snap has been removed.\n */\nexport type SnapControllerRemoveSnapAction = {\n type: `SnapController:removeSnap`;\n handler: SnapController['removeSnap'];\n};\n\n/**\n * Stops the given snaps, removes them from state, and clears all associated\n * permissions, handlers, and listeners.\n *\n * @param snapIds - The ids of the Snaps.\n */\nexport type SnapControllerRemoveSnapsAction = {\n type: `SnapController:removeSnaps`;\n handler: SnapController['removeSnaps'];\n};\n\n/**\n * Disconnect the Snap from the given origin, meaning the origin can no longer\n * interact with the Snap until it is reconnected.\n *\n * @param origin - The origin from which to remove the Snap.\n * @param snapId - The id of the snap to remove.\n */\nexport type SnapControllerDisconnectOriginAction = {\n type: `SnapController:disconnectOrigin`;\n handler: SnapController['disconnectOrigin'];\n};\n\n/**\n * Checks if a list of permissions are dynamic and allowed to be revoked, if they are they will all be revoked.\n *\n * @param snapId - The snap ID.\n * @param permissionNames - The names of the permissions.\n * @throws If non-dynamic permissions are passed.\n */\nexport type SnapControllerRevokeDynamicSnapPermissionsAction = {\n type: `SnapController:revokeDynamicSnapPermissions`;\n handler: SnapController['revokeDynamicSnapPermissions'];\n};\n\n/**\n * Gets all snaps in their truncated format.\n *\n * @returns All installed snaps in their truncated format.\n */\nexport type SnapControllerGetAllSnapsAction = {\n type: `SnapController:getAllSnaps`;\n handler: SnapController['getAllSnaps'];\n};\n\n/**\n * Gets all runnable snaps.\n *\n * @returns All runnable snaps.\n */\nexport type SnapControllerGetRunnableSnapsAction = {\n type: `SnapController:getRunnableSnaps`;\n handler: SnapController['getRunnableSnaps'];\n};\n\n/**\n * Gets the serialized permitted snaps of the given origin, if any.\n *\n * @param origin - The origin whose permitted snaps to retrieve.\n * @returns The serialized permitted snaps for the origin.\n */\nexport type SnapControllerGetPermittedSnapsAction = {\n type: `SnapController:getPermittedSnaps`;\n handler: SnapController['getPermittedSnaps'];\n};\n\n/**\n * Installs the snaps requested by the given origin, returning the snap\n * object if the origin is permitted to install it, and an authorization error\n * otherwise.\n *\n * @param origin - The origin that requested to install the snaps.\n * @param requestedSnaps - The snaps to install.\n * @returns An object of snap ids and snap objects, or errors if a\n * snap couldn't be installed.\n */\nexport type SnapControllerInstallSnapsAction = {\n type: `SnapController:installSnaps`;\n handler: SnapController['installSnaps'];\n};\n\n/**\n * Passes a JSON-RPC request object to the RPC handler function of a snap.\n *\n * @param options - A bag of options.\n * @param options.snapId - The ID of the recipient snap.\n * @param options.origin - The origin of the RPC request.\n * @param options.handler - The handler to trigger on the snap for the request.\n * @param options.request - The JSON-RPC request object.\n * @returns The result of the JSON-RPC request.\n */\nexport type SnapControllerHandleRequestAction = {\n type: `SnapController:handleRequest`;\n handler: SnapController['handleRequest'];\n};\n\n/**\n * Set the active state of the client. This will trigger the `onActive` or\n * `onInactive` lifecycle hooks for all Snaps.\n *\n * @param active - A boolean indicating whether the client is active or not.\n */\nexport type SnapControllerSetClientActiveAction = {\n type: `SnapController:setClientActive`;\n handler: SnapController['setClientActive'];\n};\n\n/**\n * Union of all SnapController action types.\n */\nexport type SnapControllerMethodActions =\n | SnapControllerInitAction\n | SnapControllerUpdateRegistryAction\n | SnapControllerEnableSnapAction\n | SnapControllerDisableSnapAction\n | SnapControllerStopSnapAction\n | SnapControllerStopAllSnapsAction\n | SnapControllerIsSnapRunningAction\n | SnapControllerHasSnapAction\n | SnapControllerGetSnapAction\n | SnapControllerUpdateSnapStateAction\n | SnapControllerClearSnapStateAction\n | SnapControllerGetSnapStateAction\n | SnapControllerGetSnapFileAction\n | SnapControllerIsMinimumPlatformVersionAction\n | SnapControllerClearStateAction\n | SnapControllerRemoveSnapAction\n | SnapControllerRemoveSnapsAction\n | SnapControllerDisconnectOriginAction\n | SnapControllerRevokeDynamicSnapPermissionsAction\n | SnapControllerGetAllSnapsAction\n | SnapControllerGetRunnableSnapsAction\n | SnapControllerGetPermittedSnapsAction\n | SnapControllerInstallSnapsAction\n | SnapControllerHandleRequestAction\n | SnapControllerSetClientActiveAction;\n"]}
{"version":3,"file":"SnapController-method-action-types.mjs","sourceRoot":"","sources":["../../src/snaps/SnapController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { SnapController } from './SnapController';\n\n/**\n * Initialise the SnapController.\n *\n * Currently this method sets up the controller and calls the `onStart` lifecycle hook for all\n * runnable Snaps.\n *\n * @param waitForPlatform - Whether to wait for the platform to be ready before returning.\n */\nexport type SnapControllerInitAction = {\n type: `SnapController:init`;\n handler: SnapController['init'];\n};\n\n/**\n * Trigger an update of the registry.\n *\n * As a side-effect, this will _always_ check if preinstalled Snaps can be updated and whether any Snaps need to be blocked/unblocked.\n */\nexport type SnapControllerUpdateRegistryAction = {\n type: `SnapController:updateRegistry`;\n handler: SnapController['updateRegistry'];\n};\n\n/**\n * Enables the given snap. A snap can only be started if it is enabled. A snap\n * can only be enabled if it isn't blocked.\n *\n * @param snapId - The id of the Snap to enable.\n */\nexport type SnapControllerEnableSnapAction = {\n type: `SnapController:enableSnap`;\n handler: SnapController['enableSnap'];\n};\n\n/**\n * Disables the given snap. A snap can only be started if it is enabled.\n *\n * @param snapId - The id of the Snap to disable.\n * @returns A promise that resolves once the snap has been disabled.\n */\nexport type SnapControllerDisableSnapAction = {\n type: `SnapController:disableSnap`;\n handler: SnapController['disableSnap'];\n};\n\n/**\n * Stops the given snap, removes all hooks, closes all connections, and\n * terminates its worker.\n *\n * @param snapId - The id of the Snap to stop.\n * @param statusEvent - The Snap status event that caused the snap to be\n * stopped.\n */\nexport type SnapControllerStopSnapAction = {\n type: `SnapController:stopSnap`;\n handler: SnapController['stopSnap'];\n};\n\n/**\n * Stops all running snaps, removes all hooks, closes all connections, and\n * terminates their workers.\n *\n * @param statusEvent - The Snap status event that caused the snap to be\n * stopped.\n */\nexport type SnapControllerStopAllSnapsAction = {\n type: `SnapController:stopAllSnaps`;\n handler: SnapController['stopAllSnaps'];\n};\n\n/**\n * Returns whether the given snap is running.\n * Throws an error if the snap doesn't exist.\n *\n * @param snapId - The id of the Snap to check.\n * @returns `true` if the snap is running, otherwise `false`.\n */\nexport type SnapControllerIsSnapRunningAction = {\n type: `SnapController:isSnapRunning`;\n handler: SnapController['isSnapRunning'];\n};\n\n/**\n * Returns whether the given snap has been added to state.\n *\n * @param snapId - The id of the Snap to check for.\n * @returns `true` if the snap exists in the controller state, otherwise `false`.\n */\nexport type SnapControllerHasSnapAction = {\n type: `SnapController:hasSnap`;\n handler: SnapController['hasSnap'];\n};\n\n/**\n * Gets the snap with the given id if it exists, including all data.\n * This should not be used if the snap is to be serializable, as e.g.\n * the snap sourceCode may be quite large.\n *\n * @param snapId - The id of the Snap to get.\n * @returns The entire snap object from the controller state.\n */\nexport type SnapControllerGetSnapAction = {\n type: `SnapController:getSnap`;\n handler: SnapController['getSnap'];\n};\n\n/**\n * Updates the own state of the snap with the given id.\n * This is distinct from the state MetaMask uses to manage snaps.\n *\n * @param snapId - The id of the Snap whose state should be updated.\n * @param newSnapState - The new state of the snap.\n * @param encrypted - A flag to indicate whether to use encrypted storage or not.\n */\nexport type SnapControllerUpdateSnapStateAction = {\n type: `SnapController:updateSnapState`;\n handler: SnapController['updateSnapState'];\n};\n\n/**\n * Clears the state of the snap with the given id.\n * This is distinct from the state MetaMask uses to manage snaps.\n *\n * @param snapId - The id of the Snap whose state should be cleared.\n * @param encrypted - A flag to indicate whether to use encrypted storage or not.\n */\nexport type SnapControllerClearSnapStateAction = {\n type: `SnapController:clearSnapState`;\n handler: SnapController['clearSnapState'];\n};\n\n/**\n * Gets the own state of the snap with the given id.\n * This is distinct from the state MetaMask uses to manage snaps.\n *\n * @param snapId - The id of the Snap whose state to get.\n * @param encrypted - A flag to indicate whether to use encrypted storage or not.\n * @returns The requested snap state or null if no state exists.\n */\nexport type SnapControllerGetSnapStateAction = {\n type: `SnapController:getSnapState`;\n handler: SnapController['getSnapState'];\n};\n\n/**\n * Gets a static auxiliary snap file in a chosen file encoding.\n *\n * @param snapId - The id of the Snap whose state to get.\n * @param path - The path to the requested file.\n * @param encoding - An optional requested file encoding.\n * @returns The file requested in the chosen file encoding or null if the file is not found.\n */\nexport type SnapControllerGetSnapFileAction = {\n type: `SnapController:getSnapFile`;\n handler: SnapController['getSnapFile'];\n};\n\n/**\n * Determine if a given Snap ID supports a given minimum version of the Snaps platform\n * by inspecting the platformVersion in the Snap manifest.\n *\n * @param snapId - The Snap ID.\n * @param version - The version.\n * @returns True if the platform version is equal or greater to the passed version, false otherwise.\n */\nexport type SnapControllerIsMinimumPlatformVersionAction = {\n type: `SnapController:isMinimumPlatformVersion`;\n handler: SnapController['isMinimumPlatformVersion'];\n};\n\n/**\n * Completely clear the controller's state: delete all associated data,\n * handlers, event listeners, and permissions; tear down all snap providers.\n * Also re-initializes the controller after clearing the state.\n */\nexport type SnapControllerClearStateAction = {\n type: `SnapController:clearState`;\n handler: SnapController['clearState'];\n};\n\n/**\n * Removes the given snap from state, and clears all associated handlers\n * and listeners.\n *\n * @param snapId - The id of the Snap.\n * @returns A promise that resolves once the snap has been removed.\n */\nexport type SnapControllerRemoveSnapAction = {\n type: `SnapController:removeSnap`;\n handler: SnapController['removeSnap'];\n};\n\n/**\n * Stops the given snaps, removes them from state, and clears all associated\n * permissions, handlers, and listeners.\n *\n * @param snapIds - The ids of the Snaps.\n */\nexport type SnapControllerRemoveSnapsAction = {\n type: `SnapController:removeSnaps`;\n handler: SnapController['removeSnaps'];\n};\n\n/**\n * Disconnect the Snap from the given origin, meaning the origin can no longer\n * interact with the Snap until it is reconnected.\n *\n * @param origin - The origin from which to remove the Snap.\n * @param snapId - The id of the snap to remove.\n */\nexport type SnapControllerDisconnectOriginAction = {\n type: `SnapController:disconnectOrigin`;\n handler: SnapController['disconnectOrigin'];\n};\n\n/**\n * Checks if a list of permissions are dynamic and allowed to be revoked, if they are they will all be revoked.\n *\n * @param snapId - The snap ID.\n * @param permissionNames - The names of the permissions.\n * @throws If non-dynamic permissions are passed.\n */\nexport type SnapControllerRevokeDynamicSnapPermissionsAction = {\n type: `SnapController:revokeDynamicSnapPermissions`;\n handler: SnapController['revokeDynamicSnapPermissions'];\n};\n\n/**\n * Gets all snaps in their truncated format.\n *\n * @returns All installed snaps in their truncated format.\n */\nexport type SnapControllerGetAllSnapsAction = {\n type: `SnapController:getAllSnaps`;\n handler: SnapController['getAllSnaps'];\n};\n\n/**\n * Gets all runnable snaps.\n *\n * @returns All runnable snaps.\n */\nexport type SnapControllerGetRunnableSnapsAction = {\n type: `SnapController:getRunnableSnaps`;\n handler: SnapController['getRunnableSnaps'];\n};\n\n/**\n * Gets the serialized permitted snaps of the given origin, if any.\n *\n * @param origin - The origin whose permitted snaps to retrieve.\n * @returns The serialized permitted snaps for the origin.\n */\nexport type SnapControllerGetPermittedSnapsAction = {\n type: `SnapController:getPermittedSnaps`;\n handler: SnapController['getPermittedSnaps'];\n};\n\n/**\n * Installs the snaps requested by the given origin, returning the snap\n * object if the origin is permitted to install it, and an authorization error\n * otherwise.\n *\n * @param origin - The origin that requested to install the snaps.\n * @param requestedSnaps - The snaps to install.\n * @returns An object of snap ids and snap objects, or errors if a\n * snap couldn't be installed.\n */\nexport type SnapControllerInstallSnapsAction = {\n type: `SnapController:installSnaps`;\n handler: SnapController['installSnaps'];\n};\n\n/**\n * Passes a JSON-RPC request object to the RPC handler function of a snap.\n *\n * @param options - A bag of options.\n * @param options.snapId - The ID of the recipient snap.\n * @param options.origin - The origin of the RPC request.\n * @param options.handler - The handler to trigger on the snap for the request.\n * @param options.request - The JSON-RPC request object.\n * @returns The result of the JSON-RPC request.\n */\nexport type SnapControllerHandleRequestAction = {\n type: `SnapController:handleRequest`;\n handler: SnapController['handleRequest'];\n};\n\n/**\n * Set the active state of the client. This will trigger the `onActive` or\n * `onInactive` lifecycle hooks for all Snaps.\n *\n * @param active - A boolean indicating whether the client is active or not.\n */\nexport type SnapControllerSetClientActiveAction = {\n type: `SnapController:setClientActive`;\n handler: SnapController['setClientActive'];\n};\n\n/**\n * Union of all SnapController action types.\n */\nexport type SnapControllerMethodActions =\n | SnapControllerInitAction\n | SnapControllerUpdateRegistryAction\n | SnapControllerEnableSnapAction\n | SnapControllerDisableSnapAction\n | SnapControllerStopSnapAction\n | SnapControllerStopAllSnapsAction\n | SnapControllerIsSnapRunningAction\n | SnapControllerHasSnapAction\n | SnapControllerGetSnapAction\n | SnapControllerUpdateSnapStateAction\n | SnapControllerClearSnapStateAction\n | SnapControllerGetSnapStateAction\n | SnapControllerGetSnapFileAction\n | SnapControllerIsMinimumPlatformVersionAction\n | SnapControllerClearStateAction\n | SnapControllerRemoveSnapAction\n | SnapControllerRemoveSnapsAction\n | SnapControllerDisconnectOriginAction\n | SnapControllerRevokeDynamicSnapPermissionsAction\n | SnapControllerGetAllSnapsAction\n | SnapControllerGetRunnableSnapsAction\n | SnapControllerGetPermittedSnapsAction\n | SnapControllerInstallSnapsAction\n | SnapControllerHandleRequestAction\n | SnapControllerSetClientActiveAction;\n"]}

@@ -17,3 +17,3 @@ import { type ApprovalControllerAddRequestAction, type ApprovalControllerUpdateRequestStateAction } from "@metamask/approval-controller";

import { detectSnapLocation } from "./location/index.cjs";
import type { SnapRegistryControllerGetAction, SnapRegistryControllerGetMetadataAction, SnapRegistryControllerResolveVersionAction, SnapRegistryControllerRequestUpdateAction, SnapRegistryControllerStateChangeEvent } from "./registry/index.cjs";
import type { SnapRegistryControllerGetAction, SnapRegistryControllerGetMetadataAction, SnapRegistryControllerResolveVersionAction, SnapRegistryControllerRequestUpdateAction, SnapRegistryControllerRegistryUpdatedEvent } from "./registry/index.cjs";
import type { SnapControllerMethodActions } from "./SnapController-method-action-types.cjs";

@@ -215,3 +215,3 @@ import { Timer } from "./Timer.cjs";

type AllowedActions = PermissionControllerGetEndowmentsAction | PermissionControllerGetPermissionsAction | PermissionControllerGetSubjectNamesAction | SubjectMetadataControllerGetSubjectMetadataAction | SubjectMetadataControllerAddSubjectMetadataAction | PermissionControllerHasPermissionAction | PermissionControllerHasPermissionsAction | PermissionControllerRevokePermissionsAction | PermissionControllerRevokeAllPermissionsAction | PermissionControllerRevokePermissionForAllSubjectsAction | PermissionControllerGrantPermissionsAction | PermissionControllerUpdateCaveatAction | ApprovalControllerAddRequestAction | ExecutionServiceHandleRpcRequestAction | ExecutionServiceExecuteSnapAction | ExecutionServiceTerminateSnapAction | ApprovalControllerUpdateRequestStateAction | SnapRegistryControllerGetAction | SnapRegistryControllerGetMetadataAction | SnapRegistryControllerResolveVersionAction | SnapRegistryControllerRequestUpdateAction | SnapInterfaceControllerCreateInterfaceAction | SnapInterfaceControllerGetInterfaceAction | SnapInterfaceControllerSetInterfaceDisplayedAction | StorageServiceSetItemAction | StorageServiceGetItemAction | StorageServiceRemoveItemAction | StorageServiceClearAction;
type AllowedEvents = ExecutionServiceEvents | SnapControllerSnapInstalledEvent | SnapControllerSnapUpdatedEvent | KeyringControllerLockEvent | SnapRegistryControllerStateChangeEvent;
type AllowedEvents = ExecutionServiceEvents | SnapControllerSnapInstalledEvent | SnapControllerSnapUpdatedEvent | KeyringControllerLockEvent | SnapRegistryControllerRegistryUpdatedEvent;
export type SnapControllerMessenger = Messenger<typeof controllerName, SnapControllerActions | AllowedActions, SnapControllerEvents | AllowedEvents>;

@@ -352,3 +352,3 @@ type FeatureFlags = {

*
* As a side-effect of this, preinstalled Snaps may be updated and Snaps may be blocked/unblocked.
* As a side-effect, this will _always_ check if preinstalled Snaps can be updated and whether any Snaps need to be blocked/unblocked.
*/

@@ -355,0 +355,0 @@ updateRegistry(): Promise<void>;

@@ -1,1 +0,1 @@

{"version":3,"file":"SnapController.d.cts","sourceRoot":"","sources":["../../src/snaps/SnapController.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kCAAkC,EACvC,KAAK,0CAA0C,EAChD,sCAAsC;AACvC,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC3B,kCAAkC;AACnC,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,2BAA2B;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AACrD,OAAO,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AE,GAAG,OAAO,CAAC,IAAI,CAAC;IA+GnD;;;;;;OAMG;IACH,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAwC/C;;;;;;OAMG;IACH,4BAA4B,CAC1B,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,aAAa,CAAC,MAAM,CAAC;IAsCxC;;;;OAIG;IACH,WAAW,IAAI,aAAa,EAAE;IAI9B;;;;OAIG;IACH,gBAAgB,IAAI,aAAa,EAAE;IAInC;;;;;OAKG;IACH,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,kBAAkB;IAqBrD;;;;;;;;;OASG;IACG,YAAY,CAChB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,kBAAkB,GACjC,OAAO,CAAC,kBAAkB,CAAC;IAs3B9B,OAAO;IA6BP;;;;;;;;;OASG;IACG,aAAa,CAAC,EAClB,MAAM,EACN,MAAM,EACN,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,UAAU,GACpB,EAAE,eAAe,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAoN1D;;;;;OAKG;IACH,eAAe,CAAC,MAAM,EAAE,OAAO;CAq4BhC"}

@@ -17,3 +17,3 @@ import { type ApprovalControllerAddRequestAction, type ApprovalControllerUpdateRequestStateAction } from "@metamask/approval-controller";

import { detectSnapLocation } from "./location/index.mjs";
import type { SnapRegistryControllerGetAction, SnapRegistryControllerGetMetadataAction, SnapRegistryControllerResolveVersionAction, SnapRegistryControllerRequestUpdateAction, SnapRegistryControllerStateChangeEvent } from "./registry/index.mjs";
import type { SnapRegistryControllerGetAction, SnapRegistryControllerGetMetadataAction, SnapRegistryControllerResolveVersionAction, SnapRegistryControllerRequestUpdateAction, SnapRegistryControllerRegistryUpdatedEvent } from "./registry/index.mjs";
import type { SnapControllerMethodActions } from "./SnapController-method-action-types.mjs";

@@ -215,3 +215,3 @@ import { Timer } from "./Timer.mjs";

type AllowedActions = PermissionControllerGetEndowmentsAction | PermissionControllerGetPermissionsAction | PermissionControllerGetSubjectNamesAction | SubjectMetadataControllerGetSubjectMetadataAction | SubjectMetadataControllerAddSubjectMetadataAction | PermissionControllerHasPermissionAction | PermissionControllerHasPermissionsAction | PermissionControllerRevokePermissionsAction | PermissionControllerRevokeAllPermissionsAction | PermissionControllerRevokePermissionForAllSubjectsAction | PermissionControllerGrantPermissionsAction | PermissionControllerUpdateCaveatAction | ApprovalControllerAddRequestAction | ExecutionServiceHandleRpcRequestAction | ExecutionServiceExecuteSnapAction | ExecutionServiceTerminateSnapAction | ApprovalControllerUpdateRequestStateAction | SnapRegistryControllerGetAction | SnapRegistryControllerGetMetadataAction | SnapRegistryControllerResolveVersionAction | SnapRegistryControllerRequestUpdateAction | SnapInterfaceControllerCreateInterfaceAction | SnapInterfaceControllerGetInterfaceAction | SnapInterfaceControllerSetInterfaceDisplayedAction | StorageServiceSetItemAction | StorageServiceGetItemAction | StorageServiceRemoveItemAction | StorageServiceClearAction;
type AllowedEvents = ExecutionServiceEvents | SnapControllerSnapInstalledEvent | SnapControllerSnapUpdatedEvent | KeyringControllerLockEvent | SnapRegistryControllerStateChangeEvent;
type AllowedEvents = ExecutionServiceEvents | SnapControllerSnapInstalledEvent | SnapControllerSnapUpdatedEvent | KeyringControllerLockEvent | SnapRegistryControllerRegistryUpdatedEvent;
export type SnapControllerMessenger = Messenger<typeof controllerName, SnapControllerActions | AllowedActions, SnapControllerEvents | AllowedEvents>;

@@ -352,3 +352,3 @@ type FeatureFlags = {

*
* As a side-effect of this, preinstalled Snaps may be updated and Snaps may be blocked/unblocked.
* As a side-effect, this will _always_ check if preinstalled Snaps can be updated and whether any Snaps need to be blocked/unblocked.
*/

@@ -355,0 +355,0 @@ updateRegistry(): Promise<void>;

@@ -1,1 +0,1 @@

{"version":3,"file":"SnapController.d.mts","sourceRoot":"","sources":["../../src/snaps/SnapController.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAA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IAInC;;;;;OAKG;IACH,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,kBAAkB;IAqBrD;;;;;;;;;OASG;IACG,YAAY,CAChB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,kBAAkB,GACjC,OAAO,CAAC,kBAAkB,CAAC;IAs3B9B,OAAO;IA6BP;;;;;;;;;OASG;IACG,aAAa,CAAC,EAClB,MAAM,EACN,MAAM,EACN,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,UAAU,GACpB,EAAE,eAAe,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAoN1D;;;;;OAKG;IACH,eAAe,CAAC,MAAM,EAAE,OAAO;CAq4BhC"}
{"version":3,"file":"SnapController.d.mts","sourceRoot":"","sources":["../../src/snaps/SnapController.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kCAAkC,EACvC,KAAK,0CAA0C,EAChD,sCAAsC;AACvC,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC3B,kCAAkC;AACnC,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,2BAA2B;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AACrD,OAAO,KAAK,EAEV,uCAAuC,EACvC,wCAAwC,EACxC,iDAAiD,EACjD,iDAAiD,EACjD,yCAAyC,EACzC,0CAA0C,EAC1C,uCAAuC,EACvC,wCAAwC,EAIxC,8CAA8C,EAC9C,wDAAwD,EACxD,2CAA2C,EAE3C,sCAAsC,EAEvC,wCAAwC;AAGzC,OAAO,KAAK,EAAE,WAAW,EAAE,iCAAiC;AAY5D,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAClB,MAAM,EAaP,4BAA4B;AAC7B,OAAO,EACL,qBAAqB,EAGtB,4BAA4B;AAC7B,OAAO,KAAK,EAGV,aAAa,EACb,IAAI,EACJ,YAAY,EAEZ,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;;OAOG;IACH,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO;IAYzE;;;;OAIG;IACG,UAAU;IAwBhB;;;;;;OAMG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/C;;;;;OAKG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IA+GnD;;;;;;OAMG;IACH,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAwC/C;;;;;;OAMG;IACH,4BAA4B,CAC1B,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,aAAa,CAAC,MAAM,CAAC;IAsCxC;;;;OAIG;IACH,WAAW,IAAI,aAAa,EAAE;IAI9B;;;;OAIG;IACH,gBAAgB,IAAI,aAAa,EAAE;IAInC;;;;;OAKG;IACH,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,kBAAkB;IAqBrD;;;;;;;;;OASG;IACG,YAAY,CAChB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,kBAAkB,GACjC,OAAO,CAAC,kBAAkB,CAAC;IAs3B9B,OAAO;IA6BP;;;;;;;;;OASG;IACG,aAAa,CAAC,EAClB,MAAM,EACN,MAAM,EACN,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,UAAU,GACpB,EAAE,eAAe,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAoN1D;;;;;OAKG;IACH,eAAe,CAAC,MAAM,EAAE,OAAO;CAq4BhC"}

@@ -187,2 +187,23 @@ import type { PermissionConstraint } from "@metamask/permission-controller";

allowedOrigins?: string[] | undefined;
capabilities?: {
scopes: `${string}:${string}`[];
bip44?: {
derivePath?: boolean | undefined;
deriveIndex?: boolean | undefined;
deriveIndexRange?: boolean | undefined;
discover?: boolean | undefined;
} | undefined;
privateKey?: {
importFormats?: {
encoding: "hexadecimal" | "base58";
type?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "entropy:account" | undefined;
}[] | undefined;
exportFormats?: {
encoding: "hexadecimal" | "base58";
}[] | undefined;
} | undefined;
custom?: {
createAccounts?: boolean | undefined;
} | undefined;
} | undefined;
maxRequestTime?: number | undefined;

@@ -225,3 +246,12 @@ };

snap_getEntropy: import("@metamask/snaps-sdk").EmptyObject;
snap_getLocale: import("@metamask/snaps-sdk").EmptyObject;
snap_getLocale: import("@metamask/snaps-sdk").EmptyObject; /**
* Returns all keys of an object, that are not literal, as an union
*
* @example
* ```
* type t1 = _NonLiteralKeys<{a: number, b: 0, c: 'foo', d: string}>
* // t1 = 'a' | 'd'
* ```
* @see [Literal types]{@link https://www.typescriptlang.org/docs/handbook/literal-types.html}
*/
snap_manageAccounts: import("@metamask/snaps-sdk").EmptyObject;

@@ -228,0 +258,0 @@ snap_manageState: import("@metamask/snaps-sdk").EmptyObject;

@@ -1,1 +0,1 @@

{"version":3,"file":"utils.d.cts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,wCAAwC;AAC5E,OAAO,KAAK,EAAE,MAAM,EAAE,4BAA4B;AAElD,OAAO,EAML,WAAW,EACZ,8BAA8B;AAC/B,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAG5C,OAAO,KAAK,EAAE,YAAY,EAAE,0BAAgB;AAC5C,OAAO,EAAE,KAAK,EAAE,0BAAsB;AAEtC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CACrB,OAAO,SAAS,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,EACpC,OAAO,SAAS,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,EACpC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAA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;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAErD"}

@@ -187,2 +187,23 @@ import type { PermissionConstraint } from "@metamask/permission-controller";

allowedOrigins?: string[] | undefined;
capabilities?: {
scopes: `${string}:${string}`[];
bip44?: {
derivePath?: boolean | undefined;
deriveIndex?: boolean | undefined;
deriveIndexRange?: boolean | undefined;
discover?: boolean | undefined;
} | undefined;
privateKey?: {
importFormats?: {
encoding: "hexadecimal" | "base58";
type?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "entropy:account" | undefined;
}[] | undefined;
exportFormats?: {
encoding: "hexadecimal" | "base58";
}[] | undefined;
} | undefined;
custom?: {
createAccounts?: boolean | undefined;
} | undefined;
} | undefined;
maxRequestTime?: number | undefined;

@@ -225,3 +246,12 @@ };

snap_getEntropy: import("@metamask/snaps-sdk").EmptyObject;
snap_getLocale: import("@metamask/snaps-sdk").EmptyObject;
snap_getLocale: import("@metamask/snaps-sdk").EmptyObject; /**
* Returns all keys of an object, that are not literal, as an union
*
* @example
* ```
* type t1 = _NonLiteralKeys<{a: number, b: 0, c: 'foo', d: string}>
* // t1 = 'a' | 'd'
* ```
* @see [Literal types]{@link https://www.typescriptlang.org/docs/handbook/literal-types.html}
*/
snap_manageAccounts: import("@metamask/snaps-sdk").EmptyObject;

@@ -228,0 +258,0 @@ snap_manageState: import("@metamask/snaps-sdk").EmptyObject;

@@ -1,1 +0,1 @@

{"version":3,"file":"utils.d.mts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,wCAAwC;AAC5E,OAAO,KAAK,EAAE,MAAM,EAAE,4BAA4B;AAElD,OAAO,EAML,WAAW,EACZ,8BAA8B;AAC/B,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAG5C,OAAO,KAAK,EAA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EAAE,MAAM,EACd,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,KACX,IAAI,EACT,OAAO,SAAQ,YAYL,MAAM,WACL,gBAAgB,WAChB,OAAO,UACR,MAAM,KACb,IAAI,CAgCR;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,WAAW,GACnB,OAAO,IAAI,gBAAgB,CAE7B;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAErD"}
{
"name": "@metamask/snaps-controllers",
"version": "19.0.1",
"version": "20.0.0",
"description": "Controllers for MetaMask Snaps",

@@ -65,3 +65,2 @@ "keywords": [

"changelog:validate": "../../scripts/validate-changelog.sh @metamask/snaps-controllers",
"generate-method-action-types": "messenger-generate-action-types",
"lint": "yarn lint:eslint && yarn lint:misc --check && yarn changelog:validate && yarn lint:dependencies",

@@ -73,2 +72,4 @@ "lint:ci": "yarn lint",

"lint:misc": "prettier --no-error-on-unmatched-pattern --log-level warn \"**/*.json\" \"**/*.md\" \"**/*.html\" \"!CHANGELOG.md\" --ignore-path ../../.gitignore",
"messenger-action-types:check": "messenger-action-types --check",
"messenger-action-types:generate": "messenger-action-types --generate",
"publish:preview": "yarn npm publish --tag preview",

@@ -90,3 +91,3 @@ "since-latest-release": "../../scripts/since-latest-release.sh",

"@metamask/key-tree": "^10.1.1",
"@metamask/messenger": "^1.1.0",
"@metamask/messenger": "^1.1.1",
"@metamask/object-multiplex": "^2.1.0",

@@ -97,8 +98,8 @@ "@metamask/permission-controller": "^12.3.0",

"@metamask/snaps-registry": "^4.0.0",
"@metamask/snaps-rpc-methods": "^15.0.2",
"@metamask/snaps-sdk": "^11.0.0",
"@metamask/snaps-utils": "^12.1.3",
"@metamask/snaps-rpc-methods": "^15.1.0",
"@metamask/snaps-sdk": "^11.1.0",
"@metamask/snaps-utils": "^12.2.0",
"@metamask/storage-service": "^1.0.1",
"@metamask/superstruct": "^3.2.1",
"@metamask/utils": "^11.10.0",
"@metamask/utils": "^11.11.0",
"@xstate/fsm": "^2.0.0",

@@ -122,2 +123,3 @@ "async-mutex": "^0.5.0",

"@metamask/browser-passworder": "^6.0.0",
"@metamask/messenger-cli": "^0.1.0",
"@noble/hashes": "^1.7.1",

@@ -124,0 +126,0 @@ "@swc/core": "1.11.31",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display