import type { BaseConfig, BaseState } from '@metamask/base-controller'; import { BaseController } from '@metamask/base-controller'; /** * ContactEntry representation. * * @property address - Hex address of a recipient account * @property name - Nickname associated with this address * @property importTime - Data time when an account as created/imported */ export interface ContactEntry { address: string; name: string; importTime?: number; } /** * @type PreferencesState * * Preferences controller state * @property featureFlags - Map of specific features to enable or disable * @property identities - Map of addresses to ContactEntry objects * @property lostIdentities - Map of lost addresses to ContactEntry objects * @property selectedAddress - Current coinbase account */ export interface PreferencesState extends BaseState { featureFlags: { [feature: string]: boolean; }; ipfsGateway: string; identities: { [address: string]: ContactEntry; }; lostIdentities: { [address: string]: ContactEntry; }; selectedAddress: string; useTokenDetection: boolean; useNftDetection: boolean; openSeaEnabled: boolean; securityAlertsEnabled: boolean; isMultiAccountBalancesEnabled: boolean; disabledRpcMethodPreferences: { [methodName: string]: boolean; }; showTestNetworks: boolean; } /** * Controller that stores shared settings and exposes convenience methods */ export declare class PreferencesController extends BaseController { /** * Name of this controller used during composition */ name: string; /** * Creates a PreferencesController instance. * * @param config - Initial options used to configure this controller. * @param state - Initial state to set on this controller. */ constructor(config?: Partial, state?: Partial); /** * Adds identities to state. * * @param addresses - List of addresses to use to generate new identities. */ addIdentities(addresses: string[]): void; /** * Removes an identity from state. * * @param address - Address of the identity to remove. */ removeIdentity(address: string): void; /** * Associates a new label with an identity. * * @param address - Address of the identity to associate. * @param label - New label to assign. */ setAccountLabel(address: string, label: string): void; /** * Enable or disable a specific feature flag. * * @param feature - Feature to toggle. * @param activated - Value to assign. */ setFeatureFlag(feature: string, activated: boolean): void; /** * Synchronizes the current identity list with new identities. * * @param addresses - List of addresses corresponding to identities to sync. * @returns Newly-selected address after syncing. */ syncIdentities(addresses: string[]): string; /** * Generates and stores a new list of stored identities based on address. If the selected address * is unset, or if it refers to an identity that was removed, it will be set to the first * identity. * * @param addresses - List of addresses to use as a basis for each identity. */ updateIdentities(addresses: string[]): void; /** * Sets selected address. * * @param selectedAddress - Ethereum address. */ setSelectedAddress(selectedAddress: string): void; /** * Sets new IPFS gateway. * * @param ipfsGateway - IPFS gateway string. */ setIpfsGateway(ipfsGateway: string): void; /** * Toggle the token detection setting. * * @param useTokenDetection - Boolean indicating user preference on token detection. */ setUseTokenDetection(useTokenDetection: boolean): void; /** * Toggle the NFT detection setting. * * @param useNftDetection - Boolean indicating user preference on NFT detection. */ setUseNftDetection(useNftDetection: boolean): void; /** * Toggle the opensea enabled setting. * * @param openSeaEnabled - Boolean indicating user preference on using OpenSea's API. */ setOpenSeaEnabled(openSeaEnabled: boolean): void; /** * Toggle the security alert enabled setting. * * @param securityAlertsEnabled - Boolean indicating user preference on using security alerts. */ setSecurityAlertsEnabled(securityAlertsEnabled: 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; /** * A setter for the user preferences to enable/disable fetch of multiple accounts balance. * * @param isMultiAccountBalancesEnabled - true to enable multiple accounts balance fetch, false to fetch only selectedAddress. */ setIsMultiAccountBalancesEnabled(isMultiAccountBalancesEnabled: boolean): void; /** * A setter for the user have the test networks visible/hidden. * * @param showTestNetworks - true to show test networks, false to hidden. */ setShowTestNetworks(showTestNetworks: boolean): void; } export default PreferencesController; //# sourceMappingURL=PreferencesController.d.ts.map