Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Bump Snaps packages #29693

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 0 additions & 40 deletions .yarn/patches/luxon-npm-3.2.1-56f8d97395.patch

This file was deleted.

8 changes: 7 additions & 1 deletion app/scripts/controllers/permissions/specifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,19 @@ export const unrestrictedMethods = Object.freeze([
'wallet_invokeSnap',
'wallet_invokeKeyring',
'snap_getClientStatus',
'snap_getCurrencyRate',
'snap_clearState',
'snap_getFile',
'snap_getState',
'snap_createInterface',
'snap_updateInterface',
'snap_getInterfaceState',
'snap_getInterfaceContext',
'snap_resolveInterface',
'snap_getCurrencyRate',
'snap_setState',
'snap_scheduleBackgroundEvent',
'snap_cancelBackgroundEvent',
'snap_getBackgroundEvents',
///: BEGIN:ONLY_INCLUDE_IF(build-mmi)
'metamaskinstitutional_authenticate',
'metamaskinstitutional_reauthenticate',
Expand Down
47 changes: 45 additions & 2 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,7 @@ export default class MetamaskController extends EventEmitter {
'ExecutionService:unhandledError',
'ExecutionService:outboundRequest',
'ExecutionService:outboundResponse',
'KeyringController:lock',
],
allowedActions: [
`${this.permissionController.name}:getEndowments`,
Expand Down Expand Up @@ -2933,6 +2934,17 @@ export default class MetamaskController extends EventEmitter {
return currentLocale;
}

/**
* Gets whether the privacy mode is enabled from the PreferencesController.
*
* @returns {boolean} Whether the privacy mode is enabled.
*/
getPrivacyMode() {
const { privacyMode } = this.preferencesController.state;

return privacyMode;
}

/**
* Constructor helper for getting Snap permission specifications.
*/
Expand All @@ -2945,7 +2957,8 @@ export default class MetamaskController extends EventEmitter {
getPreferences: () => {
const locale = this.getLocale();
const currency = this.currencyRateController.state.currentCurrency;
return { locale, currency };
const hideBalances = this.getPrivacyMode();
return { locale, currency, hideBalances };
},
clearSnapState: this.controllerMessenger.call.bind(
this.controllerMessenger,
Expand Down Expand Up @@ -6261,6 +6274,11 @@ export default class MetamaskController extends EventEmitter {

engine.push(
createSnapsMethodMiddleware(subjectType === SubjectType.Snap, {
clearSnapState: this.controllerMessenger.call.bind(
this.controllerMessenger,
'SnapController:clearSnapState',
origin,
),
getUnlockPromise: this.appStateController.getUnlockPromise.bind(
this.appStateController,
),
Expand All @@ -6283,6 +6301,16 @@ export default class MetamaskController extends EventEmitter {
'SnapController:getFile',
origin,
),
getSnapState: this.controllerMessenger.call.bind(
this.controllerMessenger,
'SnapController:getSnapState',
origin,
),
updateSnapState: this.controllerMessenger.call.bind(
this.controllerMessenger,
'SnapController:updateSnapState',
origin,
),
installSnaps: this.controllerMessenger.call.bind(
this.controllerMessenger,
'SnapController:install',
Expand Down Expand Up @@ -6344,11 +6372,26 @@ export default class MetamaskController extends EventEmitter {
currency: fiatCurrency,
};
},
///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps)
hasPermission: this.permissionController.hasPermission.bind(
this.permissionController,
origin,
),
scheduleBackgroundEvent: (event) =>
this.controllerMessenger.call(
'CronjobController:scheduleBackgroundEvent',
{ ...event, snapId: origin },
),
cancelBackgroundEvent: this.controllerMessenger.call.bind(
this.controllerMessenger,
'CronjobController:cancelBackgroundEvent',
origin,
),
getBackgroundEvents: this.controllerMessenger.call.bind(
this.controllerMessenger,
'CronjobController:getBackgroundEvents',
origin,
),
///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps)
handleSnapRpcRequest: (args) =>
this.handleSnapRequest({ ...args, origin }),
getAllowedKeyringMethods: keyringSnapPermissionsBuilder(
Expand Down
8 changes: 4 additions & 4 deletions builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ buildTypes:
- ALLOW_LOCAL_SNAPS: false
- REQUIRE_SNAPS_ALLOWLIST: true
- REJECT_INVALID_SNAPS_PLATFORM_VERSION: true
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.11.0/index.html
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.12.0/index.html
- ACCOUNT_SNAPS_DIRECTORY_URL: https://snaps.metamask.io/account-management
# Main build uses the default browser manifest
manifestOverrides: false
Expand All @@ -48,7 +48,7 @@ buildTypes:
- ALLOW_LOCAL_SNAPS: false
- REQUIRE_SNAPS_ALLOWLIST: true
- REJECT_INVALID_SNAPS_PLATFORM_VERSION: true
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.11.0/index.html
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.12.0/index.html
- ACCOUNT_SNAPS_DIRECTORY_URL: https://snaps.metamask.io/account-management
# Modifies how the version is displayed.
# eg. instead of 10.25.0 -> 10.25.0-beta.2
Expand All @@ -71,7 +71,7 @@ buildTypes:
- ALLOW_LOCAL_SNAPS: true
- REQUIRE_SNAPS_ALLOWLIST: false
- REJECT_INVALID_SNAPS_PLATFORM_VERSION: false
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.11.0/index.html
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.12.0/index.html
- SUPPORT_LINK: https://support.metamask.io/
- SUPPORT_REQUEST_LINK: https://support.metamask.io/
- INFURA_ENV_KEY_REF: INFURA_FLASK_PROJECT_ID
Expand All @@ -95,7 +95,7 @@ buildTypes:
- ALLOW_LOCAL_SNAPS: false
- REQUIRE_SNAPS_ALLOWLIST: true
- REJECT_INVALID_SNAPS_PLATFORM_VERSION: true
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.11.0/index.html
- IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.12.0/index.html
- MMI_CONFIGURATION_SERVICE_URL: https://configuration.metamask-institutional.io/v2/configuration/default
- SUPPORT_LINK: https://support.metamask-institutional.io
- SUPPORT_REQUEST_LINK: https://support.metamask-institutional.io
Expand Down
Loading
Loading