diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 33997ab115cf..c6151aa3acbc 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -1336,6 +1336,7 @@ export default class MetamaskController extends EventEmitter { const requireAllowlist = process.env.REQUIRE_SNAPS_ALLOWLIST; this.snapController = new SnapController({ + dynamicPermissions: ['endowment:caip25'], environmentEndowmentPermissions: Object.values(EndowmentPermissions), excludedPermissions: { ...ExcludedSnapPermissions, diff --git a/shared/constants/snaps/permissions.ts b/shared/constants/snaps/permissions.ts index 837beea4d9ff..58f411ea4903 100644 --- a/shared/constants/snaps/permissions.ts +++ b/shared/constants/snaps/permissions.ts @@ -20,6 +20,11 @@ export const ExcludedSnapPermissions = Object.freeze({ 'eth_accounts is disabled. For more information please see https://github.com/MetaMask/snaps/issues/990.', }); -export const ExcludedSnapEndowments = Object.freeze({}); +export const ExcludedSnapEndowments = Object.freeze({ + 'endowment:caip25': 'endowment:caip25', +}); -export const DynamicSnapPermissions = Object.freeze(['eth_accounts']); +export const DynamicSnapPermissions = Object.freeze([ + 'eth_accounts', + 'endowment:caip25', +]); diff --git a/test/e2e/snaps/test-snap-revoke-perm.spec.js b/test/e2e/snaps/test-snap-revoke-perm.spec.js index c75294ed5ec6..e0fdcd9291cb 100644 --- a/test/e2e/snaps/test-snap-revoke-perm.spec.js +++ b/test/e2e/snaps/test-snap-revoke-perm.spec.js @@ -8,8 +8,7 @@ const { const FixtureBuilder = require('../fixture-builder'); const { TEST_SNAPS_WEBSITE_URL } = require('./enums'); -// TODO: Resolve this before merging. I'm sure the linter will make sure of it though -describe.skip('Test Snap revoke permission', function () { +describe('Test Snap revoke permission', function () { it('can revoke a permission', async function () { await withFixtures( { @@ -119,7 +118,7 @@ describe.skip('Test Snap revoke permission', function () { }); // try to click on options menu - await driver.clickElement('[data-testid="eth_accounts"]'); + await driver.clickElement('[data-testid="endowment:caip25"]'); // try to click on revoke permission await driver.clickElement({ diff --git a/ui/helpers/utils/permission.js b/ui/helpers/utils/permission.js index b1d1856c40df..2924474f795c 100644 --- a/ui/helpers/utils/permission.js +++ b/ui/helpers/utils/permission.js @@ -55,6 +55,11 @@ export const PERMISSION_DESCRIPTIONS = deepFreeze({ leftIcon: IconName.Eye, weight: PermissionWeight.eth_accounts, }), + [EndowmentPermissions['endowment:caip25']]: ({ t }) => ({ + label: t('permission_ethereumAccounts'), + leftIcon: IconName.Eye, + weight: PermissionWeight.eth_accounts, + }), [PermissionNames.permittedChains]: ({ t }) => ({ label: t('permission_walletSwitchEthereumChain'), leftIcon: IconName.Wifi,