@metamask/accounts-controller 36.0.1 → 37.1.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 +44 -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 +104 -39
- package/dist/AccountsController.cjs.map +1 -1
- package/dist/AccountsController.d.cts +112 -58
- package/dist/AccountsController.d.cts.map +1 -1
- package/dist/AccountsController.d.mts +112 -58
- package/dist/AccountsController.d.mts.map +1 -1
- package/dist/AccountsController.mjs +105 -40
- 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 +8 -7
- 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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;;;OAMG;IACH,kBAAkB,IAAI,eAAe;IA2BrC;;;;;;;;;OASG;IACH,4BAA4B,CAC1B,OAAO,CAAC,EAAE,WAAW,GACpB,eAAe,GAAG,SAAS;IAmB9B;;;;;;;;OAQG;IACH,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAoBjE;;;;;;OAMG;IACH,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAe3C;;;;;;;;OAQG;IACH,cAAc,CAAC,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;CAgkBlD"}
|
|
@@ -7,102 +7,136 @@ 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
|
+
export type AccountsControllerAccountsAddedEvent = {
|
|
74
|
+
type: `${typeof controllerName}:accountsAdded`;
|
|
75
|
+
payload: [InternalAccount[]];
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* @deprecated This type is deprecated and will be removed in a future version.
|
|
79
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
80
|
+
*/
|
|
83
81
|
export type AccountsControllerAccountRemovedEvent = {
|
|
84
82
|
type: `${typeof controllerName}:accountRemoved`;
|
|
85
83
|
payload: [AccountId];
|
|
86
84
|
};
|
|
85
|
+
export type AccountsControllerAccountsRemovedEvent = {
|
|
86
|
+
type: `${typeof controllerName}:accountsRemoved`;
|
|
87
|
+
payload: [AccountId[]];
|
|
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
|
+
*/
|
|
87
93
|
export type AccountsControllerAccountRenamedEvent = {
|
|
88
94
|
type: `${typeof controllerName}:accountRenamed`;
|
|
89
95
|
payload: [InternalAccount];
|
|
90
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
|
+
*/
|
|
91
101
|
export type AccountsControllerAccountBalancesUpdatesEvent = {
|
|
92
102
|
type: `${typeof controllerName}:accountBalancesUpdated`;
|
|
93
103
|
payload: SnapKeyringAccountBalancesUpdatedEvent['payload'];
|
|
94
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
|
+
*/
|
|
95
109
|
export type AccountsControllerAccountTransactionsUpdatedEvent = {
|
|
96
110
|
type: `${typeof controllerName}:accountTransactionsUpdated`;
|
|
97
111
|
payload: SnapKeyringAccountTransactionsUpdatedEvent['payload'];
|
|
98
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
|
+
*/
|
|
99
117
|
export type AccountsControllerAccountAssetListUpdatedEvent = {
|
|
100
118
|
type: `${typeof controllerName}:accountAssetListUpdated`;
|
|
101
119
|
payload: SnapKeyringAccountAssetListUpdatedEvent['payload'];
|
|
102
120
|
};
|
|
121
|
+
/**
|
|
122
|
+
* @deprecated This type is deprecated and will be removed in a future version.
|
|
123
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
124
|
+
*/
|
|
103
125
|
export type AllowedEvents = SnapStateChange | KeyringControllerStateChangeEvent | SnapKeyringAccountAssetListUpdatedEvent | SnapKeyringAccountBalancesUpdatedEvent | SnapKeyringAccountTransactionsUpdatedEvent | MultichainNetworkControllerNetworkDidChangeEvent;
|
|
104
|
-
|
|
126
|
+
/**
|
|
127
|
+
* @deprecated This type is deprecated and will be removed in a future version.
|
|
128
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
129
|
+
*/
|
|
130
|
+
export type AccountsControllerEvents = AccountsControllerChangeEvent | AccountsControllerSelectedAccountChangeEvent | AccountsControllerSelectedEvmAccountChangeEvent | AccountsControllerAccountAddedEvent | AccountsControllerAccountsAddedEvent | AccountsControllerAccountRemovedEvent | AccountsControllerAccountsRemovedEvent | AccountsControllerAccountRenamedEvent | AccountsControllerAccountBalancesUpdatesEvent | AccountsControllerAccountTransactionsUpdatedEvent | AccountsControllerAccountAssetListUpdatedEvent;
|
|
131
|
+
/**
|
|
132
|
+
* @deprecated This type is deprecated and will be removed in a future version.
|
|
133
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
134
|
+
*/
|
|
105
135
|
export type AccountsControllerMessenger = Messenger<typeof controllerName, AccountsControllerActions | AllowedActions, AccountsControllerEvents | AllowedEvents>;
|
|
136
|
+
/**
|
|
137
|
+
* @deprecated This constant is deprecated and will be removed in a future version.
|
|
138
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
139
|
+
*/
|
|
106
140
|
export declare const EMPTY_ACCOUNT: {
|
|
107
141
|
id: string;
|
|
108
142
|
address: string;
|
|
@@ -125,6 +159,8 @@ export declare const EMPTY_ACCOUNT: {
|
|
|
125
159
|
* The accounts controller also listens for keyring state changes and updates the internal accounts accordingly.
|
|
126
160
|
* The accounts controller also listens for snap state changes and updates the internal accounts accordingly.
|
|
127
161
|
*
|
|
162
|
+
* @deprecated This class is deprecated and will be removed in a future version.
|
|
163
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
128
164
|
*/
|
|
129
165
|
export declare class AccountsController extends BaseController<typeof controllerName, AccountsControllerState, AccountsControllerMessenger> {
|
|
130
166
|
#private;
|
|
@@ -142,6 +178,8 @@ export declare class AccountsController extends BaseController<typeof controller
|
|
|
142
178
|
/**
|
|
143
179
|
* Returns the internal account object for the given account ID, if it exists.
|
|
144
180
|
*
|
|
181
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
182
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
145
183
|
* @param accountId - The ID of the account to retrieve.
|
|
146
184
|
* @returns The internal account object, or undefined if the account does not exist.
|
|
147
185
|
*/
|
|
@@ -149,6 +187,8 @@ export declare class AccountsController extends BaseController<typeof controller
|
|
|
149
187
|
/**
|
|
150
188
|
* Returns the internal account objects for the given account IDs, if they exist.
|
|
151
189
|
*
|
|
190
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
191
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
152
192
|
* @param accountIds - The IDs of the accounts to retrieve.
|
|
153
193
|
* @returns The internal account objects, or undefined if the account(s) do not exist.
|
|
154
194
|
*/
|
|
@@ -156,27 +196,25 @@ export declare class AccountsController extends BaseController<typeof controller
|
|
|
156
196
|
/**
|
|
157
197
|
* Returns an array of all evm internal accounts.
|
|
158
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.
|
|
159
201
|
* @returns An array of InternalAccount objects.
|
|
160
202
|
*/
|
|
161
203
|
listAccounts(): InternalAccount[];
|
|
162
204
|
/**
|
|
163
205
|
* Returns an array of all internal accounts.
|
|
164
206
|
*
|
|
207
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
208
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
165
209
|
* @param chainId - The chain ID.
|
|
166
210
|
* @returns An array of InternalAccount objects.
|
|
167
211
|
*/
|
|
168
212
|
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
213
|
/**
|
|
178
214
|
* Returns the last selected EVM account.
|
|
179
215
|
*
|
|
216
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
217
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
180
218
|
* @returns The selected internal account.
|
|
181
219
|
*/
|
|
182
220
|
getSelectedAccount(): InternalAccount;
|
|
@@ -185,6 +223,8 @@ export declare class AccountsController extends BaseController<typeof controller
|
|
|
185
223
|
*
|
|
186
224
|
* Retrieves the last selected account by chain ID.
|
|
187
225
|
*
|
|
226
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
227
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
188
228
|
* @param chainId - The chain ID to filter the accounts.
|
|
189
229
|
* @returns The last selected account compatible with the specified chain ID or undefined.
|
|
190
230
|
*/
|
|
@@ -193,6 +233,8 @@ export declare class AccountsController extends BaseController<typeof controller
|
|
|
193
233
|
* Returns the account with the specified address.
|
|
194
234
|
* ! This method will only return the first account that matches the address
|
|
195
235
|
*
|
|
236
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
237
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
196
238
|
* @param address - The address of the account to retrieve.
|
|
197
239
|
* @returns The account with the specified address, or undefined if not found.
|
|
198
240
|
*/
|
|
@@ -200,12 +242,16 @@ export declare class AccountsController extends BaseController<typeof controller
|
|
|
200
242
|
/**
|
|
201
243
|
* Sets the selected account by its ID.
|
|
202
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.
|
|
203
247
|
* @param accountId - The ID of the account to be selected.
|
|
204
248
|
*/
|
|
205
249
|
setSelectedAccount(accountId: string): void;
|
|
206
250
|
/**
|
|
207
251
|
* Sets the name of the account with the given ID.
|
|
208
252
|
*
|
|
253
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
254
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
209
255
|
* @param accountId - The ID of the account to set the name for.
|
|
210
256
|
* @param accountName - The new name for the account.
|
|
211
257
|
* @throws An error if an account with the same name already exists.
|
|
@@ -214,6 +260,8 @@ export declare class AccountsController extends BaseController<typeof controller
|
|
|
214
260
|
/**
|
|
215
261
|
* Sets the name of the account with the given ID and select it.
|
|
216
262
|
*
|
|
263
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
264
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
217
265
|
* @param accountId - The ID of the account to set the name for and select.
|
|
218
266
|
* @param accountName - The new name for the account.
|
|
219
267
|
* @throws An error if an account with the same name already exists.
|
|
@@ -222,6 +270,8 @@ export declare class AccountsController extends BaseController<typeof controller
|
|
|
222
270
|
/**
|
|
223
271
|
* Updates the metadata of the account with the given ID.
|
|
224
272
|
*
|
|
273
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
274
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
225
275
|
* @param accountId - The ID of the account for which the metadata will be updated.
|
|
226
276
|
* @param metadata - The new metadata for the account.
|
|
227
277
|
*/
|
|
@@ -230,12 +280,16 @@ export declare class AccountsController extends BaseController<typeof controller
|
|
|
230
280
|
* Updates the internal accounts list by retrieving normal and snap accounts,
|
|
231
281
|
* removing duplicates, and updating the metadata of each account.
|
|
232
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.
|
|
233
285
|
* @returns A Promise that resolves when the accounts have been updated.
|
|
234
286
|
*/
|
|
235
287
|
updateAccounts(): Promise<void>;
|
|
236
288
|
/**
|
|
237
289
|
* Loads the backup state of the accounts controller.
|
|
238
290
|
*
|
|
291
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
292
|
+
* Use `AccountTreeController`, `MultichainAccountService`, or the Keyring API v2 instead.
|
|
239
293
|
* @param backup - The backup state to load.
|
|
240
294
|
*/
|
|
241
295
|
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,E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