@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.
- package/CHANGELOG.md +24 -1
- package/dist/AccountsController-method-action-types.cjs +7 -0
- package/dist/AccountsController-method-action-types.cjs.map +1 -0
- package/dist/AccountsController-method-action-types.d.cts +167 -0
- package/dist/AccountsController-method-action-types.d.cts.map +1 -0
- package/dist/AccountsController-method-action-types.d.mts +167 -0
- package/dist/AccountsController-method-action-types.d.mts.map +1 -0
- package/dist/AccountsController-method-action-types.mjs +6 -0
- package/dist/AccountsController-method-action-types.mjs.map +1 -0
- package/dist/AccountsController.cjs +96 -37
- package/dist/AccountsController.cjs.map +1 -1
- package/dist/AccountsController.d.cts +103 -57
- package/dist/AccountsController.d.cts.map +1 -1
- package/dist/AccountsController.d.mts +103 -57
- package/dist/AccountsController.d.mts.map +1 -1
- package/dist/AccountsController.mjs +97 -38
- package/dist/AccountsController.mjs.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/logger.cjs +8 -0
- package/dist/logger.cjs.map +1 -0
- package/dist/logger.d.cts +5 -0
- package/dist/logger.d.cts.map +1 -0
- package/dist/logger.d.mts +5 -0
- package/dist/logger.d.mts.map +1 -0
- package/dist/logger.mjs +5 -0
- package/dist/logger.mjs.map +1 -0
- package/dist/typing.cjs.map +1 -1
- package/dist/typing.d.cts +1 -0
- package/dist/typing.d.cts.map +1 -1
- package/dist/typing.d.mts +1 -0
- package/dist/typing.d.mts.map +1 -1
- package/dist/typing.mjs.map +1 -1
- package/dist/utils.cjs +9 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +2 -0
- package/dist/utils.d.cts.map +1 -1
- package/dist/utils.d.mts +2 -0
- package/dist/utils.d.mts.map +1 -1
- package/dist/utils.mjs +7 -0
- package/dist/utils.mjs.map +1 -1
- package/package.json +3 -2
- package/dist/tests/mocks.cjs +0 -89
- package/dist/tests/mocks.cjs.map +0 -1
- package/dist/tests/mocks.d.cts +0 -26
- package/dist/tests/mocks.d.cts.map +0 -1
- package/dist/tests/mocks.d.mts +0 -26
- package/dist/tests/mocks.d.mts.map +0 -1
- package/dist/tests/mocks.mjs +0 -83
- package/dist/tests/mocks.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountsController.d.cts","sourceRoot":"","sources":["../src/AccountsController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC3B,kCAAkC;AAEnC,OAAO,KAAK,EACV,uCAAuC,EACvC,sCAAsC,EACtC,0CAA0C,EAC3C,mCAAmC;AAEpC,OAAO,EACL,cAAc,EAEd,QAAQ,EAGT,8BAA8B;AAC/B,OAAO,KAAK,EAEV,wCAAwC,EACxC,iCAAiC,EACjC,+BAA+B,EAEhC,qCAAqC;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,uCAAuC;AAEtE,OAAO,KAAK,EAAE,SAAS,EAAuB,4BAA4B;AAE1E,OAAO,KAAK,EAEV,eAAe,EAChB,oCAAoC;AAGrC,OAAO,KAAK,EAAE,WAAW,EAAE,wBAAwB;AAInD,OAAO,KAAK,EAAE,gDAAgD,EAAE,oBAAgB;
|
|
1
|
+
{"version":3,"file":"AccountsController.d.cts","sourceRoot":"","sources":["../src/AccountsController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC3B,kCAAkC;AAEnC,OAAO,KAAK,EACV,uCAAuC,EACvC,sCAAsC,EACtC,0CAA0C,EAC3C,mCAAmC;AAEpC,OAAO,EACL,cAAc,EAEd,QAAQ,EA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,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAS5D;;;;;;;;OAQG;IACH,8BAA8B,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAyC5E;;;;;;;OAOG;IACH,qBAAqB,CACnB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,GAC7C,IAAI;IAwBP;;;;;;;OAOG;IACG,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IA4DrC;;;;;;OAMG;IACH,UAAU,CAAC,MAAM,EAAE,uBAAuB,GAAG,IAAI;CAojBlD"}
|
|
@@ -7,102 +7,128 @@ import type { InternalAccount } from "@metamask/keyring-internal-api";
|
|
|
7
7
|
import type { Messenger } from "@metamask/messenger";
|
|
8
8
|
import type { SnapStateChange } from "@metamask/snaps-controllers";
|
|
9
9
|
import type { CaipChainId } from "@metamask/utils";
|
|
10
|
+
import { AccountsControllerMethodActions } from "./AccountsController-method-action-types.mjs";
|
|
10
11
|
import type { MultichainNetworkControllerNetworkDidChangeEvent } from "./types.mjs";
|
|
11
12
|
declare const controllerName = "AccountsController";
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated This type is deprecated and will be removed in a future version.
|
|
15
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
16
|
+
*/
|
|
12
17
|
export type AccountId = string;
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated This type is deprecated and will be removed in a future version.
|
|
20
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
21
|
+
*/
|
|
13
22
|
export type AccountsControllerState = {
|
|
14
23
|
internalAccounts: {
|
|
15
24
|
accounts: Record<AccountId, InternalAccount>;
|
|
16
25
|
selectedAccount: string;
|
|
17
26
|
};
|
|
27
|
+
accountIdByAddress: Record<InternalAccount['address'], AccountId>;
|
|
18
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated This type is deprecated and will be removed in a future version.
|
|
31
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
32
|
+
*/
|
|
19
33
|
export type AccountsControllerGetStateAction = ControllerGetStateAction<typeof controllerName, AccountsControllerState>;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export type AccountsControllerSetAccountNameAction = {
|
|
25
|
-
type: `${typeof controllerName}:setAccountName`;
|
|
26
|
-
handler: AccountsController['setAccountName'];
|
|
27
|
-
};
|
|
28
|
-
export type AccountsControllerSetAccountNameAndSelectAccountAction = {
|
|
29
|
-
type: `${typeof controllerName}:setAccountNameAndSelectAccount`;
|
|
30
|
-
handler: AccountsController['setAccountNameAndSelectAccount'];
|
|
31
|
-
};
|
|
32
|
-
export type AccountsControllerListAccountsAction = {
|
|
33
|
-
type: `${typeof controllerName}:listAccounts`;
|
|
34
|
-
handler: AccountsController['listAccounts'];
|
|
35
|
-
};
|
|
36
|
-
export type AccountsControllerListMultichainAccountsAction = {
|
|
37
|
-
type: `${typeof controllerName}:listMultichainAccounts`;
|
|
38
|
-
handler: AccountsController['listMultichainAccounts'];
|
|
39
|
-
};
|
|
40
|
-
export type AccountsControllerUpdateAccountsAction = {
|
|
41
|
-
type: `${typeof controllerName}:updateAccounts`;
|
|
42
|
-
handler: AccountsController['updateAccounts'];
|
|
43
|
-
};
|
|
44
|
-
export type AccountsControllerGetSelectedAccountAction = {
|
|
45
|
-
type: `${typeof controllerName}:getSelectedAccount`;
|
|
46
|
-
handler: AccountsController['getSelectedAccount'];
|
|
47
|
-
};
|
|
48
|
-
export type AccountsControllerGetSelectedMultichainAccountAction = {
|
|
49
|
-
type: `${typeof controllerName}:getSelectedMultichainAccount`;
|
|
50
|
-
handler: AccountsController['getSelectedMultichainAccount'];
|
|
51
|
-
};
|
|
52
|
-
export type AccountsControllerGetAccountByAddressAction = {
|
|
53
|
-
type: `${typeof controllerName}:getAccountByAddress`;
|
|
54
|
-
handler: AccountsController['getAccountByAddress'];
|
|
55
|
-
};
|
|
56
|
-
export type AccountsControllerGetAccountAction = {
|
|
57
|
-
type: `${typeof controllerName}:getAccount`;
|
|
58
|
-
handler: AccountsController['getAccount'];
|
|
59
|
-
};
|
|
60
|
-
export type AccountsControllerGetAccountsAction = {
|
|
61
|
-
type: `${typeof controllerName}:getAccounts`;
|
|
62
|
-
handler: AccountsController['getAccounts'];
|
|
63
|
-
};
|
|
64
|
-
export type AccountsControllerUpdateAccountMetadataAction = {
|
|
65
|
-
type: `${typeof controllerName}:updateAccountMetadata`;
|
|
66
|
-
handler: AccountsController['updateAccountMetadata'];
|
|
67
|
-
};
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated This type is deprecated and will be removed in a future version.
|
|
36
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
37
|
+
*/
|
|
68
38
|
export type AllowedActions = KeyringControllerGetKeyringsByTypeAction | KeyringControllerGetStateAction;
|
|
69
|
-
|
|
39
|
+
/**
|
|
40
|
+
* @deprecated This type is deprecated and will be removed in a future version.
|
|
41
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
42
|
+
*/
|
|
43
|
+
export type AccountsControllerActions = AccountsControllerGetStateAction | AccountsControllerMethodActions;
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated This type is deprecated and will be removed in a future version.
|
|
46
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
47
|
+
*/
|
|
70
48
|
export type AccountsControllerChangeEvent = ControllerStateChangeEvent<typeof controllerName, AccountsControllerState>;
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated This type is deprecated and will be removed in a future version.
|
|
51
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
52
|
+
*/
|
|
71
53
|
export type AccountsControllerSelectedAccountChangeEvent = {
|
|
72
54
|
type: `${typeof controllerName}:selectedAccountChange`;
|
|
73
55
|
payload: [InternalAccount];
|
|
74
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated This type is deprecated and will be removed in a future version.
|
|
59
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
60
|
+
*/
|
|
75
61
|
export type AccountsControllerSelectedEvmAccountChangeEvent = {
|
|
76
62
|
type: `${typeof controllerName}:selectedEvmAccountChange`;
|
|
77
63
|
payload: [InternalAccount];
|
|
78
64
|
};
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated This type is deprecated and will be removed in a future version.
|
|
67
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
68
|
+
*/
|
|
79
69
|
export type AccountsControllerAccountAddedEvent = {
|
|
80
70
|
type: `${typeof controllerName}:accountAdded`;
|
|
81
71
|
payload: [InternalAccount];
|
|
82
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* @deprecated This type is deprecated and will be removed in a future version.
|
|
75
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
76
|
+
*/
|
|
83
77
|
export type AccountsControllerAccountRemovedEvent = {
|
|
84
78
|
type: `${typeof controllerName}:accountRemoved`;
|
|
85
79
|
payload: [AccountId];
|
|
86
80
|
};
|
|
81
|
+
/**
|
|
82
|
+
* @deprecated This type is deprecated and will be removed in a future version.
|
|
83
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
84
|
+
*/
|
|
87
85
|
export type AccountsControllerAccountRenamedEvent = {
|
|
88
86
|
type: `${typeof controllerName}:accountRenamed`;
|
|
89
87
|
payload: [InternalAccount];
|
|
90
88
|
};
|
|
89
|
+
/**
|
|
90
|
+
* @deprecated This type is deprecated and will be removed in a future version.
|
|
91
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
92
|
+
*/
|
|
91
93
|
export type AccountsControllerAccountBalancesUpdatesEvent = {
|
|
92
94
|
type: `${typeof controllerName}:accountBalancesUpdated`;
|
|
93
95
|
payload: SnapKeyringAccountBalancesUpdatedEvent['payload'];
|
|
94
96
|
};
|
|
97
|
+
/**
|
|
98
|
+
* @deprecated This type is deprecated and will be removed in a future version.
|
|
99
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
100
|
+
*/
|
|
95
101
|
export type AccountsControllerAccountTransactionsUpdatedEvent = {
|
|
96
102
|
type: `${typeof controllerName}:accountTransactionsUpdated`;
|
|
97
103
|
payload: SnapKeyringAccountTransactionsUpdatedEvent['payload'];
|
|
98
104
|
};
|
|
105
|
+
/**
|
|
106
|
+
* @deprecated This type is deprecated and will be removed in a future version.
|
|
107
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
108
|
+
*/
|
|
99
109
|
export type AccountsControllerAccountAssetListUpdatedEvent = {
|
|
100
110
|
type: `${typeof controllerName}:accountAssetListUpdated`;
|
|
101
111
|
payload: SnapKeyringAccountAssetListUpdatedEvent['payload'];
|
|
102
112
|
};
|
|
113
|
+
/**
|
|
114
|
+
* @deprecated This type is deprecated and will be removed in a future version.
|
|
115
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
116
|
+
*/
|
|
103
117
|
export type AllowedEvents = SnapStateChange | KeyringControllerStateChangeEvent | SnapKeyringAccountAssetListUpdatedEvent | SnapKeyringAccountBalancesUpdatedEvent | SnapKeyringAccountTransactionsUpdatedEvent | MultichainNetworkControllerNetworkDidChangeEvent;
|
|
118
|
+
/**
|
|
119
|
+
* @deprecated This type is deprecated and will be removed in a future version.
|
|
120
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
121
|
+
*/
|
|
104
122
|
export type AccountsControllerEvents = AccountsControllerChangeEvent | AccountsControllerSelectedAccountChangeEvent | AccountsControllerSelectedEvmAccountChangeEvent | AccountsControllerAccountAddedEvent | AccountsControllerAccountRemovedEvent | AccountsControllerAccountRenamedEvent | AccountsControllerAccountBalancesUpdatesEvent | AccountsControllerAccountTransactionsUpdatedEvent | AccountsControllerAccountAssetListUpdatedEvent;
|
|
123
|
+
/**
|
|
124
|
+
* @deprecated This type is deprecated and will be removed in a future version.
|
|
125
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
126
|
+
*/
|
|
105
127
|
export type AccountsControllerMessenger = Messenger<typeof controllerName, AccountsControllerActions | AllowedActions, AccountsControllerEvents | AllowedEvents>;
|
|
128
|
+
/**
|
|
129
|
+
* @deprecated This constant is deprecated and will be removed in a future version.
|
|
130
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
131
|
+
*/
|
|
106
132
|
export declare const EMPTY_ACCOUNT: {
|
|
107
133
|
id: string;
|
|
108
134
|
address: string;
|
|
@@ -125,6 +151,8 @@ export declare const EMPTY_ACCOUNT: {
|
|
|
125
151
|
* The accounts controller also listens for keyring state changes and updates the internal accounts accordingly.
|
|
126
152
|
* The accounts controller also listens for snap state changes and updates the internal accounts accordingly.
|
|
127
153
|
*
|
|
154
|
+
* @deprecated This class is deprecated and will be removed in a future version.
|
|
155
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
128
156
|
*/
|
|
129
157
|
export declare class AccountsController extends BaseController<typeof controllerName, AccountsControllerState, AccountsControllerMessenger> {
|
|
130
158
|
#private;
|
|
@@ -142,6 +170,8 @@ export declare class AccountsController extends BaseController<typeof controller
|
|
|
142
170
|
/**
|
|
143
171
|
* Returns the internal account object for the given account ID, if it exists.
|
|
144
172
|
*
|
|
173
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
174
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
145
175
|
* @param accountId - The ID of the account to retrieve.
|
|
146
176
|
* @returns The internal account object, or undefined if the account does not exist.
|
|
147
177
|
*/
|
|
@@ -149,6 +179,8 @@ export declare class AccountsController extends BaseController<typeof controller
|
|
|
149
179
|
/**
|
|
150
180
|
* Returns the internal account objects for the given account IDs, if they exist.
|
|
151
181
|
*
|
|
182
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
183
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
152
184
|
* @param accountIds - The IDs of the accounts to retrieve.
|
|
153
185
|
* @returns The internal account objects, or undefined if the account(s) do not exist.
|
|
154
186
|
*/
|
|
@@ -156,27 +188,25 @@ export declare class AccountsController extends BaseController<typeof controller
|
|
|
156
188
|
/**
|
|
157
189
|
* Returns an array of all evm internal accounts.
|
|
158
190
|
*
|
|
191
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
192
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
159
193
|
* @returns An array of InternalAccount objects.
|
|
160
194
|
*/
|
|
161
195
|
listAccounts(): InternalAccount[];
|
|
162
196
|
/**
|
|
163
197
|
* Returns an array of all internal accounts.
|
|
164
198
|
*
|
|
199
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
200
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
165
201
|
* @param chainId - The chain ID.
|
|
166
202
|
* @returns An array of InternalAccount objects.
|
|
167
203
|
*/
|
|
168
204
|
listMultichainAccounts(chainId?: CaipChainId): InternalAccount[];
|
|
169
|
-
/**
|
|
170
|
-
* Returns the internal account object for the given account ID.
|
|
171
|
-
*
|
|
172
|
-
* @param accountId - The ID of the account to retrieve.
|
|
173
|
-
* @returns The internal account object.
|
|
174
|
-
* @throws An error if the account ID is not found.
|
|
175
|
-
*/
|
|
176
|
-
getAccountExpect(accountId: string): InternalAccount;
|
|
177
205
|
/**
|
|
178
206
|
* Returns the last selected EVM account.
|
|
179
207
|
*
|
|
208
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
209
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
180
210
|
* @returns The selected internal account.
|
|
181
211
|
*/
|
|
182
212
|
getSelectedAccount(): InternalAccount;
|
|
@@ -185,6 +215,8 @@ export declare class AccountsController extends BaseController<typeof controller
|
|
|
185
215
|
*
|
|
186
216
|
* Retrieves the last selected account by chain ID.
|
|
187
217
|
*
|
|
218
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
219
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
188
220
|
* @param chainId - The chain ID to filter the accounts.
|
|
189
221
|
* @returns The last selected account compatible with the specified chain ID or undefined.
|
|
190
222
|
*/
|
|
@@ -193,6 +225,8 @@ export declare class AccountsController extends BaseController<typeof controller
|
|
|
193
225
|
* Returns the account with the specified address.
|
|
194
226
|
* ! This method will only return the first account that matches the address
|
|
195
227
|
*
|
|
228
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
229
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
196
230
|
* @param address - The address of the account to retrieve.
|
|
197
231
|
* @returns The account with the specified address, or undefined if not found.
|
|
198
232
|
*/
|
|
@@ -200,12 +234,16 @@ export declare class AccountsController extends BaseController<typeof controller
|
|
|
200
234
|
/**
|
|
201
235
|
* Sets the selected account by its ID.
|
|
202
236
|
*
|
|
237
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
238
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
203
239
|
* @param accountId - The ID of the account to be selected.
|
|
204
240
|
*/
|
|
205
241
|
setSelectedAccount(accountId: string): void;
|
|
206
242
|
/**
|
|
207
243
|
* Sets the name of the account with the given ID.
|
|
208
244
|
*
|
|
245
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
246
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
209
247
|
* @param accountId - The ID of the account to set the name for.
|
|
210
248
|
* @param accountName - The new name for the account.
|
|
211
249
|
* @throws An error if an account with the same name already exists.
|
|
@@ -214,6 +252,8 @@ export declare class AccountsController extends BaseController<typeof controller
|
|
|
214
252
|
/**
|
|
215
253
|
* Sets the name of the account with the given ID and select it.
|
|
216
254
|
*
|
|
255
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
256
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
217
257
|
* @param accountId - The ID of the account to set the name for and select.
|
|
218
258
|
* @param accountName - The new name for the account.
|
|
219
259
|
* @throws An error if an account with the same name already exists.
|
|
@@ -222,6 +262,8 @@ export declare class AccountsController extends BaseController<typeof controller
|
|
|
222
262
|
/**
|
|
223
263
|
* Updates the metadata of the account with the given ID.
|
|
224
264
|
*
|
|
265
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
266
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
225
267
|
* @param accountId - The ID of the account for which the metadata will be updated.
|
|
226
268
|
* @param metadata - The new metadata for the account.
|
|
227
269
|
*/
|
|
@@ -230,12 +272,16 @@ export declare class AccountsController extends BaseController<typeof controller
|
|
|
230
272
|
* Updates the internal accounts list by retrieving normal and snap accounts,
|
|
231
273
|
* removing duplicates, and updating the metadata of each account.
|
|
232
274
|
*
|
|
275
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
276
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
233
277
|
* @returns A Promise that resolves when the accounts have been updated.
|
|
234
278
|
*/
|
|
235
279
|
updateAccounts(): Promise<void>;
|
|
236
280
|
/**
|
|
237
281
|
* Loads the backup state of the accounts controller.
|
|
238
282
|
*
|
|
283
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
284
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
239
285
|
* @param backup - The backup state to load.
|
|
240
286
|
*/
|
|
241
287
|
loadBackup(backup: AccountsControllerState): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountsController.d.mts","sourceRoot":"","sources":["../src/AccountsController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC3B,kCAAkC;AAEnC,OAAO,KAAK,EACV,uCAAuC,EACvC,sCAAsC,EACtC,0CAA0C,EAC3C,mCAAmC;AAEpC,OAAO,EACL,cAAc,EAEd,QAAQ,EAGT,8BAA8B;AAC/B,OAAO,KAAK,EAEV,wCAAwC,EACxC,iCAAiC,EACjC,+BAA+B,EAEhC,qCAAqC;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,uCAAuC;AAEtE,OAAO,KAAK,EAAE,SAAS,EAAuB,4BAA4B;AAE1E,OAAO,KAAK,EAEV,eAAe,EAChB,oCAAoC;AAGrC,OAAO,KAAK,EAAE,WAAW,EAAE,wBAAwB;AAInD,OAAO,KAAK,EAAE,gDAAgD,EAAE,oBAAgB;
|
|
1
|
+
{"version":3,"file":"AccountsController.d.mts","sourceRoot":"","sources":["../src/AccountsController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC3B,kCAAkC;AAEnC,OAAO,KAAK,EACV,uCAAuC,EACvC,sCAAsC,EACtC,0CAA0C,EAC3C,mCAAmC;AAEpC,OAAO,EACL,cAAc,EAEd,QAAQ,EAGT,8BAA8B;AAC/B,OAAO,KAAK,EAEV,wCAAwC,EACxC,iCAAiC,EACjC,+BAA+B,EAEhC,qCAAqC;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,uCAAuC;AAEtE,OAAO,KAAK,EAAE,SAAS,EAAuB,4BAA4B;AAE1E,OAAO,KAAK,EAEV,eAAe,EAChB,oCAAoC;AAGrC,OAAO,KAAK,EAAE,WAAW,EAAE,wBAAwB;AAInD,OAAO,EA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