{"version":3,"file":"AccountTreeController-method-action-types.mjs","sourceRoot":"","sources":["../src/AccountTreeController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { AccountTreeController } from './AccountTreeController';\n\n/**\n * Initialize the controller's state.\n *\n * It constructs the initial state of the account tree (tree nodes, nodes\n * names, metadata, etc..) and will automatically update the controller's\n * state with it.\n */\nexport type AccountTreeControllerInitAction = {\n  type: `AccountTreeController:init`;\n  handler: AccountTreeController['init'];\n};\n\n/**\n * Re-initialize the controller's state.\n *\n * This is done in one single (atomic) `update` block to avoid having a temporary\n * cleared state. Use this when you need to force a full re-init even if already initialized.\n */\nexport type AccountTreeControllerReinitAction = {\n  type: `AccountTreeController:reinit`;\n  handler: AccountTreeController['reinit'];\n};\n\n/**\n * Gets the account wallet object from its ID.\n *\n * @param walletId - Account wallet ID.\n * @returns The account wallet object if found, undefined otherwise.\n */\nexport type AccountTreeControllerGetAccountWalletObjectAction = {\n  type: `AccountTreeController:getAccountWalletObject`;\n  handler: AccountTreeController['getAccountWalletObject'];\n};\n\n/**\n * Gets all account wallet objects.\n *\n * @returns All account wallet objects.\n */\nexport type AccountTreeControllerGetAccountWalletObjectsAction = {\n  type: `AccountTreeController:getAccountWalletObjects`;\n  handler: AccountTreeController['getAccountWalletObjects'];\n};\n\n/**\n * Gets all underlying accounts from the currently selected account\n * group.\n *\n * It also support account selector, which allows to filter specific\n * accounts given some criterias (account type, address, scopes, etc...).\n *\n * @param selector - Optional account selector.\n * @returns Underlying accounts for the currently selected account (filtered\n * by the selector if provided).\n */\nexport type AccountTreeControllerGetAccountsFromSelectedAccountGroupAction = {\n  type: `AccountTreeController:getAccountsFromSelectedAccountGroup`;\n  handler: AccountTreeController['getAccountsFromSelectedAccountGroup'];\n};\n\n/**\n * Gets the account group object from its ID.\n *\n * @param groupId - Account group ID.\n * @returns The account group object if found, undefined otherwise.\n */\nexport type AccountTreeControllerGetAccountGroupObjectAction = {\n  type: `AccountTreeController:getAccountGroupObject`;\n  handler: AccountTreeController['getAccountGroupObject'];\n};\n\n/**\n * Gets the account's context which contains its wallet ID, group ID, and sort order.\n *\n * @param accountId - Account ID.\n * @returns The account context if found, undefined otherwise.\n */\nexport type AccountTreeControllerGetAccountContextAction = {\n  type: `AccountTreeController:getAccountContext`;\n  handler: AccountTreeController['getAccountContext'];\n};\n\n/**\n * Gets the currently selected account group ID.\n *\n * @returns The selected account group ID or empty string if none selected.\n */\nexport type AccountTreeControllerGetSelectedAccountGroupAction = {\n  type: `AccountTreeController:getSelectedAccountGroup`;\n  handler: AccountTreeController['getSelectedAccountGroup'];\n};\n\n/**\n * Sets the selected account group and updates the AccountsController selectedAccount accordingly.\n *\n * @param groupId - The account group ID to select.\n */\nexport type AccountTreeControllerSetSelectedAccountGroupAction = {\n  type: `AccountTreeController:setSelectedAccountGroup`;\n  handler: AccountTreeController['setSelectedAccountGroup'];\n};\n\n/**\n * Sets a custom name for an account group.\n *\n * @param groupId - The account group ID.\n * @param name - The custom name to set.\n * @param autoHandleConflict - If true, automatically resolves name conflicts by adding a suffix. If false, throws on conflicts.\n * @throws If the account group ID is not found in the current tree.\n * @throws If the account group name already exists and autoHandleConflict is false.\n */\nexport type AccountTreeControllerSetAccountGroupNameAction = {\n  type: `AccountTreeController:setAccountGroupName`;\n  handler: AccountTreeController['setAccountGroupName'];\n};\n\n/**\n * Sets a custom name for an account wallet.\n *\n * @param walletId - The account wallet ID.\n * @param name - The custom name to set.\n * @throws If the account wallet ID is not found in the current tree.\n */\nexport type AccountTreeControllerSetAccountWalletNameAction = {\n  type: `AccountTreeController:setAccountWalletName`;\n  handler: AccountTreeController['setAccountWalletName'];\n};\n\n/**\n * Toggles the pinned state of an account group.\n *\n * @param groupId - The account group ID.\n * @param pinned - Whether the group should be pinned.\n * @throws If the account group ID is not found in the current tree.\n */\nexport type AccountTreeControllerSetAccountGroupPinnedAction = {\n  type: `AccountTreeController:setAccountGroupPinned`;\n  handler: AccountTreeController['setAccountGroupPinned'];\n};\n\n/**\n * Toggles the hidden state of an account group.\n *\n * @param groupId - The account group ID.\n * @param hidden - Whether the group should be hidden.\n * @throws If the account group ID is not found in the current tree.\n */\nexport type AccountTreeControllerSetAccountGroupHiddenAction = {\n  type: `AccountTreeController:setAccountGroupHidden`;\n  handler: AccountTreeController['setAccountGroupHidden'];\n};\n\n/**\n * Clears the controller state and resets to default values.\n * Also clears the backup and sync service state.\n */\nexport type AccountTreeControllerClearStateAction = {\n  type: `AccountTreeController:clearState`;\n  handler: AccountTreeController['clearState'];\n};\n\n/**\n * Bi-directionally syncs the account tree with user storage.\n * This will perform a full sync, including both pulling updates\n * from user storage and pushing local changes to user storage.\n * This also performs legacy account syncing if needed.\n *\n * IMPORTANT:\n * If a full sync is already in progress, it will return the ongoing promise.\n *\n * @returns A promise that resolves when the sync is complete.\n */\nexport type AccountTreeControllerSyncWithUserStorageAction = {\n  type: `AccountTreeController:syncWithUserStorage`;\n  handler: AccountTreeController['syncWithUserStorage'];\n};\n\n/**\n * Bi-directionally syncs the account tree with user storage.\n * This will ensure at least one full sync is ran, including both pulling updates\n * from user storage and pushing local changes to user storage.\n * This also performs legacy account syncing if needed.\n *\n * IMPORTANT:\n * If the first ever full sync is already in progress, it will return the ongoing promise.\n * If the first ever full sync was previously completed, it will NOT start a new sync, and will resolve immediately.\n *\n * @returns A promise that resolves when the first ever full sync is complete.\n */\nexport type AccountTreeControllerSyncWithUserStorageAtLeastOnceAction = {\n  type: `AccountTreeController:syncWithUserStorageAtLeastOnce`;\n  handler: AccountTreeController['syncWithUserStorageAtLeastOnce'];\n};\n\n/**\n * Union of all AccountTreeController action types.\n */\nexport type AccountTreeControllerMethodActions =\n  | AccountTreeControllerInitAction\n  | AccountTreeControllerReinitAction\n  | AccountTreeControllerGetAccountWalletObjectAction\n  | AccountTreeControllerGetAccountWalletObjectsAction\n  | AccountTreeControllerGetAccountsFromSelectedAccountGroupAction\n  | AccountTreeControllerGetAccountGroupObjectAction\n  | AccountTreeControllerGetAccountContextAction\n  | AccountTreeControllerGetSelectedAccountGroupAction\n  | AccountTreeControllerSetSelectedAccountGroupAction\n  | AccountTreeControllerSetAccountGroupNameAction\n  | AccountTreeControllerSetAccountWalletNameAction\n  | AccountTreeControllerSetAccountGroupPinnedAction\n  | AccountTreeControllerSetAccountGroupHiddenAction\n  | AccountTreeControllerClearStateAction\n  | AccountTreeControllerSyncWithUserStorageAction\n  | AccountTreeControllerSyncWithUserStorageAtLeastOnceAction;\n"]}