@metamask-previews/account-tree-controller 7.5.3-preview-34f2bcbf7 → 7.5.3-preview-aa4ef4666

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/group.cjs CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isAccountGroupNameUnique = exports.isMultichainAccountGroup = exports.isAccountGroupNameUniqueFromWallet = exports.ACCOUNT_TYPE_TO_SORT_ORDER = exports.MAX_SORT_ORDER = void 0;
4
- const account_api_1 = require("@metamask/account-api");
3
+ exports.isAccountGroupNameUnique = exports.isAccountGroupNameUniqueFromWallet = exports.ACCOUNT_TYPE_TO_SORT_ORDER = exports.MAX_SORT_ORDER = void 0;
5
4
  const keyring_api_1 = require("@metamask/keyring-api");
6
5
  exports.MAX_SORT_ORDER = 9999;
7
6
  /**
@@ -38,20 +37,6 @@ function isAccountGroupNameUniqueFromWallet(wallet, groupId, name) {
38
37
  return true;
39
38
  }
40
39
  exports.isAccountGroupNameUniqueFromWallet = isAccountGroupNameUniqueFromWallet;
41
- /**
42
- * Returns `true` if the group is a multichain account group, narrowing its
43
- * type to the multichain account variant.
44
- *
45
- * Works for both {@link AccountGroupObject} state objects and the intermediate
46
- * rule-result group shapes used inside `#insert()`.
47
- *
48
- * @param group - The group to check.
49
- * @returns `true` if the group is a multichain account group, `false` otherwise.
50
- */
51
- function isMultichainAccountGroup(group) {
52
- return group.type === account_api_1.AccountGroupType.MultichainAccount;
53
- }
54
- exports.isMultichainAccountGroup = isMultichainAccountGroup;
55
40
  /**
56
41
  * Checks if an account group name is unique within the same wallet.
57
42
  *
@@ -1 +1 @@
1
- {"version":3,"file":"group.cjs","sourceRoot":"","sources":["../src/group.ts"],"names":[],"mappings":";;;AAAA,uDAAyD;AAMzD,uDAO+B;AAsBlB,QAAA,cAAc,GAAG,IAAI,CAAC;AAEnC;;GAEG;AACU,QAAA,0BAA0B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AM,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;QAC9D,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;YAC3B,mDAAmD;YACnD,OAAO,kCAAkC,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;AACrD,CAAC;AAdD,4DAcC","sourcesContent":["import { AccountGroupType } from '@metamask/account-api';\nimport type {\n MultichainAccountGroupId,\n AccountGroupId,\n} from '@metamask/account-api';\nimport type { AccountId } from '@metamask/accounts-controller';\nimport {\n AnyAccountType,\n BtcAccountType,\n EthAccountType,\n SolAccountType,\n TrxAccountType,\n XlmAccountType,\n} from '@metamask/keyring-api';\nimport type { KeyringAccountType } from '@metamask/keyring-api';\nimport type { MultichainAccountGroupStatus } from '@metamask/multichain-account-service';\n\nimport type { UpdatableField, ExtractFieldValues } from './type-utils';\nimport type { AccountTreeControllerState } from './types';\nimport type { AccountWalletObject } from './wallet';\n\n/**\n * Persisted metadata for account groups (stored in controller state for persistence/sync).\n */\nexport type AccountTreeGroupPersistedMetadata = {\n /** Custom name set by user, overrides default naming logic */\n name?: UpdatableField<string>;\n /** Whether this group is pinned in the UI */\n pinned?: UpdatableField<boolean>;\n /** Whether this group is hidden in the UI */\n hidden?: UpdatableField<boolean>;\n /** Timestamp of the last time this group was selected (local-only, not synced) */\n lastSelected?: number;\n};\n\nexport const MAX_SORT_ORDER = 9999;\n\n/**\n * Order of account types.\n */\nexport const ACCOUNT_TYPE_TO_SORT_ORDER: Record<KeyringAccountType, number> = {\n [EthAccountType.Eoa]: 0,\n [EthAccountType.Erc4337]: 1,\n [SolAccountType.DataAccount]: 2,\n [BtcAccountType.P2pkh]: 3,\n [BtcAccountType.P2sh]: 4,\n [BtcAccountType.P2wpkh]: 5,\n [BtcAccountType.P2tr]: 6,\n [TrxAccountType.Eoa]: 7,\n [XlmAccountType.Account]: 8,\n [AnyAccountType.Account]: MAX_SORT_ORDER,\n};\n\nexport type AccountTypeOrderKey = keyof typeof ACCOUNT_TYPE_TO_SORT_ORDER;\n\n/**\n * Tree metadata for account groups (required plain values extracted from persisted metadata).\n */\nexport type AccountTreeGroupMetadata = Required<\n ExtractFieldValues<AccountTreeGroupPersistedMetadata>\n>;\n\n/**\n * Type constraint for a {@link AccountGroupObject}. If one of its union-members\n * does not match this contraint, {@link AccountGroupObject} will resolve\n * to `never`.\n */\ntype IsAccountGroupObject<\n Type extends {\n type: AccountGroupType;\n id: AccountGroupId;\n accounts: AccountId[];\n metadata: AccountTreeGroupMetadata;\n },\n> = Type;\n\n/**\n * Multichain-account group object.\n */\nexport type AccountGroupMultichainAccountObject = {\n type: AccountGroupType.MultichainAccount;\n id: MultichainAccountGroupId;\n status: MultichainAccountGroupStatus;\n // Blockchain Accounts (at least 1 account per multichain-accounts):\n accounts: [AccountId, ...AccountId[]];\n metadata: AccountTreeGroupMetadata & {\n entropy: {\n groupIndex: number;\n };\n };\n};\n\n/**\n * Multichain-account group object.\n */\nexport type AccountGroupSingleAccountObject = {\n type: AccountGroupType.SingleAccount;\n id: AccountGroupId;\n // Blockchain Accounts (1 account per group):\n accounts: [AccountId];\n metadata: AccountTreeGroupMetadata;\n};\n\n/**\n * Account group object.\n */\nexport type AccountGroupObject = IsAccountGroupObject<\n AccountGroupMultichainAccountObject | AccountGroupSingleAccountObject\n>;\n\nexport type AccountGroupObjectOf<GroupType extends AccountGroupType> = Extract<\n | {\n type: AccountGroupType.MultichainAccount;\n object: AccountGroupMultichainAccountObject;\n }\n | {\n type: AccountGroupType.SingleAccount;\n object: AccountGroupSingleAccountObject;\n },\n { type: GroupType }\n>['object'];\n\n/**\n * Checks if a group name is unique within a specific wallet.\n *\n * @param wallet - The wallet to check within.\n * @param groupId - The account group ID to exclude from the check.\n * @param name - The name to validate for uniqueness.\n * @returns True if the name is unique within the wallet, false otherwise.\n */\nexport function isAccountGroupNameUniqueFromWallet(\n wallet: AccountWalletObject,\n groupId: AccountGroupId,\n name: string,\n): boolean {\n const trimmedName = name.trim();\n\n // Check for duplicates within this wallet\n for (const group of Object.values(wallet.groups)) {\n if (group.id !== groupId && group.metadata.name.trim() === trimmedName) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Returns `true` if the group is a multichain account group, narrowing its\n * type to the multichain account variant.\n *\n * Works for both {@link AccountGroupObject} state objects and the intermediate\n * rule-result group shapes used inside `#insert()`.\n *\n * @param group - The group to check.\n * @returns `true` if the group is a multichain account group, `false` otherwise.\n */\nexport function isMultichainAccountGroup<\n Value extends { type: AccountGroupType },\n>(group: Value): group is Value & { type: AccountGroupType.MultichainAccount } {\n return group.type === AccountGroupType.MultichainAccount;\n}\n\n/**\n * Checks if an account group name is unique within the same wallet.\n *\n * @param state - The account tree controller state.\n * @param groupId - The account group ID to exclude from the check.\n * @param name - The name to validate for uniqueness.\n * @returns True if the name is unique within the same wallet, false otherwise.\n * @throws Error if the group ID does not exist.\n */\nexport function isAccountGroupNameUnique(\n state: AccountTreeControllerState,\n groupId: AccountGroupId,\n name: string,\n): boolean {\n // Find the wallet that contains the group being validated\n for (const wallet of Object.values(state.accountTree.wallets)) {\n if (wallet.groups[groupId]) {\n // Use the wallet-specific function for consistency\n return isAccountGroupNameUniqueFromWallet(wallet, groupId, name);\n }\n }\n\n throw new Error('Account group not found in tree');\n}\n"]}
1
+ {"version":3,"file":"group.cjs","sourceRoot":"","sources":["../src/group.ts"],"names":[],"mappings":";;;AAMA,uDAO+B;AAqBlB,QAAA,cAAc,GAAG,IAAI,CAAC;AAEnC;;GAEG;AACU,QAAA,0BAA0B,GAAuC;IAC5E,CAAC,4BAAc,CAAC,GAAG,CAAC,EAAE,CAAC;IACvB,CAAC,4BAAc,CAAC,OAAO,CAAC,EAAE,CAAC;IAC3B,CAAC,4BAAc,CAAC,WAAW,CAAC,EAAE,CAAC;IAC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ACrD,CAAC;AAdD,4DAcC","sourcesContent":["import type {\n AccountGroupType,\n MultichainAccountGroupId,\n} from '@metamask/account-api';\nimport type { AccountGroupId } from '@metamask/account-api';\nimport type { AccountId } from '@metamask/accounts-controller';\nimport {\n AnyAccountType,\n BtcAccountType,\n EthAccountType,\n SolAccountType,\n TrxAccountType,\n XlmAccountType,\n} from '@metamask/keyring-api';\nimport type { KeyringAccountType } from '@metamask/keyring-api';\n\nimport type { UpdatableField, ExtractFieldValues } from './type-utils';\nimport type { AccountTreeControllerState } from './types';\nimport type { AccountWalletObject } from './wallet';\n\n/**\n * Persisted metadata for account groups (stored in controller state for persistence/sync).\n */\nexport type AccountTreeGroupPersistedMetadata = {\n /** Custom name set by user, overrides default naming logic */\n name?: UpdatableField<string>;\n /** Whether this group is pinned in the UI */\n pinned?: UpdatableField<boolean>;\n /** Whether this group is hidden in the UI */\n hidden?: UpdatableField<boolean>;\n /** Timestamp of the last time this group was selected (local-only, not synced) */\n lastSelected?: number;\n};\n\nexport const MAX_SORT_ORDER = 9999;\n\n/**\n * Order of account types.\n */\nexport const ACCOUNT_TYPE_TO_SORT_ORDER: Record<KeyringAccountType, number> = {\n [EthAccountType.Eoa]: 0,\n [EthAccountType.Erc4337]: 1,\n [SolAccountType.DataAccount]: 2,\n [BtcAccountType.P2pkh]: 3,\n [BtcAccountType.P2sh]: 4,\n [BtcAccountType.P2wpkh]: 5,\n [BtcAccountType.P2tr]: 6,\n [TrxAccountType.Eoa]: 7,\n [XlmAccountType.Account]: 8,\n [AnyAccountType.Account]: MAX_SORT_ORDER,\n};\n\nexport type AccountTypeOrderKey = keyof typeof ACCOUNT_TYPE_TO_SORT_ORDER;\n\n/**\n * Tree metadata for account groups (required plain values extracted from persisted metadata).\n */\nexport type AccountTreeGroupMetadata = Required<\n ExtractFieldValues<AccountTreeGroupPersistedMetadata>\n>;\n\n/**\n * Type constraint for a {@link AccountGroupObject}. If one of its union-members\n * does not match this contraint, {@link AccountGroupObject} will resolve\n * to `never`.\n */\ntype IsAccountGroupObject<\n Type extends {\n type: AccountGroupType;\n id: AccountGroupId;\n accounts: AccountId[];\n metadata: AccountTreeGroupMetadata;\n },\n> = Type;\n\n/**\n * Multichain-account group object.\n */\nexport type AccountGroupMultichainAccountObject = {\n type: AccountGroupType.MultichainAccount;\n id: MultichainAccountGroupId;\n // Blockchain Accounts (at least 1 account per multichain-accounts):\n accounts: [AccountId, ...AccountId[]];\n metadata: AccountTreeGroupMetadata & {\n entropy: {\n groupIndex: number;\n };\n };\n};\n\n/**\n * Multichain-account group object.\n */\nexport type AccountGroupSingleAccountObject = {\n type: AccountGroupType.SingleAccount;\n id: AccountGroupId;\n // Blockchain Accounts (1 account per group):\n accounts: [AccountId];\n metadata: AccountTreeGroupMetadata;\n};\n\n/**\n * Account group object.\n */\nexport type AccountGroupObject = IsAccountGroupObject<\n AccountGroupMultichainAccountObject | AccountGroupSingleAccountObject\n>;\n\nexport type AccountGroupObjectOf<GroupType extends AccountGroupType> = Extract<\n | {\n type: AccountGroupType.MultichainAccount;\n object: AccountGroupMultichainAccountObject;\n }\n | {\n type: AccountGroupType.SingleAccount;\n object: AccountGroupSingleAccountObject;\n },\n { type: GroupType }\n>['object'];\n\n/**\n * Checks if a group name is unique within a specific wallet.\n *\n * @param wallet - The wallet to check within.\n * @param groupId - The account group ID to exclude from the check.\n * @param name - The name to validate for uniqueness.\n * @returns True if the name is unique within the wallet, false otherwise.\n */\nexport function isAccountGroupNameUniqueFromWallet(\n wallet: AccountWalletObject,\n groupId: AccountGroupId,\n name: string,\n): boolean {\n const trimmedName = name.trim();\n\n // Check for duplicates within this wallet\n for (const group of Object.values(wallet.groups)) {\n if (group.id !== groupId && group.metadata.name.trim() === trimmedName) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Checks if an account group name is unique within the same wallet.\n *\n * @param state - The account tree controller state.\n * @param groupId - The account group ID to exclude from the check.\n * @param name - The name to validate for uniqueness.\n * @returns True if the name is unique within the same wallet, false otherwise.\n * @throws Error if the group ID does not exist.\n */\nexport function isAccountGroupNameUnique(\n state: AccountTreeControllerState,\n groupId: AccountGroupId,\n name: string,\n): boolean {\n // Find the wallet that contains the group being validated\n for (const wallet of Object.values(state.accountTree.wallets)) {\n if (wallet.groups[groupId]) {\n // Use the wallet-specific function for consistency\n return isAccountGroupNameUniqueFromWallet(wallet, groupId, name);\n }\n }\n\n throw new Error('Account group not found in tree');\n}\n"]}
package/dist/group.d.cts CHANGED
@@ -1,8 +1,7 @@
1
- import { AccountGroupType } from "@metamask/account-api";
2
- import type { MultichainAccountGroupId, AccountGroupId } from "@metamask/account-api";
1
+ import type { AccountGroupType, MultichainAccountGroupId } from "@metamask/account-api";
2
+ import type { AccountGroupId } from "@metamask/account-api";
3
3
  import type { AccountId } from "@metamask/accounts-controller";
4
4
  import type { KeyringAccountType } from "@metamask/keyring-api";
5
- import type { MultichainAccountGroupStatus } from "@metamask/multichain-account-service";
6
5
  import type { UpdatableField, ExtractFieldValues } from "./type-utils.cjs";
7
6
  import type { AccountTreeControllerState } from "./types.cjs";
8
7
  import type { AccountWalletObject } from "./wallet.cjs";
@@ -46,7 +45,6 @@ type IsAccountGroupObject<Type extends {
46
45
  export type AccountGroupMultichainAccountObject = {
47
46
  type: AccountGroupType.MultichainAccount;
48
47
  id: MultichainAccountGroupId;
49
- status: MultichainAccountGroupStatus;
50
48
  accounts: [AccountId, ...AccountId[]];
51
49
  metadata: AccountTreeGroupMetadata & {
52
50
  entropy: {
@@ -85,21 +83,6 @@ export type AccountGroupObjectOf<GroupType extends AccountGroupType> = Extract<{
85
83
  * @returns True if the name is unique within the wallet, false otherwise.
86
84
  */
87
85
  export declare function isAccountGroupNameUniqueFromWallet(wallet: AccountWalletObject, groupId: AccountGroupId, name: string): boolean;
88
- /**
89
- * Returns `true` if the group is a multichain account group, narrowing its
90
- * type to the multichain account variant.
91
- *
92
- * Works for both {@link AccountGroupObject} state objects and the intermediate
93
- * rule-result group shapes used inside `#insert()`.
94
- *
95
- * @param group - The group to check.
96
- * @returns `true` if the group is a multichain account group, `false` otherwise.
97
- */
98
- export declare function isMultichainAccountGroup<Value extends {
99
- type: AccountGroupType;
100
- }>(group: Value): group is Value & {
101
- type: AccountGroupType.MultichainAccount;
102
- };
103
86
  /**
104
87
  * Checks if an account group name is unique within the same wallet.
105
88
  *
@@ -1 +1 @@
1
- {"version":3,"file":"group.d.cts","sourceRoot":"","sources":["../src/group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,8BAA8B;AACzD,OAAO,KAAK,EACV,wBAAwB,EACxB,cAAc,EACf,8BAA8B;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,sCAAsC;AAS/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,8BAA8B;AAChE,OAAO,KAAK,EAAE,4BAA4B,EAAE,6CAA6C;AAEzF,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,yBAAqB;AACvE,OAAO,KAAK,EAAE,0BAA0B,EAAE,oBAAgB;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAiB;AAEpD;;GAEG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,8DAA8D;IAC9D,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAC9B,6CAA6C;IAC7C,MAAM,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IACjC,6CAA6C;IAC7C,MAAM,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IACjC,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAWzE,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,0BAA0B,CAAC;AAE1E;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,QAAQ,C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C,GACD;IACE,IAAI,EAAE,gBAAgB,CAAC,aAAa,CAAC;IACrC,MAAM,EAAE,+BAA+B,CAAC;CACzC,EACH;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CACpB,CAAC,QAAQ,CAAC,CAAC;AAEZ;;;;;;;GAOG;AACH,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,GACX,OAAO,CAUT;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,0BAA0B,EACjC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,GACX,OAAO,CAUT"}
package/dist/group.d.mts CHANGED
@@ -1,8 +1,7 @@
1
- import { AccountGroupType } from "@metamask/account-api";
2
- import type { MultichainAccountGroupId, AccountGroupId } from "@metamask/account-api";
1
+ import type { AccountGroupType, MultichainAccountGroupId } from "@metamask/account-api";
2
+ import type { AccountGroupId } from "@metamask/account-api";
3
3
  import type { AccountId } from "@metamask/accounts-controller";
4
4
  import type { KeyringAccountType } from "@metamask/keyring-api";
5
- import type { MultichainAccountGroupStatus } from "@metamask/multichain-account-service";
6
5
  import type { UpdatableField, ExtractFieldValues } from "./type-utils.mjs";
7
6
  import type { AccountTreeControllerState } from "./types.mjs";
8
7
  import type { AccountWalletObject } from "./wallet.mjs";
@@ -46,7 +45,6 @@ type IsAccountGroupObject<Type extends {
46
45
  export type AccountGroupMultichainAccountObject = {
47
46
  type: AccountGroupType.MultichainAccount;
48
47
  id: MultichainAccountGroupId;
49
- status: MultichainAccountGroupStatus;
50
48
  accounts: [AccountId, ...AccountId[]];
51
49
  metadata: AccountTreeGroupMetadata & {
52
50
  entropy: {
@@ -85,21 +83,6 @@ export type AccountGroupObjectOf<GroupType extends AccountGroupType> = Extract<{
85
83
  * @returns True if the name is unique within the wallet, false otherwise.
86
84
  */
87
85
  export declare function isAccountGroupNameUniqueFromWallet(wallet: AccountWalletObject, groupId: AccountGroupId, name: string): boolean;
88
- /**
89
- * Returns `true` if the group is a multichain account group, narrowing its
90
- * type to the multichain account variant.
91
- *
92
- * Works for both {@link AccountGroupObject} state objects and the intermediate
93
- * rule-result group shapes used inside `#insert()`.
94
- *
95
- * @param group - The group to check.
96
- * @returns `true` if the group is a multichain account group, `false` otherwise.
97
- */
98
- export declare function isMultichainAccountGroup<Value extends {
99
- type: AccountGroupType;
100
- }>(group: Value): group is Value & {
101
- type: AccountGroupType.MultichainAccount;
102
- };
103
86
  /**
104
87
  * Checks if an account group name is unique within the same wallet.
105
88
  *
@@ -1 +1 @@
1
- {"version":3,"file":"group.d.mts","sourceRoot":"","sources":["../src/group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,8BAA8B;AACzD,OAAO,KAAK,EACV,wBAAwB,EACxB,cAAc,EACf,8BAA8B;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,sCAAsC;AAS/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,8BAA8B;AAChE,OAAO,KAAK,EAAE,4BAA4B,EAAE,6CAA6C;AAEzF,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,yBAAqB;AACvE,OAAO,KAAK,EAAE,0BAA0B,EAAE,oBAAgB;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAiB;AAEpD;;GAEG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,8DAA8D;IAC9D,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAC9B,6CAA6C;IAC7C,MAAM,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IACjC,6CAA6C;IAC7C,MAAM,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IACjC,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,0BAA0B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ACtE,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,SAAS,SAAS,gBAAgB,IAAI,OAAO,CAC1E;IACE,IAAI,EAAE,gBAAgB,CAAC,iBAAiB,CAAC;IACzC,MAAM,EAAE,mCAAmC,CAAC;CAC7C,GACD;IACE,IAAI,EAAE,gBAAgB,CAAC,aAAa,CAAC;IACrC,MAAM,EAAE,+BAA+B,CAAC;CACzC,EACH;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CACpB,CAAC,QAAQ,CAAC,CAAC;AAEZ;;;;;;;GAOG;AACH,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,GACX,OAAO,CAUT;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,0BAA0B,EACjC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,GACX,OAAO,CAUT"}
package/dist/group.mjs CHANGED
@@ -1,4 +1,3 @@
1
- import { AccountGroupType } from "@metamask/account-api";
2
1
  import { AnyAccountType, BtcAccountType, EthAccountType, SolAccountType, TrxAccountType, XlmAccountType } from "@metamask/keyring-api";
3
2
  export const MAX_SORT_ORDER = 9999;
4
3
  /**
@@ -34,19 +33,6 @@ export function isAccountGroupNameUniqueFromWallet(wallet, groupId, name) {
34
33
  }
35
34
  return true;
36
35
  }
37
- /**
38
- * Returns `true` if the group is a multichain account group, narrowing its
39
- * type to the multichain account variant.
40
- *
41
- * Works for both {@link AccountGroupObject} state objects and the intermediate
42
- * rule-result group shapes used inside `#insert()`.
43
- *
44
- * @param group - The group to check.
45
- * @returns `true` if the group is a multichain account group, `false` otherwise.
46
- */
47
- export function isMultichainAccountGroup(group) {
48
- return group.type === AccountGroupType.MultichainAccount;
49
- }
50
36
  /**
51
37
  * Checks if an account group name is unique within the same wallet.
52
38
  *
@@ -1 +1 @@
1
- {"version":3,"file":"group.mjs","sourceRoot":"","sources":["../src/group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,UAAU,wBAAwB,CAEtC,KAAY;IACZ,OAAO,KAAK,CAAC,IAAI,KAAK,gBAAgB,CAAC,iBAAiB,CAAC;AAC3D,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,wBAAwB,CACtC,KAAiC,EACjC,OAAuB,EACvB,IAAY;IAEZ,0DAA0D;IAC1D,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;QAC9D,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;YAC3B,mDAAmD;YACnD,OAAO,kCAAkC,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import { AccountGroupType } from '@metamask/account-api';\nimport type {\n MultichainAccountGroupId,\n AccountGroupId,\n} from '@metamask/account-api';\nimport type { AccountId } from '@metamask/accounts-controller';\nimport {\n AnyAccountType,\n BtcAccountType,\n EthAccountType,\n SolAccountType,\n TrxAccountType,\n XlmAccountType,\n} from '@metamask/keyring-api';\nimport type { KeyringAccountType } from '@metamask/keyring-api';\nimport type { MultichainAccountGroupStatus } from '@metamask/multichain-account-service';\n\nimport type { UpdatableField, ExtractFieldValues } from './type-utils';\nimport type { AccountTreeControllerState } from './types';\nimport type { AccountWalletObject } from './wallet';\n\n/**\n * Persisted metadata for account groups (stored in controller state for persistence/sync).\n */\nexport type AccountTreeGroupPersistedMetadata = {\n /** Custom name set by user, overrides default naming logic */\n name?: UpdatableField<string>;\n /** Whether this group is pinned in the UI */\n pinned?: UpdatableField<boolean>;\n /** Whether this group is hidden in the UI */\n hidden?: UpdatableField<boolean>;\n /** Timestamp of the last time this group was selected (local-only, not synced) */\n lastSelected?: number;\n};\n\nexport const MAX_SORT_ORDER = 9999;\n\n/**\n * Order of account types.\n */\nexport const ACCOUNT_TYPE_TO_SORT_ORDER: Record<KeyringAccountType, number> = {\n [EthAccountType.Eoa]: 0,\n [EthAccountType.Erc4337]: 1,\n [SolAccountType.DataAccount]: 2,\n [BtcAccountType.P2pkh]: 3,\n [BtcAccountType.P2sh]: 4,\n [BtcAccountType.P2wpkh]: 5,\n [BtcAccountType.P2tr]: 6,\n [TrxAccountType.Eoa]: 7,\n [XlmAccountType.Account]: 8,\n [AnyAccountType.Account]: MAX_SORT_ORDER,\n};\n\nexport type AccountTypeOrderKey = keyof typeof ACCOUNT_TYPE_TO_SORT_ORDER;\n\n/**\n * Tree metadata for account groups (required plain values extracted from persisted metadata).\n */\nexport type AccountTreeGroupMetadata = Required<\n ExtractFieldValues<AccountTreeGroupPersistedMetadata>\n>;\n\n/**\n * Type constraint for a {@link AccountGroupObject}. If one of its union-members\n * does not match this contraint, {@link AccountGroupObject} will resolve\n * to `never`.\n */\ntype IsAccountGroupObject<\n Type extends {\n type: AccountGroupType;\n id: AccountGroupId;\n accounts: AccountId[];\n metadata: AccountTreeGroupMetadata;\n },\n> = Type;\n\n/**\n * Multichain-account group object.\n */\nexport type AccountGroupMultichainAccountObject = {\n type: AccountGroupType.MultichainAccount;\n id: MultichainAccountGroupId;\n status: MultichainAccountGroupStatus;\n // Blockchain Accounts (at least 1 account per multichain-accounts):\n accounts: [AccountId, ...AccountId[]];\n metadata: AccountTreeGroupMetadata & {\n entropy: {\n groupIndex: number;\n };\n };\n};\n\n/**\n * Multichain-account group object.\n */\nexport type AccountGroupSingleAccountObject = {\n type: AccountGroupType.SingleAccount;\n id: AccountGroupId;\n // Blockchain Accounts (1 account per group):\n accounts: [AccountId];\n metadata: AccountTreeGroupMetadata;\n};\n\n/**\n * Account group object.\n */\nexport type AccountGroupObject = IsAccountGroupObject<\n AccountGroupMultichainAccountObject | AccountGroupSingleAccountObject\n>;\n\nexport type AccountGroupObjectOf<GroupType extends AccountGroupType> = Extract<\n | {\n type: AccountGroupType.MultichainAccount;\n object: AccountGroupMultichainAccountObject;\n }\n | {\n type: AccountGroupType.SingleAccount;\n object: AccountGroupSingleAccountObject;\n },\n { type: GroupType }\n>['object'];\n\n/**\n * Checks if a group name is unique within a specific wallet.\n *\n * @param wallet - The wallet to check within.\n * @param groupId - The account group ID to exclude from the check.\n * @param name - The name to validate for uniqueness.\n * @returns True if the name is unique within the wallet, false otherwise.\n */\nexport function isAccountGroupNameUniqueFromWallet(\n wallet: AccountWalletObject,\n groupId: AccountGroupId,\n name: string,\n): boolean {\n const trimmedName = name.trim();\n\n // Check for duplicates within this wallet\n for (const group of Object.values(wallet.groups)) {\n if (group.id !== groupId && group.metadata.name.trim() === trimmedName) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Returns `true` if the group is a multichain account group, narrowing its\n * type to the multichain account variant.\n *\n * Works for both {@link AccountGroupObject} state objects and the intermediate\n * rule-result group shapes used inside `#insert()`.\n *\n * @param group - The group to check.\n * @returns `true` if the group is a multichain account group, `false` otherwise.\n */\nexport function isMultichainAccountGroup<\n Value extends { type: AccountGroupType },\n>(group: Value): group is Value & { type: AccountGroupType.MultichainAccount } {\n return group.type === AccountGroupType.MultichainAccount;\n}\n\n/**\n * Checks if an account group name is unique within the same wallet.\n *\n * @param state - The account tree controller state.\n * @param groupId - The account group ID to exclude from the check.\n * @param name - The name to validate for uniqueness.\n * @returns True if the name is unique within the same wallet, false otherwise.\n * @throws Error if the group ID does not exist.\n */\nexport function isAccountGroupNameUnique(\n state: AccountTreeControllerState,\n groupId: AccountGroupId,\n name: string,\n): boolean {\n // Find the wallet that contains the group being validated\n for (const wallet of Object.values(state.accountTree.wallets)) {\n if (wallet.groups[groupId]) {\n // Use the wallet-specific function for consistency\n return isAccountGroupNameUniqueFromWallet(wallet, groupId, name);\n }\n }\n\n throw new Error('Account group not found in tree');\n}\n"]}
1
+ {"version":3,"file":"group.mjs","sourceRoot":"","sources":["../src/group.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,cAAc,EACd,cAAc,EACd,cAA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AM,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;QAC9D,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;YAC3B,mDAAmD;YACnD,OAAO,kCAAkC,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import type {\n AccountGroupType,\n MultichainAccountGroupId,\n} from '@metamask/account-api';\nimport type { AccountGroupId } from '@metamask/account-api';\nimport type { AccountId } from '@metamask/accounts-controller';\nimport {\n AnyAccountType,\n BtcAccountType,\n EthAccountType,\n SolAccountType,\n TrxAccountType,\n XlmAccountType,\n} from '@metamask/keyring-api';\nimport type { KeyringAccountType } from '@metamask/keyring-api';\n\nimport type { UpdatableField, ExtractFieldValues } from './type-utils';\nimport type { AccountTreeControllerState } from './types';\nimport type { AccountWalletObject } from './wallet';\n\n/**\n * Persisted metadata for account groups (stored in controller state for persistence/sync).\n */\nexport type AccountTreeGroupPersistedMetadata = {\n /** Custom name set by user, overrides default naming logic */\n name?: UpdatableField<string>;\n /** Whether this group is pinned in the UI */\n pinned?: UpdatableField<boolean>;\n /** Whether this group is hidden in the UI */\n hidden?: UpdatableField<boolean>;\n /** Timestamp of the last time this group was selected (local-only, not synced) */\n lastSelected?: number;\n};\n\nexport const MAX_SORT_ORDER = 9999;\n\n/**\n * Order of account types.\n */\nexport const ACCOUNT_TYPE_TO_SORT_ORDER: Record<KeyringAccountType, number> = {\n [EthAccountType.Eoa]: 0,\n [EthAccountType.Erc4337]: 1,\n [SolAccountType.DataAccount]: 2,\n [BtcAccountType.P2pkh]: 3,\n [BtcAccountType.P2sh]: 4,\n [BtcAccountType.P2wpkh]: 5,\n [BtcAccountType.P2tr]: 6,\n [TrxAccountType.Eoa]: 7,\n [XlmAccountType.Account]: 8,\n [AnyAccountType.Account]: MAX_SORT_ORDER,\n};\n\nexport type AccountTypeOrderKey = keyof typeof ACCOUNT_TYPE_TO_SORT_ORDER;\n\n/**\n * Tree metadata for account groups (required plain values extracted from persisted metadata).\n */\nexport type AccountTreeGroupMetadata = Required<\n ExtractFieldValues<AccountTreeGroupPersistedMetadata>\n>;\n\n/**\n * Type constraint for a {@link AccountGroupObject}. If one of its union-members\n * does not match this contraint, {@link AccountGroupObject} will resolve\n * to `never`.\n */\ntype IsAccountGroupObject<\n Type extends {\n type: AccountGroupType;\n id: AccountGroupId;\n accounts: AccountId[];\n metadata: AccountTreeGroupMetadata;\n },\n> = Type;\n\n/**\n * Multichain-account group object.\n */\nexport type AccountGroupMultichainAccountObject = {\n type: AccountGroupType.MultichainAccount;\n id: MultichainAccountGroupId;\n // Blockchain Accounts (at least 1 account per multichain-accounts):\n accounts: [AccountId, ...AccountId[]];\n metadata: AccountTreeGroupMetadata & {\n entropy: {\n groupIndex: number;\n };\n };\n};\n\n/**\n * Multichain-account group object.\n */\nexport type AccountGroupSingleAccountObject = {\n type: AccountGroupType.SingleAccount;\n id: AccountGroupId;\n // Blockchain Accounts (1 account per group):\n accounts: [AccountId];\n metadata: AccountTreeGroupMetadata;\n};\n\n/**\n * Account group object.\n */\nexport type AccountGroupObject = IsAccountGroupObject<\n AccountGroupMultichainAccountObject | AccountGroupSingleAccountObject\n>;\n\nexport type AccountGroupObjectOf<GroupType extends AccountGroupType> = Extract<\n | {\n type: AccountGroupType.MultichainAccount;\n object: AccountGroupMultichainAccountObject;\n }\n | {\n type: AccountGroupType.SingleAccount;\n object: AccountGroupSingleAccountObject;\n },\n { type: GroupType }\n>['object'];\n\n/**\n * Checks if a group name is unique within a specific wallet.\n *\n * @param wallet - The wallet to check within.\n * @param groupId - The account group ID to exclude from the check.\n * @param name - The name to validate for uniqueness.\n * @returns True if the name is unique within the wallet, false otherwise.\n */\nexport function isAccountGroupNameUniqueFromWallet(\n wallet: AccountWalletObject,\n groupId: AccountGroupId,\n name: string,\n): boolean {\n const trimmedName = name.trim();\n\n // Check for duplicates within this wallet\n for (const group of Object.values(wallet.groups)) {\n if (group.id !== groupId && group.metadata.name.trim() === trimmedName) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Checks if an account group name is unique within the same wallet.\n *\n * @param state - The account tree controller state.\n * @param groupId - The account group ID to exclude from the check.\n * @param name - The name to validate for uniqueness.\n * @returns True if the name is unique within the same wallet, false otherwise.\n * @throws Error if the group ID does not exist.\n */\nexport function isAccountGroupNameUnique(\n state: AccountTreeControllerState,\n groupId: AccountGroupId,\n name: string,\n): boolean {\n // Find the wallet that contains the group being validated\n for (const wallet of Object.values(state.accountTree.wallets)) {\n if (wallet.groups[groupId]) {\n // Use the wallet-specific function for consistency\n return isAccountGroupNameUniqueFromWallet(wallet, groupId, name);\n }\n }\n\n throw new Error('Account group not found in tree');\n}\n"]}
package/dist/index.cjs CHANGED
@@ -1,11 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDefaultAccountTreeControllerState = exports.AccountTreeController = exports.USER_STORAGE_WALLETS_FEATURE_KEY = exports.USER_STORAGE_GROUPS_FEATURE_KEY = exports.isMultichainAccountGroup = exports.isAccountGroupNameUnique = exports.isMultichainAccountWallet = void 0;
4
- var wallet_1 = require("./wallet.cjs");
5
- Object.defineProperty(exports, "isMultichainAccountWallet", { enumerable: true, get: function () { return wallet_1.isMultichainAccountWallet; } });
3
+ exports.getDefaultAccountTreeControllerState = exports.AccountTreeController = exports.USER_STORAGE_WALLETS_FEATURE_KEY = exports.USER_STORAGE_GROUPS_FEATURE_KEY = exports.isAccountGroupNameUnique = void 0;
6
4
  var group_1 = require("./group.cjs");
7
5
  Object.defineProperty(exports, "isAccountGroupNameUnique", { enumerable: true, get: function () { return group_1.isAccountGroupNameUnique; } });
8
- Object.defineProperty(exports, "isMultichainAccountGroup", { enumerable: true, get: function () { return group_1.isMultichainAccountGroup; } });
9
6
  var constants_1 = require("./backup-and-sync/user-storage/constants.cjs");
10
7
  Object.defineProperty(exports, "USER_STORAGE_GROUPS_FEATURE_KEY", { enumerable: true, get: function () { return constants_1.USER_STORAGE_GROUPS_FEATURE_KEY; } });
11
8
  Object.defineProperty(exports, "USER_STORAGE_WALLETS_FEATURE_KEY", { enumerable: true, get: function () { return constants_1.USER_STORAGE_WALLETS_FEATURE_KEY; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,uCAAqD;AAA5C,mHAAA,yBAAyB,OAAA;AAElC,qCAA6E;AAApE,iHAAA,wBAAwB,OAAA;AAAE,iHAAA,wBAAwB,OAAA;AAE3D,0EAGkD;AAFhD,4HAAA,+BAA+B,OAAA;AAC/B,6HAAA,gCAAgC,OAAA;AAsClC,qEAGiC;AAF/B,8HAAA,qBAAqB,OAAA;AACrB,6IAAA,oCAAoC,OAAA","sourcesContent":["export type { AccountWalletObject } from './wallet';\nexport { isMultichainAccountWallet } from './wallet';\nexport type { AccountGroupObject } from './group';\nexport { isAccountGroupNameUnique, isMultichainAccountGroup } from './group';\n\nexport {\n USER_STORAGE_GROUPS_FEATURE_KEY,\n USER_STORAGE_WALLETS_FEATURE_KEY,\n} from './backup-and-sync/user-storage/constants';\n\nexport type {\n AccountTreeControllerState,\n AccountTreeControllerGetStateAction,\n AccountTreeControllerActions,\n AccountTreeControllerStateChangeEvent,\n AccountTreeControllerAccountTreeChangeEvent,\n AccountTreeControllerSelectedAccountGroupChangeEvent,\n AccountTreeControllerAccountGroupCreatedEvent,\n AccountTreeControllerAccountGroupUpdatedEvent,\n AccountTreeControllerAccountGroupRemovedEvent,\n AccountTreeControllerEvents,\n AccountTreeControllerMessenger,\n} from './types';\n\nexport type {\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 AccountTreeControllerInitAction,\n AccountTreeControllerReinitAction,\n} from './AccountTreeController-method-action-types';\n\nexport type { AccountContext } from './AccountTreeController';\n\nexport {\n AccountTreeController,\n getDefaultAccountTreeControllerState,\n} from './AccountTreeController';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,qCAAmD;AAA1C,iHAAA,wBAAwB,OAAA;AAEjC,0EAGkD;AAFhD,4HAAA,+BAA+B,OAAA;AAC/B,6HAAA,gCAAgC,OAAA;AAsClC,qEAGiC;AAF/B,8HAAA,qBAAqB,OAAA;AACrB,6IAAA,oCAAoC,OAAA","sourcesContent":["export type { AccountWalletObject } from './wallet';\nexport type { AccountGroupObject } from './group';\nexport { isAccountGroupNameUnique } from './group';\n\nexport {\n USER_STORAGE_GROUPS_FEATURE_KEY,\n USER_STORAGE_WALLETS_FEATURE_KEY,\n} from './backup-and-sync/user-storage/constants';\n\nexport type {\n AccountTreeControllerState,\n AccountTreeControllerGetStateAction,\n AccountTreeControllerActions,\n AccountTreeControllerStateChangeEvent,\n AccountTreeControllerAccountTreeChangeEvent,\n AccountTreeControllerSelectedAccountGroupChangeEvent,\n AccountTreeControllerAccountGroupCreatedEvent,\n AccountTreeControllerAccountGroupUpdatedEvent,\n AccountTreeControllerAccountGroupRemovedEvent,\n AccountTreeControllerEvents,\n AccountTreeControllerMessenger,\n} from './types';\n\nexport type {\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 AccountTreeControllerInitAction,\n AccountTreeControllerReinitAction,\n} from './AccountTreeController-method-action-types';\n\nexport type { AccountContext } from './AccountTreeController';\n\nexport {\n AccountTreeController,\n getDefaultAccountTreeControllerState,\n} from './AccountTreeController';\n"]}
package/dist/index.d.cts CHANGED
@@ -1,7 +1,6 @@
1
1
  export type { AccountWalletObject } from "./wallet.cjs";
2
- export { isMultichainAccountWallet } from "./wallet.cjs";
3
2
  export type { AccountGroupObject } from "./group.cjs";
4
- export { isAccountGroupNameUnique, isMultichainAccountGroup } from "./group.cjs";
3
+ export { isAccountGroupNameUnique } from "./group.cjs";
5
4
  export { USER_STORAGE_GROUPS_FEATURE_KEY, USER_STORAGE_WALLETS_FEATURE_KEY, } from "./backup-and-sync/user-storage/constants.cjs";
6
5
  export type { AccountTreeControllerState, AccountTreeControllerGetStateAction, AccountTreeControllerActions, AccountTreeControllerStateChangeEvent, AccountTreeControllerAccountTreeChangeEvent, AccountTreeControllerSelectedAccountGroupChangeEvent, AccountTreeControllerAccountGroupCreatedEvent, AccountTreeControllerAccountGroupUpdatedEvent, AccountTreeControllerAccountGroupRemovedEvent, AccountTreeControllerEvents, AccountTreeControllerMessenger, } from "./types.cjs";
7
6
  export type { AccountTreeControllerGetAccountWalletObjectAction, AccountTreeControllerGetAccountWalletObjectsAction, AccountTreeControllerGetAccountsFromSelectedAccountGroupAction, AccountTreeControllerGetAccountGroupObjectAction, AccountTreeControllerGetAccountContextAction, AccountTreeControllerGetSelectedAccountGroupAction, AccountTreeControllerSetSelectedAccountGroupAction, AccountTreeControllerSetAccountGroupNameAction, AccountTreeControllerSetAccountWalletNameAction, AccountTreeControllerSetAccountGroupPinnedAction, AccountTreeControllerSetAccountGroupHiddenAction, AccountTreeControllerClearStateAction, AccountTreeControllerSyncWithUserStorageAction, AccountTreeControllerSyncWithUserStorageAtLeastOnceAction, AccountTreeControllerInitAction, AccountTreeControllerReinitAction, } from "./AccountTreeController-method-action-types.cjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,qBAAiB;AACpD,OAAO,EAAE,yBAAyB,EAAE,qBAAiB;AACrD,YAAY,EAAE,kBAAkB,EAAE,oBAAgB;AAClD,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,oBAAgB;AAE7E,OAAO,EACL,+BAA+B,EAC/B,gCAAgC,GACjC,qDAAiD;AAElD,YAAY,EACV,0BAA0B,EAC1B,mCAAmC,EACnC,4BAA4B,EAC5B,qCAAqC,EACrC,2CAA2C,EAC3C,oDAAoD,EACpD,6CAA6C,EAC7C,6CAA6C,EAC7C,6CAA6C,EAC7C,2BAA2B,EAC3B,8BAA8B,GAC/B,oBAAgB;AAEjB,YAAY,EACV,iDAAiD,EACjD,kDAAkD,EAClD,8DAA8D,EAC9D,gDAAgD,EAChD,4CAA4C,EAC5C,kDAAkD,EAClD,kDAAkD,EAClD,8CAA8C,EAC9C,+CAA+C,EAC/C,gDAAgD,EAChD,gDAAgD,EAChD,qCAAqC,EACrC,8CAA8C,EAC9C,yDAAyD,EACzD,+BAA+B,EAC/B,iCAAiC,GAClC,wDAAoD;AAErD,YAAY,EAAE,cAAc,EAAE,oCAAgC;AAE9D,OAAO,EACL,qBAAqB,EACrB,oCAAoC,GACrC,oCAAgC"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,qBAAiB;AACpD,YAAY,EAAE,kBAAkB,EAAE,oBAAgB;AAClD,OAAO,EAAE,wBAAwB,EAAE,oBAAgB;AAEnD,OAAO,EACL,+BAA+B,EAC/B,gCAAgC,GACjC,qDAAiD;AAElD,YAAY,EACV,0BAA0B,EAC1B,mCAAmC,EACnC,4BAA4B,EAC5B,qCAAqC,EACrC,2CAA2C,EAC3C,oDAAoD,EACpD,6CAA6C,EAC7C,6CAA6C,EAC7C,6CAA6C,EAC7C,2BAA2B,EAC3B,8BAA8B,GAC/B,oBAAgB;AAEjB,YAAY,EACV,iDAAiD,EACjD,kDAAkD,EAClD,8DAA8D,EAC9D,gDAAgD,EAChD,4CAA4C,EAC5C,kDAAkD,EAClD,kDAAkD,EAClD,8CAA8C,EAC9C,+CAA+C,EAC/C,gDAAgD,EAChD,gDAAgD,EAChD,qCAAqC,EACrC,8CAA8C,EAC9C,yDAAyD,EACzD,+BAA+B,EAC/B,iCAAiC,GAClC,wDAAoD;AAErD,YAAY,EAAE,cAAc,EAAE,oCAAgC;AAE9D,OAAO,EACL,qBAAqB,EACrB,oCAAoC,GACrC,oCAAgC"}
package/dist/index.d.mts CHANGED
@@ -1,7 +1,6 @@
1
1
  export type { AccountWalletObject } from "./wallet.mjs";
2
- export { isMultichainAccountWallet } from "./wallet.mjs";
3
2
  export type { AccountGroupObject } from "./group.mjs";
4
- export { isAccountGroupNameUnique, isMultichainAccountGroup } from "./group.mjs";
3
+ export { isAccountGroupNameUnique } from "./group.mjs";
5
4
  export { USER_STORAGE_GROUPS_FEATURE_KEY, USER_STORAGE_WALLETS_FEATURE_KEY, } from "./backup-and-sync/user-storage/constants.mjs";
6
5
  export type { AccountTreeControllerState, AccountTreeControllerGetStateAction, AccountTreeControllerActions, AccountTreeControllerStateChangeEvent, AccountTreeControllerAccountTreeChangeEvent, AccountTreeControllerSelectedAccountGroupChangeEvent, AccountTreeControllerAccountGroupCreatedEvent, AccountTreeControllerAccountGroupUpdatedEvent, AccountTreeControllerAccountGroupRemovedEvent, AccountTreeControllerEvents, AccountTreeControllerMessenger, } from "./types.mjs";
7
6
  export type { AccountTreeControllerGetAccountWalletObjectAction, AccountTreeControllerGetAccountWalletObjectsAction, AccountTreeControllerGetAccountsFromSelectedAccountGroupAction, AccountTreeControllerGetAccountGroupObjectAction, AccountTreeControllerGetAccountContextAction, AccountTreeControllerGetSelectedAccountGroupAction, AccountTreeControllerSetSelectedAccountGroupAction, AccountTreeControllerSetAccountGroupNameAction, AccountTreeControllerSetAccountWalletNameAction, AccountTreeControllerSetAccountGroupPinnedAction, AccountTreeControllerSetAccountGroupHiddenAction, AccountTreeControllerClearStateAction, AccountTreeControllerSyncWithUserStorageAction, AccountTreeControllerSyncWithUserStorageAtLeastOnceAction, AccountTreeControllerInitAction, AccountTreeControllerReinitAction, } from "./AccountTreeController-method-action-types.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,qBAAiB;AACpD,OAAO,EAAE,yBAAyB,EAAE,qBAAiB;AACrD,YAAY,EAAE,kBAAkB,EAAE,oBAAgB;AAClD,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,oBAAgB;AAE7E,OAAO,EACL,+BAA+B,EAC/B,gCAAgC,GACjC,qDAAiD;AAElD,YAAY,EACV,0BAA0B,EAC1B,mCAAmC,EACnC,4BAA4B,EAC5B,qCAAqC,EACrC,2CAA2C,EAC3C,oDAAoD,EACpD,6CAA6C,EAC7C,6CAA6C,EAC7C,6CAA6C,EAC7C,2BAA2B,EAC3B,8BAA8B,GAC/B,oBAAgB;AAEjB,YAAY,EACV,iDAAiD,EACjD,kDAAkD,EAClD,8DAA8D,EAC9D,gDAAgD,EAChD,4CAA4C,EAC5C,kDAAkD,EAClD,kDAAkD,EAClD,8CAA8C,EAC9C,+CAA+C,EAC/C,gDAAgD,EAChD,gDAAgD,EAChD,qCAAqC,EACrC,8CAA8C,EAC9C,yDAAyD,EACzD,+BAA+B,EAC/B,iCAAiC,GAClC,wDAAoD;AAErD,YAAY,EAAE,cAAc,EAAE,oCAAgC;AAE9D,OAAO,EACL,qBAAqB,EACrB,oCAAoC,GACrC,oCAAgC"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,qBAAiB;AACpD,YAAY,EAAE,kBAAkB,EAAE,oBAAgB;AAClD,OAAO,EAAE,wBAAwB,EAAE,oBAAgB;AAEnD,OAAO,EACL,+BAA+B,EAC/B,gCAAgC,GACjC,qDAAiD;AAElD,YAAY,EACV,0BAA0B,EAC1B,mCAAmC,EACnC,4BAA4B,EAC5B,qCAAqC,EACrC,2CAA2C,EAC3C,oDAAoD,EACpD,6CAA6C,EAC7C,6CAA6C,EAC7C,6CAA6C,EAC7C,2BAA2B,EAC3B,8BAA8B,GAC/B,oBAAgB;AAEjB,YAAY,EACV,iDAAiD,EACjD,kDAAkD,EAClD,8DAA8D,EAC9D,gDAAgD,EAChD,4CAA4C,EAC5C,kDAAkD,EAClD,kDAAkD,EAClD,8CAA8C,EAC9C,+CAA+C,EAC/C,gDAAgD,EAChD,gDAAgD,EAChD,qCAAqC,EACrC,8CAA8C,EAC9C,yDAAyD,EACzD,+BAA+B,EAC/B,iCAAiC,GAClC,wDAAoD;AAErD,YAAY,EAAE,cAAc,EAAE,oCAAgC;AAE9D,OAAO,EACL,qBAAqB,EACrB,oCAAoC,GACrC,oCAAgC"}
package/dist/index.mjs CHANGED
@@ -1,5 +1,4 @@
1
- export { isMultichainAccountWallet } from "./wallet.mjs";
2
- export { isAccountGroupNameUnique, isMultichainAccountGroup } from "./group.mjs";
1
+ export { isAccountGroupNameUnique } from "./group.mjs";
3
2
  export { USER_STORAGE_GROUPS_FEATURE_KEY, USER_STORAGE_WALLETS_FEATURE_KEY } from "./backup-and-sync/user-storage/constants.mjs";
4
3
  export { AccountTreeController, getDefaultAccountTreeControllerState } from "./AccountTreeController.mjs";
5
4
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,qBAAiB;AAErD,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,oBAAgB;AAE7E,OAAO,EACL,+BAA+B,EAC/B,gCAAgC,EACjC,qDAAiD;AAqClD,OAAO,EACL,qBAAqB,EACrB,oCAAoC,EACrC,oCAAgC","sourcesContent":["export type { AccountWalletObject } from './wallet';\nexport { isMultichainAccountWallet } from './wallet';\nexport type { AccountGroupObject } from './group';\nexport { isAccountGroupNameUnique, isMultichainAccountGroup } from './group';\n\nexport {\n USER_STORAGE_GROUPS_FEATURE_KEY,\n USER_STORAGE_WALLETS_FEATURE_KEY,\n} from './backup-and-sync/user-storage/constants';\n\nexport type {\n AccountTreeControllerState,\n AccountTreeControllerGetStateAction,\n AccountTreeControllerActions,\n AccountTreeControllerStateChangeEvent,\n AccountTreeControllerAccountTreeChangeEvent,\n AccountTreeControllerSelectedAccountGroupChangeEvent,\n AccountTreeControllerAccountGroupCreatedEvent,\n AccountTreeControllerAccountGroupUpdatedEvent,\n AccountTreeControllerAccountGroupRemovedEvent,\n AccountTreeControllerEvents,\n AccountTreeControllerMessenger,\n} from './types';\n\nexport type {\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 AccountTreeControllerInitAction,\n AccountTreeControllerReinitAction,\n} from './AccountTreeController-method-action-types';\n\nexport type { AccountContext } from './AccountTreeController';\n\nexport {\n AccountTreeController,\n getDefaultAccountTreeControllerState,\n} from './AccountTreeController';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,oBAAgB;AAEnD,OAAO,EACL,+BAA+B,EAC/B,gCAAgC,EACjC,qDAAiD;AAqClD,OAAO,EACL,qBAAqB,EACrB,oCAAoC,EACrC,oCAAgC","sourcesContent":["export type { AccountWalletObject } from './wallet';\nexport type { AccountGroupObject } from './group';\nexport { isAccountGroupNameUnique } from './group';\n\nexport {\n USER_STORAGE_GROUPS_FEATURE_KEY,\n USER_STORAGE_WALLETS_FEATURE_KEY,\n} from './backup-and-sync/user-storage/constants';\n\nexport type {\n AccountTreeControllerState,\n AccountTreeControllerGetStateAction,\n AccountTreeControllerActions,\n AccountTreeControllerStateChangeEvent,\n AccountTreeControllerAccountTreeChangeEvent,\n AccountTreeControllerSelectedAccountGroupChangeEvent,\n AccountTreeControllerAccountGroupCreatedEvent,\n AccountTreeControllerAccountGroupUpdatedEvent,\n AccountTreeControllerAccountGroupRemovedEvent,\n AccountTreeControllerEvents,\n AccountTreeControllerMessenger,\n} from './types';\n\nexport type {\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 AccountTreeControllerInitAction,\n AccountTreeControllerReinitAction,\n} from './AccountTreeController-method-action-types';\n\nexport type { AccountContext } from './AccountTreeController';\n\nexport {\n AccountTreeController,\n getDefaultAccountTreeControllerState,\n} from './AccountTreeController';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountGroupId, AccountWalletId } from '@metamask/account-api';\nimport type {\n AccountId,\n AccountsControllerAccountsAddedEvent,\n AccountsControllerAccountsRemovedEvent,\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 {\n MultichainAccountServiceCreateMultichainAccountGroupAction,\n MultichainAccountServiceCreateMultichainAccountGroupsAction,\n MultichainAccountServiceGetMultichainAccountGroupAction,\n MultichainAccountServiceGetMultichainAccountWalletAction,\n} from '@metamask/multichain-account-service';\nimport type {\n MultichainAccountServiceGroupStatusChangeEvent,\n MultichainAccountServiceWalletStatusChangeEvent,\n} from '@metamask/multichain-account-service';\nimport type {\n AuthenticationController,\n UserStorageController,\n} from '@metamask/profile-sync-controller';\nimport type { SnapControllerGetSnapAction } from '@metamask/snaps-controllers';\n\nimport type { controllerName } from './AccountTreeController';\nimport type { AccountTreeControllerMethodActions } from './AccountTreeController-method-action-types';\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';\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 };\n selectedAccountGroup: AccountGroupId | '';\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 AllowedActions =\n | AccountsControllerGetAccountAction\n | AccountsControllerGetSelectedMultichainAccountAction\n | AccountsControllerListMultichainAccountsAction\n | AccountsControllerSetSelectedAccountAction\n | KeyringControllerGetStateAction\n | SnapControllerGetSnapAction\n | UserStorageController.UserStorageControllerGetStateAction\n | UserStorageController.UserStorageControllerPerformGetStorageAction\n | UserStorageController.UserStorageControllerPerformGetStorageAllFeatureEntriesAction\n | UserStorageController.UserStorageControllerPerformSetStorageAction\n | UserStorageController.UserStorageControllerPerformBatchSetStorageAction\n | AuthenticationController.AuthenticationControllerGetSessionProfileAction\n | MultichainAccountServiceCreateMultichainAccountGroupAction\n | MultichainAccountServiceCreateMultichainAccountGroupsAction\n | MultichainAccountServiceGetMultichainAccountGroupAction\n | MultichainAccountServiceGetMultichainAccountWalletAction;\n\nexport type AccountTreeControllerActions =\n | AccountTreeControllerGetStateAction\n | AccountTreeControllerMethodActions;\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\n/**\n * Represents the `AccountTreeController:accountGroupCreated` event.\n * This event is emitted when a new account group is added to the tree\n * after the controller has been initialized.\n */\nexport type AccountTreeControllerAccountGroupCreatedEvent = {\n type: `${typeof controllerName}:accountGroupCreated`;\n payload: [AccountGroupObject];\n};\n\n/**\n * Represents the `AccountTreeController:accountGroupUpdated` event.\n * This event is emitted when an existing account group's metadata or\n * membership changes after the controller has been initialized.\n */\nexport type AccountTreeControllerAccountGroupUpdatedEvent = {\n type: `${typeof controllerName}:accountGroupUpdated`;\n payload: [AccountGroupObject];\n};\n\n/**\n * Represents the `AccountTreeController:accountGroupRemoved` event.\n * This event is emitted when an account group is pruned from the tree\n * (its last account was removed) after the controller has been initialized.\n */\nexport type AccountTreeControllerAccountGroupRemovedEvent = {\n type: `${typeof controllerName}:accountGroupRemoved`;\n payload: [AccountGroupId];\n};\n\nexport type AllowedEvents =\n | AccountsControllerAccountsAddedEvent\n | AccountsControllerAccountsRemovedEvent\n | AccountsControllerSelectedAccountChangeEvent\n | UserStorageController.UserStorageControllerStateChangeEvent\n | MultichainAccountServiceWalletStatusChangeEvent\n | MultichainAccountServiceGroupStatusChangeEvent;\n\nexport type AccountTreeControllerEvents =\n | AccountTreeControllerStateChangeEvent\n | AccountTreeControllerAccountTreeChangeEvent\n | AccountTreeControllerSelectedAccountGroupChangeEvent\n | AccountTreeControllerAccountGroupCreatedEvent\n | AccountTreeControllerAccountGroupUpdatedEvent\n | AccountTreeControllerAccountGroupRemovedEvent;\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.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountGroupId, AccountWalletId } from '@metamask/account-api';\nimport type {\n AccountId,\n AccountsControllerAccountsAddedEvent,\n AccountsControllerAccountsRemovedEvent,\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 {\n MultichainAccountServiceCreateMultichainAccountGroupAction,\n MultichainAccountServiceCreateMultichainAccountGroupsAction,\n} from '@metamask/multichain-account-service';\nimport type { MultichainAccountServiceWalletStatusChangeEvent } from '@metamask/multichain-account-service';\nimport type {\n AuthenticationController,\n UserStorageController,\n} from '@metamask/profile-sync-controller';\nimport type { SnapControllerGetSnapAction } from '@metamask/snaps-controllers';\n\nimport type { controllerName } from './AccountTreeController';\nimport type { AccountTreeControllerMethodActions } from './AccountTreeController-method-action-types';\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';\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 };\n selectedAccountGroup: AccountGroupId | '';\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 AllowedActions =\n | AccountsControllerGetAccountAction\n | AccountsControllerGetSelectedMultichainAccountAction\n | AccountsControllerListMultichainAccountsAction\n | AccountsControllerSetSelectedAccountAction\n | KeyringControllerGetStateAction\n | SnapControllerGetSnapAction\n | UserStorageController.UserStorageControllerGetStateAction\n | UserStorageController.UserStorageControllerPerformGetStorageAction\n | UserStorageController.UserStorageControllerPerformGetStorageAllFeatureEntriesAction\n | UserStorageController.UserStorageControllerPerformSetStorageAction\n | UserStorageController.UserStorageControllerPerformBatchSetStorageAction\n | AuthenticationController.AuthenticationControllerGetSessionProfileAction\n | MultichainAccountServiceCreateMultichainAccountGroupAction\n | MultichainAccountServiceCreateMultichainAccountGroupsAction;\n\nexport type AccountTreeControllerActions =\n | AccountTreeControllerGetStateAction\n | AccountTreeControllerMethodActions;\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\n/**\n * Represents the `AccountTreeController:accountGroupCreated` event.\n * This event is emitted when a new account group is added to the tree\n * after the controller has been initialized.\n */\nexport type AccountTreeControllerAccountGroupCreatedEvent = {\n type: `${typeof controllerName}:accountGroupCreated`;\n payload: [AccountGroupObject];\n};\n\n/**\n * Represents the `AccountTreeController:accountGroupUpdated` event.\n * This event is emitted when an existing account group's metadata or\n * membership changes after the controller has been initialized.\n */\nexport type AccountTreeControllerAccountGroupUpdatedEvent = {\n type: `${typeof controllerName}:accountGroupUpdated`;\n payload: [AccountGroupObject];\n};\n\n/**\n * Represents the `AccountTreeController:accountGroupRemoved` event.\n * This event is emitted when an account group is pruned from the tree\n * (its last account was removed) after the controller has been initialized.\n */\nexport type AccountTreeControllerAccountGroupRemovedEvent = {\n type: `${typeof controllerName}:accountGroupRemoved`;\n payload: [AccountGroupId];\n};\n\nexport type AllowedEvents =\n | AccountsControllerAccountsAddedEvent\n | AccountsControllerAccountsRemovedEvent\n | AccountsControllerSelectedAccountChangeEvent\n | UserStorageController.UserStorageControllerStateChangeEvent\n | MultichainAccountServiceWalletStatusChangeEvent;\n\nexport type AccountTreeControllerEvents =\n | AccountTreeControllerStateChangeEvent\n | AccountTreeControllerAccountTreeChangeEvent\n | AccountTreeControllerSelectedAccountGroupChangeEvent\n | AccountTreeControllerAccountGroupCreatedEvent\n | AccountTreeControllerAccountGroupUpdatedEvent\n | AccountTreeControllerAccountGroupRemovedEvent;\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/dist/types.d.cts CHANGED
@@ -4,8 +4,8 @@ import type { ControllerGetStateAction, ControllerStateChangeEvent } from "@meta
4
4
  import type { TraceCallback } from "@metamask/controller-utils";
5
5
  import type { KeyringControllerGetStateAction } from "@metamask/keyring-controller";
6
6
  import type { Messenger } from "@metamask/messenger";
7
- import type { MultichainAccountServiceCreateMultichainAccountGroupAction, MultichainAccountServiceCreateMultichainAccountGroupsAction, MultichainAccountServiceGetMultichainAccountGroupAction, MultichainAccountServiceGetMultichainAccountWalletAction } from "@metamask/multichain-account-service";
8
- import type { MultichainAccountServiceGroupStatusChangeEvent, MultichainAccountServiceWalletStatusChangeEvent } from "@metamask/multichain-account-service";
7
+ import type { MultichainAccountServiceCreateMultichainAccountGroupAction, MultichainAccountServiceCreateMultichainAccountGroupsAction } from "@metamask/multichain-account-service";
8
+ import type { MultichainAccountServiceWalletStatusChangeEvent } from "@metamask/multichain-account-service";
9
9
  import type { AuthenticationController, UserStorageController } from "@metamask/profile-sync-controller";
10
10
  import type { SnapControllerGetSnapAction } from "@metamask/snaps-controllers";
11
11
  import type { controllerName } from "./AccountTreeController.cjs";
@@ -36,7 +36,7 @@ export type AccountTreeControllerState = {
36
36
  accountWalletsMetadata: Record<AccountWalletId, AccountTreeWalletPersistedMetadata>;
37
37
  };
38
38
  export type AccountTreeControllerGetStateAction = ControllerGetStateAction<typeof controllerName, AccountTreeControllerState>;
39
- export type AllowedActions = AccountsControllerGetAccountAction | AccountsControllerGetSelectedMultichainAccountAction | AccountsControllerListMultichainAccountsAction | AccountsControllerSetSelectedAccountAction | KeyringControllerGetStateAction | SnapControllerGetSnapAction | UserStorageController.UserStorageControllerGetStateAction | UserStorageController.UserStorageControllerPerformGetStorageAction | UserStorageController.UserStorageControllerPerformGetStorageAllFeatureEntriesAction | UserStorageController.UserStorageControllerPerformSetStorageAction | UserStorageController.UserStorageControllerPerformBatchSetStorageAction | AuthenticationController.AuthenticationControllerGetSessionProfileAction | MultichainAccountServiceCreateMultichainAccountGroupAction | MultichainAccountServiceCreateMultichainAccountGroupsAction | MultichainAccountServiceGetMultichainAccountGroupAction | MultichainAccountServiceGetMultichainAccountWalletAction;
39
+ export type AllowedActions = AccountsControllerGetAccountAction | AccountsControllerGetSelectedMultichainAccountAction | AccountsControllerListMultichainAccountsAction | AccountsControllerSetSelectedAccountAction | KeyringControllerGetStateAction | SnapControllerGetSnapAction | UserStorageController.UserStorageControllerGetStateAction | UserStorageController.UserStorageControllerPerformGetStorageAction | UserStorageController.UserStorageControllerPerformGetStorageAllFeatureEntriesAction | UserStorageController.UserStorageControllerPerformSetStorageAction | UserStorageController.UserStorageControllerPerformBatchSetStorageAction | AuthenticationController.AuthenticationControllerGetSessionProfileAction | MultichainAccountServiceCreateMultichainAccountGroupAction | MultichainAccountServiceCreateMultichainAccountGroupsAction;
40
40
  export type AccountTreeControllerActions = AccountTreeControllerGetStateAction | AccountTreeControllerMethodActions;
41
41
  export type AccountTreeControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, AccountTreeControllerState>;
42
42
  /**
@@ -82,7 +82,7 @@ export type AccountTreeControllerAccountGroupRemovedEvent = {
82
82
  type: `${typeof controllerName}:accountGroupRemoved`;
83
83
  payload: [AccountGroupId];
84
84
  };
85
- export type AllowedEvents = AccountsControllerAccountsAddedEvent | AccountsControllerAccountsRemovedEvent | AccountsControllerSelectedAccountChangeEvent | UserStorageController.UserStorageControllerStateChangeEvent | MultichainAccountServiceWalletStatusChangeEvent | MultichainAccountServiceGroupStatusChangeEvent;
85
+ export type AllowedEvents = AccountsControllerAccountsAddedEvent | AccountsControllerAccountsRemovedEvent | AccountsControllerSelectedAccountChangeEvent | UserStorageController.UserStorageControllerStateChangeEvent | MultichainAccountServiceWalletStatusChangeEvent;
86
86
  export type AccountTreeControllerEvents = AccountTreeControllerStateChangeEvent | AccountTreeControllerAccountTreeChangeEvent | AccountTreeControllerSelectedAccountGroupChangeEvent | AccountTreeControllerAccountGroupCreatedEvent | AccountTreeControllerAccountGroupUpdatedEvent | AccountTreeControllerAccountGroupRemovedEvent;
87
87
  export type AccountTreeControllerMessenger = Messenger<typeof controllerName, AccountTreeControllerActions | AllowedActions, AccountTreeControllerEvents | AllowedEvents>;
88
88
  export type AccountTreeControllerConfig = {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE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ACH,CAAC;AAEF,MAAM,MAAM,gDAAgD,GAAG;IAC7D,oBAAoB,EAAE,CAAC,KAAK,EAAE,qCAAqC,KAAK,IAAI,CAAC;CAC9E,CAAC"}
package/dist/types.d.mts CHANGED
@@ -4,8 +4,8 @@ import type { ControllerGetStateAction, ControllerStateChangeEvent } from "@meta
4
4
  import type { TraceCallback } from "@metamask/controller-utils";
5
5
  import type { KeyringControllerGetStateAction } from "@metamask/keyring-controller";
6
6
  import type { Messenger } from "@metamask/messenger";
7
- import type { MultichainAccountServiceCreateMultichainAccountGroupAction, MultichainAccountServiceCreateMultichainAccountGroupsAction, MultichainAccountServiceGetMultichainAccountGroupAction, MultichainAccountServiceGetMultichainAccountWalletAction } from "@metamask/multichain-account-service";
8
- import type { MultichainAccountServiceGroupStatusChangeEvent, MultichainAccountServiceWalletStatusChangeEvent } from "@metamask/multichain-account-service";
7
+ import type { MultichainAccountServiceCreateMultichainAccountGroupAction, MultichainAccountServiceCreateMultichainAccountGroupsAction } from "@metamask/multichain-account-service";
8
+ import type { MultichainAccountServiceWalletStatusChangeEvent } from "@metamask/multichain-account-service";
9
9
  import type { AuthenticationController, UserStorageController } from "@metamask/profile-sync-controller";
10
10
  import type { SnapControllerGetSnapAction } from "@metamask/snaps-controllers";
11
11
  import type { controllerName } from "./AccountTreeController.mjs";
@@ -36,7 +36,7 @@ export type AccountTreeControllerState = {
36
36
  accountWalletsMetadata: Record<AccountWalletId, AccountTreeWalletPersistedMetadata>;
37
37
  };
38
38
  export type AccountTreeControllerGetStateAction = ControllerGetStateAction<typeof controllerName, AccountTreeControllerState>;
39
- export type AllowedActions = AccountsControllerGetAccountAction | AccountsControllerGetSelectedMultichainAccountAction | AccountsControllerListMultichainAccountsAction | AccountsControllerSetSelectedAccountAction | KeyringControllerGetStateAction | SnapControllerGetSnapAction | UserStorageController.UserStorageControllerGetStateAction | UserStorageController.UserStorageControllerPerformGetStorageAction | UserStorageController.UserStorageControllerPerformGetStorageAllFeatureEntriesAction | UserStorageController.UserStorageControllerPerformSetStorageAction | UserStorageController.UserStorageControllerPerformBatchSetStorageAction | AuthenticationController.AuthenticationControllerGetSessionProfileAction | MultichainAccountServiceCreateMultichainAccountGroupAction | MultichainAccountServiceCreateMultichainAccountGroupsAction | MultichainAccountServiceGetMultichainAccountGroupAction | MultichainAccountServiceGetMultichainAccountWalletAction;
39
+ export type AllowedActions = AccountsControllerGetAccountAction | AccountsControllerGetSelectedMultichainAccountAction | AccountsControllerListMultichainAccountsAction | AccountsControllerSetSelectedAccountAction | KeyringControllerGetStateAction | SnapControllerGetSnapAction | UserStorageController.UserStorageControllerGetStateAction | UserStorageController.UserStorageControllerPerformGetStorageAction | UserStorageController.UserStorageControllerPerformGetStorageAllFeatureEntriesAction | UserStorageController.UserStorageControllerPerformSetStorageAction | UserStorageController.UserStorageControllerPerformBatchSetStorageAction | AuthenticationController.AuthenticationControllerGetSessionProfileAction | MultichainAccountServiceCreateMultichainAccountGroupAction | MultichainAccountServiceCreateMultichainAccountGroupsAction;
40
40
  export type AccountTreeControllerActions = AccountTreeControllerGetStateAction | AccountTreeControllerMethodActions;
41
41
  export type AccountTreeControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, AccountTreeControllerState>;
42
42
  /**
@@ -82,7 +82,7 @@ export type AccountTreeControllerAccountGroupRemovedEvent = {
82
82
  type: `${typeof controllerName}:accountGroupRemoved`;
83
83
  payload: [AccountGroupId];
84
84
  };
85
- export type AllowedEvents = AccountsControllerAccountsAddedEvent | AccountsControllerAccountsRemovedEvent | AccountsControllerSelectedAccountChangeEvent | UserStorageController.UserStorageControllerStateChangeEvent | MultichainAccountServiceWalletStatusChangeEvent | MultichainAccountServiceGroupStatusChangeEvent;
85
+ export type AllowedEvents = AccountsControllerAccountsAddedEvent | AccountsControllerAccountsRemovedEvent | AccountsControllerSelectedAccountChangeEvent | UserStorageController.UserStorageControllerStateChangeEvent | MultichainAccountServiceWalletStatusChangeEvent;
86
86
  export type AccountTreeControllerEvents = AccountTreeControllerStateChangeEvent | AccountTreeControllerAccountTreeChangeEvent | AccountTreeControllerSelectedAccountGroupChangeEvent | AccountTreeControllerAccountGroupCreatedEvent | AccountTreeControllerAccountGroupUpdatedEvent | AccountTreeControllerAccountGroupRemovedEvent;
87
87
  export type AccountTreeControllerMessenger = Messenger<typeof controllerName, AccountTreeControllerActions | AllowedActions, AccountTreeControllerEvents | AllowedEvents>;
88
88
  export type AccountTreeControllerConfig = {
@@ -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,oCAAoC,EACpC,sCAAsC,EACtC,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,EACV,0DAA0D,EAC1D,2DAA2D,EAC3D,uDAAuD,EACvD,wDAAwD,EACzD,6CAA6C;AAC9C,OAAO,KAAK,EACV,8CAA8C,EAC9C,+CAA+C,EAChD,6CAA6C;AAC9C,OAAO,KAAK,EACV,wBAAwB,EACxB,qBAAqB,EACtB,0CAA0C;AAC3C,OAAO,KAAK,EAAE,2BAA2B,EAAE,oCAAoC;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,oCAAgC;AAC9D,OAAO,KAAK,EAAE,kCAAkC,EAAE,wDAAoD;AACtG,OAAO,KAAK,EACV,kCAAkC,EAClC,qCAAqC,EACtC,8CAAoC;AACrC,OAAO,KAAK,EACV,kBAAkB,EAClB,iCAAiC,EAClC,oBA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AAc,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 AccountsControllerAccountsAddedEvent,\n AccountsControllerAccountsRemovedEvent,\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 {\n MultichainAccountServiceCreateMultichainAccountGroupAction,\n MultichainAccountServiceCreateMultichainAccountGroupsAction,\n MultichainAccountServiceGetMultichainAccountGroupAction,\n MultichainAccountServiceGetMultichainAccountWalletAction,\n} from '@metamask/multichain-account-service';\nimport type {\n MultichainAccountServiceGroupStatusChangeEvent,\n MultichainAccountServiceWalletStatusChangeEvent,\n} from '@metamask/multichain-account-service';\nimport type {\n AuthenticationController,\n UserStorageController,\n} from '@metamask/profile-sync-controller';\nimport type { SnapControllerGetSnapAction } from '@metamask/snaps-controllers';\n\nimport type { controllerName } from './AccountTreeController';\nimport type { AccountTreeControllerMethodActions } from './AccountTreeController-method-action-types';\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';\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 };\n selectedAccountGroup: AccountGroupId | '';\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 AllowedActions =\n | AccountsControllerGetAccountAction\n | AccountsControllerGetSelectedMultichainAccountAction\n | AccountsControllerListMultichainAccountsAction\n | AccountsControllerSetSelectedAccountAction\n | KeyringControllerGetStateAction\n | SnapControllerGetSnapAction\n | UserStorageController.UserStorageControllerGetStateAction\n | UserStorageController.UserStorageControllerPerformGetStorageAction\n | UserStorageController.UserStorageControllerPerformGetStorageAllFeatureEntriesAction\n | UserStorageController.UserStorageControllerPerformSetStorageAction\n | UserStorageController.UserStorageControllerPerformBatchSetStorageAction\n | AuthenticationController.AuthenticationControllerGetSessionProfileAction\n | MultichainAccountServiceCreateMultichainAccountGroupAction\n | MultichainAccountServiceCreateMultichainAccountGroupsAction\n | MultichainAccountServiceGetMultichainAccountGroupAction\n | MultichainAccountServiceGetMultichainAccountWalletAction;\n\nexport type AccountTreeControllerActions =\n | AccountTreeControllerGetStateAction\n | AccountTreeControllerMethodActions;\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\n/**\n * Represents the `AccountTreeController:accountGroupCreated` event.\n * This event is emitted when a new account group is added to the tree\n * after the controller has been initialized.\n */\nexport type AccountTreeControllerAccountGroupCreatedEvent = {\n type: `${typeof controllerName}:accountGroupCreated`;\n payload: [AccountGroupObject];\n};\n\n/**\n * Represents the `AccountTreeController:accountGroupUpdated` event.\n * This event is emitted when an existing account group's metadata or\n * membership changes after the controller has been initialized.\n */\nexport type AccountTreeControllerAccountGroupUpdatedEvent = {\n type: `${typeof controllerName}:accountGroupUpdated`;\n payload: [AccountGroupObject];\n};\n\n/**\n * Represents the `AccountTreeController:accountGroupRemoved` event.\n * This event is emitted when an account group is pruned from the tree\n * (its last account was removed) after the controller has been initialized.\n */\nexport type AccountTreeControllerAccountGroupRemovedEvent = {\n type: `${typeof controllerName}:accountGroupRemoved`;\n payload: [AccountGroupId];\n};\n\nexport type AllowedEvents =\n | AccountsControllerAccountsAddedEvent\n | AccountsControllerAccountsRemovedEvent\n | AccountsControllerSelectedAccountChangeEvent\n | UserStorageController.UserStorageControllerStateChangeEvent\n | MultichainAccountServiceWalletStatusChangeEvent\n | MultichainAccountServiceGroupStatusChangeEvent;\n\nexport type AccountTreeControllerEvents =\n | AccountTreeControllerStateChangeEvent\n | AccountTreeControllerAccountTreeChangeEvent\n | AccountTreeControllerSelectedAccountGroupChangeEvent\n | AccountTreeControllerAccountGroupCreatedEvent\n | AccountTreeControllerAccountGroupUpdatedEvent\n | AccountTreeControllerAccountGroupRemovedEvent;\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 AccountsControllerAccountsAddedEvent,\n AccountsControllerAccountsRemovedEvent,\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 {\n MultichainAccountServiceCreateMultichainAccountGroupAction,\n MultichainAccountServiceCreateMultichainAccountGroupsAction,\n} from '@metamask/multichain-account-service';\nimport type { MultichainAccountServiceWalletStatusChangeEvent } from '@metamask/multichain-account-service';\nimport type {\n AuthenticationController,\n UserStorageController,\n} from '@metamask/profile-sync-controller';\nimport type { SnapControllerGetSnapAction } from '@metamask/snaps-controllers';\n\nimport type { controllerName } from './AccountTreeController';\nimport type { AccountTreeControllerMethodActions } from './AccountTreeController-method-action-types';\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';\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 };\n selectedAccountGroup: AccountGroupId | '';\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 AllowedActions =\n | AccountsControllerGetAccountAction\n | AccountsControllerGetSelectedMultichainAccountAction\n | AccountsControllerListMultichainAccountsAction\n | AccountsControllerSetSelectedAccountAction\n | KeyringControllerGetStateAction\n | SnapControllerGetSnapAction\n | UserStorageController.UserStorageControllerGetStateAction\n | UserStorageController.UserStorageControllerPerformGetStorageAction\n | UserStorageController.UserStorageControllerPerformGetStorageAllFeatureEntriesAction\n | UserStorageController.UserStorageControllerPerformSetStorageAction\n | UserStorageController.UserStorageControllerPerformBatchSetStorageAction\n | AuthenticationController.AuthenticationControllerGetSessionProfileAction\n | MultichainAccountServiceCreateMultichainAccountGroupAction\n | MultichainAccountServiceCreateMultichainAccountGroupsAction;\n\nexport type AccountTreeControllerActions =\n | AccountTreeControllerGetStateAction\n | AccountTreeControllerMethodActions;\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\n/**\n * Represents the `AccountTreeController:accountGroupCreated` event.\n * This event is emitted when a new account group is added to the tree\n * after the controller has been initialized.\n */\nexport type AccountTreeControllerAccountGroupCreatedEvent = {\n type: `${typeof controllerName}:accountGroupCreated`;\n payload: [AccountGroupObject];\n};\n\n/**\n * Represents the `AccountTreeController:accountGroupUpdated` event.\n * This event is emitted when an existing account group's metadata or\n * membership changes after the controller has been initialized.\n */\nexport type AccountTreeControllerAccountGroupUpdatedEvent = {\n type: `${typeof controllerName}:accountGroupUpdated`;\n payload: [AccountGroupObject];\n};\n\n/**\n * Represents the `AccountTreeController:accountGroupRemoved` event.\n * This event is emitted when an account group is pruned from the tree\n * (its last account was removed) after the controller has been initialized.\n */\nexport type AccountTreeControllerAccountGroupRemovedEvent = {\n type: `${typeof controllerName}:accountGroupRemoved`;\n payload: [AccountGroupId];\n};\n\nexport type AllowedEvents =\n | AccountsControllerAccountsAddedEvent\n | AccountsControllerAccountsRemovedEvent\n | AccountsControllerSelectedAccountChangeEvent\n | UserStorageController.UserStorageControllerStateChangeEvent\n | MultichainAccountServiceWalletStatusChangeEvent;\n\nexport type AccountTreeControllerEvents =\n | AccountTreeControllerStateChangeEvent\n | AccountTreeControllerAccountTreeChangeEvent\n | AccountTreeControllerSelectedAccountGroupChangeEvent\n | AccountTreeControllerAccountGroupCreatedEvent\n | AccountTreeControllerAccountGroupUpdatedEvent\n | AccountTreeControllerAccountGroupRemovedEvent;\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/dist/wallet.cjs CHANGED
@@ -1,19 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isMultichainAccountWallet = void 0;
4
- const account_api_1 = require("@metamask/account-api");
5
- /**
6
- * Returns `true` if the wallet is a multichain account (entropy-backed) wallet,
7
- * narrowing its type to the entropy variant.
8
- *
9
- * Works for both {@link AccountWalletObject} state objects and the intermediate
10
- * rule-result wallet shapes used inside `#insert()`.
11
- *
12
- * @param wallet - The wallet to check.
13
- * @returns `true` if the wallet is a multichain account wallet, `false` otherwise.
14
- */
15
- function isMultichainAccountWallet(wallet) {
16
- return wallet.type === account_api_1.AccountWalletType.Entropy;
17
- }
18
- exports.isMultichainAccountWallet = isMultichainAccountWallet;
19
3
  //# sourceMappingURL=wallet.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"wallet.cjs","sourceRoot":"","sources":["../src/wallet.ts"],"names":[],"mappings":";;;AACA,uDAA0D;AA0H1D;;;;;;;;;GASG;AACH,SAAgB,yBAAyB,CAEvC,MAAa;IACb,OAAO,MAAM,CAAC,IAAI,KAAK,+BAAiB,CAAC,OAAO,CAAC;AACnD,CAAC;AAJD,8DAIC","sourcesContent":["import type { AccountGroupId } from '@metamask/account-api';\nimport { AccountWalletType } from '@metamask/account-api';\nimport type {\n AccountWalletId,\n MultichainAccountWalletId,\n AccountWalletStatus,\n MultichainAccountWalletStatus,\n} from '@metamask/account-api';\nimport type { EntropySourceId } from '@metamask/keyring-api';\nimport type { KeyringTypes } from '@metamask/keyring-controller';\nimport type { SnapId } from '@metamask/snaps-sdk';\n\nimport type {\n AccountGroupMultichainAccountObject,\n AccountGroupObject,\n AccountGroupSingleAccountObject,\n} from './group';\nimport type { UpdatableField, ExtractFieldValues } from './type-utils.js';\n\n/**\n * Persisted metadata for account wallets (stored in controller state for persistence/sync).\n */\nexport type AccountTreeWalletPersistedMetadata = {\n /** Custom name set by user, overrides default naming logic */\n name?: UpdatableField<string>;\n};\n\n/**\n * Tree metadata for account wallets (required plain values extracted from persisted metadata).\n */\nexport type AccountTreeWalletMetadata = Required<\n ExtractFieldValues<AccountTreeWalletPersistedMetadata>\n>;\n\n/**\n * Type constraint for a {@link AccountGroupObject}. If one of its union-members\n * does not match this contraint, {@link AccountGroupObject} will resolve\n * to `never`.\n */\ntype IsAccountWalletObject<\n Type extends {\n type: AccountWalletType;\n id: AccountWalletId;\n status: string; // Has to be refined by the type extending this base type.\n groups: {\n [groupId: AccountGroupId]: AccountGroupObject;\n };\n metadata: AccountTreeWalletMetadata;\n },\n> = Type;\n\n/**\n * Account wallet object for the \"entropy\" wallet category.\n */\nexport type AccountWalletEntropyObject = {\n type: AccountWalletType.Entropy;\n id: MultichainAccountWalletId;\n status: MultichainAccountWalletStatus;\n groups: {\n // NOTE: Using `MultichainAccountGroupId` instead of `AccountGroupId` would introduce\n // some type problems when using a group ID as an `AccountGroupId` directly. This\n // would require some up-cast to a `MultichainAccountGroupId` which could be considered\n // unsafe... So we keep it as a `AccountGroupId` for now.\n [groupId: AccountGroupId]: AccountGroupMultichainAccountObject;\n };\n metadata: AccountTreeWalletMetadata & {\n entropy: {\n id: EntropySourceId;\n };\n };\n};\n\n/**\n * Account wallet object for the \"snap\" wallet category.\n */\nexport type AccountWalletSnapObject = {\n type: AccountWalletType.Snap;\n id: AccountWalletId;\n status: AccountWalletStatus;\n groups: {\n [groupId: AccountGroupId]: AccountGroupSingleAccountObject;\n };\n metadata: AccountTreeWalletMetadata & {\n snap: {\n id: SnapId;\n };\n };\n};\n\n/**\n * Account wallet object for the \"keyring\" wallet category.\n */\nexport type AccountWalletKeyringObject = {\n type: AccountWalletType.Keyring;\n id: AccountWalletId;\n status: AccountWalletStatus;\n groups: {\n [groupId: AccountGroupId]: AccountGroupSingleAccountObject;\n };\n metadata: AccountTreeWalletMetadata & {\n keyring: {\n type: KeyringTypes;\n };\n };\n};\n\n/**\n * Account wallet metadata for the \"keyring\" wallet category.\n */\nexport type AccountWalletObject = IsAccountWalletObject<\n | AccountWalletEntropyObject\n | AccountWalletSnapObject\n | AccountWalletKeyringObject\n>;\n\nexport type AccountWalletObjectOf<WalletType extends AccountWalletType> =\n Extract<\n | { type: AccountWalletType.Entropy; object: AccountWalletEntropyObject }\n | { type: AccountWalletType.Keyring; object: AccountWalletKeyringObject }\n | { type: AccountWalletType.Snap; object: AccountWalletSnapObject },\n { type: WalletType }\n >['object'];\n\n/**\n * Returns `true` if the wallet is a multichain account (entropy-backed) wallet,\n * narrowing its type to the entropy variant.\n *\n * Works for both {@link AccountWalletObject} state objects and the intermediate\n * rule-result wallet shapes used inside `#insert()`.\n *\n * @param wallet - The wallet to check.\n * @returns `true` if the wallet is a multichain account wallet, `false` otherwise.\n */\nexport function isMultichainAccountWallet<\n Value extends { type: AccountWalletType },\n>(wallet: Value): wallet is Value & { type: AccountWalletType.Entropy } {\n return wallet.type === AccountWalletType.Entropy;\n}\n"]}
1
+ {"version":3,"file":"wallet.cjs","sourceRoot":"","sources":["../src/wallet.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountGroupId } from '@metamask/account-api';\nimport type {\n AccountWalletType,\n AccountWalletId,\n MultichainAccountWalletId,\n AccountWalletStatus,\n} from '@metamask/account-api';\nimport type { MultichainAccountWalletStatus } from '@metamask/account-api';\nimport type { EntropySourceId } from '@metamask/keyring-api';\nimport type { KeyringTypes } from '@metamask/keyring-controller';\nimport type { SnapId } from '@metamask/snaps-sdk';\n\nimport type {\n AccountGroupMultichainAccountObject,\n AccountGroupObject,\n AccountGroupSingleAccountObject,\n} from './group';\nimport type { UpdatableField, ExtractFieldValues } from './type-utils.js';\n\n/**\n * Persisted metadata for account wallets (stored in controller state for persistence/sync).\n */\nexport type AccountTreeWalletPersistedMetadata = {\n /** Custom name set by user, overrides default naming logic */\n name?: UpdatableField<string>;\n};\n\n/**\n * Tree metadata for account wallets (required plain values extracted from persisted metadata).\n */\nexport type AccountTreeWalletMetadata = Required<\n ExtractFieldValues<AccountTreeWalletPersistedMetadata>\n>;\n\n/**\n * Type constraint for a {@link AccountGroupObject}. If one of its union-members\n * does not match this contraint, {@link AccountGroupObject} will resolve\n * to `never`.\n */\ntype IsAccountWalletObject<\n Type extends {\n type: AccountWalletType;\n id: AccountWalletId;\n status: string; // Has to be refined by the type extending this base type.\n groups: {\n [groupId: AccountGroupId]: AccountGroupObject;\n };\n metadata: AccountTreeWalletMetadata;\n },\n> = Type;\n\n/**\n * Account wallet object for the \"entropy\" wallet category.\n */\nexport type AccountWalletEntropyObject = {\n type: AccountWalletType.Entropy;\n id: MultichainAccountWalletId;\n status: MultichainAccountWalletStatus;\n groups: {\n // NOTE: Using `MultichainAccountGroupId` instead of `AccountGroupId` would introduce\n // some type problems when using a group ID as an `AccountGroupId` directly. This\n // would require some up-cast to a `MultichainAccountGroupId` which could be considered\n // unsafe... So we keep it as a `AccountGroupId` for now.\n [groupId: AccountGroupId]: AccountGroupMultichainAccountObject;\n };\n metadata: AccountTreeWalletMetadata & {\n entropy: {\n id: EntropySourceId;\n };\n };\n};\n\n/**\n * Account wallet object for the \"snap\" wallet category.\n */\nexport type AccountWalletSnapObject = {\n type: AccountWalletType.Snap;\n id: AccountWalletId;\n status: AccountWalletStatus;\n groups: {\n [groupId: AccountGroupId]: AccountGroupSingleAccountObject;\n };\n metadata: AccountTreeWalletMetadata & {\n snap: {\n id: SnapId;\n };\n };\n};\n\n/**\n * Account wallet object for the \"keyring\" wallet category.\n */\nexport type AccountWalletKeyringObject = {\n type: AccountWalletType.Keyring;\n id: AccountWalletId;\n status: AccountWalletStatus;\n groups: {\n [groupId: AccountGroupId]: AccountGroupSingleAccountObject;\n };\n metadata: AccountTreeWalletMetadata & {\n keyring: {\n type: KeyringTypes;\n };\n };\n};\n\n/**\n * Account wallet metadata for the \"keyring\" wallet category.\n */\nexport type AccountWalletObject = IsAccountWalletObject<\n | AccountWalletEntropyObject\n | AccountWalletSnapObject\n | AccountWalletKeyringObject\n>;\n\nexport type AccountWalletObjectOf<WalletType extends AccountWalletType> =\n Extract<\n | { type: AccountWalletType.Entropy; object: AccountWalletEntropyObject }\n | { type: AccountWalletType.Keyring; object: AccountWalletKeyringObject }\n | { type: AccountWalletType.Snap; object: AccountWalletSnapObject },\n { type: WalletType }\n >['object'];\n"]}