Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@metamask/preferences-controller

Package Overview
Dependencies
Maintainers
8
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metamask/preferences-controller - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

7

CHANGELOG.md

@@ -9,2 +9,6 @@ # Changelog

## [2.1.0]
### Added
- `disabledRpcMethodPreferences` state to PreferencesController ([#1109](https://github.com/MetaMask/core/pull/1109)). See [this PR on extension](https://github.com/MetaMask/metamask-extension/pull/17308) and [this ticket](https://github.com/MetaMask/metamask-mobile/issues/5676)
## [2.0.0]

@@ -33,3 +37,4 @@ ### Removed

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@2.0.0...HEAD
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@2.1.0...HEAD
[2.1.0]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@2.0.0...@metamask/preferences-controller@2.1.0
[2.0.0]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@1.0.2...@metamask/preferences-controller@2.0.0

@@ -36,0 +41,0 @@ [1.0.2]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@1.0.1...@metamask/preferences-controller@1.0.2

@@ -64,2 +64,5 @@ import { BaseController, BaseConfig, BaseState } from '@metamask/base-controller';

openSeaEnabled: boolean;
disabledRpcMethodPreferences: {
[methodName: string]: boolean;
};
}

@@ -168,3 +171,10 @@ /**

setOpenSeaEnabled(openSeaEnabled: boolean): void;
/**
* A setter for the user preferences to enable/disable rpc methods.
*
* @param methodName - The RPC method name to change the setting of.
* @param isEnabled - true to enable the rpc method, false to disable it.
*/
setDisabledRpcMethodPreference(methodName: string, isEnabled: boolean): void;
}
export default PreferencesController;

@@ -32,2 +32,5 @@ "use strict";

openSeaEnabled: false,
disabledRpcMethodPreferences: {
eth_sign: false,
},
};

@@ -241,2 +244,13 @@ this.initialize();

}
/**
* A setter for the user preferences to enable/disable rpc methods.
*
* @param methodName - The RPC method name to change the setting of.
* @param isEnabled - true to enable the rpc method, false to disable it.
*/
setDisabledRpcMethodPreference(methodName, isEnabled) {
const { disabledRpcMethodPreferences } = this.state;
const newDisabledRpcMethods = Object.assign(Object.assign({}, disabledRpcMethodPreferences), { [methodName]: isEnabled });
this.update({ disabledRpcMethodPreferences: newDisabledRpcMethods });
}
}

@@ -243,0 +257,0 @@ exports.PreferencesController = PreferencesController;

2

package.json
{
"name": "@metamask/preferences-controller",
"version": "2.0.0",
"version": "2.1.0",
"description": "Manages user-configurable settings for MetaMask",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc