@metamask/accounts-controller 36.0.1 → 37.0.0

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.
Files changed (54) hide show
  1. package/CHANGELOG.md +24 -1
  2. package/dist/AccountsController-method-action-types.cjs +7 -0
  3. package/dist/AccountsController-method-action-types.cjs.map +1 -0
  4. package/dist/AccountsController-method-action-types.d.cts +167 -0
  5. package/dist/AccountsController-method-action-types.d.cts.map +1 -0
  6. package/dist/AccountsController-method-action-types.d.mts +167 -0
  7. package/dist/AccountsController-method-action-types.d.mts.map +1 -0
  8. package/dist/AccountsController-method-action-types.mjs +6 -0
  9. package/dist/AccountsController-method-action-types.mjs.map +1 -0
  10. package/dist/AccountsController.cjs +96 -37
  11. package/dist/AccountsController.cjs.map +1 -1
  12. package/dist/AccountsController.d.cts +103 -57
  13. package/dist/AccountsController.d.cts.map +1 -1
  14. package/dist/AccountsController.d.mts +103 -57
  15. package/dist/AccountsController.d.mts.map +1 -1
  16. package/dist/AccountsController.mjs +97 -38
  17. package/dist/AccountsController.mjs.map +1 -1
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +2 -1
  20. package/dist/index.d.cts.map +1 -1
  21. package/dist/index.d.mts +2 -1
  22. package/dist/index.d.mts.map +1 -1
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/logger.cjs +8 -0
  25. package/dist/logger.cjs.map +1 -0
  26. package/dist/logger.d.cts +5 -0
  27. package/dist/logger.d.cts.map +1 -0
  28. package/dist/logger.d.mts +5 -0
  29. package/dist/logger.d.mts.map +1 -0
  30. package/dist/logger.mjs +5 -0
  31. package/dist/logger.mjs.map +1 -0
  32. package/dist/typing.cjs.map +1 -1
  33. package/dist/typing.d.cts +1 -0
  34. package/dist/typing.d.cts.map +1 -1
  35. package/dist/typing.d.mts +1 -0
  36. package/dist/typing.d.mts.map +1 -1
  37. package/dist/typing.mjs.map +1 -1
  38. package/dist/utils.cjs +9 -1
  39. package/dist/utils.cjs.map +1 -1
  40. package/dist/utils.d.cts +2 -0
  41. package/dist/utils.d.cts.map +1 -1
  42. package/dist/utils.d.mts +2 -0
  43. package/dist/utils.d.mts.map +1 -1
  44. package/dist/utils.mjs +7 -0
  45. package/dist/utils.mjs.map +1 -1
  46. package/package.json +3 -2
  47. package/dist/tests/mocks.cjs +0 -89
  48. package/dist/tests/mocks.cjs.map +0 -1
  49. package/dist/tests/mocks.d.cts +0 -26
  50. package/dist/tests/mocks.d.cts.map +0 -1
  51. package/dist/tests/mocks.d.mts +0 -26
  52. package/dist/tests/mocks.d.mts.map +0 -1
  53. package/dist/tests/mocks.mjs +0 -83
  54. package/dist/tests/mocks.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [37.0.0]
