@metamask-previews/account-tree-controller 5.0.1-preview-3ce0062c4 → 5.0.1-preview-dbd93752f

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * This file is auto generated by `scripts/generate-method-action-types.ts`.
3
+ * This file is auto generated.
4
4
  * Do not edit manually.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1 @@
1
- {"version":3,"file":"AccountTreeController-method-action-types.cjs","sourceRoot":"","sources":["../src/AccountTreeController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated by `scripts/generate-method-action-types.ts`.\n * Do not edit manually.\n */\n\nimport type { AccountTreeController } from './AccountTreeController';\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 | 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"]}
1
+ {"version":3,"file":"AccountTreeController-method-action-types.cjs","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 * 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 | 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"]}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file is auto generated by `scripts/generate-method-action-types.ts`.
2
+ * This file is auto generated.
3
3
  * Do not edit manually.
4
4
  */
5
5
  import type { AccountTreeController } from "./AccountTreeController.cjs";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file is auto generated by `scripts/generate-method-action-types.ts`.
2
+ * This file is auto generated.
3
3
  * Do not edit manually.
4
4
  */
5
5
  import type { AccountTreeController } from "./AccountTreeController.mjs";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file is auto generated by `scripts/generate-method-action-types.ts`.
2
+ * This file is auto generated.
3
3
  * Do not edit manually.
4
4
  */
5
5
  export {};
@@ -1 +1 @@
1
- {"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 by `scripts/generate-method-action-types.ts`.\n * Do not edit manually.\n */\n\nimport type { AccountTreeController } from './AccountTreeController';\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 | 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"]}
1
+ {"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 * 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 | 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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/account-tree-controller",
3
- "version": "5.0.1-preview-3ce0062c4",
3
+ "version": "5.0.1-preview-dbd93752f",
4
4
  "description": "Controller to group account together based on some pre-defined rules",
5
5
  "keywords": [
6
6
  "MetaMask",