{"version":3,"file":"TokenDetectionController-method-action-types.mjs","sourceRoot":"","sources":["../src/TokenDetectionController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { TokenDetectionController } from './TokenDetectionController';\n\n/**\n * Allows controller to make active and passive polling requests\n */\nexport type TokenDetectionControllerEnableAction = {\n  type: `TokenDetectionController:enable`;\n  handler: TokenDetectionController['enable'];\n};\n\n/**\n * Blocks controller from making network calls\n */\nexport type TokenDetectionControllerDisableAction = {\n  type: `TokenDetectionController:disable`;\n  handler: TokenDetectionController['disable'];\n};\n\n/**\n * Start polling for detected tokens.\n */\nexport type TokenDetectionControllerStartAction = {\n  type: `TokenDetectionController:start`;\n  handler: TokenDetectionController['start'];\n};\n\n/**\n * Stop polling for detected tokens.\n */\nexport type TokenDetectionControllerStopAction = {\n  type: `TokenDetectionController:stop`;\n  handler: TokenDetectionController['stop'];\n};\n\n/**\n * For each token in the token list provided by the TokenListController, checks the token's balance for the selected account address on the active network.\n * On mainnet, if token detection is disabled in preferences, ERC20 token auto detection will be triggered for each contract address in the legacy token list from the @metamask/contract-metadata repo.\n *\n * @param options - Options for token detection.\n * @param options.chainIds - The chain IDs of the network client to use.\n * @param options.selectedAddress - the selectedAddress against which to detect for token balances.\n * @param options.forceRpc - Force RPC-based token detection for all specified chains,\n * bypassing external services check and ensuring RPC is used even for chains\n * that might otherwise be handled by the Accounts API.\n */\nexport type TokenDetectionControllerDetectTokensAction = {\n  type: `TokenDetectionController:detectTokens`;\n  handler: TokenDetectionController['detectTokens'];\n};\n\n/**\n * Add tokens detected from websocket balance updates\n * This method:\n * - Checks if useTokenDetection preference is enabled (skips if disabled)\n * - Checks if external services are enabled (skips if disabled)\n * - Tokens are expected to be in the tokensChainsCache with full metadata\n * - Balance fetching is skipped since balances are provided by the websocket\n * - Ignored tokens have been filtered out by the caller\n *\n * @param options - The options object\n * @param options.tokensSlice - Array of token addresses detected from websocket (already filtered to exclude ignored tokens)\n * @param options.chainId - Hex chain ID\n * @returns Promise that resolves when tokens are added\n */\nexport type TokenDetectionControllerAddDetectedTokensViaWsAction = {\n  type: `TokenDetectionController:addDetectedTokensViaWs`;\n  handler: TokenDetectionController['addDetectedTokensViaWs'];\n};\n\n/**\n * Add tokens detected from polling balance updates\n * This method:\n * - Checks if useTokenDetection preference is enabled (skips if disabled)\n * - Checks if external services are enabled (skips if disabled)\n * - Filters out tokens already in allTokens or allIgnoredTokens\n * - Tokens are expected to be in the tokensChainsCache with full metadata\n * - Balance fetching is skipped since balances are provided by the caller\n *\n * @param options - The options object\n * @param options.tokensSlice - Array of token addresses detected from polling\n * @param options.chainId - Hex chain ID\n * @returns Promise that resolves when tokens are added\n */\nexport type TokenDetectionControllerAddDetectedTokensViaPollingAction = {\n  type: `TokenDetectionController:addDetectedTokensViaPolling`;\n  handler: TokenDetectionController['addDetectedTokensViaPolling'];\n};\n\n/**\n * Union of all TokenDetectionController action types.\n */\nexport type TokenDetectionControllerMethodActions =\n  | TokenDetectionControllerEnableAction\n  | TokenDetectionControllerDisableAction\n  | TokenDetectionControllerStartAction\n  | TokenDetectionControllerStopAction\n  | TokenDetectionControllerDetectTokensAction\n  | TokenDetectionControllerAddDetectedTokensViaWsAction\n  | TokenDetectionControllerAddDetectedTokensViaPollingAction;\n"]}