@metamask-previews/account-tree-controller 2.0.0-preview-3d9bbf60 → 2.0.0-preview-e98a6769
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -6
- package/dist/AccountTreeController.cjs +104 -219
- package/dist/AccountTreeController.cjs.map +1 -1
- package/dist/AccountTreeController.d.cts +12 -0
- package/dist/AccountTreeController.d.cts.map +1 -1
- package/dist/AccountTreeController.d.mts +12 -0
- package/dist/AccountTreeController.d.mts.map +1 -1
- package/dist/AccountTreeController.mjs +106 -221
- package/dist/AccountTreeController.mjs.map +1 -1
- package/dist/rules/entropy.cjs +69 -53
- package/dist/rules/entropy.cjs.map +1 -1
- package/dist/rules/entropy.d.cts +12 -24
- package/dist/rules/entropy.d.cts.map +1 -1
- package/dist/rules/entropy.d.mts +12 -24
- package/dist/rules/entropy.d.mts.map +1 -1
- package/dist/rules/entropy.mjs +67 -49
- package/dist/rules/entropy.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +3 -3
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +3 -3
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/package.json +1 -1
package/dist/rules/entropy.d.cts
CHANGED
|
@@ -1,27 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AccountGroupType, AccountWalletType } from "@metamask/account-api";
|
|
2
|
+
import type { InternalAccount } from "@metamask/keyring-internal-api";
|
|
2
3
|
import type { AccountGroupObjectOf } from "../group.cjs";
|
|
3
|
-
import type
|
|
4
|
+
import { BaseRule, type Rule, type RuleResult } from "../rule.cjs";
|
|
4
5
|
import type { AccountWalletObjectOf } from "../wallet.cjs";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* Get computed group name for entropy-based wallet groups.
|
|
15
|
-
*
|
|
16
|
-
* @param messenger - Controller's messenger.
|
|
17
|
-
* @param group - The group to get the name for.
|
|
18
|
-
* @returns The computed name for this group.
|
|
19
|
-
*/
|
|
20
|
-
export declare function getEntropyComputedAccountGroupName(messenger: AccountTreeControllerMessenger, group: AccountGroupObjectOf<AccountGroupType.MultichainAccount>): string;
|
|
21
|
-
/**
|
|
22
|
-
* Get the group name prefix for entropy-based wallet groups.
|
|
23
|
-
*
|
|
24
|
-
* @returns The prefix for entropy-based wallet groups.
|
|
25
|
-
*/
|
|
26
|
-
export declare function getEntropyDefaultAccountGroupPrefix(): string;
|
|
6
|
+
export declare class EntropyRule extends BaseRule implements Rule<AccountWalletType.Entropy, AccountGroupType.MultichainAccount> {
|
|
7
|
+
readonly walletType = AccountWalletType.Entropy;
|
|
8
|
+
readonly groupType = AccountGroupType.MultichainAccount;
|
|
9
|
+
getEntropySourceIndex(entropySource: string): number;
|
|
10
|
+
match(account: InternalAccount): RuleResult<AccountWalletType.Entropy, AccountGroupType.MultichainAccount> | undefined;
|
|
11
|
+
getDefaultAccountWalletName(wallet: AccountWalletObjectOf<AccountWalletType.Entropy>): string;
|
|
12
|
+
getComputedAccountGroupName(group: AccountGroupObjectOf<AccountGroupType.MultichainAccount>): string;
|
|
13
|
+
getDefaultAccountGroupPrefix(_wallet: AccountWalletObjectOf<AccountWalletType.Entropy>): string;
|
|
14
|
+
}
|
|
27
15
|
//# sourceMappingURL=entropy.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entropy.d.cts","sourceRoot":"","sources":["../../src/rules/entropy.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"entropy.d.cts","sourceRoot":"","sources":["../../src/rules/entropy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EAIlB,8BAA8B;AAG/B,OAAO,KAAK,EAAE,eAAe,EAAE,uCAAuC;AAEtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAiB;AACrD,OAAO,EAAE,QAAQ,EAAE,KAAK,IAAI,EAAE,KAAK,UAAU,EAAE,oBAAgB;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAkB;AAEvD,qBAAa,WACX,SAAQ,QACR,YAAW,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,CAAC,iBAAiB,CAAC;IAE9E,QAAQ,CAAC,UAAU,6BAA6B;IAEhD,QAAQ,CAAC,SAAS,sCAAsC;IAExD,qBAAqB,CAAC,aAAa,EAAE,MAAM;IAQ3C,KAAK,CACH,OAAO,EAAE,eAAe,GAEtB,UAAU,CAAC,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,GACzE,SAAS;IA6Cb,2BAA2B,CACzB,MAAM,EAAE,qBAAqB,CAAC,iBAAiB,CAAC,OAAO,CAAC,GACvD,MAAM;IAUT,2BAA2B,CACzB,KAAK,EAAE,oBAAoB,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,GAC9D,MAAM;IAcT,4BAA4B,CAC1B,OAAO,EAAE,qBAAqB,CAAC,iBAAiB,CAAC,OAAO,CAAC,GACxD,MAAM;CAGV"}
|
package/dist/rules/entropy.d.mts
CHANGED
|
@@ -1,27 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AccountGroupType, AccountWalletType } from "@metamask/account-api";
|
|
2
|
+
import type { InternalAccount } from "@metamask/keyring-internal-api";
|
|
2
3
|
import type { AccountGroupObjectOf } from "../group.mjs";
|
|
3
|
-
import type
|
|
4
|
+
import { BaseRule, type Rule, type RuleResult } from "../rule.mjs";
|
|
4
5
|
import type { AccountWalletObjectOf } from "../wallet.mjs";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* Get computed group name for entropy-based wallet groups.
|
|
15
|
-
*
|
|
16
|
-
* @param messenger - Controller's messenger.
|
|
17
|
-
* @param group - The group to get the name for.
|
|
18
|
-
* @returns The computed name for this group.
|
|
19
|
-
*/
|
|
20
|
-
export declare function getEntropyComputedAccountGroupName(messenger: AccountTreeControllerMessenger, group: AccountGroupObjectOf<AccountGroupType.MultichainAccount>): string;
|
|
21
|
-
/**
|
|
22
|
-
* Get the group name prefix for entropy-based wallet groups.
|
|
23
|
-
*
|
|
24
|
-
* @returns The prefix for entropy-based wallet groups.
|
|
25
|
-
*/
|
|
26
|
-
export declare function getEntropyDefaultAccountGroupPrefix(): string;
|
|
6
|
+
export declare class EntropyRule extends BaseRule implements Rule<AccountWalletType.Entropy, AccountGroupType.MultichainAccount> {
|
|
7
|
+
readonly walletType = AccountWalletType.Entropy;
|
|
8
|
+
readonly groupType = AccountGroupType.MultichainAccount;
|
|
9
|
+
getEntropySourceIndex(entropySource: string): number;
|
|
10
|
+
match(account: InternalAccount): RuleResult<AccountWalletType.Entropy, AccountGroupType.MultichainAccount> | undefined;
|
|
11
|
+
getDefaultAccountWalletName(wallet: AccountWalletObjectOf<AccountWalletType.Entropy>): string;
|
|
12
|
+
getComputedAccountGroupName(group: AccountGroupObjectOf<AccountGroupType.MultichainAccount>): string;
|
|
13
|
+
getDefaultAccountGroupPrefix(_wallet: AccountWalletObjectOf<AccountWalletType.Entropy>): string;
|
|
14
|
+
}
|
|
27
15
|
//# sourceMappingURL=entropy.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entropy.d.mts","sourceRoot":"","sources":["../../src/rules/entropy.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"entropy.d.mts","sourceRoot":"","sources":["../../src/rules/entropy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EAIlB,8BAA8B;AAG/B,OAAO,KAAK,EAAE,eAAe,EAAE,uCAAuC;AAEtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAiB;AACrD,OAAO,EAAE,QAAQ,EAAE,KAAK,IAAI,EAAE,KAAK,UAAU,EAAE,oBAAgB;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAkB;AAEvD,qBAAa,WACX,SAAQ,QACR,YAAW,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,CAAC,iBAAiB,CAAC;IAE9E,QAAQ,CAAC,UAAU,6BAA6B;IAEhD,QAAQ,CAAC,SAAS,sCAAsC;IAExD,qBAAqB,CAAC,aAAa,EAAE,MAAM;IAQ3C,KAAK,CACH,OAAO,EAAE,eAAe,GAEtB,UAAU,CAAC,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,GACzE,SAAS;IA6Cb,2BAA2B,CACzB,MAAM,EAAE,qBAAqB,CAAC,iBAAiB,CAAC,OAAO,CAAC,GACvD,MAAM;IAUT,2BAA2B,CACzB,KAAK,EAAE,oBAAoB,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,GAC9D,MAAM;IAcT,4BAA4B,CAC1B,OAAO,EAAE,qBAAqB,CAAC,iBAAiB,CAAC,OAAO,CAAC,GACxD,MAAM;CAGV"}
|
package/dist/rules/entropy.mjs
CHANGED
|
@@ -1,55 +1,73 @@
|
|
|
1
|
+
import { AccountGroupType, AccountWalletType, isBip44Account, toMultichainAccountGroupId, toMultichainAccountWalletId } from "@metamask/account-api";
|
|
1
2
|
import { isEvmAccountType } from "@metamask/keyring-api";
|
|
2
3
|
import { KeyringTypes } from "@metamask/keyring-controller";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// well-defined here.
|
|
26
|
-
const entropySourceIndex = getEntropySourceIndex(messenger, wallet.metadata.entropy.id);
|
|
27
|
-
return `Wallet ${entropySourceIndex + 1}`; // Use human indexing (starts at 1).
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Get computed group name for entropy-based wallet groups.
|
|
31
|
-
*
|
|
32
|
-
* @param messenger - Controller's messenger.
|
|
33
|
-
* @param group - The group to get the name for.
|
|
34
|
-
* @returns The computed name for this group.
|
|
35
|
-
*/
|
|
36
|
-
export function getEntropyComputedAccountGroupName(messenger, group) {
|
|
37
|
-
// Only use EVM account names for multichain groups to avoid chain-specific names becoming group names.
|
|
38
|
-
// Non-EVM account names should not be used as group names since groups represent multichain collections.
|
|
39
|
-
for (const id of group.accounts) {
|
|
40
|
-
const account = messenger.call('AccountsController:getAccount', id);
|
|
41
|
-
if (account && isEvmAccountType(account.type)) {
|
|
42
|
-
return account.metadata.name;
|
|
4
|
+
import { BaseRule } from "../rule.mjs";
|
|
5
|
+
export class EntropyRule extends BaseRule {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.walletType = AccountWalletType.Entropy;
|
|
9
|
+
this.groupType = AccountGroupType.MultichainAccount;
|
|
10
|
+
}
|
|
11
|
+
getEntropySourceIndex(entropySource) {
|
|
12
|
+
const { keyrings } = this.messenger.call('KeyringController:getState');
|
|
13
|
+
return keyrings
|
|
14
|
+
.filter((keyring) => keyring.type === KeyringTypes.hd)
|
|
15
|
+
.findIndex((keyring) => keyring.metadata.id === entropySource);
|
|
16
|
+
}
|
|
17
|
+
match(account) {
|
|
18
|
+
if (!isBip44Account(account)) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
const entropySource = account.options.entropy.id;
|
|
22
|
+
const entropySourceIndex = this.getEntropySourceIndex(entropySource);
|
|
23
|
+
if (entropySourceIndex === -1) {
|
|
24
|
+
console.warn(`! Found an unknown entropy ID: "${entropySource}", account "${account.id}" won't be grouped by entropy.`);
|
|
25
|
+
return undefined;
|
|
43
26
|
}
|
|
27
|
+
const walletId = toMultichainAccountWalletId(entropySource);
|
|
28
|
+
const groupId = toMultichainAccountGroupId(walletId, account.options.entropy.groupIndex);
|
|
29
|
+
return {
|
|
30
|
+
wallet: {
|
|
31
|
+
type: this.walletType,
|
|
32
|
+
id: walletId,
|
|
33
|
+
metadata: {
|
|
34
|
+
entropy: {
|
|
35
|
+
id: entropySource,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
group: {
|
|
40
|
+
type: this.groupType,
|
|
41
|
+
id: groupId,
|
|
42
|
+
metadata: {
|
|
43
|
+
entropy: {
|
|
44
|
+
groupIndex: account.options.entropy.groupIndex,
|
|
45
|
+
},
|
|
46
|
+
pinned: false,
|
|
47
|
+
hidden: false,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
getDefaultAccountWalletName(wallet) {
|
|
53
|
+
// NOTE: We have checked during the rule matching, so we can safely assume it will
|
|
54
|
+
// well-defined here.
|
|
55
|
+
const entropySourceIndex = this.getEntropySourceIndex(wallet.metadata.entropy.id);
|
|
56
|
+
return `Wallet ${entropySourceIndex + 1}`; // Use human indexing (starts at 1).
|
|
57
|
+
}
|
|
58
|
+
getComputedAccountGroupName(group) {
|
|
59
|
+
// Only use EVM account names for multichain groups to avoid chain-specific names becoming group names.
|
|
60
|
+
// Non-EVM account names should not be used as group names since groups represent multichain collections.
|
|
61
|
+
for (const id of group.accounts) {
|
|
62
|
+
const account = this.messenger.call('AccountsController:getAccount', id);
|
|
63
|
+
if (account && isEvmAccountType(account.type)) {
|
|
64
|
+
return account.metadata.name;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return '';
|
|
68
|
+
}
|
|
69
|
+
getDefaultAccountGroupPrefix(_wallet) {
|
|
70
|
+
return 'Account';
|
|
44
71
|
}
|
|
45
|
-
return '';
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Get the group name prefix for entropy-based wallet groups.
|
|
49
|
-
*
|
|
50
|
-
* @returns The prefix for entropy-based wallet groups.
|
|
51
|
-
*/
|
|
52
|
-
export function getEntropyDefaultAccountGroupPrefix() {
|
|
53
|
-
return 'Account';
|
|
54
72
|
}
|
|
55
73
|
//# sourceMappingURL=entropy.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entropy.mjs","sourceRoot":"","sources":["../../src/rules/entropy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entropy.mjs","sourceRoot":"","sources":["../../src/rules/entropy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,0BAA0B,EAC1B,2BAA2B,EAC5B,8BAA8B;AAC/B,OAAO,EAAE,gBAAgB,EAAE,8BAA8B;AACzD,OAAO,EAAE,YAAY,EAAE,qCAAqC;AAI5D,OAAO,EAAE,QAAQ,EAA8B,oBAAgB;AAG/D,MAAM,OAAO,WACX,SAAQ,QAAQ;IADlB;;QAIW,eAAU,GAAG,iBAAiB,CAAC,OAAO,CAAC;QAEvC,cAAS,GAAG,gBAAgB,CAAC,iBAAiB,CAAC;IA4F1D,CAAC;IA1FC,qBAAqB,CAAC,aAAqB;QACzC,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;QAEvE,OAAO,QAAQ;aACZ,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAM,YAAY,CAAC,EAAa,CAAC;aACjE,SAAS,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,KAAK,aAAa,CAAC,CAAC;IACnE,CAAC;IAED,KAAK,CACH,OAAwB;QAIxB,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE;YAC5B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zG,KAAK,MAAM,EAAE,IAAI,KAAK,CAAC,QAAQ,EAAE;YAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,+BAA+B,EAAE,EAAE,CAAC,CAAC;YAEzE,IAAI,OAAO,IAAI,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBAC7C,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;aAC9B;SACF;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,4BAA4B,CAC1B,OAAyD;QAEzD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["import {\n AccountGroupType,\n AccountWalletType,\n isBip44Account,\n toMultichainAccountGroupId,\n toMultichainAccountWalletId,\n} from '@metamask/account-api';\nimport { isEvmAccountType } from '@metamask/keyring-api';\nimport { KeyringTypes } from '@metamask/keyring-controller';\nimport type { InternalAccount } from '@metamask/keyring-internal-api';\n\nimport type { AccountGroupObjectOf } from '../group';\nimport { BaseRule, type Rule, type RuleResult } from '../rule';\nimport type { AccountWalletObjectOf } from '../wallet';\n\nexport class EntropyRule\n extends BaseRule\n implements Rule<AccountWalletType.Entropy, AccountGroupType.MultichainAccount>\n{\n readonly walletType = AccountWalletType.Entropy;\n\n readonly groupType = AccountGroupType.MultichainAccount;\n\n getEntropySourceIndex(entropySource: string) {\n const { keyrings } = this.messenger.call('KeyringController:getState');\n\n return keyrings\n .filter((keyring) => keyring.type === (KeyringTypes.hd as string))\n .findIndex((keyring) => keyring.metadata.id === entropySource);\n }\n\n match(\n account: InternalAccount,\n ):\n | RuleResult<AccountWalletType.Entropy, AccountGroupType.MultichainAccount>\n | undefined {\n if (!isBip44Account(account)) {\n return undefined;\n }\n\n const entropySource = account.options.entropy.id;\n const entropySourceIndex = this.getEntropySourceIndex(entropySource);\n if (entropySourceIndex === -1) {\n console.warn(\n `! Found an unknown entropy ID: \"${entropySource}\", account \"${account.id}\" won't be grouped by entropy.`,\n );\n return undefined;\n }\n\n const walletId = toMultichainAccountWalletId(entropySource);\n const groupId = toMultichainAccountGroupId(\n walletId,\n account.options.entropy.groupIndex,\n );\n\n return {\n wallet: {\n type: this.walletType,\n id: walletId,\n metadata: {\n entropy: {\n id: entropySource,\n },\n },\n },\n\n group: {\n type: this.groupType,\n id: groupId,\n metadata: {\n entropy: {\n groupIndex: account.options.entropy.groupIndex,\n },\n pinned: false,\n hidden: false,\n },\n },\n };\n }\n\n getDefaultAccountWalletName(\n wallet: AccountWalletObjectOf<AccountWalletType.Entropy>,\n ): string {\n // NOTE: We have checked during the rule matching, so we can safely assume it will\n // well-defined here.\n const entropySourceIndex = this.getEntropySourceIndex(\n wallet.metadata.entropy.id,\n );\n\n return `Wallet ${entropySourceIndex + 1}`; // Use human indexing (starts at 1).\n }\n\n getComputedAccountGroupName(\n group: AccountGroupObjectOf<AccountGroupType.MultichainAccount>,\n ): string {\n // Only use EVM account names for multichain groups to avoid chain-specific names becoming group names.\n // Non-EVM account names should not be used as group names since groups represent multichain collections.\n for (const id of group.accounts) {\n const account = this.messenger.call('AccountsController:getAccount', id);\n\n if (account && isEvmAccountType(account.type)) {\n return account.metadata.name;\n }\n }\n\n return '';\n }\n\n getDefaultAccountGroupPrefix(\n _wallet: AccountWalletObjectOf<AccountWalletType.Entropy>,\n ): string {\n return 'Account';\n }\n}\n"]}
|
package/dist/types.cjs.map
CHANGED
|
@@ -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 AccountsControllerAccountAddedEvent,\n AccountsControllerAccountRemovedEvent,\n AccountsControllerGetAccountAction,\n AccountsControllerGetSelectedMultichainAccountAction,\n AccountsControllerListMultichainAccountsAction,\n AccountsControllerSelectedAccountChangeEvent,\n AccountsControllerSetSelectedAccountAction,\n} from '@metamask/accounts-controller';\nimport {\n type ControllerGetStateAction,\n type ControllerStateChangeEvent,\n} from '@metamask/base-controller';\nimport type { TraceCallback } from '@metamask/controller-utils';\nimport type { KeyringControllerGetStateAction } from '@metamask/keyring-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { MultichainAccountServiceCreateMultichainAccountGroupAction } from '@metamask/multichain-account-service';\nimport type {\n AuthenticationController,\n UserStorageController,\n} from '@metamask/profile-sync-controller';\nimport type { GetSnap as SnapControllerGetSnap } from '@metamask/snaps-controllers';\n\nimport type {\n AccountTreeController,\n controllerName,\n} from './AccountTreeController';\nimport type {\n BackupAndSyncAnalyticsEventPayload,\n BackupAndSyncEmitAnalyticsEventParams,\n} from './backup-and-sync/analytics';\nimport type {\n AccountGroupObject,\n AccountTreeGroupPersistedMetadata,\n} from './group';\nimport type {\n AccountWalletObject,\n AccountTreeWalletPersistedMetadata,\n} from './wallet';\nimport type {
|
|
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 AccountsControllerAccountAddedEvent,\n AccountsControllerAccountRemovedEvent,\n AccountsControllerGetAccountAction,\n AccountsControllerGetSelectedMultichainAccountAction,\n AccountsControllerListMultichainAccountsAction,\n AccountsControllerSelectedAccountChangeEvent,\n AccountsControllerSetSelectedAccountAction,\n} from '@metamask/accounts-controller';\nimport {\n type ControllerGetStateAction,\n type ControllerStateChangeEvent,\n} from '@metamask/base-controller';\nimport type { TraceCallback } from '@metamask/controller-utils';\nimport type { KeyringControllerGetStateAction } from '@metamask/keyring-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { MultichainAccountServiceCreateMultichainAccountGroupAction } from '@metamask/multichain-account-service';\nimport type {\n AuthenticationController,\n UserStorageController,\n} from '@metamask/profile-sync-controller';\nimport type { GetSnap as SnapControllerGetSnap } from '@metamask/snaps-controllers';\n\nimport type {\n AccountTreeController,\n controllerName,\n} from './AccountTreeController';\nimport type {\n BackupAndSyncAnalyticsEventPayload,\n BackupAndSyncEmitAnalyticsEventParams,\n} from './backup-and-sync/analytics';\nimport type {\n AccountGroupObject,\n AccountTreeGroupPersistedMetadata,\n} from './group';\nimport type {\n AccountWalletObject,\n AccountTreeWalletPersistedMetadata,\n} from './wallet';\nimport type { MultichainAccountServiceWalletStatusChangeEvent } from '../../multichain-account-service/src/types';\n\n// Backward compatibility aliases using indexed access types\n/**\n * @deprecated Use AccountTreeGroupMetadata for tree objects or AccountTreeGroupPersistedMetadata for controller state\n */\nexport type AccountGroupMetadata = AccountGroupObject['metadata'];\n\n/**\n * @deprecated Use AccountTreeWalletMetadata for tree objects or AccountTreeWalletPersistedMetadata for controller state\n */\nexport type AccountWalletMetadata = AccountWalletObject['metadata'];\n\nexport type AccountTreeControllerState = {\n accountTree: {\n wallets: {\n // Wallets:\n [walletId: AccountWalletId]: AccountWalletObject;\n };\n selectedAccountGroup: AccountGroupId | '';\n };\n isAccountTreeSyncingInProgress: boolean;\n hasAccountTreeSyncingSyncedAtLeastOnce: boolean;\n /** Persistent metadata for account groups (names, pinning, hiding, sync timestamps) */\n accountGroupsMetadata: Record<\n AccountGroupId,\n AccountTreeGroupPersistedMetadata\n >;\n /** Persistent metadata for account wallets (names, sync timestamps) */\n accountWalletsMetadata: Record<\n AccountWalletId,\n AccountTreeWalletPersistedMetadata\n >;\n};\n\nexport type AccountTreeControllerGetStateAction = ControllerGetStateAction<\n typeof controllerName,\n AccountTreeControllerState\n>;\n\nexport type AccountTreeControllerSetSelectedAccountGroupAction = {\n type: `${typeof controllerName}:setSelectedAccountGroup`;\n handler: AccountTreeController['setSelectedAccountGroup'];\n};\n\nexport type AccountTreeControllerGetSelectedAccountGroupAction = {\n type: `${typeof controllerName}:getSelectedAccountGroup`;\n handler: AccountTreeController['getSelectedAccountGroup'];\n};\n\nexport type AccountTreeControllerGetAccountsFromSelectedAccountGroupAction = {\n type: `${typeof controllerName}:getAccountsFromSelectedAccountGroup`;\n handler: AccountTreeController['getAccountsFromSelectedAccountGroup'];\n};\n\nexport type AccountTreeControllerSetAccountWalletNameAction = {\n type: `${typeof controllerName}:setAccountWalletName`;\n handler: AccountTreeController['setAccountWalletName'];\n};\n\nexport type AccountTreeControllerSetAccountGroupNameAction = {\n type: `${typeof controllerName}:setAccountGroupName`;\n handler: AccountTreeController['setAccountGroupName'];\n};\n\nexport type AccountTreeControllerSetAccountGroupHiddenAction = {\n type: `${typeof controllerName}:setAccountGroupHidden`;\n handler: AccountTreeController['setAccountGroupHidden'];\n};\n\nexport type AccountTreeControllerSetAccountGroupPinnedAction = {\n type: `${typeof controllerName}:setAccountGroupPinned`;\n handler: AccountTreeController['setAccountGroupPinned'];\n};\n\nexport type AllowedActions =\n | AccountsControllerGetAccountAction\n | AccountsControllerGetSelectedMultichainAccountAction\n | AccountsControllerListMultichainAccountsAction\n | AccountsControllerSetSelectedAccountAction\n | KeyringControllerGetStateAction\n | SnapControllerGetSnap\n | UserStorageController.UserStorageControllerGetStateAction\n | UserStorageController.UserStorageControllerPerformGetStorage\n | UserStorageController.UserStorageControllerPerformGetStorageAllFeatureEntries\n | UserStorageController.UserStorageControllerPerformSetStorage\n | UserStorageController.UserStorageControllerPerformBatchSetStorage\n | AuthenticationController.AuthenticationControllerGetSessionProfile\n | MultichainAccountServiceCreateMultichainAccountGroupAction;\n\nexport type AccountTreeControllerActions =\n | AccountTreeControllerGetStateAction\n | AccountTreeControllerSetSelectedAccountGroupAction\n | AccountTreeControllerGetSelectedAccountGroupAction\n | AccountTreeControllerGetAccountsFromSelectedAccountGroupAction\n | AccountTreeControllerSetAccountWalletNameAction\n | AccountTreeControllerSetAccountGroupNameAction\n | AccountTreeControllerSetAccountGroupPinnedAction\n | AccountTreeControllerSetAccountGroupHiddenAction;\n\nexport type AccountTreeControllerStateChangeEvent = ControllerStateChangeEvent<\n typeof controllerName,\n AccountTreeControllerState\n>;\n\n/**\n * Represents the `AccountTreeController:accountTreeChange` event.\n * This event is emitted when nodes (wallets, groups, or accounts) are added or removed.\n */\nexport type AccountTreeControllerAccountTreeChangeEvent = {\n type: `${typeof controllerName}:accountTreeChange`;\n payload: [AccountTreeControllerState['accountTree']];\n};\n\n/**\n * Represents the `AccountTreeController:selectedAccountGroupChange` event.\n * This event is emitted when the selected account group changes.\n */\nexport type AccountTreeControllerSelectedAccountGroupChangeEvent = {\n type: `${typeof controllerName}:selectedAccountGroupChange`;\n payload: [AccountGroupId | '', AccountGroupId | ''];\n};\n\nexport type AllowedEvents =\n | AccountsControllerAccountAddedEvent\n | AccountsControllerAccountRemovedEvent\n | AccountsControllerSelectedAccountChangeEvent\n | UserStorageController.UserStorageControllerStateChangeEvent\n | MultichainAccountServiceWalletStatusChangeEvent;\n\nexport type AccountTreeControllerEvents =\n | AccountTreeControllerStateChangeEvent\n | AccountTreeControllerAccountTreeChangeEvent\n | AccountTreeControllerSelectedAccountGroupChangeEvent;\n\nexport type AccountTreeControllerMessenger = Messenger<\n typeof controllerName,\n AccountTreeControllerActions | AllowedActions,\n AccountTreeControllerEvents | AllowedEvents\n>;\n\nexport type AccountTreeControllerConfig = {\n trace?: TraceCallback;\n backupAndSync?: {\n onBackupAndSyncEvent?: (event: BackupAndSyncAnalyticsEventPayload) => void;\n };\n accountOrderCallbacks?: {\n isHiddenAccount?: (accountId: AccountId) => boolean;\n isPinnedAccount?: (accountId: AccountId) => boolean;\n };\n};\n\nexport type AccountTreeControllerInternalBackupAndSyncConfig = {\n emitAnalyticsEventFn: (event: BackupAndSyncEmitAnalyticsEventParams) => void;\n};\n"]}
|
package/dist/types.d.cts
CHANGED
|
@@ -11,7 +11,7 @@ import type { AccountTreeController, controllerName } from "./AccountTreeControl
|
|
|
11
11
|
import type { BackupAndSyncAnalyticsEventPayload, BackupAndSyncEmitAnalyticsEventParams } from "./backup-and-sync/analytics/index.cjs";
|
|
12
12
|
import type { AccountGroupObject, AccountTreeGroupPersistedMetadata } from "./group.cjs";
|
|
13
13
|
import type { AccountWalletObject, AccountTreeWalletPersistedMetadata } from "./wallet.cjs";
|
|
14
|
-
import type {
|
|
14
|
+
import type { MultichainAccountServiceWalletStatusChangeEvent } from "../../multichain-account-service/src/types.cjs";
|
|
15
15
|
/**
|
|
16
16
|
* @deprecated Use AccountTreeGroupMetadata for tree objects or AccountTreeGroupPersistedMetadata for controller state
|
|
17
17
|
*/
|
|
@@ -63,7 +63,7 @@ export type AccountTreeControllerSetAccountGroupPinnedAction = {
|
|
|
63
63
|
type: `${typeof controllerName}:setAccountGroupPinned`;
|
|
64
64
|
handler: AccountTreeController['setAccountGroupPinned'];
|
|
65
65
|
};
|
|
66
|
-
export type AllowedActions = AccountsControllerGetAccountAction | AccountsControllerGetSelectedMultichainAccountAction | AccountsControllerListMultichainAccountsAction | AccountsControllerSetSelectedAccountAction | KeyringControllerGetStateAction | SnapControllerGetSnap | UserStorageController.UserStorageControllerGetStateAction | UserStorageController.UserStorageControllerPerformGetStorage | UserStorageController.UserStorageControllerPerformGetStorageAllFeatureEntries | UserStorageController.UserStorageControllerPerformSetStorage | UserStorageController.UserStorageControllerPerformBatchSetStorage | AuthenticationController.AuthenticationControllerGetSessionProfile |
|
|
66
|
+
export type AllowedActions = AccountsControllerGetAccountAction | AccountsControllerGetSelectedMultichainAccountAction | AccountsControllerListMultichainAccountsAction | AccountsControllerSetSelectedAccountAction | KeyringControllerGetStateAction | SnapControllerGetSnap | UserStorageController.UserStorageControllerGetStateAction | UserStorageController.UserStorageControllerPerformGetStorage | UserStorageController.UserStorageControllerPerformGetStorageAllFeatureEntries | UserStorageController.UserStorageControllerPerformSetStorage | UserStorageController.UserStorageControllerPerformBatchSetStorage | AuthenticationController.AuthenticationControllerGetSessionProfile | MultichainAccountServiceCreateMultichainAccountGroupAction;
|
|
67
67
|
export type AccountTreeControllerActions = AccountTreeControllerGetStateAction | AccountTreeControllerSetSelectedAccountGroupAction | AccountTreeControllerGetSelectedAccountGroupAction | AccountTreeControllerGetAccountsFromSelectedAccountGroupAction | AccountTreeControllerSetAccountWalletNameAction | AccountTreeControllerSetAccountGroupNameAction | AccountTreeControllerSetAccountGroupPinnedAction | AccountTreeControllerSetAccountGroupHiddenAction;
|
|
68
68
|
export type AccountTreeControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, AccountTreeControllerState>;
|
|
69
69
|
/**
|
|
@@ -82,7 +82,7 @@ export type AccountTreeControllerSelectedAccountGroupChangeEvent = {
|
|
|
82
82
|
type: `${typeof controllerName}:selectedAccountGroupChange`;
|
|
83
83
|
payload: [AccountGroupId | '', AccountGroupId | ''];
|
|
84
84
|
};
|
|
85
|
-
export type AllowedEvents = AccountsControllerAccountAddedEvent | AccountsControllerAccountRemovedEvent | AccountsControllerSelectedAccountChangeEvent | UserStorageController.UserStorageControllerStateChangeEvent |
|
|
85
|
+
export type AllowedEvents = AccountsControllerAccountAddedEvent | AccountsControllerAccountRemovedEvent | AccountsControllerSelectedAccountChangeEvent | UserStorageController.UserStorageControllerStateChangeEvent | MultichainAccountServiceWalletStatusChangeEvent;
|
|
86
86
|
export type AccountTreeControllerEvents = AccountTreeControllerStateChangeEvent | AccountTreeControllerAccountTreeChangeEvent | AccountTreeControllerSelectedAccountGroupChangeEvent;
|
|
87
87
|
export type AccountTreeControllerMessenger = Messenger<typeof controllerName, AccountTreeControllerActions | AllowedActions, AccountTreeControllerEvents | AllowedEvents>;
|
|
88
88
|
export type AccountTreeControllerConfig = {
|
package/dist/types.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,8BAA8B;AAC7E,OAAO,KAAK,EACV,SAAS,EACT,mCAAmC,EACnC,qCAAqC,EACrC,kCAAkC,EAClC,oDAAoD,EACpD,8CAA8C,EAC9C,4CAA4C,EAC5C,0CAA0C,EAC3C,sCAAsC;AACvC,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,0BA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package/dist/types.d.mts
CHANGED
|
@@ -11,7 +11,7 @@ import type { AccountTreeController, controllerName } from "./AccountTreeControl
|
|
|
11
11
|
import type { BackupAndSyncAnalyticsEventPayload, BackupAndSyncEmitAnalyticsEventParams } from "./backup-and-sync/analytics/index.mjs";
|
|
12
12
|
import type { AccountGroupObject, AccountTreeGroupPersistedMetadata } from "./group.mjs";
|
|
13
13
|
import type { AccountWalletObject, AccountTreeWalletPersistedMetadata } from "./wallet.mjs";
|
|
14
|
-
import type {
|
|
14
|
+
import type { MultichainAccountServiceWalletStatusChangeEvent } from "../../multichain-account-service/src/types.mjs";
|
|
15
15
|
/**
|
|
16
16
|
* @deprecated Use AccountTreeGroupMetadata for tree objects or AccountTreeGroupPersistedMetadata for controller state
|
|
17
17
|
*/
|
|
@@ -63,7 +63,7 @@ export type AccountTreeControllerSetAccountGroupPinnedAction = {
|
|
|
63
63
|
type: `${typeof controllerName}:setAccountGroupPinned`;
|
|
64
64
|
handler: AccountTreeController['setAccountGroupPinned'];
|
|
65
65
|
};
|
|
66
|
-
export type AllowedActions = AccountsControllerGetAccountAction | AccountsControllerGetSelectedMultichainAccountAction | AccountsControllerListMultichainAccountsAction | AccountsControllerSetSelectedAccountAction | KeyringControllerGetStateAction | SnapControllerGetSnap | UserStorageController.UserStorageControllerGetStateAction | UserStorageController.UserStorageControllerPerformGetStorage | UserStorageController.UserStorageControllerPerformGetStorageAllFeatureEntries | UserStorageController.UserStorageControllerPerformSetStorage | UserStorageController.UserStorageControllerPerformBatchSetStorage | AuthenticationController.AuthenticationControllerGetSessionProfile |
|
|
66
|
+
export type AllowedActions = AccountsControllerGetAccountAction | AccountsControllerGetSelectedMultichainAccountAction | AccountsControllerListMultichainAccountsAction | AccountsControllerSetSelectedAccountAction | KeyringControllerGetStateAction | SnapControllerGetSnap | UserStorageController.UserStorageControllerGetStateAction | UserStorageController.UserStorageControllerPerformGetStorage | UserStorageController.UserStorageControllerPerformGetStorageAllFeatureEntries | UserStorageController.UserStorageControllerPerformSetStorage | UserStorageController.UserStorageControllerPerformBatchSetStorage | AuthenticationController.AuthenticationControllerGetSessionProfile | MultichainAccountServiceCreateMultichainAccountGroupAction;
|
|
67
67
|
export type AccountTreeControllerActions = AccountTreeControllerGetStateAction | AccountTreeControllerSetSelectedAccountGroupAction | AccountTreeControllerGetSelectedAccountGroupAction | AccountTreeControllerGetAccountsFromSelectedAccountGroupAction | AccountTreeControllerSetAccountWalletNameAction | AccountTreeControllerSetAccountGroupNameAction | AccountTreeControllerSetAccountGroupPinnedAction | AccountTreeControllerSetAccountGroupHiddenAction;
|
|
68
68
|
export type AccountTreeControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, AccountTreeControllerState>;
|
|
69
69
|
/**
|
|
@@ -82,7 +82,7 @@ export type AccountTreeControllerSelectedAccountGroupChangeEvent = {
|
|
|
82
82
|
type: `${typeof controllerName}:selectedAccountGroupChange`;
|
|
83
83
|
payload: [AccountGroupId | '', AccountGroupId | ''];
|
|
84
84
|
};
|
|
85
|
-
export type AllowedEvents = AccountsControllerAccountAddedEvent | AccountsControllerAccountRemovedEvent | AccountsControllerSelectedAccountChangeEvent | UserStorageController.UserStorageControllerStateChangeEvent |
|
|
85
|
+
export type AllowedEvents = AccountsControllerAccountAddedEvent | AccountsControllerAccountRemovedEvent | AccountsControllerSelectedAccountChangeEvent | UserStorageController.UserStorageControllerStateChangeEvent | MultichainAccountServiceWalletStatusChangeEvent;
|
|
86
86
|
export type AccountTreeControllerEvents = AccountTreeControllerStateChangeEvent | AccountTreeControllerAccountTreeChangeEvent | AccountTreeControllerSelectedAccountGroupChangeEvent;
|
|
87
87
|
export type AccountTreeControllerMessenger = Messenger<typeof controllerName, AccountTreeControllerActions | AllowedActions, AccountTreeControllerEvents | AllowedEvents>;
|
|
88
88
|
export type AccountTreeControllerConfig = {
|
package/dist/types.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,8BAA8B;AAC7E,OAAO,KAAK,EACV,SAAS,EACT,mCAAmC,EACnC,qCAAqC,EACrC,kCAAkC,EAClC,oDAAoD,EACpD,8CAA8C,EAC9C,4CAA4C,EAC5C,0CAA0C,EAC3C,sCAAsC;AACvC,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAChC,kCAAkC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,mCAAmC;AAChE,OAAO,KAAK,EAAE,+BAA+B,EAAE,qCAAqC;AACpF,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AACrD,OAAO,KAAK,EAAE,0DAA0D,EAAE,6CAA6C;AACvH,OAAO,KAAK,EACV,wBAAwB,EACxB,qBAAqB,EACtB,0CAA0C;AAC3C,OAAO,KAAK,EAAE,OAAO,IAAI,qBAAqB,EAAE,oCAAoC;AAEpF,OAAO,KAAK,EACV,qBAAqB,EACrB,cAAc,EACf,oCAAgC;AACjC,OAAO,KAAK,EACV,kCAAkC,EAClC,qCAAqC,EACtC,8CAAoC;AACrC,OAAO,KAAK,EACV,kBAAkB,EAClB,iCAAiC,EAClC,oBAAgB;AACjB,OAAO,KAAK,EACV,mBAAmB,EACnB,kCAAkC,EACnC,qBAAiB;AAClB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,8BAA8B;AAC7E,OAAO,KAAK,EACV,SAAS,EACT,mCAAmC,EACnC,qCAAqC,EACrC,kCAAkC,EAClC,oDAAoD,EACpD,8CAA8C,EAC9C,4CAA4C,EAC5C,0CAA0C,EAC3C,sCAAsC;AACvC,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAChC,kCAAkC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,m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ACtB,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"}
|
package/dist/types.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountGroupId, AccountWalletId } from '@metamask/account-api';\nimport type {\n AccountId,\n AccountsControllerAccountAddedEvent,\n AccountsControllerAccountRemovedEvent,\n AccountsControllerGetAccountAction,\n AccountsControllerGetSelectedMultichainAccountAction,\n AccountsControllerListMultichainAccountsAction,\n AccountsControllerSelectedAccountChangeEvent,\n AccountsControllerSetSelectedAccountAction,\n} from '@metamask/accounts-controller';\nimport {\n type ControllerGetStateAction,\n type ControllerStateChangeEvent,\n} from '@metamask/base-controller';\nimport type { TraceCallback } from '@metamask/controller-utils';\nimport type { KeyringControllerGetStateAction } from '@metamask/keyring-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { MultichainAccountServiceCreateMultichainAccountGroupAction } from '@metamask/multichain-account-service';\nimport type {\n AuthenticationController,\n UserStorageController,\n} from '@metamask/profile-sync-controller';\nimport type { GetSnap as SnapControllerGetSnap } from '@metamask/snaps-controllers';\n\nimport type {\n AccountTreeController,\n controllerName,\n} from './AccountTreeController';\nimport type {\n BackupAndSyncAnalyticsEventPayload,\n BackupAndSyncEmitAnalyticsEventParams,\n} from './backup-and-sync/analytics';\nimport type {\n AccountGroupObject,\n AccountTreeGroupPersistedMetadata,\n} from './group';\nimport type {\n AccountWalletObject,\n AccountTreeWalletPersistedMetadata,\n} from './wallet';\nimport type {
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountGroupId, AccountWalletId } from '@metamask/account-api';\nimport type {\n AccountId,\n AccountsControllerAccountAddedEvent,\n AccountsControllerAccountRemovedEvent,\n AccountsControllerGetAccountAction,\n AccountsControllerGetSelectedMultichainAccountAction,\n AccountsControllerListMultichainAccountsAction,\n AccountsControllerSelectedAccountChangeEvent,\n AccountsControllerSetSelectedAccountAction,\n} from '@metamask/accounts-controller';\nimport {\n type ControllerGetStateAction,\n type ControllerStateChangeEvent,\n} from '@metamask/base-controller';\nimport type { TraceCallback } from '@metamask/controller-utils';\nimport type { KeyringControllerGetStateAction } from '@metamask/keyring-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { MultichainAccountServiceCreateMultichainAccountGroupAction } from '@metamask/multichain-account-service';\nimport type {\n AuthenticationController,\n UserStorageController,\n} from '@metamask/profile-sync-controller';\nimport type { GetSnap as SnapControllerGetSnap } from '@metamask/snaps-controllers';\n\nimport type {\n AccountTreeController,\n controllerName,\n} from './AccountTreeController';\nimport type {\n BackupAndSyncAnalyticsEventPayload,\n BackupAndSyncEmitAnalyticsEventParams,\n} from './backup-and-sync/analytics';\nimport type {\n AccountGroupObject,\n AccountTreeGroupPersistedMetadata,\n} from './group';\nimport type {\n AccountWalletObject,\n AccountTreeWalletPersistedMetadata,\n} from './wallet';\nimport type { MultichainAccountServiceWalletStatusChangeEvent } from '../../multichain-account-service/src/types';\n\n// Backward compatibility aliases using indexed access types\n/**\n * @deprecated Use AccountTreeGroupMetadata for tree objects or AccountTreeGroupPersistedMetadata for controller state\n */\nexport type AccountGroupMetadata = AccountGroupObject['metadata'];\n\n/**\n * @deprecated Use AccountTreeWalletMetadata for tree objects or AccountTreeWalletPersistedMetadata for controller state\n */\nexport type AccountWalletMetadata = AccountWalletObject['metadata'];\n\nexport type AccountTreeControllerState = {\n accountTree: {\n wallets: {\n // Wallets:\n [walletId: AccountWalletId]: AccountWalletObject;\n };\n selectedAccountGroup: AccountGroupId | '';\n };\n isAccountTreeSyncingInProgress: boolean;\n hasAccountTreeSyncingSyncedAtLeastOnce: boolean;\n /** Persistent metadata for account groups (names, pinning, hiding, sync timestamps) */\n accountGroupsMetadata: Record<\n AccountGroupId,\n AccountTreeGroupPersistedMetadata\n >;\n /** Persistent metadata for account wallets (names, sync timestamps) */\n accountWalletsMetadata: Record<\n AccountWalletId,\n AccountTreeWalletPersistedMetadata\n >;\n};\n\nexport type AccountTreeControllerGetStateAction = ControllerGetStateAction<\n typeof controllerName,\n AccountTreeControllerState\n>;\n\nexport type AccountTreeControllerSetSelectedAccountGroupAction = {\n type: `${typeof controllerName}:setSelectedAccountGroup`;\n handler: AccountTreeController['setSelectedAccountGroup'];\n};\n\nexport type AccountTreeControllerGetSelectedAccountGroupAction = {\n type: `${typeof controllerName}:getSelectedAccountGroup`;\n handler: AccountTreeController['getSelectedAccountGroup'];\n};\n\nexport type AccountTreeControllerGetAccountsFromSelectedAccountGroupAction = {\n type: `${typeof controllerName}:getAccountsFromSelectedAccountGroup`;\n handler: AccountTreeController['getAccountsFromSelectedAccountGroup'];\n};\n\nexport type AccountTreeControllerSetAccountWalletNameAction = {\n type: `${typeof controllerName}:setAccountWalletName`;\n handler: AccountTreeController['setAccountWalletName'];\n};\n\nexport type AccountTreeControllerSetAccountGroupNameAction = {\n type: `${typeof controllerName}:setAccountGroupName`;\n handler: AccountTreeController['setAccountGroupName'];\n};\n\nexport type AccountTreeControllerSetAccountGroupHiddenAction = {\n type: `${typeof controllerName}:setAccountGroupHidden`;\n handler: AccountTreeController['setAccountGroupHidden'];\n};\n\nexport type AccountTreeControllerSetAccountGroupPinnedAction = {\n type: `${typeof controllerName}:setAccountGroupPinned`;\n handler: AccountTreeController['setAccountGroupPinned'];\n};\n\nexport type AllowedActions =\n | AccountsControllerGetAccountAction\n | AccountsControllerGetSelectedMultichainAccountAction\n | AccountsControllerListMultichainAccountsAction\n | AccountsControllerSetSelectedAccountAction\n | KeyringControllerGetStateAction\n | SnapControllerGetSnap\n | UserStorageController.UserStorageControllerGetStateAction\n | UserStorageController.UserStorageControllerPerformGetStorage\n | UserStorageController.UserStorageControllerPerformGetStorageAllFeatureEntries\n | UserStorageController.UserStorageControllerPerformSetStorage\n | UserStorageController.UserStorageControllerPerformBatchSetStorage\n | AuthenticationController.AuthenticationControllerGetSessionProfile\n | MultichainAccountServiceCreateMultichainAccountGroupAction;\n\nexport type AccountTreeControllerActions =\n | AccountTreeControllerGetStateAction\n | AccountTreeControllerSetSelectedAccountGroupAction\n | AccountTreeControllerGetSelectedAccountGroupAction\n | AccountTreeControllerGetAccountsFromSelectedAccountGroupAction\n | AccountTreeControllerSetAccountWalletNameAction\n | AccountTreeControllerSetAccountGroupNameAction\n | AccountTreeControllerSetAccountGroupPinnedAction\n | AccountTreeControllerSetAccountGroupHiddenAction;\n\nexport type AccountTreeControllerStateChangeEvent = ControllerStateChangeEvent<\n typeof controllerName,\n AccountTreeControllerState\n>;\n\n/**\n * Represents the `AccountTreeController:accountTreeChange` event.\n * This event is emitted when nodes (wallets, groups, or accounts) are added or removed.\n */\nexport type AccountTreeControllerAccountTreeChangeEvent = {\n type: `${typeof controllerName}:accountTreeChange`;\n payload: [AccountTreeControllerState['accountTree']];\n};\n\n/**\n * Represents the `AccountTreeController:selectedAccountGroupChange` event.\n * This event is emitted when the selected account group changes.\n */\nexport type AccountTreeControllerSelectedAccountGroupChangeEvent = {\n type: `${typeof controllerName}:selectedAccountGroupChange`;\n payload: [AccountGroupId | '', AccountGroupId | ''];\n};\n\nexport type AllowedEvents =\n | AccountsControllerAccountAddedEvent\n | AccountsControllerAccountRemovedEvent\n | AccountsControllerSelectedAccountChangeEvent\n | UserStorageController.UserStorageControllerStateChangeEvent\n | MultichainAccountServiceWalletStatusChangeEvent;\n\nexport type AccountTreeControllerEvents =\n | AccountTreeControllerStateChangeEvent\n | AccountTreeControllerAccountTreeChangeEvent\n | AccountTreeControllerSelectedAccountGroupChangeEvent;\n\nexport type AccountTreeControllerMessenger = Messenger<\n typeof controllerName,\n AccountTreeControllerActions | AllowedActions,\n AccountTreeControllerEvents | AllowedEvents\n>;\n\nexport type AccountTreeControllerConfig = {\n trace?: TraceCallback;\n backupAndSync?: {\n onBackupAndSyncEvent?: (event: BackupAndSyncAnalyticsEventPayload) => void;\n };\n accountOrderCallbacks?: {\n isHiddenAccount?: (accountId: AccountId) => boolean;\n isPinnedAccount?: (accountId: AccountId) => boolean;\n };\n};\n\nexport type AccountTreeControllerInternalBackupAndSyncConfig = {\n emitAnalyticsEventFn: (event: BackupAndSyncEmitAnalyticsEventParams) => void;\n};\n"]}
|
package/package.json
CHANGED