@metamask-previews/account-tree-controller 4.0.0-preview-91e0d8c4 → 4.0.0-preview-e09bf49f

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/dist/types.d.mts CHANGED
@@ -47,6 +47,10 @@ export type AccountTreeControllerGetAccountsFromSelectedAccountGroupAction = {
47
47
  type: `${typeof controllerName}:getAccountsFromSelectedAccountGroup`;
48
48
  handler: AccountTreeController['getAccountsFromSelectedAccountGroup'];
49
49
  };
50
+ export type AccountTreeControllerGetAccountContextAction = {
51
+ type: `${typeof controllerName}:getAccountContext`;
52
+ handler: AccountTreeController['getAccountContext'];
53
+ };
50
54
  export type AccountTreeControllerSetAccountWalletNameAction = {
51
55
  type: `${typeof controllerName}:setAccountWalletName`;
52
56
  handler: AccountTreeController['setAccountWalletName'];
@@ -64,7 +68,7 @@ export type AccountTreeControllerSetAccountGroupPinnedAction = {
64
68
  handler: AccountTreeController['setAccountGroupPinned'];
65
69
  };
66
70
  export type AllowedActions = AccountsControllerGetAccountAction | AccountsControllerGetSelectedMultichainAccountAction | AccountsControllerListMultichainAccountsAction | AccountsControllerSetSelectedAccountAction | KeyringControllerGetStateAction | SnapControllerGetSnap | UserStorageController.UserStorageControllerGetStateAction | UserStorageController.UserStorageControllerPerformGetStorage | UserStorageController.UserStorageControllerPerformGetStorageAllFeatureEntries | UserStorageController.UserStorageControllerPerformSetStorage | UserStorageController.UserStorageControllerPerformBatchSetStorage | AuthenticationController.AuthenticationControllerGetSessionProfile | MultichainAccountServiceCreateMultichainAccountGroupAction;
67
- export type AccountTreeControllerActions = AccountTreeControllerGetStateAction | AccountTreeControllerSetSelectedAccountGroupAction | AccountTreeControllerGetSelectedAccountGroupAction | AccountTreeControllerGetAccountsFromSelectedAccountGroupAction | AccountTreeControllerSetAccountWalletNameAction | AccountTreeControllerSetAccountGroupNameAction | AccountTreeControllerSetAccountGroupPinnedAction | AccountTreeControllerSetAccountGroupHiddenAction;
71
+ export type AccountTreeControllerActions = AccountTreeControllerGetStateAction | AccountTreeControllerSetSelectedAccountGroupAction | AccountTreeControllerGetSelectedAccountGroupAction | AccountTreeControllerGetAccountsFromSelectedAccountGroupAction | AccountTreeControllerGetAccountContextAction | AccountTreeControllerSetAccountWalletNameAction | AccountTreeControllerSetAccountGroupNameAction | AccountTreeControllerSetAccountGroupPinnedAction | AccountTreeControllerSetAccountGroupHiddenAction;
68
72
  export type AccountTreeControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, AccountTreeControllerState>;
69
73
  /**
70
74
  * Represents the `AccountTreeController:accountTreeChange` event.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,8BAA8B;AAC7E,OAAO,KAAK,EACV,SAAS,EACT,mCAAmC,EACnC,qCAAqC,EACrC,kCAAkC,EAClC,oDAAoD,EACpD,8CAA8C,EAC9C,4CAA4C,EAC5C,0CAA0C,EAC3C,sCAAsC;AACvC,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC3B,kCAAkC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,mCAAmC;AAChE,OAAO,KAAK,EAAE,+BAA+B,EAAE,qCAAqC;AACpF,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AACrD,OAAO,KAAK,EAAE,0DAA0D,EAAE,6CAA6C;AACvH,OAAO,KAAK,EACV,wBAAwB,EACxB,qBAAqB,EACtB,0CAA0C;AAC3C,OAAO,KAAK,EAAE,OAAO,IAAI,qBAAqB,EAAE,oCAAoC;AAEpF,OAAO,KAAK,EACV,qBAAqB,EACrB,cAAc,EACf,oCAAgC;AACjC,OAAO,KAAK,EACV,kCAAkC,EAClC,qCAAqC,EACtC,8CAAoC;AACrC,OAAO,KAAK,EACV,kBAAkB,EAClB,iCAAiC,EAClC,oBAAgB;AACjB,OAAO,KAAK,EACV,m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AAC;AAEzD,MAAM,MAAM,8BAA8B,GAAG,SAAS,CACpD,OAAO,cAAc,EACrB,4BAA4B,GAAG,cAAc,EAC7C,2BAA2B,GAAG,aAAa,CAC5C,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,aAAa,CAAC,EAAE;QACd,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,kCAAkC,KAAK,IAAI,CAAC;KAC5E,CAAC;IACF,qBAAqB,CAAC,EAAE;QACtB,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO,CAAC;QACpD,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO,CAAC;KACrD,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,gDAAgD,GAAG;IAC7D,oBAAoB,EAAE,CAAC,KAAK,EAAE,qCAAqC,KAAK,IAAI,CAAC;CAC9E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountGroupId, AccountWalletId } from '@metamask/account-api';\nimport type {\n AccountId,\n AccountsControllerAccountAddedEvent,\n AccountsControllerAccountRemovedEvent,\n AccountsControllerGetAccountAction,\n AccountsControllerGetSelectedMultichainAccountAction,\n AccountsControllerListMultichainAccountsAction,\n AccountsControllerSelectedAccountChangeEvent,\n AccountsControllerSetSelectedAccountAction,\n} from '@metamask/accounts-controller';\nimport type {\n ControllerGetStateAction,\n ControllerStateChangeEvent,\n} from '@metamask/base-controller';\nimport type { TraceCallback } from '@metamask/controller-utils';\nimport type { KeyringControllerGetStateAction } from '@metamask/keyring-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { MultichainAccountServiceCreateMultichainAccountGroupAction } from '@metamask/multichain-account-service';\nimport type {\n AuthenticationController,\n UserStorageController,\n} from '@metamask/profile-sync-controller';\nimport type { GetSnap as SnapControllerGetSnap } from '@metamask/snaps-controllers';\n\nimport type {\n AccountTreeController,\n controllerName,\n} from './AccountTreeController';\nimport type {\n BackupAndSyncAnalyticsEventPayload,\n BackupAndSyncEmitAnalyticsEventParams,\n} from './backup-and-sync/analytics';\nimport type {\n AccountGroupObject,\n AccountTreeGroupPersistedMetadata,\n} from './group';\nimport type {\n AccountWalletObject,\n AccountTreeWalletPersistedMetadata,\n} from './wallet';\nimport type { MultichainAccountServiceWalletStatusChangeEvent } from '../../multichain-account-service/src/types';\n\n// Backward compatibility aliases using indexed access types\n/**\n * @deprecated Use AccountTreeGroupMetadata for tree objects or AccountTreeGroupPersistedMetadata for controller state\n */\nexport type AccountGroupMetadata = AccountGroupObject['metadata'];\n\n/**\n * @deprecated Use AccountTreeWalletMetadata for tree objects or AccountTreeWalletPersistedMetadata for controller state\n */\nexport type AccountWalletMetadata = AccountWalletObject['metadata'];\n\nexport type AccountTreeControllerState = {\n accountTree: {\n wallets: {\n // Wallets:\n [walletId: AccountWalletId]: AccountWalletObject;\n };\n selectedAccountGroup: AccountGroupId | '';\n };\n isAccountTreeSyncingInProgress: boolean;\n hasAccountTreeSyncingSyncedAtLeastOnce: boolean;\n /** Persistent metadata for account groups (names, pinning, hiding, sync timestamps) */\n accountGroupsMetadata: Record<\n AccountGroupId,\n AccountTreeGroupPersistedMetadata\n >;\n /** Persistent metadata for account wallets (names, sync timestamps) */\n accountWalletsMetadata: Record<\n AccountWalletId,\n AccountTreeWalletPersistedMetadata\n >;\n};\n\nexport type AccountTreeControllerGetStateAction = ControllerGetStateAction<\n typeof controllerName,\n AccountTreeControllerState\n>;\n\nexport type AccountTreeControllerSetSelectedAccountGroupAction = {\n type: `${typeof controllerName}:setSelectedAccountGroup`;\n handler: AccountTreeController['setSelectedAccountGroup'];\n};\n\nexport type AccountTreeControllerGetSelectedAccountGroupAction = {\n type: `${typeof controllerName}:getSelectedAccountGroup`;\n handler: AccountTreeController['getSelectedAccountGroup'];\n};\n\nexport type AccountTreeControllerGetAccountsFromSelectedAccountGroupAction = {\n type: `${typeof controllerName}:getAccountsFromSelectedAccountGroup`;\n handler: AccountTreeController['getAccountsFromSelectedAccountGroup'];\n};\n\nexport type AccountTreeControllerSetAccountWalletNameAction = {\n type: `${typeof controllerName}:setAccountWalletName`;\n handler: AccountTreeController['setAccountWalletName'];\n};\n\nexport type AccountTreeControllerSetAccountGroupNameAction = {\n type: `${typeof controllerName}:setAccountGroupName`;\n handler: AccountTreeController['setAccountGroupName'];\n};\n\nexport type AccountTreeControllerSetAccountGroupHiddenAction = {\n type: `${typeof controllerName}:setAccountGroupHidden`;\n handler: AccountTreeController['setAccountGroupHidden'];\n};\n\nexport type AccountTreeControllerSetAccountGroupPinnedAction = {\n type: `${typeof controllerName}:setAccountGroupPinned`;\n handler: AccountTreeController['setAccountGroupPinned'];\n};\n\nexport type AllowedActions =\n | AccountsControllerGetAccountAction\n | AccountsControllerGetSelectedMultichainAccountAction\n | AccountsControllerListMultichainAccountsAction\n | AccountsControllerSetSelectedAccountAction\n | KeyringControllerGetStateAction\n | SnapControllerGetSnap\n | UserStorageController.UserStorageControllerGetStateAction\n | UserStorageController.UserStorageControllerPerformGetStorage\n | UserStorageController.UserStorageControllerPerformGetStorageAllFeatureEntries\n | UserStorageController.UserStorageControllerPerformSetStorage\n | UserStorageController.UserStorageControllerPerformBatchSetStorage\n | AuthenticationController.AuthenticationControllerGetSessionProfile\n | MultichainAccountServiceCreateMultichainAccountGroupAction;\n\nexport type AccountTreeControllerActions =\n | AccountTreeControllerGetStateAction\n | AccountTreeControllerSetSelectedAccountGroupAction\n | AccountTreeControllerGetSelectedAccountGroupAction\n | AccountTreeControllerGetAccountsFromSelectedAccountGroupAction\n | AccountTreeControllerSetAccountWalletNameAction\n | AccountTreeControllerSetAccountGroupNameAction\n | AccountTreeControllerSetAccountGroupPinnedAction\n | AccountTreeControllerSetAccountGroupHiddenAction;\n\nexport type AccountTreeControllerStateChangeEvent = ControllerStateChangeEvent<\n typeof controllerName,\n AccountTreeControllerState\n>;\n\n/**\n * Represents the `AccountTreeController:accountTreeChange` event.\n * This event is emitted when nodes (wallets, groups, or accounts) are added or removed.\n */\nexport type AccountTreeControllerAccountTreeChangeEvent = {\n type: `${typeof controllerName}:accountTreeChange`;\n payload: [AccountTreeControllerState['accountTree']];\n};\n\n/**\n * Represents the `AccountTreeController:selectedAccountGroupChange` event.\n * This event is emitted when the selected account group changes.\n */\nexport type AccountTreeControllerSelectedAccountGroupChangeEvent = {\n type: `${typeof controllerName}:selectedAccountGroupChange`;\n payload: [AccountGroupId | '', AccountGroupId | ''];\n};\n\nexport type AllowedEvents =\n | AccountsControllerAccountAddedEvent\n | AccountsControllerAccountRemovedEvent\n | AccountsControllerSelectedAccountChangeEvent\n | UserStorageController.UserStorageControllerStateChangeEvent\n | MultichainAccountServiceWalletStatusChangeEvent;\n\nexport type AccountTreeControllerEvents =\n | AccountTreeControllerStateChangeEvent\n | AccountTreeControllerAccountTreeChangeEvent\n | AccountTreeControllerSelectedAccountGroupChangeEvent;\n\nexport type AccountTreeControllerMessenger = Messenger<\n typeof controllerName,\n AccountTreeControllerActions | AllowedActions,\n AccountTreeControllerEvents | AllowedEvents\n>;\n\nexport type AccountTreeControllerConfig = {\n trace?: TraceCallback;\n backupAndSync?: {\n onBackupAndSyncEvent?: (event: BackupAndSyncAnalyticsEventPayload) => void;\n };\n accountOrderCallbacks?: {\n isHiddenAccount?: (accountId: AccountId) => boolean;\n isPinnedAccount?: (accountId: AccountId) => boolean;\n };\n};\n\nexport type AccountTreeControllerInternalBackupAndSyncConfig = {\n emitAnalyticsEventFn: (event: BackupAndSyncEmitAnalyticsEventParams) => void;\n};\n"]}
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountGroupId, AccountWalletId } from '@metamask/account-api';\nimport type {\n AccountId,\n AccountsControllerAccountAddedEvent,\n AccountsControllerAccountRemovedEvent,\n AccountsControllerGetAccountAction,\n AccountsControllerGetSelectedMultichainAccountAction,\n AccountsControllerListMultichainAccountsAction,\n AccountsControllerSelectedAccountChangeEvent,\n AccountsControllerSetSelectedAccountAction,\n} from '@metamask/accounts-controller';\nimport type {\n ControllerGetStateAction,\n ControllerStateChangeEvent,\n} from '@metamask/base-controller';\nimport type { TraceCallback } from '@metamask/controller-utils';\nimport type { KeyringControllerGetStateAction } from '@metamask/keyring-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { MultichainAccountServiceCreateMultichainAccountGroupAction } from '@metamask/multichain-account-service';\nimport type {\n AuthenticationController,\n UserStorageController,\n} from '@metamask/profile-sync-controller';\nimport type { GetSnap as SnapControllerGetSnap } from '@metamask/snaps-controllers';\n\nimport type {\n AccountTreeController,\n controllerName,\n} from './AccountTreeController';\nimport type {\n BackupAndSyncAnalyticsEventPayload,\n BackupAndSyncEmitAnalyticsEventParams,\n} from './backup-and-sync/analytics';\nimport type {\n AccountGroupObject,\n AccountTreeGroupPersistedMetadata,\n} from './group';\nimport type {\n AccountWalletObject,\n AccountTreeWalletPersistedMetadata,\n} from './wallet';\nimport type { MultichainAccountServiceWalletStatusChangeEvent } from '../../multichain-account-service/src/types';\n\n// Backward compatibility aliases using indexed access types\n/**\n * @deprecated Use AccountTreeGroupMetadata for tree objects or AccountTreeGroupPersistedMetadata for controller state\n */\nexport type AccountGroupMetadata = AccountGroupObject['metadata'];\n\n/**\n * @deprecated Use AccountTreeWalletMetadata for tree objects or AccountTreeWalletPersistedMetadata for controller state\n */\nexport type AccountWalletMetadata = AccountWalletObject['metadata'];\n\nexport type AccountTreeControllerState = {\n accountTree: {\n wallets: {\n // Wallets:\n [walletId: AccountWalletId]: AccountWalletObject;\n };\n selectedAccountGroup: AccountGroupId | '';\n };\n isAccountTreeSyncingInProgress: boolean;\n hasAccountTreeSyncingSyncedAtLeastOnce: boolean;\n /** Persistent metadata for account groups (names, pinning, hiding, sync timestamps) */\n accountGroupsMetadata: Record<\n AccountGroupId,\n AccountTreeGroupPersistedMetadata\n >;\n /** Persistent metadata for account wallets (names, sync timestamps) */\n accountWalletsMetadata: Record<\n AccountWalletId,\n AccountTreeWalletPersistedMetadata\n >;\n};\n\nexport type AccountTreeControllerGetStateAction = ControllerGetStateAction<\n typeof controllerName,\n AccountTreeControllerState\n>;\n\nexport type AccountTreeControllerSetSelectedAccountGroupAction = {\n type: `${typeof controllerName}:setSelectedAccountGroup`;\n handler: AccountTreeController['setSelectedAccountGroup'];\n};\n\nexport type AccountTreeControllerGetSelectedAccountGroupAction = {\n type: `${typeof controllerName}:getSelectedAccountGroup`;\n handler: AccountTreeController['getSelectedAccountGroup'];\n};\n\nexport type AccountTreeControllerGetAccountsFromSelectedAccountGroupAction = {\n type: `${typeof controllerName}:getAccountsFromSelectedAccountGroup`;\n handler: AccountTreeController['getAccountsFromSelectedAccountGroup'];\n};\n\nexport type AccountTreeControllerGetAccountContextAction = {\n type: `${typeof controllerName}:getAccountContext`;\n handler: AccountTreeController['getAccountContext'];\n};\n\nexport type AccountTreeControllerSetAccountWalletNameAction = {\n type: `${typeof controllerName}:setAccountWalletName`;\n handler: AccountTreeController['setAccountWalletName'];\n};\n\nexport type AccountTreeControllerSetAccountGroupNameAction = {\n type: `${typeof controllerName}:setAccountGroupName`;\n handler: AccountTreeController['setAccountGroupName'];\n};\n\nexport type AccountTreeControllerSetAccountGroupHiddenAction = {\n type: `${typeof controllerName}:setAccountGroupHidden`;\n handler: AccountTreeController['setAccountGroupHidden'];\n};\n\nexport type AccountTreeControllerSetAccountGroupPinnedAction = {\n type: `${typeof controllerName}:setAccountGroupPinned`;\n handler: AccountTreeController['setAccountGroupPinned'];\n};\n\nexport type AllowedActions =\n | AccountsControllerGetAccountAction\n | AccountsControllerGetSelectedMultichainAccountAction\n | AccountsControllerListMultichainAccountsAction\n | AccountsControllerSetSelectedAccountAction\n | KeyringControllerGetStateAction\n | SnapControllerGetSnap\n | UserStorageController.UserStorageControllerGetStateAction\n | UserStorageController.UserStorageControllerPerformGetStorage\n | UserStorageController.UserStorageControllerPerformGetStorageAllFeatureEntries\n | UserStorageController.UserStorageControllerPerformSetStorage\n | UserStorageController.UserStorageControllerPerformBatchSetStorage\n | AuthenticationController.AuthenticationControllerGetSessionProfile\n | MultichainAccountServiceCreateMultichainAccountGroupAction;\n\nexport type AccountTreeControllerActions =\n | AccountTreeControllerGetStateAction\n | AccountTreeControllerSetSelectedAccountGroupAction\n | AccountTreeControllerGetSelectedAccountGroupAction\n | AccountTreeControllerGetAccountsFromSelectedAccountGroupAction\n | AccountTreeControllerGetAccountContextAction\n | AccountTreeControllerSetAccountWalletNameAction\n | AccountTreeControllerSetAccountGroupNameAction\n | AccountTreeControllerSetAccountGroupPinnedAction\n | AccountTreeControllerSetAccountGroupHiddenAction;\n\nexport type AccountTreeControllerStateChangeEvent = ControllerStateChangeEvent<\n typeof controllerName,\n AccountTreeControllerState\n>;\n\n/**\n * Represents the `AccountTreeController:accountTreeChange` event.\n * This event is emitted when nodes (wallets, groups, or accounts) are added or removed.\n */\nexport type AccountTreeControllerAccountTreeChangeEvent = {\n type: `${typeof controllerName}:accountTreeChange`;\n payload: [AccountTreeControllerState['accountTree']];\n};\n\n/**\n * Represents the `AccountTreeController:selectedAccountGroupChange` event.\n * This event is emitted when the selected account group changes.\n */\nexport type AccountTreeControllerSelectedAccountGroupChangeEvent = {\n type: `${typeof controllerName}:selectedAccountGroupChange`;\n payload: [AccountGroupId | '', AccountGroupId | ''];\n};\n\nexport type AllowedEvents =\n | AccountsControllerAccountAddedEvent\n | AccountsControllerAccountRemovedEvent\n | AccountsControllerSelectedAccountChangeEvent\n | UserStorageController.UserStorageControllerStateChangeEvent\n | MultichainAccountServiceWalletStatusChangeEvent;\n\nexport type AccountTreeControllerEvents =\n | AccountTreeControllerStateChangeEvent\n | AccountTreeControllerAccountTreeChangeEvent\n | AccountTreeControllerSelectedAccountGroupChangeEvent;\n\nexport type AccountTreeControllerMessenger = Messenger<\n typeof controllerName,\n AccountTreeControllerActions | AllowedActions,\n AccountTreeControllerEvents | AllowedEvents\n>;\n\nexport type AccountTreeControllerConfig = {\n trace?: TraceCallback;\n backupAndSync?: {\n onBackupAndSyncEvent?: (event: BackupAndSyncAnalyticsEventPayload) => void;\n };\n accountOrderCallbacks?: {\n isHiddenAccount?: (accountId: AccountId) => boolean;\n isPinnedAccount?: (accountId: AccountId) => boolean;\n };\n};\n\nexport type AccountTreeControllerInternalBackupAndSyncConfig = {\n emitAnalyticsEventFn: (event: BackupAndSyncEmitAnalyticsEventParams) => void;\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/account-tree-controller",
3
- "version": "4.0.0-preview-91e0d8c4",
3
+ "version": "4.0.0-preview-e09bf49f",
4
4
  "description": "Controller to group account together based on some pre-defined rules",
5
5
  "keywords": [
6
6
  "MetaMask",
@@ -48,11 +48,11 @@
48
48
  "test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
49
49
  },
50
50
  "dependencies": {
51
- "@metamask/accounts-controller": "^35.0.0",
51
+ "@metamask/accounts-controller": "^35.0.2",
52
52
  "@metamask/base-controller": "^9.0.0",
53
- "@metamask/keyring-controller": "^25.0.0",
53
+ "@metamask/keyring-controller": "^25.1.0",
54
54
  "@metamask/messenger": "^0.3.0",
55
- "@metamask/multichain-account-service": "^5.0.0",
55
+ "@metamask/multichain-account-service": "^5.1.0",
56
56
  "@metamask/profile-sync-controller": "^27.0.0",
57
57
  "@metamask/snaps-controllers": "^17.2.0",
58
58
  "@metamask/snaps-sdk": "^10.3.0",