@metamask/snaps-controllers 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -1
- package/dist/cjs/cronjob/CronjobController.js +3 -1
- package/dist/cjs/cronjob/CronjobController.js.map +1 -1
- package/dist/cjs/snaps/SnapController.js +25 -9
- package/dist/cjs/snaps/SnapController.js.map +1 -1
- package/dist/esm/cronjob/CronjobController.js +3 -1
- package/dist/esm/cronjob/CronjobController.js.map +1 -1
- package/dist/esm/snaps/SnapController.js +25 -9
- package/dist/esm/snaps/SnapController.js.map +1 -1
- package/dist/types/snaps/SnapController.d.ts +12 -11
- package/package.json +1 -1
|
@@ -205,7 +205,15 @@ export declare type SnapInstalled = {
|
|
|
205
205
|
payload: [snap: TruncatedSnap];
|
|
206
206
|
};
|
|
207
207
|
/**
|
|
208
|
-
* Emitted when a snap is
|
|
208
|
+
* Emitted when a snap that has previously been fully installed, is uninstalled.
|
|
209
|
+
*/
|
|
210
|
+
export declare type SnapUninstalled = {
|
|
211
|
+
type: `${typeof controllerName}:snapUninstalled`;
|
|
212
|
+
payload: [snap: TruncatedSnap];
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Emitted when a snap is removed from state, this may happen even
|
|
216
|
+
* if a snap has not fully completed installation.
|
|
209
217
|
*/
|
|
210
218
|
export declare type SnapRemoved = {
|
|
211
219
|
type: `${typeof controllerName}:snapRemoved`;
|
|
@@ -255,19 +263,11 @@ export declare type SnapDisabled = {
|
|
|
255
263
|
type: `${typeof controllerName}:snapDisabled`;
|
|
256
264
|
payload: [snap: TruncatedSnap];
|
|
257
265
|
};
|
|
258
|
-
export declare type SnapControllerEvents = SnapAdded | SnapBlocked | SnapInstalled | SnapRemoved | SnapStateChange | SnapUnblocked | SnapUpdated | SnapRolledback | SnapTerminated | SnapEnabled | SnapDisabled;
|
|
266
|
+
export declare type SnapControllerEvents = SnapAdded | SnapBlocked | SnapInstalled | SnapUninstalled | SnapRemoved | SnapStateChange | SnapUnblocked | SnapUpdated | SnapRolledback | SnapTerminated | SnapEnabled | SnapDisabled;
|
|
259
267
|
export declare type AllowedActions = GetEndowments | GetPermissions | GetSubjects | GetSubjectMetadata | HasPermission | HasPermissions | RevokePermissions | RevokeAllPermissions | RevokePermissionForAllSubjects | GrantPermissions | AddApprovalRequest | HandleRpcRequestAction | ExecuteSnapAction | TerminateAllSnapsAction | TerminateSnapAction | UpdateCaveat | UpdateRequestState | GetResult | GetMetadata | Update;
|
|
260
268
|
export declare type AllowedEvents = ExecutionServiceEvents | SnapInstalled | SnapUpdated;
|
|
261
269
|
declare type SnapControllerMessenger = RestrictedControllerMessenger<typeof controllerName, SnapControllerActions | AllowedActions, SnapControllerEvents | AllowedEvents, AllowedActions['type'], AllowedEvents['type']>;
|
|
262
270
|
declare type FeatureFlags = {
|
|
263
|
-
/**
|
|
264
|
-
* We still need to implement new UI approval page in metamask-extension before we can allow
|
|
265
|
-
* DApps to update Snaps. After it's added, this flag can be removed.
|
|
266
|
-
*
|
|
267
|
-
* @see {SNAP_APPROVAL_UPDATE}
|
|
268
|
-
* @see {SnapController.processRequestedSnap}
|
|
269
|
-
*/
|
|
270
|
-
dappsCanUpdateSnaps?: true;
|
|
271
271
|
requireAllowlist?: true;
|
|
272
272
|
allowLocalSnaps?: true;
|
|
273
273
|
};
|
|
@@ -564,9 +564,10 @@ export declare class SnapController extends BaseController<string, SnapControlle
|
|
|
564
564
|
* @param snapId - The id of the Snap to be updated.
|
|
565
565
|
* @param location - The location implementation of the snap.
|
|
566
566
|
* @param newVersionRange - A semver version range in which the maximum version will be chosen.
|
|
567
|
+
* @param emitEvent - An optional boolean flag to indicate whether this update should emit an event.
|
|
567
568
|
* @returns The snap metadata if updated, `null` otherwise.
|
|
568
569
|
*/
|
|
569
|
-
updateSnap(origin: string, snapId: ValidatedSnapId, location: SnapLocation, newVersionRange?: string): Promise<TruncatedSnap>;
|
|
570
|
+
updateSnap(origin: string, snapId: ValidatedSnapId, location: SnapLocation, newVersionRange?: string, emitEvent?: boolean): Promise<TruncatedSnap>;
|
|
570
571
|
/**
|
|
571
572
|
* Get metadata for the given snap ID.
|
|
572
573
|
*
|