@metamask/snaps-rpc-methods
Advanced tools
+14
-1
@@ -10,2 +10,14 @@ # Changelog | ||
| ## [14.0.0] | ||
| ### Changed | ||
| - **BREAKING**: `handleSnapInstall` now accepts a `messenger` parameter of type `Messenger` instead of a `messagingSystem` parameter of type `RestrictedMessenger` ([#3611](https://github.com/MetaMask/snaps/pull/3611)) | ||
| - **BREAKING**: `MockControllerMessenger` now extends `Messenger` from `@metamask/messenger` instead of from `@metamask/base-controller` ([#3611](https://github.com/MetaMask/snaps/pull/3611)) | ||
| - Bump `@metamask/permission-controller` from `^11.0.6` to `^12.0.0`(([#3611](https://github.com/MetaMask/snaps/pull/3611)) | ||
| ### Removed | ||
| - Remove `@metamask/base-controller` dependency ([#3611](https://github.com/MetaMask/snaps/pull/3611)) | ||
| ## [13.5.3] | ||
@@ -520,3 +532,4 @@ | ||
| [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-rpc-methods@13.5.3...HEAD | ||
| [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-rpc-methods@14.0.0...HEAD | ||
| [14.0.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-rpc-methods@13.5.3...@metamask/snaps-rpc-methods@14.0.0 | ||
| [13.5.3]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-rpc-methods@13.5.2...@metamask/snaps-rpc-methods@13.5.3 | ||
@@ -523,0 +536,0 @@ [13.5.2]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-rpc-methods@13.5.1...@metamask/snaps-rpc-methods@13.5.2 |
@@ -13,9 +13,9 @@ "use strict"; | ||
| * @param params.requestData - The request data associated to the requested permission. | ||
| * @param params.messagingSystem - The messenger to call an action. | ||
| * @param params.messenger - The messenger to call an action. | ||
| * @returns The result of the Snap installation. | ||
| */ | ||
| const handleSnapInstall = async ({ requestData, messagingSystem }) => { | ||
| const handleSnapInstall = async ({ requestData, messenger }) => { | ||
| const snaps = requestData.permissions[exports.WALLET_SNAP_PERMISSION_KEY].caveats?.[0] | ||
| .value; | ||
| const permittedSnaps = messagingSystem.call(`SnapController:getPermitted`, requestData.metadata.origin); | ||
| const permittedSnaps = messenger.call(`SnapController:getPermitted`, requestData.metadata.origin); | ||
| const dedupedSnaps = Object.keys(snaps).reduce((filteredSnaps, snap) => { | ||
@@ -27,3 +27,3 @@ if (!permittedSnaps[snap]) { | ||
| }, {}); | ||
| return messagingSystem.call(`SnapController:install`, requestData.metadata.origin, dedupedSnaps); | ||
| return messenger.call(`SnapController:install`, requestData.metadata.origin, dedupedSnaps); | ||
| }; | ||
@@ -30,0 +30,0 @@ exports.handleSnapInstall = handleSnapInstall; |
@@ -35,3 +35,3 @@ import type { PermissionSpecificationBuilder, RestrictedMethodOptions, PermissionValidatorConstraint, PermissionSideEffect } from "@metamask/permission-controller"; | ||
| * @param params.requestData - The request data associated to the requested permission. | ||
| * @param params.messagingSystem - The messenger to call an action. | ||
| * @param params.messenger - The messenger to call an action. | ||
| * @returns The result of the Snap installation. | ||
@@ -38,0 +38,0 @@ */ |
@@ -35,3 +35,3 @@ import type { PermissionSpecificationBuilder, RestrictedMethodOptions, PermissionValidatorConstraint, PermissionSideEffect } from "@metamask/permission-controller"; | ||
| * @param params.requestData - The request data associated to the requested permission. | ||
| * @param params.messagingSystem - The messenger to call an action. | ||
| * @param params.messenger - The messenger to call an action. | ||
| * @returns The result of the Snap installation. | ||
@@ -38,0 +38,0 @@ */ |
@@ -10,9 +10,9 @@ import { PermissionType } from "@metamask/permission-controller"; | ||
| * @param params.requestData - The request data associated to the requested permission. | ||
| * @param params.messagingSystem - The messenger to call an action. | ||
| * @param params.messenger - The messenger to call an action. | ||
| * @returns The result of the Snap installation. | ||
| */ | ||
| export const handleSnapInstall = async ({ requestData, messagingSystem }) => { | ||
| export const handleSnapInstall = async ({ requestData, messenger }) => { | ||
| const snaps = requestData.permissions[WALLET_SNAP_PERMISSION_KEY].caveats?.[0] | ||
| .value; | ||
| const permittedSnaps = messagingSystem.call(`SnapController:getPermitted`, requestData.metadata.origin); | ||
| const permittedSnaps = messenger.call(`SnapController:getPermitted`, requestData.metadata.origin); | ||
| const dedupedSnaps = Object.keys(snaps).reduce((filteredSnaps, snap) => { | ||
@@ -24,3 +24,3 @@ if (!permittedSnaps[snap]) { | ||
| }, {}); | ||
| return messagingSystem.call(`SnapController:install`, requestData.metadata.origin, dedupedSnaps); | ||
| return messenger.call(`SnapController:install`, requestData.metadata.origin, dedupedSnaps); | ||
| }; | ||
@@ -27,0 +27,0 @@ /** |
+4
-3
| { | ||
| "name": "@metamask/snaps-rpc-methods", | ||
| "version": "13.5.3", | ||
| "version": "14.0.0", | ||
| "description": "MetaMask Snaps JSON-RPC method implementations", | ||
@@ -59,6 +59,6 @@ "keywords": [ | ||
| "@metamask/key-tree": "^10.1.1", | ||
| "@metamask/permission-controller": "^11.0.6", | ||
| "@metamask/permission-controller": "^12.0.0", | ||
| "@metamask/rpc-errors": "^7.0.3", | ||
| "@metamask/snaps-sdk": "^10.0.0", | ||
| "@metamask/snaps-utils": "^11.6.0", | ||
| "@metamask/snaps-utils": "^11.6.1", | ||
| "@metamask/superstruct": "^3.2.1", | ||
@@ -72,2 +72,3 @@ "@metamask/utils": "^11.8.1", | ||
| "@metamask/json-rpc-engine": "^10.1.0", | ||
| "@metamask/messenger": "^0.3.0", | ||
| "@swc/core": "1.11.31", | ||
@@ -74,0 +75,0 @@ "@swc/jest": "^0.2.38", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Unidentified License
LicenseSomething that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Unidentified License
LicenseSomething that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
1825472
0.04%16
6.67%- Removed
- Removed
- Removed