@metamask-previews/preferences-controller 23.1.0-preview-8bfa290fb → 24.0.0-preview-97d6b86c0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -9
- package/dist/{PreferencesController-method-action-types.d.mts → PreferencesController-method-action-types.d.ts} +2 -2
- package/dist/PreferencesController-method-action-types.d.ts.map +1 -0
- package/dist/{PreferencesController-method-action-types.mjs → PreferencesController-method-action-types.js} +1 -1
- package/dist/PreferencesController-method-action-types.js.map +1 -0
- package/dist/{PreferencesController.d.mts → PreferencesController.d.ts} +6 -6
- package/dist/PreferencesController.d.ts.map +1 -0
- package/dist/{PreferencesController.mjs → PreferencesController.js} +3 -3
- package/dist/PreferencesController.js.map +1 -0
- package/dist/constants.d.ts +26 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/{constants.mjs → constants.js} +1 -1
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/package.json +14 -18
- package/dist/PreferencesController-method-action-types.cjs +0 -7
- package/dist/PreferencesController-method-action-types.cjs.map +0 -1
- package/dist/PreferencesController-method-action-types.d.cts +0 -183
- package/dist/PreferencesController-method-action-types.d.cts.map +0 -1
- package/dist/PreferencesController-method-action-types.d.mts.map +0 -1
- package/dist/PreferencesController-method-action-types.mjs.map +0 -1
- package/dist/PreferencesController.cjs +0 -434
- package/dist/PreferencesController.cjs.map +0 -1
- package/dist/PreferencesController.d.cts +0 -251
- package/dist/PreferencesController.d.cts.map +0 -1
- package/dist/PreferencesController.d.mts.map +0 -1
- package/dist/PreferencesController.mjs.map +0 -1
- package/dist/constants.cjs +0 -29
- package/dist/constants.cjs.map +0 -1
- package/dist/constants.d.cts +0 -26
- package/dist/constants.d.cts.map +0 -1
- package/dist/constants.d.mts +0 -26
- package/dist/constants.d.mts.map +0 -1
- package/dist/constants.mjs.map +0 -1
- package/dist/index.cjs +0 -21
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -4
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts +0 -4
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs +0 -3
- package/dist/index.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,11 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [24.0.0]
|
|
11
|
+
|
|
10
12
|
### Changed
|
|
11
13
|
|
|
14
|
+
- **BREAKING:** Drop CommonJS support ([#9536](https://github.com/MetaMask/core/pull/9536))
|
|
15
|
+
- This package is now ESM-only, but can still be used in CommonJS projects via `require(esm)` in modern Node.js versions (22+), or dynamic imports in older Node.js versions.
|
|
16
|
+
- **BREAKING:** Bump minimum Node.js version to 22 ([#9976](https://github.com/MetaMask/core/pull/9976))
|
|
17
|
+
- **BREAKING:** Bump TypeScript target to ES2022 ([#10019](https://github.com/MetaMask/core/pull/10019))
|
|
18
|
+
- This package now ships ES2022 code, requiring a compatible modern environment or bundler configuration to consume.
|
|
12
19
|
- Bump `@metamask/utils` from `^11.9.0` to `^11.11.0` ([#9074](https://github.com/MetaMask/core/pull/9074))
|
|
13
|
-
- Bump `@metamask/messenger` from `^1.0.0` to `^
|
|
14
|
-
- Bump `@metamask/base-controller` from `^9.0.1` to `^
|
|
20
|
+
- Bump `@metamask/messenger` from `^1.0.0` to `^3.0.0` ([#8364](https://github.com/MetaMask/core/pull/8364), [#8373](https://github.com/MetaMask/core/pull/8373), [#8632](https://github.com/MetaMask/core/pull/8632), [#9392](https://github.com/MetaMask/core/pull/9392), [#10160](https://github.com/MetaMask/core/pull/10160))
|
|
21
|
+
- Bump `@metamask/base-controller` from `^9.0.1` to `^10.0.0` ([#8457](https://github.com/MetaMask/core/pull/8457), [#10160](https://github.com/MetaMask/core/pull/10160))
|
|
15
22
|
|
|
16
23
|
## [23.1.0]
|
|
17
24
|
|
|
@@ -52,7 +59,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
52
59
|
- **BREAKING:** Remove legacy methods and state ([#8115](https://github.com/MetaMask/core/pull/8115))
|
|
53
60
|
- `identities`, `lostIdentities` and `selectedAddress` along with any associated methods and types were removed.
|
|
54
61
|
- `setSmartAccountOptInForAccounts` was also removed as it is deprecated and not used in the clients.
|
|
55
|
-
- Removed `@metamask/keyring-controller` and `@metamask/controller-utils` dependencies ([#7995](https://github.com/MetaMask/core/pull/7995)
|
|
62
|
+
- Removed `@metamask/keyring-controller` and `@metamask/controller-utils` dependencies ([#7995](https://github.com/MetaMask/core/pull/7995), [#8115](https://github.com/MetaMask/core/pull/8115))
|
|
56
63
|
|
|
57
64
|
## [22.1.0]
|
|
58
65
|
|
|
@@ -211,8 +218,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
211
218
|
|
|
212
219
|
### Changed
|
|
213
220
|
|
|
214
|
-
- Bump `@metamask/base-controller` from `^7.0.2` to `^8.0.0` ([#5079](https://github.com/MetaMask/core/pull/5079)
|
|
215
|
-
- Bump `@metamask/controller-utils` from `^11.4.4` to `^11.5.0` ([#5135](https://github.com/MetaMask/core/pull/5135)
|
|
221
|
+
- Bump `@metamask/base-controller` from `^7.0.2` to `^8.0.0` ([#5079](https://github.com/MetaMask/core/pull/5079), [#5135](https://github.com/MetaMask/core/pull/5135), [#5305](https://github.com/MetaMask/core/pull/5305))
|
|
222
|
+
- Bump `@metamask/controller-utils` from `^11.4.4` to `^11.5.0` ([#5135](https://github.com/MetaMask/core/pull/5135), [#5272](https://github.com/MetaMask/core/pull/5272))
|
|
216
223
|
|
|
217
224
|
## [15.0.1]
|
|
218
225
|
|
|
@@ -224,7 +231,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
224
231
|
|
|
225
232
|
### Changed
|
|
226
233
|
|
|
227
|
-
- **BREAKING:** Bump `@metamask/keyring-controller` peer dependency from `^18.0.0` to `^19.0.0` ([#4195](https://github.com/MetaMask/core/pull/
|
|
234
|
+
- **BREAKING:** Bump `@metamask/keyring-controller` peer dependency from `^18.0.0` to `^19.0.0` ([#4195](https://github.com/MetaMask/core/pull/4195))
|
|
228
235
|
|
|
229
236
|
## [14.0.0]
|
|
230
237
|
|
|
@@ -277,7 +284,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
277
284
|
["Are the Types Wrong?"](https://arethetypeswrong.github.io/) tool as
|
|
278
285
|
["masquerading as CJS"](https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseCJS.md).
|
|
279
286
|
All of the ATTW checks now pass.
|
|
280
|
-
- Remove chunk files ([#4648](https://github.com/MetaMask/core/pull/4648))
|
|
287
|
+
- Remove chunk files. ([#4648](https://github.com/MetaMask/core/pull/4648))
|
|
281
288
|
- Previously, the build tool we used to generate JavaScript files extracted
|
|
282
289
|
common code to "chunk" files. While this was intended to make this package
|
|
283
290
|
more tree-shakeable, it also made debugging more difficult for our
|
|
@@ -505,7 +512,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
505
512
|
|
|
506
513
|
### Added
|
|
507
514
|
|
|
508
|
-
- `disabledRpcMethodPreferences` state to PreferencesController
|
|
515
|
+
- `disabledRpcMethodPreferences` state to PreferencesController. See [this PR on extension](https://github.com/MetaMask/metamask-extension/pull/17308) and [this ticket](https://github.com/MetaMask/metamask-mobile/issues/5676) ([#1109](https://github.com/MetaMask/core/pull/1109))
|
|
509
516
|
|
|
510
517
|
## [2.0.0]
|
|
511
518
|
|
|
@@ -538,7 +545,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
538
545
|
|
|
539
546
|
All changes listed after this point were applied to this package following the monorepo conversion.
|
|
540
547
|
|
|
541
|
-
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@
|
|
548
|
+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@24.0.0...HEAD
|
|
549
|
+
[24.0.0]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@23.1.0...@metamask/preferences-controller@24.0.0
|
|
542
550
|
[23.1.0]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@23.0.0...@metamask/preferences-controller@23.1.0
|
|
543
551
|
[23.0.0]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@22.1.0...@metamask/preferences-controller@23.0.0
|
|
544
552
|
[22.1.0]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@22.0.0...@metamask/preferences-controller@22.1.0
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* This file is auto generated.
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
*/
|
|
5
|
-
import type { PreferencesController } from
|
|
5
|
+
import type { PreferencesController } from './PreferencesController.js';
|
|
6
6
|
/**
|
|
7
7
|
* Enable or disable a specific feature flag.
|
|
8
8
|
*
|
|
@@ -180,4 +180,4 @@ export type PreferencesControllerSetTokenNetworkFilterAction = {
|
|
|
180
180
|
* Union of all PreferencesController action types.
|
|
181
181
|
*/
|
|
182
182
|
export type PreferencesControllerMethodActions = PreferencesControllerSetFeatureFlagAction | PreferencesControllerSetIpfsGatewayAction | PreferencesControllerSetUseTokenDetectionAction | PreferencesControllerSetUseNftDetectionAction | PreferencesControllerSetDisplayNftMediaAction | PreferencesControllerSetSecurityAlertsEnabledAction | PreferencesControllerSetIsMultiAccountBalancesEnabledAction | PreferencesControllerSetShowTestNetworksAction | PreferencesControllerSetIsIpfsGatewayEnabledAction | PreferencesControllerSetEnableNetworkIncomingTransactionsAction | PreferencesControllerSetShowMultiRpcModalAction | PreferencesControllerSetSmartTransactionsOptInStatusAction | PreferencesControllerSetUseTransactionSimulationsAction | PreferencesControllerSetTokenSortConfigAction | PreferencesControllerSetUseSafeChainsListValidationAction | PreferencesControllerSetPrivacyModeAction | PreferencesControllerSetDismissSmartAccountSuggestionEnabledAction | PreferencesControllerSetSmartAccountOptInAction | PreferencesControllerSetTokenNetworkFilterAction;
|
|
183
|
-
//# sourceMappingURL=PreferencesController-method-action-types.d.
|
|
183
|
+
//# sourceMappingURL=PreferencesController-method-action-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreferencesController-method-action-types.d.ts","sourceRoot":"","sources":["../src/PreferencesController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExE;;;;;GAKG;AACH,MAAM,MAAM,yCAAyC,GAAG;IACtD,IAAI,EAAE,sCAAsC,CAAC;IAC7C,OAAO,EAAE,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;CAClD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,yCAAyC,GAAG;IACtD,IAAI,EAAE,sCAAsC,CAAC;IAC7C,OAAO,EAAE,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;CAClD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,+CAA+C,GAAG;IAC5D,IAAI,EAAE,4CAA4C,CAAC;IACnD,OAAO,EAAE,qBAAqB,CAAC,sBAAsB,CAAC,CAAC;CACxD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,6CAA6C,GAAG;IAC1D,IAAI,EAAE,0CAA0C,CAAC;IACjD,OAAO,EAAE,qBAAqB,CAAC,oBAAoB,CAAC,CAAC;CACtD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,6CAA6C,GAAG;IAC1D,IAAI,EAAE,0CAA0C,CAAC;IACjD,OAAO,EAAE,qBAAqB,CAAC,oBAAoB,CAAC,CAAC;CACtD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,mDAAmD,GAAG;IAChE,IAAI,EAAE,gDAAgD,CAAC;IACvD,OAAO,EAAE,qBAAqB,CAAC,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,yDAAyD,GAAG;IACtE,IAAI,EAAE,sDAAsD,CAAC;IAC7D,OAAO,EAAE,qBAAqB,CAAC,gCAAgC,CAAC,CAAC;CAClE,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,yCAAyC,GAAG;IACtD,IAAI,EAAE,sCAAsC,CAAC;IAC7C,OAAO,EAAE,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;CAClD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kEAAkE,GAC5E;IACE,IAAI,EAAE,+DAA+D,CAAC;IACtE,OAAO,EAAE,qBAAqB,CAAC,yCAAyC,CAAC,CAAC;CAC3E,CAAC;AAEJ;;;;GAIG;AACH,MAAM,MAAM,+CAA+C,GAAG;IAC5D,IAAI,EAAE,4CAA4C,CAAC;IACnD,OAAO,EAAE,qBAAqB,CAAC,sBAAsB,CAAC,CAAC;CACxD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,gDAAgD,GAAG;IAC7D,IAAI,EAAE,6CAA6C,CAAC;IACpD,OAAO,EAAE,qBAAqB,CAAC,uBAAuB,CAAC,CAAC;CACzD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kCAAkC,GAC1C,yCAAyC,GACzC,yCAAyC,GACzC,+CAA+C,GAC/C,6CAA6C,GAC7C,6CAA6C,GAC7C,mDAAmD,GACnD,2DAA2D,GAC3D,8CAA8C,GAC9C,kDAAkD,GAClD,+DAA+D,GAC/D,+CAA+C,GAC/C,0DAA0D,GAC1D,uDAAuD,GACvD,6CAA6C,GAC7C,yDAAyD,GACzD,yCAAyC,GACzC,kEAAkE,GAClE,+CAA+C,GAC/C,gDAAgD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreferencesController-method-action-types.js","sourceRoot":"","sources":["../src/PreferencesController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { PreferencesController } from './PreferencesController.js';\n\n/**\n * Enable or disable a specific feature flag.\n *\n * @param feature - Feature to toggle.\n * @param activated - Value to assign.\n */\nexport type PreferencesControllerSetFeatureFlagAction = {\n type: `PreferencesController:setFeatureFlag`;\n handler: PreferencesController['setFeatureFlag'];\n};\n\n/**\n * Sets new IPFS gateway.\n *\n * @param ipfsGateway - IPFS gateway string.\n */\nexport type PreferencesControllerSetIpfsGatewayAction = {\n type: `PreferencesController:setIpfsGateway`;\n handler: PreferencesController['setIpfsGateway'];\n};\n\n/**\n * Toggle the token detection setting.\n *\n * @param useTokenDetection - Boolean indicating user preference on token detection.\n */\nexport type PreferencesControllerSetUseTokenDetectionAction = {\n type: `PreferencesController:setUseTokenDetection`;\n handler: PreferencesController['setUseTokenDetection'];\n};\n\n/**\n * Toggle the NFT detection setting.\n *\n * @param useNftDetection - Boolean indicating user preference on NFT detection.\n */\nexport type PreferencesControllerSetUseNftDetectionAction = {\n type: `PreferencesController:setUseNftDetection`;\n handler: PreferencesController['setUseNftDetection'];\n};\n\n/**\n * Toggle the display nft media enabled setting.\n *\n * @param displayNftMedia - Boolean indicating user preference on using OpenSea's API.\n */\nexport type PreferencesControllerSetDisplayNftMediaAction = {\n type: `PreferencesController:setDisplayNftMedia`;\n handler: PreferencesController['setDisplayNftMedia'];\n};\n\n/**\n * Toggle the security alert enabled setting.\n *\n * @param securityAlertsEnabled - Boolean indicating user preference on using security alerts.\n */\nexport type PreferencesControllerSetSecurityAlertsEnabledAction = {\n type: `PreferencesController:setSecurityAlertsEnabled`;\n handler: PreferencesController['setSecurityAlertsEnabled'];\n};\n\n/**\n * A setter for the user preferences to enable/disable fetch of multiple accounts balance.\n *\n * @param isMultiAccountBalancesEnabled - true to enable multiple accounts balance fetch, false to fetch only selectedAddress.\n */\nexport type PreferencesControllerSetIsMultiAccountBalancesEnabledAction = {\n type: `PreferencesController:setIsMultiAccountBalancesEnabled`;\n handler: PreferencesController['setIsMultiAccountBalancesEnabled'];\n};\n\n/**\n * A setter for the user have the test networks visible/hidden.\n *\n * @param showTestNetworks - true to show test networks, false to hidden.\n */\nexport type PreferencesControllerSetShowTestNetworksAction = {\n type: `PreferencesController:setShowTestNetworks`;\n handler: PreferencesController['setShowTestNetworks'];\n};\n\n/**\n * A setter for the user allow to be fetched IPFS content\n *\n * @param isIpfsGatewayEnabled - true to enable ipfs source\n */\nexport type PreferencesControllerSetIsIpfsGatewayEnabledAction = {\n type: `PreferencesController:setIsIpfsGatewayEnabled`;\n handler: PreferencesController['setIsIpfsGatewayEnabled'];\n};\n\n/**\n * A setter for the user allow to be fetched IPFS content\n *\n * @param chainId - On hexadecimal format to enable the incoming transaction network\n * @param isIncomingTransactionNetworkEnable - true to enable incoming transactions\n */\nexport type PreferencesControllerSetEnableNetworkIncomingTransactionsAction = {\n type: `PreferencesController:setEnableNetworkIncomingTransactions`;\n handler: PreferencesController['setEnableNetworkIncomingTransactions'];\n};\n\n/**\n * Toggle multi rpc migration modal.\n *\n * @param showMultiRpcModal - Boolean indicating if the multi rpc modal will be displayed or not.\n */\nexport type PreferencesControllerSetShowMultiRpcModalAction = {\n type: `PreferencesController:setShowMultiRpcModal`;\n handler: PreferencesController['setShowMultiRpcModal'];\n};\n\n/**\n * A setter for the user to opt into smart transactions\n *\n * @param smartTransactionsOptInStatus - true to opt into smart transactions\n */\nexport type PreferencesControllerSetSmartTransactionsOptInStatusAction = {\n type: `PreferencesController:setSmartTransactionsOptInStatus`;\n handler: PreferencesController['setSmartTransactionsOptInStatus'];\n};\n\n/**\n * A setter for the user preferences to enable/disable transaction simulations.\n *\n * @param useTransactionSimulations - true to enable transaction simulations, false to disable it.\n */\nexport type PreferencesControllerSetUseTransactionSimulationsAction = {\n type: `PreferencesController:setUseTransactionSimulations`;\n handler: PreferencesController['setUseTransactionSimulations'];\n};\n\n/**\n * A setter to update the user's preferred token sorting order.\n *\n * @param tokenSortConfig - a configuration representing the sort order of tokens.\n */\nexport type PreferencesControllerSetTokenSortConfigAction = {\n type: `PreferencesController:setTokenSortConfig`;\n handler: PreferencesController['setTokenSortConfig'];\n};\n\n/**\n * A setter for the user preferences to enable/disable safe chains list validation.\n *\n * @param useSafeChainsListValidation - true to enable safe chains list validation, false to disable it.\n */\nexport type PreferencesControllerSetUseSafeChainsListValidationAction = {\n type: `PreferencesController:setUseSafeChainsListValidation`;\n handler: PreferencesController['setUseSafeChainsListValidation'];\n};\n\n/**\n * A setter for the user preferences to enable/disable privacy mode.\n *\n * @param privacyMode - true to enable privacy mode, false to disable it.\n */\nexport type PreferencesControllerSetPrivacyModeAction = {\n type: `PreferencesController:setPrivacyMode`;\n handler: PreferencesController['setPrivacyMode'];\n};\n\n/**\n * A setter for the user preferences dismiss smart account upgrade prompt.\n *\n * @param dismissSmartAccountSuggestionEnabled - true to dismiss smart account upgrade prompt, false to enable it.\n */\nexport type PreferencesControllerSetDismissSmartAccountSuggestionEnabledAction =\n {\n type: `PreferencesController:setDismissSmartAccountSuggestionEnabled`;\n handler: PreferencesController['setDismissSmartAccountSuggestionEnabled'];\n };\n\n/**\n * A setter for the user preferences smart account OptIn.\n *\n * @param smartAccountOptIn - true if user opts in for smart account update, false otherwise.\n */\nexport type PreferencesControllerSetSmartAccountOptInAction = {\n type: `PreferencesController:setSmartAccountOptIn`;\n handler: PreferencesController['setSmartAccountOptIn'];\n};\n\n/**\n * Set the token network filter configuration setting.\n *\n * @param tokenNetworkFilter - Object describing token network filter configuration.\n */\nexport type PreferencesControllerSetTokenNetworkFilterAction = {\n type: `PreferencesController:setTokenNetworkFilter`;\n handler: PreferencesController['setTokenNetworkFilter'];\n};\n\n/**\n * Union of all PreferencesController action types.\n */\nexport type PreferencesControllerMethodActions =\n | PreferencesControllerSetFeatureFlagAction\n | PreferencesControllerSetIpfsGatewayAction\n | PreferencesControllerSetUseTokenDetectionAction\n | PreferencesControllerSetUseNftDetectionAction\n | PreferencesControllerSetDisplayNftMediaAction\n | PreferencesControllerSetSecurityAlertsEnabledAction\n | PreferencesControllerSetIsMultiAccountBalancesEnabledAction\n | PreferencesControllerSetShowTestNetworksAction\n | PreferencesControllerSetIsIpfsGatewayEnabledAction\n | PreferencesControllerSetEnableNetworkIncomingTransactionsAction\n | PreferencesControllerSetShowMultiRpcModalAction\n | PreferencesControllerSetSmartTransactionsOptInStatusAction\n | PreferencesControllerSetUseTransactionSimulationsAction\n | PreferencesControllerSetTokenSortConfigAction\n | PreferencesControllerSetUseSafeChainsListValidationAction\n | PreferencesControllerSetPrivacyModeAction\n | PreferencesControllerSetDismissSmartAccountSuggestionEnabledAction\n | PreferencesControllerSetSmartAccountOptInAction\n | PreferencesControllerSetTokenNetworkFilterAction;\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { BaseController } from
|
|
2
|
-
import type { ControllerStateChangeEvent, ControllerGetStateAction } from
|
|
3
|
-
import type { Messenger } from
|
|
4
|
-
import { ETHERSCAN_SUPPORTED_CHAIN_IDS } from
|
|
5
|
-
import type { PreferencesControllerMethodActions } from
|
|
1
|
+
import { BaseController } from '@metamask/base-controller';
|
|
2
|
+
import type { ControllerStateChangeEvent, ControllerGetStateAction } from '@metamask/base-controller';
|
|
3
|
+
import type { Messenger } from '@metamask/messenger';
|
|
4
|
+
import { ETHERSCAN_SUPPORTED_CHAIN_IDS } from './constants.js';
|
|
5
|
+
import type { PreferencesControllerMethodActions } from './PreferencesController-method-action-types.js';
|
|
6
6
|
/**
|
|
7
7
|
* A type union of the name for each chain that is supported by Etherscan or
|
|
8
8
|
* an Etherscan-compatible service.
|
|
@@ -248,4 +248,4 @@ export declare class PreferencesController extends BaseController<typeof name, P
|
|
|
248
248
|
setTokenNetworkFilter(tokenNetworkFilter: Record<string, boolean>): void;
|
|
249
249
|
}
|
|
250
250
|
export default PreferencesController;
|
|
251
|
-
//# sourceMappingURL=PreferencesController.d.
|
|
251
|
+
//# sourceMappingURL=PreferencesController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreferencesController.d.ts","sourceRoot":"","sources":["../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CAAC,iBAAiB,EAAE,OAAO,GAAG,IAAI,CAIrD;IAED;;;;OAIG;IACH,qBAAqB,CAAC,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAIvE;CACF;eAEc,qBAAqB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseController } from
|
|
2
|
-
import { ETHERSCAN_SUPPORTED_CHAIN_IDS } from
|
|
1
|
+
import { BaseController } from '@metamask/base-controller';
|
|
2
|
+
import { ETHERSCAN_SUPPORTED_CHAIN_IDS } from './constants.js';
|
|
3
3
|
const metadata = {
|
|
4
4
|
featureFlags: {
|
|
5
5
|
includeInStateLogs: true,
|
|
@@ -426,4 +426,4 @@ export class PreferencesController extends BaseController {
|
|
|
426
426
|
}
|
|
427
427
|
}
|
|
428
428
|
export default PreferencesController;
|
|
429
|
-
//# sourceMappingURL=PreferencesController.
|
|
429
|
+
//# sourceMappingURL=PreferencesController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreferencesController.js","sourceRoot":"","sources":["../src/PreferencesController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAO3D,OAAO,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AA2G/D,MAAM,QAAQ,GAAG;IACf,YAAY,EAAE;QACZ,kBAAkB,EAAE,IAAI;QACxB,OAAO,EAAE,IAAI;QACb,sBAAsB,EAAE,IAAI;QAC5B,QAAQ,EAAE,IAAI;KACf;IACD,WAAW,EAAE;QACX,kBAAkB,EAAE,IAAI;QACxB,OAAO,EAAE,IAAI;QACb,sBAAsB,EAAE,KAAK;QAC7B,QAAQ,EAAE,IAAI;KACf;IACD,oBAAoB,EAAE;QACpB,kBAAkB,EAAE,IAAI;QACxB,OAAO,EAAE,IAAI;QACb,sBAAsB,EAAE,IAAI;QAC5B,QAAQ,EAAE,IAAI;KACf;IACD,6BAA6B,EAAE;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G;IACH,kBAAkB,CAAC,eAAgC;QACjD,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;YACpB,KAAK,CAAC,eAAe,GAAG,eAAe,CAAC;QAC1C,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,8BAA8B,CAAC,2BAAoC;QACjE,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;YACpB,KAAK,CAAC,2BAA2B,GAAG,2BAA2B,CAAC;QAClE,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,cAAc,CAAC,WAAoB;QACjC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;YACpB,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,uCAAuC,CACrC,oCAA6C;QAE7C,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;YACpB,KAAK,CAAC,oCAAoC;gBACxC,oCAAoC,CAAC;QACzC,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,oBAAoB,CAAC,iBAA0B;QAC7C,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;YACpB,KAAK,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC9C,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,qBAAqB,CAAC,kBAA2C;QAC/D,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;YACpB,KAAK,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QAChD,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,eAAe,qBAAqB,CAAC","sourcesContent":["import { BaseController } from '@metamask/base-controller';\nimport type {\n ControllerStateChangeEvent,\n ControllerGetStateAction,\n} from '@metamask/base-controller';\nimport type { Messenger } from '@metamask/messenger';\n\nimport { ETHERSCAN_SUPPORTED_CHAIN_IDS } from './constants.js';\nimport type { PreferencesControllerMethodActions } from './PreferencesController-method-action-types.js';\n\n/**\n * A type union of the name for each chain that is supported by Etherscan or\n * an Etherscan-compatible service.\n */\nexport type EtherscanSupportedChains =\n keyof typeof ETHERSCAN_SUPPORTED_CHAIN_IDS;\n\n/**\n * A type union of the chain ID for each chain that is supported by Etherscan\n * or an Etherscan-compatible service.\n */\nexport type EtherscanSupportedHexChainId =\n (typeof ETHERSCAN_SUPPORTED_CHAIN_IDS)[EtherscanSupportedChains];\n\ntype TokenSortConfig = {\n key: string;\n order: 'asc' | 'dsc';\n sortCallback: string;\n};\n\n/**\n * Preferences controller state\n */\nexport type PreferencesState = {\n /**\n * Map of specific features to enable or disable\n */\n featureFlags: { [feature: string]: boolean };\n /**\n * The configured IPFS gateway\n */\n ipfsGateway: string;\n /**\n * Controls whether IPFS is enabled or not\n */\n isIpfsGatewayEnabled: boolean;\n /**\n * Controls whether multi-account balances are enabled or not\n */\n isMultiAccountBalancesEnabled: boolean;\n /**\n * Controls whether the OpenSea API is used\n */\n displayNftMedia: boolean;\n /**\n * Controls whether \"security alerts\" are enabled\n */\n securityAlertsEnabled: boolean;\n /**\n * Controls whether incoming transactions are enabled, per-chain (for Etherscan-supported chains)\n */\n showIncomingTransactions: {\n [chainId in EtherscanSupportedHexChainId]: boolean;\n };\n /**\n * Controls whether test networks are shown in the wallet\n */\n showTestNetworks: boolean;\n /**\n * Controls whether NFT detection is enabled\n */\n useNftDetection: boolean;\n /**\n * Controls whether token detection is enabled\n */\n useTokenDetection: boolean;\n /**\n * Controls whether smart transactions are opted into\n */\n smartTransactionsOptInStatus: boolean;\n /**\n * Controls whether transaction simulations are enabled\n */\n useTransactionSimulations: boolean;\n /**\n * Controls whether Multi rpc modal is displayed or not\n */\n showMultiRpcModal: boolean;\n /**\n * Controls whether to use the safe chains list validation\n */\n useSafeChainsListValidation: boolean;\n /**\n * Controls which order tokens are sorted in\n */\n tokenSortConfig: TokenSortConfig;\n /**\n * Controls whether balance and assets are hidden or not\n */\n privacyMode: boolean;\n /**\n * Allow user to stop being prompted for smart account upgrade\n */\n dismissSmartAccountSuggestionEnabled: boolean;\n /**\n * User to opt in for smart account upgrade for all user accounts.\n */\n smartAccountOptIn: boolean;\n /**\n * Controls token filtering controls\n */\n tokenNetworkFilter: Record<string, boolean>;\n};\n\nconst metadata = {\n featureFlags: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n ipfsGateway: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: false,\n usedInUi: true,\n },\n isIpfsGatewayEnabled: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n isMultiAccountBalancesEnabled: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n displayNftMedia: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n securityAlertsEnabled: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n showTestNetworks: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n showIncomingTransactions: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n useNftDetection: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n useTokenDetection: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n smartTransactionsOptInStatus: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: false,\n usedInUi: true,\n },\n useTransactionSimulations: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n showMultiRpcModal: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n useSafeChainsListValidation: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n tokenSortConfig: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n privacyMode: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n dismissSmartAccountSuggestionEnabled: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n smartAccountOptIn: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: true,\n usedInUi: true,\n },\n tokenNetworkFilter: {\n includeInStateLogs: true,\n persist: true,\n includeInDebugSnapshot: false,\n usedInUi: true,\n },\n};\n\nconst name = 'PreferencesController';\n\nconst MESSENGER_EXPOSED_METHODS = [\n 'setFeatureFlag',\n 'setIpfsGateway',\n 'setUseTokenDetection',\n 'setUseNftDetection',\n 'setDisplayNftMedia',\n 'setSecurityAlertsEnabled',\n 'setIsMultiAccountBalancesEnabled',\n 'setShowTestNetworks',\n 'setIsIpfsGatewayEnabled',\n 'setEnableNetworkIncomingTransactions',\n 'setShowMultiRpcModal',\n 'setSmartTransactionsOptInStatus',\n 'setUseTransactionSimulations',\n 'setTokenSortConfig',\n 'setUseSafeChainsListValidation',\n 'setPrivacyMode',\n 'setDismissSmartAccountSuggestionEnabled',\n 'setSmartAccountOptIn',\n 'setTokenNetworkFilter',\n] as const;\n\nexport type PreferencesControllerGetStateAction = ControllerGetStateAction<\n typeof name,\n PreferencesState\n>;\n\nexport type PreferencesControllerStateChangeEvent = ControllerStateChangeEvent<\n typeof name,\n PreferencesState\n>;\n\nexport type PreferencesControllerActions =\n | PreferencesControllerGetStateAction\n | PreferencesControllerMethodActions;\n\nexport type PreferencesControllerEvents = PreferencesControllerStateChangeEvent;\n\nexport type PreferencesControllerMessenger = Messenger<\n typeof name,\n PreferencesControllerActions,\n PreferencesControllerEvents\n>;\n\n/**\n * Get the default PreferencesController state.\n *\n * @returns The default PreferencesController state.\n */\nexport function getDefaultPreferencesState(): PreferencesState {\n return {\n featureFlags: {},\n ipfsGateway: 'https://ipfs.io/ipfs/',\n isIpfsGatewayEnabled: true,\n isMultiAccountBalancesEnabled: true,\n displayNftMedia: false,\n securityAlertsEnabled: false,\n showIncomingTransactions: {\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.MAINNET]: true,\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.GOERLI]: true,\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.BSC]: true,\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.BSC_TESTNET]: true,\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.OPTIMISM]: true,\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.OPTIMISM_SEPOLIA]: true,\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.POLYGON]: true,\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.POLYGON_TESTNET]: true,\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.AVALANCHE]: true,\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.AVALANCHE_TESTNET]: true,\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.FANTOM]: true,\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.FANTOM_TESTNET]: true,\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.SEPOLIA]: true,\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.LINEA_GOERLI]: true,\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.LINEA_SEPOLIA]: true,\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.LINEA_MAINNET]: true,\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.MOONBEAM]: true,\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.MOONBEAM_TESTNET]: true,\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.MOONRIVER]: true,\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.GNOSIS]: true,\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.SEI]: true,\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.MONAD]: true,\n [ETHERSCAN_SUPPORTED_CHAIN_IDS.HYPEREVM]: true,\n },\n showTestNetworks: false,\n useNftDetection: false,\n useTokenDetection: true,\n showMultiRpcModal: false,\n smartTransactionsOptInStatus: true,\n useTransactionSimulations: true,\n useSafeChainsListValidation: true,\n tokenSortConfig: {\n key: 'tokenFiatAmount',\n order: 'dsc',\n sortCallback: 'stringNumeric',\n },\n privacyMode: false,\n dismissSmartAccountSuggestionEnabled: false,\n smartAccountOptIn: true,\n tokenNetworkFilter: {},\n };\n}\n\n/**\n * Controller that stores shared settings and exposes convenience methods\n */\nexport class PreferencesController extends BaseController<\n typeof name,\n PreferencesState,\n PreferencesControllerMessenger\n> {\n /**\n * Creates a PreferencesController instance.\n *\n * @param args - Arguments\n * @param args.messenger - The preferences controller messenger.\n * @param args.state - Preferences controller state.\n */\n constructor({\n messenger,\n state,\n }: {\n messenger: PreferencesControllerMessenger;\n state?: Partial<PreferencesState>;\n }) {\n super({\n name,\n metadata,\n messenger,\n state: {\n ...getDefaultPreferencesState(),\n ...state,\n },\n });\n\n this.messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n }\n\n /**\n * Enable or disable a specific feature flag.\n *\n * @param feature - Feature to toggle.\n * @param activated - Value to assign.\n */\n setFeatureFlag(feature: string, activated: boolean): void {\n this.update((state) => {\n state.featureFlags[feature] = activated;\n });\n }\n\n /**\n * Sets new IPFS gateway.\n *\n * @param ipfsGateway - IPFS gateway string.\n */\n setIpfsGateway(ipfsGateway: string): void {\n this.update((state) => {\n state.ipfsGateway = ipfsGateway;\n });\n }\n\n /**\n * Toggle the token detection setting.\n *\n * @param useTokenDetection - Boolean indicating user preference on token detection.\n */\n setUseTokenDetection(useTokenDetection: boolean): void {\n this.update((state) => {\n state.useTokenDetection = useTokenDetection;\n });\n }\n\n /**\n * Toggle the NFT detection setting.\n *\n * @param useNftDetection - Boolean indicating user preference on NFT detection.\n */\n setUseNftDetection(useNftDetection: boolean): void {\n if (useNftDetection && !this.state.displayNftMedia) {\n throw new Error(\n 'useNftDetection cannot be enabled if displayNftMedia is false',\n );\n }\n this.update((state) => {\n state.useNftDetection = useNftDetection;\n });\n }\n\n /**\n * Toggle the display nft media enabled setting.\n *\n * @param displayNftMedia - Boolean indicating user preference on using OpenSea's API.\n */\n setDisplayNftMedia(displayNftMedia: boolean): void {\n this.update((state) => {\n state.displayNftMedia = displayNftMedia;\n if (!displayNftMedia) {\n state.useNftDetection = false;\n }\n });\n }\n\n /**\n * Toggle the security alert enabled setting.\n *\n * @param securityAlertsEnabled - Boolean indicating user preference on using security alerts.\n */\n setSecurityAlertsEnabled(securityAlertsEnabled: boolean): void {\n this.update((state) => {\n state.securityAlertsEnabled = securityAlertsEnabled;\n });\n }\n\n /**\n * A setter for the user preferences to enable/disable fetch of multiple accounts balance.\n *\n * @param isMultiAccountBalancesEnabled - true to enable multiple accounts balance fetch, false to fetch only selectedAddress.\n */\n setIsMultiAccountBalancesEnabled(\n isMultiAccountBalancesEnabled: boolean,\n ): void {\n this.update((state) => {\n state.isMultiAccountBalancesEnabled = isMultiAccountBalancesEnabled;\n });\n }\n\n /**\n * A setter for the user have the test networks visible/hidden.\n *\n * @param showTestNetworks - true to show test networks, false to hidden.\n */\n setShowTestNetworks(showTestNetworks: boolean): void {\n this.update((state) => {\n state.showTestNetworks = showTestNetworks;\n });\n }\n\n /**\n * A setter for the user allow to be fetched IPFS content\n *\n * @param isIpfsGatewayEnabled - true to enable ipfs source\n */\n setIsIpfsGatewayEnabled(isIpfsGatewayEnabled: boolean): void {\n this.update((state) => {\n state.isIpfsGatewayEnabled = isIpfsGatewayEnabled;\n });\n }\n\n /**\n * A setter for the user allow to be fetched IPFS content\n *\n * @param chainId - On hexadecimal format to enable the incoming transaction network\n * @param isIncomingTransactionNetworkEnable - true to enable incoming transactions\n */\n setEnableNetworkIncomingTransactions(\n chainId: EtherscanSupportedHexChainId,\n isIncomingTransactionNetworkEnable: boolean,\n ): void {\n if (Object.values(ETHERSCAN_SUPPORTED_CHAIN_IDS).includes(chainId)) {\n this.update((state) => {\n state.showIncomingTransactions = {\n ...this.state.showIncomingTransactions,\n [chainId]: isIncomingTransactionNetworkEnable,\n };\n });\n }\n }\n\n /**\n * Toggle multi rpc migration modal.\n *\n * @param showMultiRpcModal - Boolean indicating if the multi rpc modal will be displayed or not.\n */\n setShowMultiRpcModal(showMultiRpcModal: boolean): void {\n this.update((state) => {\n state.showMultiRpcModal = showMultiRpcModal;\n if (!showMultiRpcModal) {\n state.showMultiRpcModal = false;\n }\n });\n }\n\n /**\n * A setter for the user to opt into smart transactions\n *\n * @param smartTransactionsOptInStatus - true to opt into smart transactions\n */\n setSmartTransactionsOptInStatus(smartTransactionsOptInStatus: boolean): void {\n this.update((state) => {\n state.smartTransactionsOptInStatus = smartTransactionsOptInStatus;\n });\n }\n\n /**\n * A setter for the user preferences to enable/disable transaction simulations.\n *\n * @param useTransactionSimulations - true to enable transaction simulations, false to disable it.\n */\n setUseTransactionSimulations(useTransactionSimulations: boolean): void {\n this.update((state) => {\n state.useTransactionSimulations = useTransactionSimulations;\n });\n }\n\n /**\n * A setter to update the user's preferred token sorting order.\n *\n * @param tokenSortConfig - a configuration representing the sort order of tokens.\n */\n setTokenSortConfig(tokenSortConfig: TokenSortConfig): void {\n this.update((state) => {\n state.tokenSortConfig = tokenSortConfig;\n });\n }\n\n /**\n * A setter for the user preferences to enable/disable safe chains list validation.\n *\n * @param useSafeChainsListValidation - true to enable safe chains list validation, false to disable it.\n */\n setUseSafeChainsListValidation(useSafeChainsListValidation: boolean): void {\n this.update((state) => {\n state.useSafeChainsListValidation = useSafeChainsListValidation;\n });\n }\n\n /**\n * A setter for the user preferences to enable/disable privacy mode.\n *\n * @param privacyMode - true to enable privacy mode, false to disable it.\n */\n setPrivacyMode(privacyMode: boolean): void {\n this.update((state) => {\n state.privacyMode = privacyMode;\n });\n }\n\n /**\n * A setter for the user preferences dismiss smart account upgrade prompt.\n *\n * @param dismissSmartAccountSuggestionEnabled - true to dismiss smart account upgrade prompt, false to enable it.\n */\n setDismissSmartAccountSuggestionEnabled(\n dismissSmartAccountSuggestionEnabled: boolean,\n ): void {\n this.update((state) => {\n state.dismissSmartAccountSuggestionEnabled =\n dismissSmartAccountSuggestionEnabled;\n });\n }\n\n /**\n * A setter for the user preferences smart account OptIn.\n *\n * @param smartAccountOptIn - true if user opts in for smart account update, false otherwise.\n */\n setSmartAccountOptIn(smartAccountOptIn: boolean): void {\n this.update((state) => {\n state.smartAccountOptIn = smartAccountOptIn;\n });\n }\n\n /**\n * Set the token network filter configuration setting.\n *\n * @param tokenNetworkFilter - Object describing token network filter configuration.\n */\n setTokenNetworkFilter(tokenNetworkFilter: Record<string, boolean>): void {\n this.update((state) => {\n state.tokenNetworkFilter = tokenNetworkFilter;\n });\n }\n}\n\nexport default PreferencesController;\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const ETHERSCAN_SUPPORTED_CHAIN_IDS: {
|
|
2
|
+
readonly MAINNET: '0x1';
|
|
3
|
+
readonly GOERLI: '0x5';
|
|
4
|
+
readonly BSC: '0x38';
|
|
5
|
+
readonly BSC_TESTNET: '0x61';
|
|
6
|
+
readonly OPTIMISM: '0xa';
|
|
7
|
+
readonly OPTIMISM_SEPOLIA: '0xaa37dc';
|
|
8
|
+
readonly POLYGON: '0x89';
|
|
9
|
+
readonly POLYGON_TESTNET: '0x13881';
|
|
10
|
+
readonly AVALANCHE: '0xa86a';
|
|
11
|
+
readonly AVALANCHE_TESTNET: '0xa869';
|
|
12
|
+
readonly FANTOM: '0xfa';
|
|
13
|
+
readonly FANTOM_TESTNET: '0xfa2';
|
|
14
|
+
readonly SEPOLIA: '0xaa36a7';
|
|
15
|
+
readonly LINEA_GOERLI: '0xe704';
|
|
16
|
+
readonly LINEA_SEPOLIA: '0xe705';
|
|
17
|
+
readonly LINEA_MAINNET: '0xe708';
|
|
18
|
+
readonly MOONBEAM: '0x504';
|
|
19
|
+
readonly MOONBEAM_TESTNET: '0x507';
|
|
20
|
+
readonly MOONRIVER: '0x505';
|
|
21
|
+
readonly GNOSIS: '0x64';
|
|
22
|
+
readonly SEI: '0x531';
|
|
23
|
+
readonly MONAD: '0x8f';
|
|
24
|
+
readonly HYPEREVM: '0x3e7';
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B;aACxC,OAAO,EAAE,KAAK;aACd,MAAM,EAAE,KAAK;aACb,GAAG,EAAE,MAAM;aACX,WAAW,EAAE,MAAM;aACnB,QAAQ,EAAE,KAAK;aACf,gBAAgB,EAAE,UAAU;aAC5B,OAAO,EAAE,MAAM;aACf,eAAe,EAAE,SAAS;aAC1B,SAAS,EAAE,QAAQ;aACnB,iBAAiB,EAAE,QAAQ;aAC3B,MAAM,EAAE,MAAM;aACd,cAAc,EAAE,OAAO;aACvB,OAAO,EAAE,UAAU;aACnB,YAAY,EAAE,QAAQ;aACtB,aAAa,EAAE,QAAQ;aACvB,aAAa,EAAE,QAAQ;aACvB,QAAQ,EAAE,OAAO;aACjB,gBAAgB,EAAE,OAAO;aACzB,SAAS,EAAE,OAAO;aAClB,MAAM,EAAE,MAAM;aACd,GAAG,EAAE,OAAO;aACZ,KAAK,EAAE,MAAM;aACb,QAAQ,EAAE,OAAO;CACT,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,OAAO,EAAE,KAAK;IACd,MAAM,EAAE,KAAK;IACb,GAAG,EAAE,MAAM;IACX,WAAW,EAAE,MAAM;IACnB,QAAQ,EAAE,KAAK;IACf,gBAAgB,EAAE,UAAU;IAC5B,OAAO,EAAE,MAAM;IACf,eAAe,EAAE,SAAS;IAC1B,SAAS,EAAE,QAAQ;IACnB,iBAAiB,EAAE,QAAQ;IAC3B,MAAM,EAAE,MAAM;IACd,cAAc,EAAE,OAAO;IACvB,OAAO,EAAE,UAAU;IACnB,YAAY,EAAE,QAAQ;IACtB,aAAa,EAAE,QAAQ;IACvB,aAAa,EAAE,QAAQ;IACvB,QAAQ,EAAE,OAAO;IACjB,gBAAgB,EAAE,OAAO;IACzB,SAAS,EAAE,OAAO;IAClB,MAAM,EAAE,MAAM;IACd,GAAG,EAAE,OAAO;IACZ,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,OAAO;CACT,CAAC","sourcesContent":["export const ETHERSCAN_SUPPORTED_CHAIN_IDS = {\n MAINNET: '0x1',\n GOERLI: '0x5',\n BSC: '0x38',\n BSC_TESTNET: '0x61',\n OPTIMISM: '0xa',\n OPTIMISM_SEPOLIA: '0xaa37dc',\n POLYGON: '0x89',\n POLYGON_TESTNET: '0x13881',\n AVALANCHE: '0xa86a',\n AVALANCHE_TESTNET: '0xa869',\n FANTOM: '0xfa',\n FANTOM_TESTNET: '0xfa2',\n SEPOLIA: '0xaa36a7',\n LINEA_GOERLI: '0xe704',\n LINEA_SEPOLIA: '0xe705',\n LINEA_MAINNET: '0xe708',\n MOONBEAM: '0x504',\n MOONBEAM_TESTNET: '0x507',\n MOONRIVER: '0x505',\n GNOSIS: '0x64',\n SEI: '0x531',\n MONAD: '0x8f',\n HYPEREVM: '0x3e7',\n} as const;\n"]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,mBAAmB,gDAAgD,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAE3C,OAAO,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["export * from './PreferencesController.js';\nexport type * from './PreferencesController-method-action-types.js';\nexport { ETHERSCAN_SUPPORTED_CHAIN_IDS } from './constants.js';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/preferences-controller",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "24.0.0-preview-97d6b86c0",
|
|
4
4
|
"description": "Manages user-configurable settings for MetaMask",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ethereum",
|
|
@@ -18,19 +18,12 @@
|
|
|
18
18
|
"files": [
|
|
19
19
|
"dist/"
|
|
20
20
|
],
|
|
21
|
+
"type": "module",
|
|
21
22
|
"sideEffects": false,
|
|
22
|
-
"main": "./dist/index.cjs",
|
|
23
|
-
"types": "./dist/index.d.cts",
|
|
24
23
|
"exports": {
|
|
25
24
|
".": {
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
"default": "./dist/index.mjs"
|
|
29
|
-
},
|
|
30
|
-
"require": {
|
|
31
|
-
"types": "./dist/index.d.cts",
|
|
32
|
-
"default": "./dist/index.cjs"
|
|
33
|
-
}
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"default": "./dist/index.js"
|
|
34
27
|
},
|
|
35
28
|
"./package.json": "./package.json"
|
|
36
29
|
},
|
|
@@ -39,9 +32,11 @@
|
|
|
39
32
|
"registry": "https://registry.npmjs.org/"
|
|
40
33
|
},
|
|
41
34
|
"scripts": {
|
|
42
|
-
"build": "
|
|
43
|
-
"build:all": "
|
|
35
|
+
"build": "tsc --project tsconfig.build.json",
|
|
36
|
+
"build:all": "tsc --build tsconfig.build.json --verbose",
|
|
37
|
+
"build:clean": "yarn build:only-clean && yarn build",
|
|
44
38
|
"build:docs": "typedoc",
|
|
39
|
+
"build:only-clean": "rimraf './dist' './tsconfig.build.tsbuildinfo'",
|
|
45
40
|
"changelog:update": "../../scripts/update-changelog.sh @metamask/preferences-controller",
|
|
46
41
|
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/preferences-controller",
|
|
47
42
|
"lint:tsconfigs": "tsx ../../scripts/lint-tsconfigs/lint-tsconfigs.mts",
|
|
@@ -55,23 +50,24 @@
|
|
|
55
50
|
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
|
|
56
51
|
},
|
|
57
52
|
"dependencies": {
|
|
58
|
-
"@metamask/base-controller": "^
|
|
59
|
-
"@metamask/messenger": "^
|
|
53
|
+
"@metamask/base-controller": "^10.0.0",
|
|
54
|
+
"@metamask/messenger": "^3.0.0"
|
|
60
55
|
},
|
|
61
56
|
"devDependencies": {
|
|
62
57
|
"@metamask/auto-changelog": "^6.1.0",
|
|
63
58
|
"@metamask/utils": "^11.12.0",
|
|
64
|
-
"@ts-bridge/cli": "^0.6.4",
|
|
65
59
|
"@types/jest": "^30.0.0",
|
|
60
|
+
"@typescript/native": "npm:typescript@^7.0.2",
|
|
66
61
|
"deepmerge": "^4.2.2",
|
|
67
62
|
"jest": "^30.4.2",
|
|
63
|
+
"rimraf": "^5.0.5",
|
|
68
64
|
"ts-jest": "^29.4.11",
|
|
69
65
|
"tsx": "^4.20.5",
|
|
70
66
|
"typedoc": "^0.25.13",
|
|
71
67
|
"typedoc-plugin-missing-exports": "^2.0.0",
|
|
72
|
-
"typescript": "
|
|
68
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2"
|
|
73
69
|
},
|
|
74
70
|
"engines": {
|
|
75
|
-
"node": "^
|
|
71
|
+
"node": "^22.14.0 || ^24"
|
|
76
72
|
}
|
|
77
73
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PreferencesController-method-action-types.cjs","sourceRoot":"","sources":["../src/PreferencesController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { PreferencesController } from './PreferencesController.js';\n\n/**\n * Enable or disable a specific feature flag.\n *\n * @param feature - Feature to toggle.\n * @param activated - Value to assign.\n */\nexport type PreferencesControllerSetFeatureFlagAction = {\n type: `PreferencesController:setFeatureFlag`;\n handler: PreferencesController['setFeatureFlag'];\n};\n\n/**\n * Sets new IPFS gateway.\n *\n * @param ipfsGateway - IPFS gateway string.\n */\nexport type PreferencesControllerSetIpfsGatewayAction = {\n type: `PreferencesController:setIpfsGateway`;\n handler: PreferencesController['setIpfsGateway'];\n};\n\n/**\n * Toggle the token detection setting.\n *\n * @param useTokenDetection - Boolean indicating user preference on token detection.\n */\nexport type PreferencesControllerSetUseTokenDetectionAction = {\n type: `PreferencesController:setUseTokenDetection`;\n handler: PreferencesController['setUseTokenDetection'];\n};\n\n/**\n * Toggle the NFT detection setting.\n *\n * @param useNftDetection - Boolean indicating user preference on NFT detection.\n */\nexport type PreferencesControllerSetUseNftDetectionAction = {\n type: `PreferencesController:setUseNftDetection`;\n handler: PreferencesController['setUseNftDetection'];\n};\n\n/**\n * Toggle the display nft media enabled setting.\n *\n * @param displayNftMedia - Boolean indicating user preference on using OpenSea's API.\n */\nexport type PreferencesControllerSetDisplayNftMediaAction = {\n type: `PreferencesController:setDisplayNftMedia`;\n handler: PreferencesController['setDisplayNftMedia'];\n};\n\n/**\n * Toggle the security alert enabled setting.\n *\n * @param securityAlertsEnabled - Boolean indicating user preference on using security alerts.\n */\nexport type PreferencesControllerSetSecurityAlertsEnabledAction = {\n type: `PreferencesController:setSecurityAlertsEnabled`;\n handler: PreferencesController['setSecurityAlertsEnabled'];\n};\n\n/**\n * A setter for the user preferences to enable/disable fetch of multiple accounts balance.\n *\n * @param isMultiAccountBalancesEnabled - true to enable multiple accounts balance fetch, false to fetch only selectedAddress.\n */\nexport type PreferencesControllerSetIsMultiAccountBalancesEnabledAction = {\n type: `PreferencesController:setIsMultiAccountBalancesEnabled`;\n handler: PreferencesController['setIsMultiAccountBalancesEnabled'];\n};\n\n/**\n * A setter for the user have the test networks visible/hidden.\n *\n * @param showTestNetworks - true to show test networks, false to hidden.\n */\nexport type PreferencesControllerSetShowTestNetworksAction = {\n type: `PreferencesController:setShowTestNetworks`;\n handler: PreferencesController['setShowTestNetworks'];\n};\n\n/**\n * A setter for the user allow to be fetched IPFS content\n *\n * @param isIpfsGatewayEnabled - true to enable ipfs source\n */\nexport type PreferencesControllerSetIsIpfsGatewayEnabledAction = {\n type: `PreferencesController:setIsIpfsGatewayEnabled`;\n handler: PreferencesController['setIsIpfsGatewayEnabled'];\n};\n\n/**\n * A setter for the user allow to be fetched IPFS content\n *\n * @param chainId - On hexadecimal format to enable the incoming transaction network\n * @param isIncomingTransactionNetworkEnable - true to enable incoming transactions\n */\nexport type PreferencesControllerSetEnableNetworkIncomingTransactionsAction = {\n type: `PreferencesController:setEnableNetworkIncomingTransactions`;\n handler: PreferencesController['setEnableNetworkIncomingTransactions'];\n};\n\n/**\n * Toggle multi rpc migration modal.\n *\n * @param showMultiRpcModal - Boolean indicating if the multi rpc modal will be displayed or not.\n */\nexport type PreferencesControllerSetShowMultiRpcModalAction = {\n type: `PreferencesController:setShowMultiRpcModal`;\n handler: PreferencesController['setShowMultiRpcModal'];\n};\n\n/**\n * A setter for the user to opt into smart transactions\n *\n * @param smartTransactionsOptInStatus - true to opt into smart transactions\n */\nexport type PreferencesControllerSetSmartTransactionsOptInStatusAction = {\n type: `PreferencesController:setSmartTransactionsOptInStatus`;\n handler: PreferencesController['setSmartTransactionsOptInStatus'];\n};\n\n/**\n * A setter for the user preferences to enable/disable transaction simulations.\n *\n * @param useTransactionSimulations - true to enable transaction simulations, false to disable it.\n */\nexport type PreferencesControllerSetUseTransactionSimulationsAction = {\n type: `PreferencesController:setUseTransactionSimulations`;\n handler: PreferencesController['setUseTransactionSimulations'];\n};\n\n/**\n * A setter to update the user's preferred token sorting order.\n *\n * @param tokenSortConfig - a configuration representing the sort order of tokens.\n */\nexport type PreferencesControllerSetTokenSortConfigAction = {\n type: `PreferencesController:setTokenSortConfig`;\n handler: PreferencesController['setTokenSortConfig'];\n};\n\n/**\n * A setter for the user preferences to enable/disable safe chains list validation.\n *\n * @param useSafeChainsListValidation - true to enable safe chains list validation, false to disable it.\n */\nexport type PreferencesControllerSetUseSafeChainsListValidationAction = {\n type: `PreferencesController:setUseSafeChainsListValidation`;\n handler: PreferencesController['setUseSafeChainsListValidation'];\n};\n\n/**\n * A setter for the user preferences to enable/disable privacy mode.\n *\n * @param privacyMode - true to enable privacy mode, false to disable it.\n */\nexport type PreferencesControllerSetPrivacyModeAction = {\n type: `PreferencesController:setPrivacyMode`;\n handler: PreferencesController['setPrivacyMode'];\n};\n\n/**\n * A setter for the user preferences dismiss smart account upgrade prompt.\n *\n * @param dismissSmartAccountSuggestionEnabled - true to dismiss smart account upgrade prompt, false to enable it.\n */\nexport type PreferencesControllerSetDismissSmartAccountSuggestionEnabledAction =\n {\n type: `PreferencesController:setDismissSmartAccountSuggestionEnabled`;\n handler: PreferencesController['setDismissSmartAccountSuggestionEnabled'];\n };\n\n/**\n * A setter for the user preferences smart account OptIn.\n *\n * @param smartAccountOptIn - true if user opts in for smart account update, false otherwise.\n */\nexport type PreferencesControllerSetSmartAccountOptInAction = {\n type: `PreferencesController:setSmartAccountOptIn`;\n handler: PreferencesController['setSmartAccountOptIn'];\n};\n\n/**\n * Set the token network filter configuration setting.\n *\n * @param tokenNetworkFilter - Object describing token network filter configuration.\n */\nexport type PreferencesControllerSetTokenNetworkFilterAction = {\n type: `PreferencesController:setTokenNetworkFilter`;\n handler: PreferencesController['setTokenNetworkFilter'];\n};\n\n/**\n * Union of all PreferencesController action types.\n */\nexport type PreferencesControllerMethodActions =\n | PreferencesControllerSetFeatureFlagAction\n | PreferencesControllerSetIpfsGatewayAction\n | PreferencesControllerSetUseTokenDetectionAction\n | PreferencesControllerSetUseNftDetectionAction\n | PreferencesControllerSetDisplayNftMediaAction\n | PreferencesControllerSetSecurityAlertsEnabledAction\n | PreferencesControllerSetIsMultiAccountBalancesEnabledAction\n | PreferencesControllerSetShowTestNetworksAction\n | PreferencesControllerSetIsIpfsGatewayEnabledAction\n | PreferencesControllerSetEnableNetworkIncomingTransactionsAction\n | PreferencesControllerSetShowMultiRpcModalAction\n | PreferencesControllerSetSmartTransactionsOptInStatusAction\n | PreferencesControllerSetUseTransactionSimulationsAction\n | PreferencesControllerSetTokenSortConfigAction\n | PreferencesControllerSetUseSafeChainsListValidationAction\n | PreferencesControllerSetPrivacyModeAction\n | PreferencesControllerSetDismissSmartAccountSuggestionEnabledAction\n | PreferencesControllerSetSmartAccountOptInAction\n | PreferencesControllerSetTokenNetworkFilterAction;\n"]}
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is auto generated.
|
|
3
|
-
* Do not edit manually.
|
|
4
|
-
*/
|
|
5
|
-
import type { PreferencesController } from "./PreferencesController.cjs";
|
|
6
|
-
/**
|
|
7
|
-
* Enable or disable a specific feature flag.
|
|
8
|
-
*
|
|
9
|
-
* @param feature - Feature to toggle.
|
|
10
|
-
* @param activated - Value to assign.
|
|
11
|
-
*/
|
|
12
|
-
export type PreferencesControllerSetFeatureFlagAction = {
|
|
13
|
-
type: `PreferencesController:setFeatureFlag`;
|
|
14
|
-
handler: PreferencesController['setFeatureFlag'];
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Sets new IPFS gateway.
|
|
18
|
-
*
|
|
19
|
-
* @param ipfsGateway - IPFS gateway string.
|
|
20
|
-
*/
|
|
21
|
-
export type PreferencesControllerSetIpfsGatewayAction = {
|
|
22
|
-
type: `PreferencesController:setIpfsGateway`;
|
|
23
|
-
handler: PreferencesController['setIpfsGateway'];
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Toggle the token detection setting.
|
|
27
|
-
*
|
|
28
|
-
* @param useTokenDetection - Boolean indicating user preference on token detection.
|
|
29
|
-
*/
|
|
30
|
-
export type PreferencesControllerSetUseTokenDetectionAction = {
|
|
31
|
-
type: `PreferencesController:setUseTokenDetection`;
|
|
32
|
-
handler: PreferencesController['setUseTokenDetection'];
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Toggle the NFT detection setting.
|
|
36
|
-
*
|
|
37
|
-
* @param useNftDetection - Boolean indicating user preference on NFT detection.
|
|
38
|
-
*/
|
|
39
|
-
export type PreferencesControllerSetUseNftDetectionAction = {
|
|
40
|
-
type: `PreferencesController:setUseNftDetection`;
|
|
41
|
-
handler: PreferencesController['setUseNftDetection'];
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Toggle the display nft media enabled setting.
|
|
45
|
-
*
|
|
46
|
-
* @param displayNftMedia - Boolean indicating user preference on using OpenSea's API.
|
|
47
|
-
*/
|
|
48
|
-
export type PreferencesControllerSetDisplayNftMediaAction = {
|
|
49
|
-
type: `PreferencesController:setDisplayNftMedia`;
|
|
50
|
-
handler: PreferencesController['setDisplayNftMedia'];
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Toggle the security alert enabled setting.
|
|
54
|
-
*
|
|
55
|
-
* @param securityAlertsEnabled - Boolean indicating user preference on using security alerts.
|
|
56
|
-
*/
|
|
57
|
-
export type PreferencesControllerSetSecurityAlertsEnabledAction = {
|
|
58
|
-
type: `PreferencesController:setSecurityAlertsEnabled`;
|
|
59
|
-
handler: PreferencesController['setSecurityAlertsEnabled'];
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* A setter for the user preferences to enable/disable fetch of multiple accounts balance.
|
|
63
|
-
*
|
|
64
|
-
* @param isMultiAccountBalancesEnabled - true to enable multiple accounts balance fetch, false to fetch only selectedAddress.
|
|
65
|
-
*/
|
|
66
|
-
export type PreferencesControllerSetIsMultiAccountBalancesEnabledAction = {
|
|
67
|
-
type: `PreferencesController:setIsMultiAccountBalancesEnabled`;
|
|
68
|
-
handler: PreferencesController['setIsMultiAccountBalancesEnabled'];
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* A setter for the user have the test networks visible/hidden.
|
|
72
|
-
*
|
|
73
|
-
* @param showTestNetworks - true to show test networks, false to hidden.
|
|
74
|
-
*/
|
|
75
|
-
export type PreferencesControllerSetShowTestNetworksAction = {
|
|
76
|
-
type: `PreferencesController:setShowTestNetworks`;
|
|
77
|
-
handler: PreferencesController['setShowTestNetworks'];
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* A setter for the user allow to be fetched IPFS content
|
|
81
|
-
*
|
|
82
|
-
* @param isIpfsGatewayEnabled - true to enable ipfs source
|
|
83
|
-
*/
|
|
84
|
-
export type PreferencesControllerSetIsIpfsGatewayEnabledAction = {
|
|
85
|
-
type: `PreferencesController:setIsIpfsGatewayEnabled`;
|
|
86
|
-
handler: PreferencesController['setIsIpfsGatewayEnabled'];
|
|
87
|
-
};
|
|
88
|
-
/**
|
|
89
|
-
* A setter for the user allow to be fetched IPFS content
|
|
90
|
-
*
|
|
91
|
-
* @param chainId - On hexadecimal format to enable the incoming transaction network
|
|
92
|
-
* @param isIncomingTransactionNetworkEnable - true to enable incoming transactions
|
|
93
|
-
*/
|
|
94
|
-
export type PreferencesControllerSetEnableNetworkIncomingTransactionsAction = {
|
|
95
|
-
type: `PreferencesController:setEnableNetworkIncomingTransactions`;
|
|
96
|
-
handler: PreferencesController['setEnableNetworkIncomingTransactions'];
|
|
97
|
-
};
|
|
98
|
-
/**
|
|
99
|
-
* Toggle multi rpc migration modal.
|
|
100
|
-
*
|
|
101
|
-
* @param showMultiRpcModal - Boolean indicating if the multi rpc modal will be displayed or not.
|
|
102
|
-
*/
|
|
103
|
-
export type PreferencesControllerSetShowMultiRpcModalAction = {
|
|
104
|
-
type: `PreferencesController:setShowMultiRpcModal`;
|
|
105
|
-
handler: PreferencesController['setShowMultiRpcModal'];
|
|
106
|
-
};
|
|
107
|
-
/**
|
|
108
|
-
* A setter for the user to opt into smart transactions
|
|
109
|
-
*
|
|
110
|
-
* @param smartTransactionsOptInStatus - true to opt into smart transactions
|
|
111
|
-
*/
|
|
112
|
-
export type PreferencesControllerSetSmartTransactionsOptInStatusAction = {
|
|
113
|
-
type: `PreferencesController:setSmartTransactionsOptInStatus`;
|
|
114
|
-
handler: PreferencesController['setSmartTransactionsOptInStatus'];
|
|
115
|
-
};
|
|
116
|
-
/**
|
|
117
|
-
* A setter for the user preferences to enable/disable transaction simulations.
|
|
118
|
-
*
|
|
119
|
-
* @param useTransactionSimulations - true to enable transaction simulations, false to disable it.
|
|
120
|
-
*/
|
|
121
|
-
export type PreferencesControllerSetUseTransactionSimulationsAction = {
|
|
122
|
-
type: `PreferencesController:setUseTransactionSimulations`;
|
|
123
|
-
handler: PreferencesController['setUseTransactionSimulations'];
|
|
124
|
-
};
|
|
125
|
-
/**
|
|
126
|
-
* A setter to update the user's preferred token sorting order.
|
|
127
|
-
*
|
|
128
|
-
* @param tokenSortConfig - a configuration representing the sort order of tokens.
|
|
129
|
-
*/
|
|
130
|
-
export type PreferencesControllerSetTokenSortConfigAction = {
|
|
131
|
-
type: `PreferencesController:setTokenSortConfig`;
|
|
132
|
-
handler: PreferencesController['setTokenSortConfig'];
|
|
133
|
-
};
|
|
134
|
-
/**
|
|
135
|
-
* A setter for the user preferences to enable/disable safe chains list validation.
|
|
136
|
-
*
|
|
137
|
-
* @param useSafeChainsListValidation - true to enable safe chains list validation, false to disable it.
|
|
138
|
-
*/
|
|
139
|
-
export type PreferencesControllerSetUseSafeChainsListValidationAction = {
|
|
140
|
-
type: `PreferencesController:setUseSafeChainsListValidation`;
|
|
141
|
-
handler: PreferencesController['setUseSafeChainsListValidation'];
|
|
142
|
-
};
|
|
143
|
-
/**
|
|
144
|
-
* A setter for the user preferences to enable/disable privacy mode.
|
|
145
|
-
*
|
|
146
|
-
* @param privacyMode - true to enable privacy mode, false to disable it.
|
|
147
|
-
*/
|
|
148
|
-
export type PreferencesControllerSetPrivacyModeAction = {
|
|
149
|
-
type: `PreferencesController:setPrivacyMode`;
|
|
150
|
-
handler: PreferencesController['setPrivacyMode'];
|
|
151
|
-
};
|
|
152
|
-
/**
|
|
153
|
-
* A setter for the user preferences dismiss smart account upgrade prompt.
|
|
154
|
-
*
|
|
155
|
-
* @param dismissSmartAccountSuggestionEnabled - true to dismiss smart account upgrade prompt, false to enable it.
|
|
156
|
-
*/
|
|
157
|
-
export type PreferencesControllerSetDismissSmartAccountSuggestionEnabledAction = {
|
|
158
|
-
type: `PreferencesController:setDismissSmartAccountSuggestionEnabled`;
|
|
159
|
-
handler: PreferencesController['setDismissSmartAccountSuggestionEnabled'];
|
|
160
|
-
};
|
|
161
|
-
/**
|
|
162
|
-
* A setter for the user preferences smart account OptIn.
|
|
163
|
-
*
|
|
164
|
-
* @param smartAccountOptIn - true if user opts in for smart account update, false otherwise.
|
|
165
|
-
*/
|
|
166
|
-
export type PreferencesControllerSetSmartAccountOptInAction = {
|
|
167
|
-
type: `PreferencesController:setSmartAccountOptIn`;
|
|
168
|
-
handler: PreferencesController['setSmartAccountOptIn'];
|
|
169
|
-
};
|
|
170
|
-
/**
|
|
171
|
-
* Set the token network filter configuration setting.
|
|
172
|
-
*
|
|
173
|
-
* @param tokenNetworkFilter - Object describing token network filter configuration.
|
|
174
|
-
*/
|
|
175
|
-
export type PreferencesControllerSetTokenNetworkFilterAction = {
|
|
176
|
-
type: `PreferencesController:setTokenNetworkFilter`;
|
|
177
|
-
handler: PreferencesController['setTokenNetworkFilter'];
|
|
178
|
-
};
|
|
179
|
-
/**
|
|
180
|
-
* Union of all PreferencesController action types.
|
|
181
|
-
*/
|
|
182
|
-
export type PreferencesControllerMethodActions = PreferencesControllerSetFeatureFlagAction | PreferencesControllerSetIpfsGatewayAction | PreferencesControllerSetUseTokenDetectionAction | PreferencesControllerSetUseNftDetectionAction | PreferencesControllerSetDisplayNftMediaAction | PreferencesControllerSetSecurityAlertsEnabledAction | PreferencesControllerSetIsMultiAccountBalancesEnabledAction | PreferencesControllerSetShowTestNetworksAction | PreferencesControllerSetIsIpfsGatewayEnabledAction | PreferencesControllerSetEnableNetworkIncomingTransactionsAction | PreferencesControllerSetShowMultiRpcModalAction | PreferencesControllerSetSmartTransactionsOptInStatusAction | PreferencesControllerSetUseTransactionSimulationsAction | PreferencesControllerSetTokenSortConfigAction | PreferencesControllerSetUseSafeChainsListValidationAction | PreferencesControllerSetPrivacyModeAction | PreferencesControllerSetDismissSmartAccountSuggestionEnabledAction | PreferencesControllerSetSmartAccountOptInAction | PreferencesControllerSetTokenNetworkFilterAction;
|
|
183
|
-
//# sourceMappingURL=PreferencesController-method-action-types.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PreferencesController-method-action-types.d.cts","sourceRoot":"","sources":["../src/PreferencesController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,oCAAmC;AAExE;;;;;GAKG;AACH,MAAM,MAAM,yCAAyC,GAAG;IACtD,IAAI,EAAE,sCAAsC,CAAC;IAC7C,OAAO,EAAE,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;CAClD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,yCAAyC,GAAG;IACtD,IAAI,EAAE,sCAAsC,CAAC;IAC7C,OAAO,EAAE,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;CAClD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,+CAA+C,GAAG;IAC5D,IAAI,EAAE,4CAA4C,CAAC;IACnD,OAAO,EAAE,qBAAqB,CAAC,sBAAsB,CAAC,CAAC;CACxD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,6CAA6C,GAAG;IAC1D,IAAI,EAAE,0CAA0C,CAAC;IACjD,OAAO,EAAE,qBAAqB,CAAC,oBAAoB,CAAC,CAAC;CACtD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,6CA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C/C,gDAAgD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PreferencesController-method-action-types.d.mts","sourceRoot":"","sources":["../src/PreferencesController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,oCAAmC;AAExE;;;;;GAKG;AACH,MAAM,MAAM,yCAAyC,GAAG;IACtD,IAAI,EAAE,sCAAsC,CAAC;IAC7C,OAAO,EAAE,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;CAClD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,yCAAyC,GAAG;IACtD,IAAI,EAAE,sCAAsC,CAAC;IAC7C,OAAO,EAAE,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;CAClD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,+CAA+C,GAAG;IAC5D,IAAI,EAAE,4CAA4C,CAAC;IACnD,OAAO,EAAE,qBAAqB,CAAC,sBAAsB,CAAC,CAAC;CACxD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,6CAA6C,GAAG;IAC1D,IAAI,EAAE,0CAA0C,CAAC;IACjD,OAAO,EAAE,qBAAqB,CAAC,oBAAoB,CAAC,CAAC;CACtD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,6CAA6C,GAAG;IAC1D,IAAI,EAAE,0CAA0C,CAAC;IACjD,OAAO,EAAE,qBAAqB,CAAC,oBAAoB,CAAC,CAAC;CACtD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,mDAAmD,GAAG;IAChE,IAAI,EAAE,gDAAgD,CAAC;IACvD,OAAO,EAAE,qBAAqB,CAAC,0BAA0B,CAAC,CAAC;CAC5D,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,2DAA2D,GAAG;IACxE,IAAI,EAAE,wDAAwD,CAAC;IAC/D,OAAO,EAAE,qBAAqB,CAAC,kCAAkC,CAAC,CAAC;CACpE,CAAC;AAEF;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