@metamask-previews/approval-controller
Advanced tools
Comparing version 3.5.1-preview.f71e42f to 4.0.0-preview.7cc5454
@@ -9,2 +9,13 @@ # Changelog | ||
## [4.0.0] | ||
### Changed | ||
- **BREAKING:** Move `eth-rpc-errors@^4.0.2` dependency to `@metamask/rpc-errors@^6.0.2` ([#1743](https://github.com/MetaMask/core/pull/1743)) | ||
- Upon upgrading, you may need to also use `@metamask/rpc-errors@^6.0.2`, which restricts valid data that can be used to build messages | ||
- Bump dependency on `@metamask/utils` to ^8.1.0 ([#1639](https://github.com/MetaMask/core/pull/1639)) | ||
- Bump dependency on `@metamask/base-controller` to ^3.2.3 | ||
## [3.5.2] | ||
### Changed | ||
- Update TypeScript to v4.8.x ([#1718](https://github.com/MetaMask/core/pull/1718)) | ||
## [3.5.1] | ||
@@ -75,3 +86,5 @@ ### Changed | ||
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/approval-controller@3.5.1...HEAD | ||
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/approval-controller@4.0.0...HEAD | ||
[4.0.0]: https://github.com/MetaMask/core/compare/@metamask/approval-controller@3.5.2...@metamask/approval-controller@4.0.0 | ||
[3.5.2]: https://github.com/MetaMask/core/compare/@metamask/approval-controller@3.5.1...@metamask/approval-controller@3.5.2 | ||
[3.5.1]: https://github.com/MetaMask/core/compare/@metamask/approval-controller@3.5.0...@metamask/approval-controller@3.5.1 | ||
@@ -78,0 +91,0 @@ [3.5.0]: https://github.com/MetaMask/core/compare/@metamask/approval-controller@3.4.0...@metamask/approval-controller@3.5.0 |
import type { RestrictedControllerMessenger } from '@metamask/base-controller'; | ||
import { BaseControllerV2 } from '@metamask/base-controller'; | ||
import type { JsonRpcError, DataWithOptionalCause } from '@metamask/rpc-errors'; | ||
import type { Json, OptionalField } from '@metamask/utils'; | ||
import type { EthereumRpcError } from 'eth-rpc-errors'; | ||
import type { Patch } from 'immer'; | ||
@@ -157,3 +157,3 @@ export declare const ORIGIN_METAMASK = "metamask"; | ||
type: `${typeof controllerName}:clearRequests`; | ||
handler: (error: EthereumRpcError<unknown>) => void; | ||
handler: (error: JsonRpcError<DataWithOptionalCause>) => void; | ||
}; | ||
@@ -379,6 +379,6 @@ export declare type AddApprovalRequest = { | ||
* | ||
* @param rejectionError - The EthereumRpcError to reject the approval | ||
* @param rejectionError - The JsonRpcError to reject the approval | ||
* requests with. | ||
*/ | ||
clear(rejectionError: EthereumRpcError<unknown>): void; | ||
clear(rejectionError: JsonRpcError<DataWithOptionalCause>): void; | ||
/** | ||
@@ -385,0 +385,0 @@ * Updates the request state of the approval with the given id. |
@@ -26,3 +26,3 @@ "use strict"; | ||
const base_controller_1 = require("@metamask/base-controller"); | ||
const eth_rpc_errors_1 = require("eth-rpc-errors"); | ||
const rpc_errors_1 = require("@metamask/rpc-errors"); | ||
const nanoid_1 = require("nanoid"); | ||
@@ -264,3 +264,3 @@ const errors_1 = require("./errors"); | ||
* | ||
* @param rejectionError - The EthereumRpcError to reject the approval | ||
* @param rejectionError - The JsonRpcError to reject the approval | ||
* requests with. | ||
@@ -389,3 +389,3 @@ */ | ||
this.has({ origin, type })) { | ||
throw eth_rpc_errors_1.ethErrors.rpc.resourceUnavailable(getAlreadyPendingMessage(origin, type)); | ||
throw rpc_errors_1.rpcErrors.resourceUnavailable(getAlreadyPendingMessage(origin, type)); | ||
} | ||
@@ -421,3 +421,3 @@ // add pending approval | ||
if (errorMessage) { | ||
throw eth_rpc_errors_1.ethErrors.rpc.internal(errorMessage); | ||
throw rpc_errors_1.rpcErrors.internal(errorMessage); | ||
} | ||
@@ -424,0 +424,0 @@ }, _ApprovalController_addPendingApprovalOrigin = function _ApprovalController_addPendingApprovalOrigin(origin, type) { |
{ | ||
"name": "@metamask-previews/approval-controller", | ||
"version": "3.5.1-preview.f71e42f", | ||
"version": "4.0.0-preview.7cc5454", | ||
"description": "Manages requests that require user approval", | ||
@@ -28,8 +28,9 @@ "keywords": [ | ||
"test": "jest", | ||
"test:clean": "jest --clearCache", | ||
"test:watch": "jest --watch" | ||
}, | ||
"dependencies": { | ||
"@metamask/base-controller": "^3.2.1", | ||
"@metamask/utils": "^6.2.0", | ||
"eth-rpc-errors": "^4.0.2", | ||
"@metamask/base-controller": "^3.2.3", | ||
"@metamask/rpc-errors": "^6.0.0", | ||
"@metamask/utils": "^8.1.0", | ||
"immer": "^9.0.6", | ||
@@ -45,5 +46,5 @@ "nanoid": "^3.1.31" | ||
"ts-jest": "^27.1.4", | ||
"typedoc": "^0.22.15", | ||
"typedoc-plugin-missing-exports": "^0.22.6", | ||
"typescript": "~4.6.3" | ||
"typedoc": "^0.24.8", | ||
"typedoc-plugin-missing-exports": "^2.0.0", | ||
"typescript": "~4.8.4" | ||
}, | ||
@@ -50,0 +51,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
108795
+ Added@metamask/rpc-errors@^6.0.0
+ Added@metamask/rpc-errors@6.4.0(transitive)
+ Added@metamask/utils@9.3.0(transitive)
- Removedeth-rpc-errors@^4.0.2
- Removed@metamask/utils@6.2.0(transitive)
- Removedeth-rpc-errors@4.0.3(transitive)
- Removedsuperstruct@1.0.4(transitive)
Updated@metamask/utils@^8.1.0