11
+
12
+ ### Added
13
+
14
+ - Add `accountIdByAddress` mapping to state ([#7893](https://github.com/MetaMask/core/pull/7893))
15
+ - This state was added to improve lookup times for an account by address from O(n) to O(1).
16
+ - `getAccountByAddress` also leverages this new map, thus, should be slightly faster too.
17
+ - Add logging capabilities ([#8118](https://github.com/MetaMask/core/pull/8118/))
18
+ - Expose missing public `AccountsController` methods through its messenger ([#7976](https://github.com/MetaMask/core/pull/7976/))
19
+ - The following actions are now available:
20
+ - `AccountController:loadBackupAction`
21
+ - Corresponding action types (e.g. `AccountControllerLoadBackupAction`) are available as well.
22
+
23
+ ### Deprecated
24
+
25
+ - Mark `AccountsController`, all of its public methods, and all exported types as deprecated in favor of `AccountTreeController`, `MultichainAccountService`, and Keyring API v2 ([#8027](https://github.com/MetaMask/core/pull/8027))
26
+
27
+ ### Removed
28
+
29
+ - **BREAKING:** Remove `getAccountExpect` from `AccountsController` ([#7976](https://github.com/MetaMask/core/pull/7976))
30
+ - This method was only used internally.
31
+
10
32
  ## [36.0.1]
11
33
 
12
34
  ### Changed
@@ -699,7 +721,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
699
721
 
700
722
  - Initial release ([#1637](https://github.com/MetaMask/core/pull/1637))
701
723
 
702
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/accounts-controller@36.0.1...HEAD
724
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/accounts-controller@37.0.0...HEAD
725
+ [37.0.0]: https://github.com/MetaMask/core/compare/@metamask/accounts-controller@36.0.1...@metamask/accounts-controller@37.0.0
703
726
  [36.0.1]: https://github.com/MetaMask/core/compare/@metamask/accounts-controller@36.0.0...@metamask/accounts-controller@36.0.1
704
727
  [36.0.0]: https://github.com/MetaMask/core/compare/@metamask/accounts-controller@35.0.2...@metamask/accounts-controller@36.0.0
705
728
  [35.0.2]: https://github.com/MetaMask/core/compare/@metamask/accounts-controller@35.0.1...@metamask/accounts-controller@35.0.2
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * This file is auto generated by `scripts/generate-method-action-types.ts`.
4
+ * Do not edit manually.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=AccountsController-method-action-types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountsController-method-action-types.cjs","sourceRoot":"","sources":["../src/AccountsController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated by `scripts/generate-method-action-types.ts`.\n * Do not edit manually.\n */\n\nimport type { AccountsController } from './AccountsController';\n\n/**\n * Returns the internal account object for the given account ID, if it exists.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @param accountId - The ID of the account to retrieve.\n * @returns The internal account object, or undefined if the account does not exist.\n */\nexport type AccountsControllerGetAccountAction = {\n type: `AccountsController:getAccount`;\n handler: AccountsController['getAccount'];\n};\n\n/**\n * Returns the internal account objects for the given account IDs, if they exist.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @param accountIds - The IDs of the accounts to retrieve.\n * @returns The internal account objects, or undefined if the account(s) do not exist.\n */\nexport type AccountsControllerGetAccountsAction = {\n type: `AccountsController:getAccounts`;\n handler: AccountsController['getAccounts'];\n};\n\n/**\n * Returns an array of all evm internal accounts.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @returns An array of InternalAccount objects.\n */\nexport type AccountsControllerListAccountsAction = {\n type: `AccountsController:listAccounts`;\n handler: AccountsController['listAccounts'];\n};\n\n/**\n * Returns an array of all internal accounts.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @param chainId - The chain ID.\n * @returns An array of InternalAccount objects.\n */\nexport type AccountsControllerListMultichainAccountsAction = {\n type: `AccountsController:listMultichainAccounts`;\n handler: AccountsController['listMultichainAccounts'];\n};\n\n/**\n * Returns the last selected EVM account.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @returns The selected internal account.\n */\nexport type AccountsControllerGetSelectedAccountAction = {\n type: `AccountsController:getSelectedAccount`;\n handler: AccountsController['getSelectedAccount'];\n};\n\n/**\n * __WARNING The return value may be undefined if there isn't an account for that chain id.__\n *\n * Retrieves the last selected account by chain ID.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @param chainId - The chain ID to filter the accounts.\n * @returns The last selected account compatible with the specified chain ID or undefined.\n */\nexport type AccountsControllerGetSelectedMultichainAccountAction = {\n type: `AccountsController:getSelectedMultichainAccount`;\n handler: AccountsController['getSelectedMultichainAccount'];\n};\n\n/**\n * Returns the account with the specified address.\n * ! This method will only return the first account that matches the address\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @param address - The address of the account to retrieve.\n * @returns The account with the specified address, or undefined if not found.\n */\nexport type AccountsControllerGetAccountByAddressAction = {\n type: `AccountsController:getAccountByAddress`;\n handler: AccountsController['getAccountByAddress'];\n};\n\n/**\n * Sets the selected account by its ID.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @param accountId - The ID of the account to be selected.\n */\nexport type AccountsControllerSetSelectedAccountAction = {\n type: `AccountsController:setSelectedAccount`;\n handler: AccountsController['setSelectedAccount'];\n};\n\n/**\n * Sets the name of the account with the given ID.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @param accountId - The ID of the account to set the name for.\n * @param accountName - The new name for the account.\n * @throws An error if an account with the same name already exists.\n */\nexport type AccountsControllerSetAccountNameAction = {\n type: `AccountsController:setAccountName`;\n handler: AccountsController['setAccountName'];\n};\n\n/**\n * Sets the name of the account with the given ID and select it.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @param accountId - The ID of the account to set the name for and select.\n * @param accountName - The new name for the account.\n * @throws An error if an account with the same name already exists.\n */\nexport type AccountsControllerSetAccountNameAndSelectAccountAction = {\n type: `AccountsController:setAccountNameAndSelectAccount`;\n handler: AccountsController['setAccountNameAndSelectAccount'];\n};\n\n/**\n * Updates the metadata of the account with the given ID.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @param accountId - The ID of the account for which the metadata will be updated.\n * @param metadata - The new metadata for the account.\n */\nexport type AccountsControllerUpdateAccountMetadataAction = {\n type: `AccountsController:updateAccountMetadata`;\n handler: AccountsController['updateAccountMetadata'];\n};\n\n/**\n * Updates the internal accounts list by retrieving normal and snap accounts,\n * removing duplicates, and updating the metadata of each account.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @returns A Promise that resolves when the accounts have been updated.\n */\nexport type AccountsControllerUpdateAccountsAction = {\n type: `AccountsController:updateAccounts`;\n handler: AccountsController['updateAccounts'];\n};\n\n/**\n * Loads the backup state of the accounts controller.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @param backup - The backup state to load.\n */\nexport type AccountsControllerLoadBackupAction = {\n type: `AccountsController:loadBackup`;\n handler: AccountsController['loadBackup'];\n};\n\n/**\n * Union of all AccountsController action types.\n */\nexport type AccountsControllerMethodActions =\n | AccountsControllerGetAccountAction\n | AccountsControllerGetAccountsAction\n | AccountsControllerListAccountsAction\n | AccountsControllerListMultichainAccountsAction\n | AccountsControllerGetSelectedAccountAction\n | AccountsControllerGetSelectedMultichainAccountAction\n | AccountsControllerGetAccountByAddressAction\n | AccountsControllerSetSelectedAccountAction\n | AccountsControllerSetAccountNameAction\n | AccountsControllerSetAccountNameAndSelectAccountAction\n | AccountsControllerUpdateAccountMetadataAction\n | AccountsControllerUpdateAccountsAction\n | AccountsControllerLoadBackupAction;\n"]}
@@ -0,0 +1,167 @@
1
+ /**
2
+ * This file is auto generated by `scripts/generate-method-action-types.ts`.
3
+ * Do not edit manually.
4
+ */
5
+ import type { AccountsController } from "./AccountsController.cjs";
6
+ /**
7
+ * Returns the internal account object for the given account ID, if it exists.
8
+ *
9
+ * @deprecated This method is deprecated and will be removed in a future version.
10
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
11
+ * @param accountId - The ID of the account to retrieve.
12
+ * @returns The internal account object, or undefined if the account does not exist.
13
+ */
14
+ export type AccountsControllerGetAccountAction = {
15
+ type: `AccountsController:getAccount`;
16
+ handler: AccountsController['getAccount'];
17
+ };
18
+ /**
19
+ * Returns the internal account objects for the given account IDs, if they exist.
20
+ *
21
+ * @deprecated This method is deprecated and will be removed in a future version.
22
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
23
+ * @param accountIds - The IDs of the accounts to retrieve.
24
+ * @returns The internal account objects, or undefined if the account(s) do not exist.
25
+ */
26
+ export type AccountsControllerGetAccountsAction = {
27
+ type: `AccountsController:getAccounts`;
28
+ handler: AccountsController['getAccounts'];
29
+ };
30
+ /**
31
+ * Returns an array of all evm internal accounts.
32
+ *
33
+ * @deprecated This method is deprecated and will be removed in a future version.
34
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
35
+ * @returns An array of InternalAccount objects.
36
+ */
37
+ export type AccountsControllerListAccountsAction = {
38
+ type: `AccountsController:listAccounts`;
39
+ handler: AccountsController['listAccounts'];
40
+ };
41
+ /**
42
+ * Returns an array of all internal accounts.
43
+ *
44
+ * @deprecated This method is deprecated and will be removed in a future version.
45
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
46
+ * @param chainId - The chain ID.
47
+ * @returns An array of InternalAccount objects.
48
+ */
49
+ export type AccountsControllerListMultichainAccountsAction = {
50
+ type: `AccountsController:listMultichainAccounts`;
51
+ handler: AccountsController['listMultichainAccounts'];
52
+ };
53
+ /**
54
+ * Returns the last selected EVM account.
55
+ *
56
+ * @deprecated This method is deprecated and will be removed in a future version.
57
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
58
+ * @returns The selected internal account.
59
+ */
60
+ export type AccountsControllerGetSelectedAccountAction = {
61
+ type: `AccountsController:getSelectedAccount`;
62
+ handler: AccountsController['getSelectedAccount'];
63
+ };
64
+ /**
65
+ * __WARNING The return value may be undefined if there isn't an account for that chain id.__
66
+ *
67
+ * Retrieves the last selected account by chain ID.
68
+ *
69
+ * @deprecated This method is deprecated and will be removed in a future version.
70
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
71
+ * @param chainId - The chain ID to filter the accounts.
72
+ * @returns The last selected account compatible with the specified chain ID or undefined.
73
+ */
74
+ export type AccountsControllerGetSelectedMultichainAccountAction = {
75
+ type: `AccountsController:getSelectedMultichainAccount`;
76
+ handler: AccountsController['getSelectedMultichainAccount'];
77
+ };
78
+ /**
79
+ * Returns the account with the specified address.
80
+ * ! This method will only return the first account that matches the address
81
+ *
82
+ * @deprecated This method is deprecated and will be removed in a future version.
83
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
84
+ * @param address - The address of the account to retrieve.
85
+ * @returns The account with the specified address, or undefined if not found.
86
+ */
87
+ export type AccountsControllerGetAccountByAddressAction = {
88
+ type: `AccountsController:getAccountByAddress`;
89
+ handler: AccountsController['getAccountByAddress'];
90
+ };
91
+ /**
92
+ * Sets the selected account by its ID.
93
+ *
94
+ * @deprecated This method is deprecated and will be removed in a future version.
95
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
96
+ * @param accountId - The ID of the account to be selected.
97
+ */
98
+ export type AccountsControllerSetSelectedAccountAction = {
99
+ type: `AccountsController:setSelectedAccount`;
100
+ handler: AccountsController['setSelectedAccount'];
101
+ };
102
+ /**
103
+ * Sets the name of the account with the given ID.
104
+ *
105
+ * @deprecated This method is deprecated and will be removed in a future version.
106
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
107
+ * @param accountId - The ID of the account to set the name for.
108
+ * @param accountName - The new name for the account.
109
+ * @throws An error if an account with the same name already exists.
110
+ */
111
+ export type AccountsControllerSetAccountNameAction = {
112
+ type: `AccountsController:setAccountName`;
113
+ handler: AccountsController['setAccountName'];
114
+ };
115
+ /**
116
+ * Sets the name of the account with the given ID and select it.
117
+ *
118
+ * @deprecated This method is deprecated and will be removed in a future version.
119
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
120
+ * @param accountId - The ID of the account to set the name for and select.
121
+ * @param accountName - The new name for the account.
122
+ * @throws An error if an account with the same name already exists.
123
+ */
124
+ export type AccountsControllerSetAccountNameAndSelectAccountAction = {
125
+ type: `AccountsController:setAccountNameAndSelectAccount`;
126
+ handler: AccountsController['setAccountNameAndSelectAccount'];
127
+ };
128
+ /**
129
+ * Updates the metadata of the account with the given ID.
130
+ *
131
+ * @deprecated This method is deprecated and will be removed in a future version.
132
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
133
+ * @param accountId - The ID of the account for which the metadata will be updated.
134
+ * @param metadata - The new metadata for the account.
135
+ */
136
+ export type AccountsControllerUpdateAccountMetadataAction = {
137
+ type: `AccountsController:updateAccountMetadata`;
138
+ handler: AccountsController['updateAccountMetadata'];
139
+ };
140
+ /**
141
+ * Updates the internal accounts list by retrieving normal and snap accounts,
142
+ * removing duplicates, and updating the metadata of each account.
143
+ *
144
+ * @deprecated This method is deprecated and will be removed in a future version.
145
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
146
+ * @returns A Promise that resolves when the accounts have been updated.
147
+ */
148
+ export type AccountsControllerUpdateAccountsAction = {
149
+ type: `AccountsController:updateAccounts`;
150
+ handler: AccountsController['updateAccounts'];
151
+ };
152
+ /**
153
+ * Loads the backup state of the accounts controller.
154
+ *
155
+ * @deprecated This method is deprecated and will be removed in a future version.
156
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
157
+ * @param backup - The backup state to load.
158
+ */
159
+ export type AccountsControllerLoadBackupAction = {
160
+ type: `AccountsController:loadBackup`;
161
+ handler: AccountsController['loadBackup'];
162
+ };
163
+ /**
164
+ * Union of all AccountsController action types.
165
+ */
166
+ export type AccountsControllerMethodActions = AccountsControllerGetAccountAction | AccountsControllerGetAccountsAction | AccountsControllerListAccountsAction | AccountsControllerListMultichainAccountsAction | AccountsControllerGetSelectedAccountAction | AccountsControllerGetSelectedMultichainAccountAction | AccountsControllerGetAccountByAddressAction | AccountsControllerSetSelectedAccountAction | AccountsControllerSetAccountNameAction | AccountsControllerSetAccountNameAndSelectAccountAction | AccountsControllerUpdateAccountMetadataAction | AccountsControllerUpdateAccountsAction | AccountsControllerLoadBackupAction;
167
+ //# sourceMappingURL=AccountsController-method-action-types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountsController-method-action-types.d.cts","sourceRoot":"","sources":["../src/AccountsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,iCAA6B;AAE/D;;;;;;;GAOG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,8CAA8C,GAAG;IAC3D,IAAI,EAAE,2CAA2C,CAAC;IAClD,OAAO,EAAE,kBAAkB,CAAC,wBAAwB,CAAC,CAAC;CACvD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,0CAA0C,GAAG;IACvD,IAAI,EAAE,uCAAuC,CAAC;IAC9C,OAAO,EAAE,kBAAkB,CAAC,oBAAoB,CAAC,CAAC;CACnD,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,oDAAoD,GAAG;IACjE,IAAI,EAAE,iDAAiD,CAAC;IACxD,OAAO,EAAE,kBAAkB,CAAC,8BAA8B,CAAC,CAAC;CAC7D,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,M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,GACtC,kCAAkC,CAAC"}
@@ -0,0 +1,167 @@
1
+ /**
2
+ * This file is auto generated by `scripts/generate-method-action-types.ts`.
3
+ * Do not edit manually.
4
+ */
5
+ import type { AccountsController } from "./AccountsController.mjs";
6
+ /**
7
+ * Returns the internal account object for the given account ID, if it exists.
8
+ *
9
+ * @deprecated This method is deprecated and will be removed in a future version.
10
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
11
+ * @param accountId - The ID of the account to retrieve.
12
+ * @returns The internal account object, or undefined if the account does not exist.
13
+ */
14
+ export type AccountsControllerGetAccountAction = {
15
+ type: `AccountsController:getAccount`;
16
+ handler: AccountsController['getAccount'];
17
+ };
18
+ /**
19
+ * Returns the internal account objects for the given account IDs, if they exist.
20
+ *
21
+ * @deprecated This method is deprecated and will be removed in a future version.
22
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
23
+ * @param accountIds - The IDs of the accounts to retrieve.
24
+ * @returns The internal account objects, or undefined if the account(s) do not exist.
25
+ */
26
+ export type AccountsControllerGetAccountsAction = {
27
+ type: `AccountsController:getAccounts`;
28
+ handler: AccountsController['getAccounts'];
29
+ };
30
+ /**
31
+ * Returns an array of all evm internal accounts.
32
+ *
33
+ * @deprecated This method is deprecated and will be removed in a future version.
34
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
35
+ * @returns An array of InternalAccount objects.
36
+ */
37
+ export type AccountsControllerListAccountsAction = {
38
+ type: `AccountsController:listAccounts`;
39
+ handler: AccountsController['listAccounts'];
40
+ };
41
+ /**
42
+ * Returns an array of all internal accounts.
43
+ *
44
+ * @deprecated This method is deprecated and will be removed in a future version.
45
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
46
+ * @param chainId - The chain ID.
47
+ * @returns An array of InternalAccount objects.
48
+ */
49
+ export type AccountsControllerListMultichainAccountsAction = {
50
+ type: `AccountsController:listMultichainAccounts`;
51
+ handler: AccountsController['listMultichainAccounts'];
52
+ };
53
+ /**
54
+ * Returns the last selected EVM account.
55
+ *
56
+ * @deprecated This method is deprecated and will be removed in a future version.
57
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
58
+ * @returns The selected internal account.
59
+ */
60
+ export type AccountsControllerGetSelectedAccountAction = {
61
+ type: `AccountsController:getSelectedAccount`;
62
+ handler: AccountsController['getSelectedAccount'];
63
+ };
64
+ /**
65
+ * __WARNING The return value may be undefined if there isn't an account for that chain id.__
66
+ *
67
+ * Retrieves the last selected account by chain ID.
68
+ *
69
+ * @deprecated This method is deprecated and will be removed in a future version.
70
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
71
+ * @param chainId - The chain ID to filter the accounts.
72
+ * @returns The last selected account compatible with the specified chain ID or undefined.
73
+ */
74
+ export type AccountsControllerGetSelectedMultichainAccountAction = {
75
+ type: `AccountsController:getSelectedMultichainAccount`;
76
+ handler: AccountsController['getSelectedMultichainAccount'];
77
+ };
78
+ /**
79
+ * Returns the account with the specified address.
80
+ * ! This method will only return the first account that matches the address
81
+ *
82
+ * @deprecated This method is deprecated and will be removed in a future version.
83
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
84
+ * @param address - The address of the account to retrieve.
85
+ * @returns The account with the specified address, or undefined if not found.
86
+ */
87
+ export type AccountsControllerGetAccountByAddressAction = {
88
+ type: `AccountsController:getAccountByAddress`;
89
+ handler: AccountsController['getAccountByAddress'];
90
+ };
91
+ /**
92
+ * Sets the selected account by its ID.
93
+ *
94
+ * @deprecated This method is deprecated and will be removed in a future version.
95
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
96
+ * @param accountId - The ID of the account to be selected.
97
+ */
98
+ export type AccountsControllerSetSelectedAccountAction = {
99
+ type: `AccountsController:setSelectedAccount`;
100
+ handler: AccountsController['setSelectedAccount'];
101
+ };
102
+ /**
103
+ * Sets the name of the account with the given ID.
104
+ *
105
+ * @deprecated This method is deprecated and will be removed in a future version.
106
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
107
+ * @param accountId - The ID of the account to set the name for.
108
+ * @param accountName - The new name for the account.
109
+ * @throws An error if an account with the same name already exists.
110
+ */
111
+ export type AccountsControllerSetAccountNameAction = {
112
+ type: `AccountsController:setAccountName`;
113
+ handler: AccountsController['setAccountName'];
114
+ };
115
+ /**
116
+ * Sets the name of the account with the given ID and select it.
117
+ *
118
+ * @deprecated This method is deprecated and will be removed in a future version.
119
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
120
+ * @param accountId - The ID of the account to set the name for and select.
121
+ * @param accountName - The new name for the account.
122
+ * @throws An error if an account with the same name already exists.
123
+ */
124
+ export type AccountsControllerSetAccountNameAndSelectAccountAction = {
125
+ type: `AccountsController:setAccountNameAndSelectAccount`;
126
+ handler: AccountsController['setAccountNameAndSelectAccount'];
127
+ };
128
+ /**
129
+ * Updates the metadata of the account with the given ID.
130
+ *
131
+ * @deprecated This method is deprecated and will be removed in a future version.
132
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
133
+ * @param accountId - The ID of the account for which the metadata will be updated.
134
+ * @param metadata - The new metadata for the account.
135
+ */
136
+ export type AccountsControllerUpdateAccountMetadataAction = {
137
+ type: `AccountsController:updateAccountMetadata`;
138
+ handler: AccountsController['updateAccountMetadata'];
139
+ };
140
+ /**
141
+ * Updates the internal accounts list by retrieving normal and snap accounts,
142
+ * removing duplicates, and updating the metadata of each account.
143
+ *
144
+ * @deprecated This method is deprecated and will be removed in a future version.
145
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
146
+ * @returns A Promise that resolves when the accounts have been updated.
147
+ */
148
+ export type AccountsControllerUpdateAccountsAction = {
149
+ type: `AccountsController:updateAccounts`;
150
+ handler: AccountsController['updateAccounts'];
151
+ };
152
+ /**
153
+ * Loads the backup state of the accounts controller.
154
+ *
155
+ * @deprecated This method is deprecated and will be removed in a future version.
156
+ * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
157
+ * @param backup - The backup state to load.
158
+ */
159
+ export type AccountsControllerLoadBackupAction = {
160
+ type: `AccountsController:loadBackup`;
161
+ handler: AccountsController['loadBackup'];
162
+ };
163
+ /**
164
+ * Union of all AccountsController action types.
165
+ */
166
+ export type AccountsControllerMethodActions = AccountsControllerGetAccountAction | AccountsControllerGetAccountsAction | AccountsControllerListAccountsAction | AccountsControllerListMultichainAccountsAction | AccountsControllerGetSelectedAccountAction | AccountsControllerGetSelectedMultichainAccountAction | AccountsControllerGetAccountByAddressAction | AccountsControllerSetSelectedAccountAction | AccountsControllerSetAccountNameAction | AccountsControllerSetAccountNameAndSelectAccountAction | AccountsControllerUpdateAccountMetadataAction | AccountsControllerUpdateAccountsAction | AccountsControllerLoadBackupAction;
167
+ //# sourceMappingURL=AccountsController-method-action-types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountsController-method-action-types.d.mts","sourceRoot":"","sources":["../src/AccountsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,iCAA6B;AAE/D;;;;;;;GAOG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,8CAA8C,GAAG;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AC1C,OAAO,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;CAC/C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;CAC3C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,+BAA+B,GACvC,kCAAkC,GAClC,mCAAmC,GACnC,oCAAoC,GACpC,8CAA8C,GAC9C,0CAA0C,GAC1C,oDAAoD,GACpD,2CAA2C,GAC3C,0CAA0C,GAC1C,sCAAsC,GACtC,sDAAsD,GACtD,6CAA6C,GAC7C,sCAAsC,GACtC,kCAAkC,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file is auto generated by `scripts/generate-method-action-types.ts`.
3
+ * Do not edit manually.
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=AccountsController-method-action-types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountsController-method-action-types.mjs","sourceRoot":"","sources":["../src/AccountsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated by `scripts/generate-method-action-types.ts`.\n * Do not edit manually.\n */\n\nimport type { AccountsController } from './AccountsController';\n\n/**\n * Returns the internal account object for the given account ID, if it exists.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @param accountId - The ID of the account to retrieve.\n * @returns The internal account object, or undefined if the account does not exist.\n */\nexport type AccountsControllerGetAccountAction = {\n type: `AccountsController:getAccount`;\n handler: AccountsController['getAccount'];\n};\n\n/**\n * Returns the internal account objects for the given account IDs, if they exist.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @param accountIds - The IDs of the accounts to retrieve.\n * @returns The internal account objects, or undefined if the account(s) do not exist.\n */\nexport type AccountsControllerGetAccountsAction = {\n type: `AccountsController:getAccounts`;\n handler: AccountsController['getAccounts'];\n};\n\n/**\n * Returns an array of all evm internal accounts.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @returns An array of InternalAccount objects.\n */\nexport type AccountsControllerListAccountsAction = {\n type: `AccountsController:listAccounts`;\n handler: AccountsController['listAccounts'];\n};\n\n/**\n * Returns an array of all internal accounts.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @param chainId - The chain ID.\n * @returns An array of InternalAccount objects.\n */\nexport type AccountsControllerListMultichainAccountsAction = {\n type: `AccountsController:listMultichainAccounts`;\n handler: AccountsController['listMultichainAccounts'];\n};\n\n/**\n * Returns the last selected EVM account.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @returns The selected internal account.\n */\nexport type AccountsControllerGetSelectedAccountAction = {\n type: `AccountsController:getSelectedAccount`;\n handler: AccountsController['getSelectedAccount'];\n};\n\n/**\n * __WARNING The return value may be undefined if there isn't an account for that chain id.__\n *\n * Retrieves the last selected account by chain ID.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @param chainId - The chain ID to filter the accounts.\n * @returns The last selected account compatible with the specified chain ID or undefined.\n */\nexport type AccountsControllerGetSelectedMultichainAccountAction = {\n type: `AccountsController:getSelectedMultichainAccount`;\n handler: AccountsController['getSelectedMultichainAccount'];\n};\n\n/**\n * Returns the account with the specified address.\n * ! This method will only return the first account that matches the address\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @param address - The address of the account to retrieve.\n * @returns The account with the specified address, or undefined if not found.\n */\nexport type AccountsControllerGetAccountByAddressAction = {\n type: `AccountsController:getAccountByAddress`;\n handler: AccountsController['getAccountByAddress'];\n};\n\n/**\n * Sets the selected account by its ID.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @param accountId - The ID of the account to be selected.\n */\nexport type AccountsControllerSetSelectedAccountAction = {\n type: `AccountsController:setSelectedAccount`;\n handler: AccountsController['setSelectedAccount'];\n};\n\n/**\n * Sets the name of the account with the given ID.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @param accountId - The ID of the account to set the name for.\n * @param accountName - The new name for the account.\n * @throws An error if an account with the same name already exists.\n */\nexport type AccountsControllerSetAccountNameAction = {\n type: `AccountsController:setAccountName`;\n handler: AccountsController['setAccountName'];\n};\n\n/**\n * Sets the name of the account with the given ID and select it.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @param accountId - The ID of the account to set the name for and select.\n * @param accountName - The new name for the account.\n * @throws An error if an account with the same name already exists.\n */\nexport type AccountsControllerSetAccountNameAndSelectAccountAction = {\n type: `AccountsController:setAccountNameAndSelectAccount`;\n handler: AccountsController['setAccountNameAndSelectAccount'];\n};\n\n/**\n * Updates the metadata of the account with the given ID.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @param accountId - The ID of the account for which the metadata will be updated.\n * @param metadata - The new metadata for the account.\n */\nexport type AccountsControllerUpdateAccountMetadataAction = {\n type: `AccountsController:updateAccountMetadata`;\n handler: AccountsController['updateAccountMetadata'];\n};\n\n/**\n * Updates the internal accounts list by retrieving normal and snap accounts,\n * removing duplicates, and updating the metadata of each account.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @returns A Promise that resolves when the accounts have been updated.\n */\nexport type AccountsControllerUpdateAccountsAction = {\n type: `AccountsController:updateAccounts`;\n handler: AccountsController['updateAccounts'];\n};\n\n/**\n * Loads the backup state of the accounts controller.\n *\n * @deprecated This method is deprecated and will be removed in a future version.\n * Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.\n * @param backup - The backup state to load.\n */\nexport type AccountsControllerLoadBackupAction = {\n type: `AccountsController:loadBackup`;\n handler: AccountsController['loadBackup'];\n};\n\n/**\n * Union of all AccountsController action types.\n */\nexport type AccountsControllerMethodActions =\n | AccountsControllerGetAccountAction\n | AccountsControllerGetAccountsAction\n | AccountsControllerListAccountsAction\n | AccountsControllerListMultichainAccountsAction\n | AccountsControllerGetSelectedAccountAction\n | AccountsControllerGetSelectedMultichainAccountAction\n | AccountsControllerGetAccountByAddressAction\n | AccountsControllerSetSelectedAccountAction\n | AccountsControllerSetAccountNameAction\n | AccountsControllerSetAccountNameAndSelectAccountAction\n | AccountsControllerUpdateAccountMetadataAction\n | AccountsControllerUpdateAccountsAction\n | AccountsControllerLoadBackupAction;\n"]}