PreferencesController Actions
20 actions registered.
PreferencesController:getState
Package: @metamask/preferences-controller
Handler signature:
() => PreferencesState
PreferencesController:setDismissSmartAccountSuggestionEnabled
Package: @metamask/preferences-controller
A setter for the user preferences dismiss smart account upgrade prompt.
Parameters:
| Name | Description |
|---|---|
dismissSmartAccountSuggestionEnabled | true to dismiss smart account upgrade prompt, false to enable it. |
Handler signature:
(dismissSmartAccountSuggestionEnabled: boolean) => void
PreferencesController:setDisplayNftMedia
Package: @metamask/preferences-controller
Toggle the display nft media enabled setting.
Parameters:
| Name | Description |
|---|---|
displayNftMedia | Boolean indicating user preference on using OpenSea's API. |
Handler signature:
(displayNftMedia: boolean) => void
PreferencesController:setEnableNetworkIncomingTransactions
Package: @metamask/preferences-controller
A setter for the user allow to be fetched IPFS content
Parameters:
| Name | Description |
|---|---|
chainId | On hexadecimal format to enable the incoming transaction network |
isIncomingTransactionNetworkEnable | true to enable incoming transactions |
Handler signature:
(chainId: EtherscanSupportedHexChainId, isIncomingTransactionNetworkEnable: boolean) => void
PreferencesController:setFeatureFlag
Package: @metamask/preferences-controller
Enable or disable a specific feature flag.
Parameters:
| Name | Description |
|---|---|
feature | Feature to toggle. |
activated | Value to assign. |
Handler signature:
(feature: string, activated: boolean) => void
PreferencesController:setIpfsGateway
Package: @metamask/preferences-controller
Sets new IPFS gateway.
Parameters:
| Name | Description |
|---|---|
ipfsGateway | IPFS gateway string. |
Handler signature:
(ipfsGateway: string) => void
PreferencesController:setIsIpfsGatewayEnabled
Package: @metamask/preferences-controller
A setter for the user allow to be fetched IPFS content
Parameters:
| Name | Description |
|---|---|
isIpfsGatewayEnabled | true to enable ipfs source |
Handler signature:
(isIpfsGatewayEnabled: boolean) => void
PreferencesController:setIsMultiAccountBalancesEnabled
Package: @metamask/preferences-controller
A setter for the user preferences to enable/disable fetch of multiple accounts balance.
Parameters:
| Name | Description |
|---|---|
isMultiAccountBalancesEnabled | true to enable multiple accounts balance fetch, false to fetch only selectedAddress. |
Handler signature:
(isMultiAccountBalancesEnabled: boolean) => void
PreferencesController:setPrivacyMode
Package: @metamask/preferences-controller
A setter for the user preferences to enable/disable privacy mode.
Parameters:
| Name | Description |
|---|---|
privacyMode | true to enable privacy mode, false to disable it. |
Handler signature:
(privacyMode: boolean) => void
PreferencesController:setSecurityAlertsEnabled
Package: @metamask/preferences-controller
Toggle the security alert enabled setting.
Parameters:
| Name | Description |
|---|---|
securityAlertsEnabled | Boolean indicating user preference on using security alerts. |
Handler signature:
(securityAlertsEnabled: boolean) => void
PreferencesController:setShowMultiRpcModal
Package: @metamask/preferences-controller
Toggle multi rpc migration modal.
Parameters:
| Name | Description |
|---|---|
showMultiRpcModal | Boolean indicating if the multi rpc modal will be displayed or not. |
Handler signature:
(showMultiRpcModal: boolean) => void
PreferencesController:setShowTestNetworks
Package: @metamask/preferences-controller
A setter for the user have the test networks visible/hidden.
Parameters:
| Name | Description |
|---|---|
showTestNetworks | true to show test networks, false to hidden. |
Handler signature:
(showTestNetworks: boolean) => void
PreferencesController:setSmartAccountOptIn
Package: @metamask/preferences-controller
A setter for the user preferences smart account OptIn.
Parameters:
| Name | Description |
|---|---|
smartAccountOptIn | true if user opts in for smart account update, false otherwise. |
Handler signature:
(smartAccountOptIn: boolean) => void
PreferencesController:setSmartTransactionsOptInStatus
Package: @metamask/preferences-controller
A setter for the user to opt into smart transactions
Parameters:
| Name | Description |
|---|---|
smartTransactionsOptInStatus | true to opt into smart transactions |
Handler signature:
(smartTransactionsOptInStatus: boolean) => void
PreferencesController:setTokenNetworkFilter
Package: @metamask/preferences-controller
Set the token network filter configuration setting.
Parameters:
| Name | Description |
|---|---|
tokenNetworkFilter | Object describing token network filter configuration. |
Handler signature:
(tokenNetworkFilter: Record<string, boolean>) => void
PreferencesController:setTokenSortConfig
Package: @metamask/preferences-controller
A setter to update the user's preferred token sorting order.
Parameters:
| Name | Description |
|---|---|
tokenSortConfig | a configuration representing the sort order of tokens. |
Handler signature:
(tokenSortConfig: TokenSortConfig) => void
PreferencesController:setUseNftDetection
Package: @metamask/preferences-controller
Toggle the NFT detection setting.
Parameters:
| Name | Description |
|---|---|
useNftDetection | Boolean indicating user preference on NFT detection. |
Handler signature:
(useNftDetection: boolean) => void
PreferencesController:setUseSafeChainsListValidation
Package: @metamask/preferences-controller
A setter for the user preferences to enable/disable safe chains list validation.
Parameters:
| Name | Description |
|---|---|
useSafeChainsListValidation | true to enable safe chains list validation, false to disable it. |
Handler signature:
(useSafeChainsListValidation: boolean) => void
PreferencesController:setUseTokenDetection
Package: @metamask/preferences-controller
Toggle the token detection setting.
Parameters:
| Name | Description |
|---|---|
useTokenDetection | Boolean indicating user preference on token detection. |
Handler signature:
(useTokenDetection: boolean) => void
PreferencesController:setUseTransactionSimulations
Package: @metamask/preferences-controller
A setter for the user preferences to enable/disable transaction simulations.
Parameters:
| Name | Description |
|---|---|
useTransactionSimulations | true to enable transaction simulations, false to disable it. |
Handler signature:
(useTransactionSimulations: boolean) => void