You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@metamask/approval-controller

Package Overview
Dependencies
Maintainers
3
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metamask/approval-controller - npm Package Compare versions

Comparing version
7.2.1
to
8.0.0
+10
-1
CHANGELOG.md

@@ -10,2 +10,10 @@ # Changelog

## [8.0.0]
### Changed
- **BREAKING:** Use new `Messenger` from `@metamask/messenger` ([#6386](https://github.com/MetaMask/core/pull/6386))
- Previously, `ApprovalController` accepted a `RestrictedMessenger` instance from `@metamask/base-controller`.
- Bump `@metamask/base-controller` from `^8.4.2` to `^9.0.0` ([#6962](https://github.com/MetaMask/core/pull/6962))
## [7.2.1]

@@ -290,3 +298,4 @@

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/approval-controller@7.2.1...HEAD
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/approval-controller@8.0.0...HEAD
[8.0.0]: https://github.com/MetaMask/core/compare/@metamask/approval-controller@7.2.1...@metamask/approval-controller@8.0.0
[7.2.1]: https://github.com/MetaMask/core/compare/@metamask/approval-controller@7.2.0...@metamask/approval-controller@7.2.1

@@ -293,0 +302,0 @@ [7.2.0]: https://github.com/MetaMask/core/compare/@metamask/approval-controller@7.1.3...@metamask/approval-controller@7.2.0

+14
-14

@@ -30,3 +30,3 @@ "use strict";

persist: false,
anonymous: true,
includeInDebugSnapshot: true,
usedInUi: true,

@@ -37,3 +37,3 @@ },

persist: false,
anonymous: false,
includeInDebugSnapshot: false,
usedInUi: true,

@@ -44,3 +44,3 @@ },

persist: false,
anonymous: false,
includeInDebugSnapshot: false,
usedInUi: true,

@@ -102,4 +102,4 @@ },

registerMessageHandlers() {
this.messagingSystem.registerActionHandler(`${controllerName}:clearRequests`, this.clear.bind(this));
this.messagingSystem.registerActionHandler(`${controllerName}:addRequest`, (opts, shouldShowRequest) => {
this.messenger.registerActionHandler(`${controllerName}:clearRequests`, this.clear.bind(this));
this.messenger.registerActionHandler(`${controllerName}:addRequest`, (opts, shouldShowRequest) => {
if (shouldShowRequest) {

@@ -110,11 +110,11 @@ return this.addAndShowApprovalRequest(opts);

});
this.messagingSystem.registerActionHandler(`${controllerName}:hasRequest`, this.has.bind(this));
this.messagingSystem.registerActionHandler(`${controllerName}:acceptRequest`, this.accept.bind(this));
this.messagingSystem.registerActionHandler(`${controllerName}:rejectRequest`, this.reject.bind(this));
this.messagingSystem.registerActionHandler(`${controllerName}:updateRequestState`, this.updateRequestState.bind(this));
this.messagingSystem.registerActionHandler(`${controllerName}:startFlow`, this.startFlow.bind(this));
this.messagingSystem.registerActionHandler(`${controllerName}:endFlow`, this.endFlow.bind(this));
this.messagingSystem.registerActionHandler(`${controllerName}:setFlowLoadingText`, this.setFlowLoadingText.bind(this));
this.messagingSystem.registerActionHandler(`${controllerName}:showSuccess`, this.success.bind(this));
this.messagingSystem.registerActionHandler(`${controllerName}:showError`, this.error.bind(this));
this.messenger.registerActionHandler(`${controllerName}:hasRequest`, this.has.bind(this));
this.messenger.registerActionHandler(`${controllerName}:acceptRequest`, this.accept.bind(this));
this.messenger.registerActionHandler(`${controllerName}:rejectRequest`, this.reject.bind(this));
this.messenger.registerActionHandler(`${controllerName}:updateRequestState`, this.updateRequestState.bind(this));
this.messenger.registerActionHandler(`${controllerName}:startFlow`, this.startFlow.bind(this));
this.messenger.registerActionHandler(`${controllerName}:endFlow`, this.endFlow.bind(this));
this.messenger.registerActionHandler(`${controllerName}:setFlowLoadingText`, this.setFlowLoadingText.bind(this));
this.messenger.registerActionHandler(`${controllerName}:showSuccess`, this.success.bind(this));
this.messenger.registerActionHandler(`${controllerName}:showError`, this.error.bind(this));
}

@@ -121,0 +121,0 @@ addAndShowApprovalRequest(opts) {

import type { ControllerGetStateAction } from "@metamask/base-controller";
import { BaseController, type ControllerStateChangeEvent, type RestrictedMessenger } from "@metamask/base-controller";
import { BaseController, type ControllerStateChangeEvent } from "@metamask/base-controller";
import type { Messenger } from "@metamask/messenger";
import type { JsonRpcError, DataWithOptionalCause } from "@metamask/rpc-errors";

@@ -59,3 +60,3 @@ import type { Json, OptionalField } from "@metamask/utils";

};
export type ApprovalControllerMessenger = RestrictedMessenger<typeof controllerName, ApprovalControllerActions, ApprovalControllerEvents, never, never>;
export type ApprovalControllerMessenger = Messenger<typeof controllerName, ApprovalControllerActions, ApprovalControllerEvents>;
export type ShowApprovalRequest = () => void | Promise<void>;

@@ -62,0 +63,0 @@ export type ResultComponent = {

import type { ControllerGetStateAction } from "@metamask/base-controller";
import { BaseController, type ControllerStateChangeEvent, type RestrictedMessenger } from "@metamask/base-controller";
import { BaseController, type ControllerStateChangeEvent } from "@metamask/base-controller";
import type { Messenger } from "@metamask/messenger";
import type { JsonRpcError, DataWithOptionalCause } from "@metamask/rpc-errors";

@@ -59,3 +60,3 @@ import type { Json, OptionalField } from "@metamask/utils";

};
export type ApprovalControllerMessenger = RestrictedMessenger<typeof controllerName, ApprovalControllerActions, ApprovalControllerEvents, never, never>;
export type ApprovalControllerMessenger = Messenger<typeof controllerName, ApprovalControllerActions, ApprovalControllerEvents>;
export type ShowApprovalRequest = () => void | Promise<void>;

@@ -62,0 +63,0 @@ export type ResultComponent = {

@@ -27,3 +27,3 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {

persist: false,
anonymous: true,
includeInDebugSnapshot: true,
usedInUi: true,

@@ -34,3 +34,3 @@ },

persist: false,
anonymous: false,
includeInDebugSnapshot: false,
usedInUi: true,

@@ -41,3 +41,3 @@ },

persist: false,
anonymous: false,
includeInDebugSnapshot: false,
usedInUi: true,

@@ -99,4 +99,4 @@ },

registerMessageHandlers() {
this.messagingSystem.registerActionHandler(`${controllerName}:clearRequests`, this.clear.bind(this));
this.messagingSystem.registerActionHandler(`${controllerName}:addRequest`, (opts, shouldShowRequest) => {
this.messenger.registerActionHandler(`${controllerName}:clearRequests`, this.clear.bind(this));
this.messenger.registerActionHandler(`${controllerName}:addRequest`, (opts, shouldShowRequest) => {
if (shouldShowRequest) {

@@ -107,11 +107,11 @@ return this.addAndShowApprovalRequest(opts);

});
this.messagingSystem.registerActionHandler(`${controllerName}:hasRequest`, this.has.bind(this));
this.messagingSystem.registerActionHandler(`${controllerName}:acceptRequest`, this.accept.bind(this));
this.messagingSystem.registerActionHandler(`${controllerName}:rejectRequest`, this.reject.bind(this));
this.messagingSystem.registerActionHandler(`${controllerName}:updateRequestState`, this.updateRequestState.bind(this));
this.messagingSystem.registerActionHandler(`${controllerName}:startFlow`, this.startFlow.bind(this));
this.messagingSystem.registerActionHandler(`${controllerName}:endFlow`, this.endFlow.bind(this));
this.messagingSystem.registerActionHandler(`${controllerName}:setFlowLoadingText`, this.setFlowLoadingText.bind(this));
this.messagingSystem.registerActionHandler(`${controllerName}:showSuccess`, this.success.bind(this));
this.messagingSystem.registerActionHandler(`${controllerName}:showError`, this.error.bind(this));
this.messenger.registerActionHandler(`${controllerName}:hasRequest`, this.has.bind(this));
this.messenger.registerActionHandler(`${controllerName}:acceptRequest`, this.accept.bind(this));
this.messenger.registerActionHandler(`${controllerName}:rejectRequest`, this.reject.bind(this));
this.messenger.registerActionHandler(`${controllerName}:updateRequestState`, this.updateRequestState.bind(this));
this.messenger.registerActionHandler(`${controllerName}:startFlow`, this.startFlow.bind(this));
this.messenger.registerActionHandler(`${controllerName}:endFlow`, this.endFlow.bind(this));
this.messenger.registerActionHandler(`${controllerName}:setFlowLoadingText`, this.setFlowLoadingText.bind(this));
this.messenger.registerActionHandler(`${controllerName}:showSuccess`, this.success.bind(this));
this.messenger.registerActionHandler(`${controllerName}:showError`, this.error.bind(this));
}

@@ -118,0 +118,0 @@ addAndShowApprovalRequest(opts) {

{
"name": "@metamask/approval-controller",
"version": "7.2.1",
"version": "8.0.0",
"description": "Manages requests that require user approval",

@@ -50,3 +50,4 @@ "keywords": [

"dependencies": {
"@metamask/base-controller": "^8.4.2",
"@metamask/base-controller": "^9.0.0",
"@metamask/messenger": "^0.3.0",
"@metamask/rpc-errors": "^7.0.2",

@@ -53,0 +54,0 @@ "@metamask/utils": "^11.8.1",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet