@metamask-previews/account-tree-controller 7.2.0-preview-938a7fe → 7.2.0-preview-55fbbe681

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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Added
11
+
12
+ - Expose missing public `AccountTreeController` methods through its messenger ([#8716](https://github.com/MetaMask/core/pull/8716))
13
+ - The following actions are now available:
14
+ - `AccountTreeController:init`
15
+ - `AccountTreeController:reinit`
16
+ - Corresponding action types are available as well.
17
+
10
18
  ## [7.2.0]
11
19
 
12
20
  ### Changed
@@ -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.\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 * 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"]}
@@ -3,6 +3,27 @@
3
3
  * Do not edit manually.
4
4
  */
5
5
  import type { AccountTreeController } from "./AccountTreeController.cjs";
6
+ /**
7
+ * Initialize the controller's state.
8
+ *
9
+ * It constructs the initial state of the account tree (tree nodes, nodes
10
+ * names, metadata, etc..) and will automatically update the controller's
11
+ * state with it.
12
+ */
13
+ export type AccountTreeControllerInitAction = {
14
+ type: `AccountTreeController:init`;
15
+ handler: AccountTreeController['init'];
16
+ };
17
+ /**
18
+ * Re-initialize the controller's state.
19
+ *
20
+ * This is done in one single (atomic) `update` block to avoid having a temporary
21
+ * cleared state. Use this when you need to force a full re-init even if already initialized.
22
+ */
23
+ export type AccountTreeControllerReinitAction = {
24
+ type: `AccountTreeController:reinit`;
25
+ handler: AccountTreeController['reinit'];
26
+ };
6
27
  /**
7
28
  * Gets the account wallet object from its ID.
8
29
  *
@@ -163,5 +184,5 @@ export type AccountTreeControllerSyncWithUserStorageAtLeastOnceAction = {
163
184
  /**
164
185
  * Union of all AccountTreeController action types.
165
186
  */
166
- export type AccountTreeControllerMethodActions = AccountTreeControllerGetAccountWalletObjectAction | AccountTreeControllerGetAccountWalletObjectsAction | AccountTreeControllerGetAccountsFromSelectedAccountGroupAction | AccountTreeControllerGetAccountGroupObjectAction | AccountTreeControllerGetAccountContextAction | AccountTreeControllerGetSelectedAccountGroupAction | AccountTreeControllerSetSelectedAccountGroupAction | AccountTreeControllerSetAccountGroupNameAction | AccountTreeControllerSetAccountWalletNameAction | AccountTreeControllerSetAccountGroupPinnedAction | AccountTreeControllerSetAccountGroupHiddenAction | AccountTreeControllerClearStateAction | AccountTreeControllerSyncWithUserStorageAction | AccountTreeControllerSyncWithUserStorageAtLeastOnceAction;
187
+ export type AccountTreeControllerMethodActions = AccountTreeControllerInitAction | AccountTreeControllerReinitAction | AccountTreeControllerGetAccountWalletObjectAction | AccountTreeControllerGetAccountWalletObjectsAction | AccountTreeControllerGetAccountsFromSelectedAccountGroupAction | AccountTreeControllerGetAccountGroupObjectAction | AccountTreeControllerGetAccountContextAction | AccountTreeControllerGetSelectedAccountGroupAction | AccountTreeControllerSetSelectedAccountGroupAction | AccountTreeControllerSetAccountGroupNameAction | AccountTreeControllerSetAccountWalletNameAction | AccountTreeControllerSetAccountGroupPinnedAction | AccountTreeControllerSetAccountGroupHiddenAction | AccountTreeControllerClearStateAction | AccountTreeControllerSyncWithUserStorageAction | AccountTreeControllerSyncWithUserStorageAtLeastOnceAction;
167
188
  //# sourceMappingURL=AccountTreeController-method-action-types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccountTreeController-method-action-types.d.cts","sourceRoot":"","sources":["../src/AccountTreeController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,oCAAgC;AAErE;;;;;GAKG;AACH,MAAM,MAAM,iDAAiD,GAAG;IAC9D,IAAI,EAAE,8CAA8C,CAAC;IACrD,O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ACxD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,gDAAgD,GAAG;IAC7D,IAAI,EAAE,6CAA6C,CAAC;IACpD,OAAO,EAAE,qBAAqB,CAAC,uBAAuB,CAAC,CAAC;CACzD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,gDAAgD,GAAG;IAC7D,IAAI,EAAE,6CAA6C,CAAC;IACpD,OAAO,EAAE,qBAAqB,CAAC,uBAAuB,CAAC,CAAC;CACzD,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,qCAAqC,GAAG;IAClD,IAAI,EAAE,kCAAkC,CAAC;IACzC,OAAO,EAAE,qBAAqB,CAAC,YAAY,CAAC,CAAC;CAC9C,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,8CAA8C,GAAG;IAC3D,IAAI,EAAE,2CAA2C,CAAC;IAClD,OAAO,EAAE,qBAAqB,CAAC,qBAAqB,CAAC,CAAC;CACvD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,yDAAyD,GAAG;IACtE,IAAI,EAAE,sDAAsD,CAAC;IAC7D,OAAO,EAAE,qBAAqB,CAAC,gCAAgC,CAAC,CAAC;CAClE,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kCAAkC,GAC1C,iDAAiD,GACjD,kDAAkD,GAClD,8DAA8D,GAC9D,gDAAgD,GAChD,4CAA4C,GAC5C,kDAAkD,GAClD,kDAAkD,GAClD,8CAA8C,GAC9C,+CAA+C,GAC/C,gDAAgD,GAChD,gDAAgD,GAChD,qCAAqC,GACrC,8CAA8C,GAC9C,yDAAyD,CAAC"}
1
+ {"version":3,"file":"AccountTreeController-method-action-types.d.cts","sourceRoot":"","sources":["../src/AccountTreeController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,oCAAgC;AAErE;;;;;;GAMG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,EA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AClD,kDAAkD,GAClD,8CAA8C,GAC9C,+CAA+C,GAC/C,gDAAgD,GAChD,gDAAgD,GAChD,qCAAqC,GACrC,8CAA8C,GAC9C,yDAAyD,CAAC"}
@@ -3,6 +3,27 @@
3
3
  * Do not edit manually.
4
4
  */
5
5
  import type { AccountTreeController } from "./AccountTreeController.mjs";
6
+ /**
7
+ * Initialize the controller's state.
8
+ *
9
+ * It constructs the initial state of the account tree (tree nodes, nodes
10
+ * names, metadata, etc..) and will automatically update the controller's
11
+ * state with it.
12
+ */
13
+ export type AccountTreeControllerInitAction = {
14
+ type: `AccountTreeController:init`;
15
+ handler: AccountTreeController['init'];
16
+ };
17
+ /**
18
+ * Re-initialize the controller's state.
19
+ *
20
+ * This is done in one single (atomic) `update` block to avoid having a temporary
21
+ * cleared state. Use this when you need to force a full re-init even if already initialized.
22
+ */
23
+ export type AccountTreeControllerReinitAction = {
24
+ type: `AccountTreeController:reinit`;
25
+ handler: AccountTreeController['reinit'];
26
+ };
6
27
  /**
7
28
  * Gets the account wallet object from its ID.
8
29
  *
@@ -163,5 +184,5 @@ export type AccountTreeControllerSyncWithUserStorageAtLeastOnceAction = {
163
184
  /**
164
185
  * Union of all AccountTreeController action types.
165
186
  */
166
- export type AccountTreeControllerMethodActions = AccountTreeControllerGetAccountWalletObjectAction | AccountTreeControllerGetAccountWalletObjectsAction | AccountTreeControllerGetAccountsFromSelectedAccountGroupAction | AccountTreeControllerGetAccountGroupObjectAction | AccountTreeControllerGetAccountContextAction | AccountTreeControllerGetSelectedAccountGroupAction | AccountTreeControllerSetSelectedAccountGroupAction | AccountTreeControllerSetAccountGroupNameAction | AccountTreeControllerSetAccountWalletNameAction | AccountTreeControllerSetAccountGroupPinnedAction | AccountTreeControllerSetAccountGroupHiddenAction | AccountTreeControllerClearStateAction | AccountTreeControllerSyncWithUserStorageAction | AccountTreeControllerSyncWithUserStorageAtLeastOnceAction;
187
+ export type AccountTreeControllerMethodActions = AccountTreeControllerInitAction | AccountTreeControllerReinitAction | AccountTreeControllerGetAccountWalletObjectAction | AccountTreeControllerGetAccountWalletObjectsAction | AccountTreeControllerGetAccountsFromSelectedAccountGroupAction | AccountTreeControllerGetAccountGroupObjectAction | AccountTreeControllerGetAccountContextAction | AccountTreeControllerGetSelectedAccountGroupAction | AccountTreeControllerSetSelectedAccountGroupAction | AccountTreeControllerSetAccountGroupNameAction | AccountTreeControllerSetAccountWalletNameAction | AccountTreeControllerSetAccountGroupPinnedAction | AccountTreeControllerSetAccountGroupHiddenAction | AccountTreeControllerClearStateAction | AccountTreeControllerSyncWithUserStorageAction | AccountTreeControllerSyncWithUserStorageAtLeastOnceAction;
167
188
  //# sourceMappingURL=AccountTreeController-method-action-types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccountTreeController-method-action-types.d.mts","sourceRoot":"","sources":["../src/AccountTreeController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,oCAAgC;AAErE;;;;;GAKG;AACH,MAAM,MAAM,iDAAiD,GAAG;IAC9D,IAAI,EAAE,8CAA8C,CAAC;IACrD,OAAO,EAAE,qBAAqB,CAAC,wBAAwB,CAAC,CAAC;CAC1D,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kDAAkD,GAAG;IAC/D,IAAI,EAAE,+CAA+C,CAAC;IACtD,OAAO,EAAE,qBAAqB,CAAC,yBAAyB,CAAC,CAAC;CAC3D,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,8DAA8D,GAAG;IAC3E,IAAI,EAAE,2DAA2D,CAAC;IAClE,OAAO,EAAE,qBAAqB,CAAC,qCAAqC,CAAC,CAAC;CACvE,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,gDAAgD,GAAG;IAC7D,IAAI,EAAE,6CAA6C,CAAC;IACpD,OAAO,EAAE,qBAAqB,CAAC,uBAAuB,CAAC,CAAC;CACzD,CAAC;AAEF;;;;;GAKG;AACH,M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C,CAAC;IAClD,OAAO,EAAE,qBAAqB,CAAC,qBAAqB,CAAC,CAAC;CACvD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,yDAAyD,GAAG;IACtE,IAAI,EAAE,sDAAsD,CAAC;IAC7D,OAAO,EAAE,qBAAqB,CAAC,gCAAgC,CAAC,CAAC;CAClE,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kCAAkC,GAC1C,iDAAiD,GACjD,kDAAkD,GAClD,8DAA8D,GAC9D,gDAAgD,GAChD,4CAA4C,GAC5C,kDAAkD,GAClD,kDAAkD,GAClD,8CAA8C,GAC9C,+CAA+C,GAC/C,gDAAgD,GAChD,gDAAgD,GAChD,qCAAqC,GACrC,8CAA8C,GAC9C,yDAAyD,CAAC"}
1
+ {"version":3,"file":"AccountTreeController-method-action-types.d.mts","sourceRoot":"","sources":["../src/AccountTreeController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,oCAAgC;AAErE;;;;;;GAMG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,EAAE,4BAA4B,CAAC;IACnC,OAAO,EAAE,qBAAqB,CAAC,MAAM,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,qBAAqB,CAAC,QAAQ,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,iDAAiD,GAAG;IAC9D,IAAI,EAAE,8CAA8C,CAAC;IACrD,OAAO,EAAE,qBAAqB,CAAC,wBAAwB,CAAC,CAAC;CAC1D,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kDAAkD,GAAG;IAC/D,IAAI,EAAE,+CAA+C,CAAC;IACtD,OAAO,EAAE,qBAAqB,CAAC,yBAAyB,CAAC,CAAC;CAC3D,CAAC;AAEF;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7D,IAAI,EAAE,6CAA6C,CAAC;IACpD,OAAO,EAAE,qBAAqB,CAAC,uBAAuB,CAAC,CAAC;CACzD,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,qCAAqC,GAAG;IAClD,IAAI,EAAE,kCAAkC,CAAC;IACzC,OAAO,EAAE,qBAAqB,CAAC,YAAY,CAAC,CAAC;CAC9C,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,8CAA8C,GAAG;IAC3D,IAAI,EAAE,2CAA2C,CAAC;IAClD,OAAO,EAAE,qBAAqB,CAAC,qBAAqB,CAAC,CAAC;CACvD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,yDAAyD,GAAG;IACtE,IAAI,EAAE,sDAAsD,CAAC;IAC7D,OAAO,EAAE,qBAAqB,CAAC,gCAAgC,CAAC,CAAC;CAClE,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kCAAkC,GAC1C,+BAA+B,GAC/B,iCAAiC,GACjC,iDAAiD,GACjD,kDAAkD,GAClD,8DAA8D,GAC9D,gDAAgD,GAChD,4CAA4C,GAC5C,kDAAkD,GAClD,kDAAkD,GAClD,8CAA8C,GAC9C,+CAA+C,GAC/C,gDAAgD,GAChD,gDAAgD,GAChD,qCAAqC,GACrC,8CAA8C,GAC9C,yDAAyD,CAAC"}
@@ -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.\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 * 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"]}
@@ -40,6 +40,8 @@ const MESSENGER_EXPOSED_METHODS = [
40
40
  'clearState',
41
41
  'syncWithUserStorage',
42
42
  'syncWithUserStorageAtLeastOnce',
43
+ 'init',
44
+ 'reinit',
43
45
  ];
44
46
  const accountTreeControllerMetadata = {
45
47
  accountTree: {