@metamask-previews/keyring-controller 12.0.0-preview.d357889 → 12.2.0-preview.0a7589e7

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 CHANGED
@@ -1,4 +1,5 @@
1
1
  # Changelog
2
+
2
3
  All notable changes to this project will be documented in this file.
3
4
 
4
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
@@ -6,12 +7,55 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
7
 
7
8
  ## [Unreleased]
8
9
 
10
+ ### Removed
11
+
12
+ - **BREAKING:** Remove callbacks `updateIdentities`, `syncIdentities`, `setSelectedAddress`, `setAccountLabel` from constructor options of the `KeyringController` class. These were previously used to update `PreferencesController` state, but are now replaced with `PreferencesController`'s subscription to the `KeyringController:stateChange` event. ([#3853](https://github.com/MetaMask/core/pull/3853))
13
+ - Class methods `addNewAccount`, `addNewAccountForKeyring`, `createNewVaultAndRestore`, `createNewVaultAndKeychain`, `importAccountWithStrategy`, `restoreQRKeyring`, `unlockQRHardwareWalletAccount`, `forgetQRDevice` no longer directly updates `PreferencesController` state by calling the `updateIdentities` callback.
14
+ - Class method `submitPassword` no longer directly updates `PreferencesController` state by calling the `syncIdentities` callback.
15
+ - Class method `unlockQRHardwareWalletAccount` no longer directly updates `PreferencesController` state by calling the `setAccountLabel`, `setSelectedAddress` callbacks.
16
+
17
+ ## [12.2.0]
18
+
19
+ ### Added
20
+
21
+ - Add `getDefaultKeyringState` function ([#3799](https://github.com/MetaMask/core/pull/3799))
22
+
23
+ ### Changed
24
+
25
+ - Bump `@metamask/base-controller` to `^4.1.1` ([#3821](https://github.com/MetaMask/core/pull/3821))
26
+ - Bump `@metamask/message-manager` to `^7.3.8` ([#3821](https://github.com/MetaMask/core/pull/3821))
27
+
28
+ ### Removed
29
+
30
+ - Remove `peerDependency` and `devDependency` upon `@metamask/preferences-controller` ([#3799](https://github.com/MetaMask/core/pull/3799))
31
+ - This dependency was just used to access the types of four methods. Those types are now inlined instead.
32
+
33
+ ## [12.1.0]
34
+
35
+ ### Added
36
+
37
+ - Add methods to support ERC-4337 accounts ([#3602](https://github.com/MetaMask/core/pull/3602))
38
+
39
+ ### Changed
40
+
41
+ - Bump `@metamask/keyring-api` to ^3.0.0 ([#3747](https://github.com/MetaMask/core/pull/3747))
42
+ - Bump @metamask/eth-keyring-controller from 17.0.0 to 17.0.1 ([#3805](https://github.com/MetaMask/core/pull/3805))
43
+ - Bump `@metamask/utils` to `^8.3.0` ([#3769](https://github.com/MetaMask/core/pull/3769))
44
+
45
+ ### Fixed
46
+
47
+ - Fix custody keyring name ([#3803](https://github.com/MetaMask/core/pull/3803))
48
+
9
49
  ## [12.0.0]
50
+
10
51
  ### Changed
52
+
11
53
  - **BREAKING:** Bump `@metamask/preferences-controller` to ^6.0.0
12
54
 
13
55
  ## [11.0.0]
56
+
14
57
  ### Changed
58
+
15
59
  - **BREAKING:** Bump `@metamask/preferences-controller` peer dependency from `^5.0.0` to `^5.0.1` ([#3695](https://github.com/MetaMask/core/pull/3695))
16
60
  - Bump `@metamask/base-controller` to `^4.0.1` ([#3695](https://github.com/MetaMask/core/pull/3695))
17
61
  - Bump `@metamask/eth-keyring-controller` to `^15.1.0` ([#3617](https://github.com/MetaMask/core/pull/3617))
@@ -20,79 +64,104 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
20
64
  - Update `forgetQRDevice` to return an object containing `removedAccounts` and `remainingAccounts` ([#3641](https://github.com/MetaMask/core/pull/3641))
21
65
 
22
66
  ### Fixed
67
+
23
68
  - Remove `@metamask/preferences-controller` dependency ([#3607](https://github.com/MetaMask/core/pull/3607))
24
69
 
25
70
  ## [10.0.0]
71
+
26
72
  ### Changed
73
+
27
74
  - **BREAKING:** Bump `@metamask/base-controller` to ^4.0.0 ([#2063](https://github.com/MetaMask/core/pull/2063))
28
75
  - This is breaking because the type of the `messenger` has backward-incompatible changes. See the changelog for this package for more.
29
76
  - Bump `@metamask/message-manager` to ^7.3.6 ([#2063](https://github.com/MetaMask/core/pull/2063))
30
77
  - Bump `@metamask/preferences-controller` to ^4.5.0 ([#2063](https://github.com/MetaMask/core/pull/2063))
31
78
 
32
79
  ## [9.0.0]
80
+
33
81
  ### Added
82
+
34
83
  - Add `KeyringController:persistAllKeyrings` messenger action ([#1965](https://github.com/MetaMask/core/pull/1965))
35
84
 
36
85
  ### Changed
37
- - **BREAKING** Change `encryptor` constructor option property type to `GenericEncryptor | ExportableKeyEncryptor | undefined` ([#2041](https://github.com/MetaMask/core/pull/2041))
86
+
87
+ - **BREAKING** Change `encryptor` constructor option property type to `GenericEncryptor | ExportableKeyEncryptor | undefined` ([#2041](https://github.com/MetaMask/core/pull/2041))
38
88
  - When the controller is instantiated with `cacheEncryptionKey: true`, `encryptor` may no longer be of type `GenericEncryptor`.
39
89
  - Bump dependency on `@metamask/scure-bip39` 2.1.1 ([#1868](https://github.com/MetaMask/core/pull/1868))
40
90
  - Bump dependency on `@metamask/utils` to 8.2.0 ([#1957](https://github.com/MetaMask/core/pull/1957))
41
91
  - Bump @metamask/eth-keyring-controller to 14.0.0 ([#1771](https://github.com/MetaMask/core/pull/1771))
42
92
 
43
93
  ## [8.1.0]
94
+
44
95
  ### Changed
96
+
45
97
  - Adds additional options to KeyringTypes enum ([#1839](https://github.com/MetaMask/core/pull/1839))
46
98
 
47
99
  ## [8.0.3]
100
+
48
101
  ### Changed
102
+
49
103
  - `signTransaction` now accepts an optional `opts: Record<string, unknown>` argument to support `signTransaction` from `Keyring` type ([#1789](https://github.com/MetaMask/core/pull/1789))
50
104
  - Bump dependency and peer dependency on `@metamask/preferences-controller` to ^4.4.3
51
105
 
52
106
  ## [8.0.2]
107
+
53
108
  ### Changed
109
+
54
110
  - Bump dependency on `@metamask/utils` to ^8.1.0 ([#1639](https://github.com/MetaMask/core/pull/1639))
55
111
  - Bump dependency on `@metamask/base-controller` to ^3.2.3
56
112
  - Bump dependency on `@metamask/message-manager` to ^7.3.5
57
113
 
58
114
  ### Fixed
115
+
59
116
  - Update `removeAccount` to remove call to `PreferencesController.removeIdentity` as `PreferencesController` already handles account removal side effects through messenger events ([#1759](https://github.com/MetaMask/core/pull/1759))
60
117
 
61
118
  ## [8.0.1]
119
+
62
120
  ### Changed
121
+
63
122
  - Update TypeScript to v4.8.x ([#1718](https://github.com/MetaMask/core/pull/1718))
64
123
 
65
124
  ### Fixed
125
+
66
126
  - Removed `keyringTypes` from `memStore` ([#1710](https://github.com/MetaMask/core/pull/1710))
67
127
  - This property was accidentally getting copied into the memstore from the internal keyring controller. It was causing errors because there is no metadata for this state property.
68
128
 
69
129
  ## [8.0.0]
130
+
70
131
  ### Added
132
+
71
133
  - Add `getQRKeyring(): QRKeyring | undefined` method
72
134
  - Add `KeyringController:qrKeyringStateChange` messenger event
73
135
  - The event emits updates from the internal `QRKeyring` instance, if there's one
74
136
 
75
137
  ### Changed
138
+
76
139
  - **BREAKING:** addNewKeyring(type) return type changed from Promise<Keyring<Json>> to Promise<unknown>
77
140
  - When calling with QRKeyring type the keyring instance is retrieved or created (no multiple QRKeyring instances possible)
78
141
  - Bump dependency on `@metamask/message-manager` to ^7.3.3
79
142
  - Bump dependency on `@metamask/preferences-controller` to ^4.4.1
80
143
 
81
144
  ### Fixed
145
+
82
146
  - Fix `addNewAccountForKeyring` for `CustodyKeyring` ([#1694](https://github.com/MetaMask/core/pull/1694))
83
147
 
84
148
  ## [7.5.0]
149
+
85
150
  ### Added
151
+
86
152
  - Add `KeyringController` messenger actions ([#1691](https://github.com/MetaMask/core/pull/1691))
87
153
  - `KeyringController:getAccounts`
88
154
  - `KeyringController:getKeyringsByType`
89
155
  - `KeyringController:getKeyringForAccount`
90
156
 
91
157
  ### Changed
158
+
92
159
  - Bump `@metamask/eth-sig-util` from 6.0.0 to 7.0.0 ([#1669](https://github.com/MetaMask/core/pull/1669))
93
160
 
94
161
  ## [7.4.0]
162
+
95
163
  ### Added
164
+
96
165
  - Add `KeyringController` messenger actions ([#1654](https://github.com/MetaMask/core/pull/1654))
97
166
  - `KeyringController:signMessage`
98
167
  - `KeyringController:signPersonalMessage`
@@ -101,26 +170,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
101
170
  - `KeyringController:getEncryptionPublicKey`
102
171
 
103
172
  ## [7.3.0]
173
+
104
174
  ### Added
175
+
105
176
  - Add `decryptMessage` method ([#1596](https://github.com/MetaMask/core/pull/1596))
106
177
 
107
178
  ## [7.2.0]
179
+
108
180
  ### Added
181
+
109
182
  - Add `addNewAccountForKeyring` method ([#1591](https://github.com/MetaMask/core/pull/1591))
110
183
  - Add `addNewKeyring` method ([#1594](https://github.com/MetaMask/core/pull/1594))
111
184
  - Add `persistAllKeyrings` method ([#1574](https://github.com/MetaMask/core/pull/1574))
112
185
 
113
186
  ### Changed
187
+
114
188
  - Bump dependency on `@metamask/base-controller` to ^3.2.1
115
189
  - Bump dependency on `@metamask/message-manager` to ^7.3.1
116
190
  - Bump dependency and peer dependency on `@metamask/preferences-controller` to ^4.4.0
117
191
 
118
192
  ## [7.1.0]
193
+
119
194
  ### Added
195
+
120
196
  - Add `getEncryptionPublicKey` method on KeyringController ([#1569](https://github.com/MetaMask/core/pull/1569))
121
197
 
122
198
  ## [7.0.0]
199
+
123
200
  ### Changed
201
+
124
202
  - **BREAKING**: Remove `keyringTypes` property from the KeyringController state ([#1441](https://github.com/MetaMask/core/pull/1441))
125
203
  - **BREAKING**: Constructor `KeyringControllerOptions` type changed ([#1441](https://github.com/MetaMask/core/pull/1441))
126
204
  - The `KeyringControllerOptions.state` accepted type is now `{ vault?: string }`
@@ -140,16 +218,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
140
218
  - Update `@keystonehq/metamask-airgapped-keyring` to `^0.13.1` ([#1514](https://github.com/MetaMask/core/pull/1514))
141
219
 
142
220
  ## [6.1.0]
221
+
143
222
  ### Changed
223
+
144
224
  - Bump @metamask/eth-sig-util to ^6.0.0 ([#1483](https://github.com/MetaMask/core/pull/1483))
145
225
 
146
226
  ## [6.0.0]
227
+
147
228
  ### Added
229
+
148
230
  - Add messenger events `KeyringController:lock` and `KeyringController:unlock`, emitted when the inner EthKeyringController is locked/unlocked ([#1378](https://github.com/MetaMask/core/pull/1378))
149
231
  - Also add corresponding types `KeyringControllerLockEvent` and `KeyringControllerUnlockEvent`
150
232
  - Add `KeyringController:accountRemoved` event, fired whenever an account is removed through `removeAccount` ([#1416](https://github.com/MetaMask/core/pull/1416))
151
233
 
152
234
  ### Changed
235
+
153
236
  - **BREAKING:** Update constructor to take a single argument, an options bag, instead of three arguments ([#1378](https://github.com/MetaMask/core/pull/1378))
154
237
  - **BREAKING:** Update controller so state is now accessible via `controller.state` instead of `controller.store.getState()` ([#1378](https://github.com/MetaMask/core/pull/1378))
155
238
  - **BREAKING:** Update KeyringController to take a required `messenger` option ([#1378](https://github.com/MetaMask/core/pull/1378))
@@ -176,6 +259,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
176
259
  - Add `immer` as a dependency ([#1378](https://github.com/MetaMask/core/pull/1378))
177
260
 
178
261
  ### Removed
262
+
179
263
  - **BREAKING:** Remove `subscribe` and `unsubscribe` methods ([#1378](https://github.com/MetaMask/core/pull/1378))
180
264
  - State changes can be directly subscribed to (or unsubscribed from) via the messenger if necessary
181
265
  - **BREAKING:** Remove `lock` and `unlock` methods ([#1378](https://github.com/MetaMask/core/pull/1378))
@@ -185,11 +269,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
185
269
  - **BREAKING:** Remove `index` from the `Keyring` type ([#1378](https://github.com/MetaMask/core/pull/1378))
186
270
 
187
271
  ## [5.1.0]
272
+
188
273
  ### Added
274
+
189
275
  - Add `cancelQRSynchronization` method ([#1387](https://github.com/MetaMask/core.git/pull/1387))
190
276
 
191
277
  ## [5.0.0]
278
+
192
279
  ### Added
280
+
193
281
  - Add support for encryption keys ([#1342](https://github.com/MetaMask/core/pull/1342))
194
282
  - The configuration option `cacheEncryptionKey` has been added, along with two new state properties (`encryptionKey` and `encryptionSalt`) and a new method (`submitEncryptionKey`)
195
283
  - All new state and config entries are optional, so this will have no effect if you're not using this feature.
@@ -198,9 +286,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
198
286
  - Add deprecated `getKeyringForAccount` and `getKeyringsByType` methods ([#1376](https://github.com/MetaMask/core/pull/1376), [#1386](https://github.com/MetaMask/core/pull/1386))
199
287
 
200
288
  ### Changed
289
+
201
290
  - **BREAKING:** Bump to Node 16 ([#1262](https://github.com/MetaMask/core/pull/1262))
202
291
  - **BREAKING:** Change return type of `createNewVaultAndRestore` from `string | number[]` to `Uint8Array` ([#1349](https://github.com/MetaMask/core/pull/1349))
203
- - **BREAKING:** Change return type of `verifySeedPhrase` from `string` to `Uint8Array` ([#1338](https://github.com/MetaMask/core/pull/1338))
292
+ - **BREAKING:** Change return type of `verifySeedPhrase` from `string` to `Uint8Array` ([#1338](https://github.com/MetaMask/core/pull/1338))
204
293
  - **BREAKING:** Replace `validatePassword` with `verifyPassword` ([#1348](https://github.com/MetaMask/core/pull/1348))
205
294
  - `verifyPassword` is asynchronous, unlike `validatePassword` which was not.
206
295
  - `verifyPassword` does not return a boolean to indicate whether the password is valid. Instead an error is thrown when it's invalid.
@@ -218,6 +307,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
218
307
  - Update `@metamask/preferences-controller` dependency
219
308
 
220
309
  ### Fixed
310
+
221
311
  - Improve validation of `from` address in `signTypedMessage` ([#1293](https://github.com/MetaMask/core/pull/1293))
222
312
  - Improve private key validation in `importAccountWithStrategy` ([#1297](https://github.com/MetaMask/core/pull/1297))
223
313
  - A more helpful error is now thrown when the given private key has the wrong length
@@ -226,37 +316,51 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
226
316
  - The old behavior was especially confusing because the `subscribe` method is overridden to return state change events from the internal `EthKeyingController` state, resulting in state change events being out of sync with controller state. They should be the same now.
227
317
 
228
318
  ## [4.0.0]
319
+
229
320
  ### Removed
321
+
230
322
  - **BREAKING:** Remove `isomorphic-fetch` ([#1106](https://github.com/MetaMask/controllers/pull/1106))
231
323
  - Consumers must now import `isomorphic-fetch` or another polyfill themselves if they are running in an environment without `fetch`
232
324
 
233
325
  ## [3.0.0]
326
+
234
327
  ### Changed
328
+
235
329
  - **BREAKING:**: Bump eth-keyring-controller version to @metamask/eth-keyring-controller v10 ([#1072](https://github.com/MetaMask/core.git/pull/1072))
236
- - `exportSeedPhrase` now returns a `Uint8Array` typed SRP (can be converted to a string using [this approach](https://github.com/MetaMask/eth-hd-keyring/blob/53b0570559595ba5b3fd8c80e900d847cd6dee3d/index.js#L40)). It was previously a Buffer.
330
+ - `exportSeedPhrase` now returns a `Uint8Array` typed SRP (can be converted to a string using [this approach](https://github.com/MetaMask/eth-hd-keyring/blob/53b0570559595ba5b3fd8c80e900d847cd6dee3d/index.js#L40)). It was previously a Buffer.
237
331
  - The HD keyring included with the keyring controller has been updated from v4 to v6. See [the `eth-hd-keyring` changelog entries for v5 and v6](https://github.com/MetaMask/eth-hd-keyring/blob/main/CHANGELOG.md#600) for further details on breaking changes.
238
332
 
239
333
  ## [2.0.0]
334
+
240
335
  ### Changed
336
+
241
337
  - **BREAKING:**: Require ES2020 support or greater ([#914](https://github.com/MetaMask/controllers/pull/914))
242
- - This change was introduced by an indirect dependency on `ethereumjs/util` v8
338
+ - This change was introduced by an indirect dependency on `ethereumjs/util` v8
243
339
  - Rename this repository to `core` ([#1031](https://github.com/MetaMask/controllers/pull/1031))
244
340
  - Update `@metamask/eth-sig-util` to v5 ([#914](https://github.com/MetaMask/controllers/pull/914))
245
341
  - Update `@metamask/controller-utils` package ([#1041](https://github.com/MetaMask/controllers/pull/1041))
246
342
 
247
343
  ## [1.0.1]
344
+
248
345
  ### Changed
346
+
249
347
  - Relax dependencies on `@metamask/base-controller`, `@metamask/controller-utils`, `@metamask/message-manager`, and `@metamask/preferences-controller` (use `^` instead of `~`) ([#998](https://github.com/MetaMask/core/pull/998))
250
348
 
251
349
  ## [1.0.0]
350
+
252
351
  ### Added
352
+
253
353
  - Initial release
354
+
254
355
  - As a result of converting our shared controllers repo into a monorepo ([#831](https://github.com/MetaMask/core/pull/831)), we've created this package from select parts of [`@metamask/controllers` v33.0.0](https://github.com/MetaMask/core/tree/v33.0.0), namely:
356
+
255
357
  - Everything in `src/keyring`
256
358
 
257
359
  All changes listed after this point were applied to this package following the monorepo conversion.
258
360
 
259
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@12.0.0...HEAD
361
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@12.2.0...HEAD
362
+ [12.2.0]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@12.1.0...@metamask/keyring-controller@12.2.0
363
+ [12.1.0]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@12.0.0...@metamask/keyring-controller@12.1.0
260
364
  [12.0.0]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@11.0.0...@metamask/keyring-controller@12.0.0
261
365
  [11.0.0]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@10.0.0...@metamask/keyring-controller@11.0.0
262
366
  [10.0.0]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@9.0.0...@metamask/keyring-controller@10.0.0
@@ -2,10 +2,10 @@ import type { TxData, TypedTransaction } from '@ethereumjs/tx';
2
2
  import type { MetaMaskKeyring as QRKeyring, IKeyringState as IQRKeyringState } from '@keystonehq/metamask-airgapped-keyring';
3
3
  import type { RestrictedControllerMessenger } from '@metamask/base-controller';
4
4
  import { BaseController } from '@metamask/base-controller';
5
- import type { ExportableKeyEncryptor, GenericEncryptor } from '@metamask/eth-keyring-controller/dist/types';
5
+ import * as encryptorUtils from '@metamask/browser-passworder';
6
+ import type { EthBaseTransaction, EthBaseUserOperation, EthKeyring, EthUserOperation, EthUserOperationPatch } from '@metamask/keyring-api';
6
7
  import type { PersonalMessageParams, TypedMessageParams } from '@metamask/message-manager';
7
- import type { PreferencesController } from '@metamask/preferences-controller';
8
- import type { Eip1024EncryptedData, Hex, Keyring, Json } from '@metamask/utils';
8
+ import type { Eip1024EncryptedData, Hex, Json, KeyringClass } from '@metamask/utils';
9
9
  import type { Patch } from 'immer';
10
10
  declare const name = "KeyringController";
11
11
  /**
@@ -18,9 +18,15 @@ export declare enum KeyringTypes {
18
18
  trezor = "Trezor Hardware",
19
19
  ledger = "Ledger Hardware",
20
20
  lattice = "Lattice Hardware",
21
- snap = "Snap Keyring",
22
- custody = "Custody"
21
+ snap = "Snap Keyring"
23
22
  }
23
+ /**
24
+ * Custody keyring types are a special case, as they are not a single type
25
+ * but they all start with the prefix "Custody".
26
+ * @param keyringType - The type of the keyring.
27
+ * @returns Whether the keyring type is a custody keyring.
28
+ */
29
+ export declare const isCustodyKeyring: (keyringType: string) => boolean;
24
30
  /**
25
31
  * @type KeyringControllerState
26
32
  *
@@ -80,6 +86,18 @@ export declare type KeyringControllerPersistAllKeyringsAction = {
80
86
  type: `${typeof name}:persistAllKeyrings`;
81
87
  handler: KeyringController['persistAllKeyrings'];
82
88
  };
89
+ export declare type KeyringControllerPrepareUserOperationAction = {
90
+ type: `${typeof name}:prepareUserOperation`;
91
+ handler: KeyringController['prepareUserOperation'];
92
+ };
93
+ export declare type KeyringControllerPatchUserOperationAction = {
94
+ type: `${typeof name}:patchUserOperation`;
95
+ handler: KeyringController['patchUserOperation'];
96
+ };
97
+ export declare type KeyringControllerSignUserOperationAction = {
98
+ type: `${typeof name}:signUserOperation`;
99
+ handler: KeyringController['signUserOperation'];
100
+ };
83
101
  export declare type KeyringControllerStateChangeEvent = {
84
102
  type: `${typeof name}:stateChange`;
85
103
  payload: [KeyringControllerState, Patch[]];
@@ -100,16 +118,12 @@ export declare type KeyringControllerQRKeyringStateChangeEvent = {
100
118
  type: `${typeof name}:qrKeyringStateChange`;
101
119
  payload: [ReturnType<IQRKeyringState['getState']>];
102
120
  };
103
- export declare type KeyringControllerActions = KeyringControllerGetStateAction | KeyringControllerSignMessageAction | KeyringControllerSignPersonalMessageAction | KeyringControllerSignTypedMessageAction | KeyringControllerDecryptMessageAction | KeyringControllerGetEncryptionPublicKeyAction | KeyringControllerGetAccountsAction | KeyringControllerGetKeyringsByTypeAction | KeyringControllerGetKeyringForAccountAction | KeyringControllerPersistAllKeyringsAction;
121
+ export declare type KeyringControllerActions = KeyringControllerGetStateAction | KeyringControllerSignMessageAction | KeyringControllerSignPersonalMessageAction | KeyringControllerSignTypedMessageAction | KeyringControllerDecryptMessageAction | KeyringControllerGetEncryptionPublicKeyAction | KeyringControllerGetAccountsAction | KeyringControllerGetKeyringsByTypeAction | KeyringControllerGetKeyringForAccountAction | KeyringControllerPersistAllKeyringsAction | KeyringControllerPrepareUserOperationAction | KeyringControllerPatchUserOperationAction | KeyringControllerSignUserOperationAction;
104
122
  export declare type KeyringControllerEvents = KeyringControllerStateChangeEvent | KeyringControllerLockEvent | KeyringControllerUnlockEvent | KeyringControllerAccountRemovedEvent | KeyringControllerQRKeyringStateChangeEvent;
105
123
  export declare type KeyringControllerMessenger = RestrictedControllerMessenger<typeof name, KeyringControllerActions, KeyringControllerEvents, string, string>;
106
124
  export declare type KeyringControllerOptions = {
107
- syncIdentities: PreferencesController['syncIdentities'];
108
- updateIdentities: PreferencesController['updateIdentities'];
109
- setSelectedAddress: PreferencesController['setSelectedAddress'];
110
- setAccountLabel?: PreferencesController['setAccountLabel'];
111
125
  keyringBuilders?: {
112
- (): Keyring<Json>;
126
+ (): EthKeyring<Json>;
113
127
  type: string;
114
128
  }[];
115
129
  messenger: KeyringControllerMessenger;
@@ -151,6 +165,107 @@ export declare enum SignTypedDataVersion {
151
165
  V3 = "V3",
152
166
  V4 = "V4"
153
167
  }
168
+ /**
169
+ * A serialized keyring object.
170
+ */
171
+ export declare type SerializedKeyring = {
172
+ type: string;
173
+ data: Json;
174
+ };
175
+ /**
176
+ * A generic encryptor interface that supports encrypting and decrypting
177
+ * serializable data with a password.
178
+ */
179
+ export declare type GenericEncryptor = {
180
+ /**
181
+ * Encrypts the given object with the given password.
182
+ *
183
+ * @param password - The password to encrypt with.
184
+ * @param object - The object to encrypt.
185
+ * @returns The encrypted string.
186
+ */
187
+ encrypt: (password: string, object: Json) => Promise<string>;
188
+ /**
189
+ * Decrypts the given encrypted string with the given password.
190
+ *
191
+ * @param password - The password to decrypt with.
192
+ * @param encryptedString - The encrypted string to decrypt.
193
+ * @returns The decrypted object.
194
+ */
195
+ decrypt: (password: string, encryptedString: string) => Promise<unknown>;
196
+ /**
197
+ * Optional vault migration helper. Checks if the provided vault is up to date
198
+ * with the desired encryption algorithm.
199
+ *
200
+ * @param vault - The encrypted string to check.
201
+ * @param targetDerivationParams - The desired target derivation params.
202
+ * @returns The updated encrypted string.
203
+ */
204
+ isVaultUpdated?: (vault: string, targetDerivationParams?: encryptorUtils.KeyDerivationOptions) => boolean;
205
+ };
206
+ /**
207
+ * An encryptor interface that supports encrypting and decrypting
208
+ * serializable data with a password, and exporting and importing keys.
209
+ */
210
+ export declare type ExportableKeyEncryptor = GenericEncryptor & {
211
+ /**
212
+ * Encrypts the given object with the given encryption key.
213
+ *
214
+ * @param key - The encryption key to encrypt with.
215
+ * @param object - The object to encrypt.
216
+ * @returns The encryption result.
217
+ */
218
+ encryptWithKey: (key: unknown, object: Json) => Promise<encryptorUtils.EncryptionResult>;
219
+ /**
220
+ * Encrypts the given object with the given password, and returns the
221
+ * encryption result and the exported key string.
222
+ *
223
+ * @param password - The password to encrypt with.
224
+ * @param object - The object to encrypt.
225
+ * @param salt - The optional salt to use for encryption.
226
+ * @returns The encrypted string and the exported key string.
227
+ */
228
+ encryptWithDetail: (password: string, object: Json, salt?: string) => Promise<encryptorUtils.DetailedEncryptionResult>;
229
+ /**
230
+ * Decrypts the given encrypted string with the given encryption key.
231
+ *
232
+ * @param key - The encryption key to decrypt with.
233
+ * @param encryptedString - The encrypted string to decrypt.
234
+ * @returns The decrypted object.
235
+ */
236
+ decryptWithKey: (key: unknown, encryptedString: string) => Promise<unknown>;
237
+ /**
238
+ * Decrypts the given encrypted string with the given password, and returns
239
+ * the decrypted object and the salt and exported key string used for
240
+ * encryption.
241
+ *
242
+ * @param password - The password to decrypt with.
243
+ * @param encryptedString - The encrypted string to decrypt.
244
+ * @returns The decrypted object and the salt and exported key string used for
245
+ * encryption.
246
+ */
247
+ decryptWithDetail: (password: string, encryptedString: string) => Promise<encryptorUtils.DetailedDecryptResult>;
248
+ /**
249
+ * Generates an encryption key from exported key string.
250
+ *
251
+ * @param key - The exported key string.
252
+ * @returns The encryption key.
253
+ */
254
+ importKey: (key: string) => Promise<unknown>;
255
+ };
256
+ /**
257
+ * Get builder function for `Keyring`
258
+ *
259
+ * Returns a builder function for `Keyring` with a `type` property.
260
+ *
261
+ * @param KeyringConstructor - The Keyring class for the builder.
262
+ * @returns A builder function for the given Keyring.
263
+ */
264
+ export declare function keyringBuilderFactory(KeyringConstructor: KeyringClass<Json>): {
265
+ (): import("@metamask/utils").Keyring<Json>;
266
+ type: string;
267
+ };
268
+ export declare const getDefaultKeyringState: () => KeyringControllerState;
154
269
  /**
155
270
  * Controller responsible for establishing and managing user identity.
156
271
  *
@@ -163,18 +278,10 @@ export declare enum SignTypedDataVersion {
163
278
  export declare class KeyringController extends BaseController<typeof name, KeyringControllerState, KeyringControllerMessenger> {
164
279
  #private;
165
280
  private readonly mutex;
166
- private readonly syncIdentities;
167
- private readonly updateIdentities;
168
- private readonly setSelectedAddress;
169
- private readonly setAccountLabel?;
170
281
  /**
171
282
  * Creates a KeyringController instance.
172
283
  *
173
284
  * @param options - Initial options used to configure this controller
174
- * @param options.syncIdentities - Sync identities with the given list of addresses.
175
- * @param options.updateIdentities - Generate an identity for each address given that doesn't already have an identity.
176
- * @param options.setSelectedAddress - Set the selected address.
177
- * @param options.setAccountLabel - Set a new name for account.
178
285
  * @param options.encryptor - An optional object for defining encryption schemes.
179
286
  * @param options.keyringBuilders - Set a new name for account.
180
287
  * @param options.cacheEncryptionKey - Whether to cache or not encryption key.
@@ -201,7 +308,7 @@ export declare class KeyringController extends BaseController<typeof name, Keyri
201
308
  * @param accountCount - Number of accounts before adding a new one, used to make the method idempotent.
202
309
  * @returns Promise resolving to keyring current state and added account
203
310
  */
204
- addNewAccountForKeyring(keyring: Keyring<Json>, accountCount?: number): Promise<Hex>;
311
+ addNewAccountForKeyring(keyring: EthKeyring<Json>, accountCount?: number): Promise<Hex>;
205
312
  /**
206
313
  * Adds a new account to the default (first) HD seed phrase keyring without updating identities in preferences.
207
314
  *
@@ -376,6 +483,31 @@ export declare class KeyringController extends BaseController<typeof name, Keyri
376
483
  * @returns Promise resolving to a signed transaction string.
377
484
  */
378
485
  signTransaction(transaction: TypedTransaction, from: string, opts?: Record<string, unknown>): Promise<TxData>;
486
+ /**
487
+ * Convert a base transaction to a base UserOperation.
488
+ *
489
+ * @param from - Address of the sender.
490
+ * @param transactions - Base transactions to include in the UserOperation.
491
+ * @returns A pseudo-UserOperation that can be used to construct a real.
492
+ */
493
+ prepareUserOperation(from: string, transactions: EthBaseTransaction[]): Promise<EthBaseUserOperation>;
494
+ /**
495
+ * Patches properties of a UserOperation. Currently, only the
496
+ * `paymasterAndData` can be patched.
497
+ *
498
+ * @param from - Address of the sender.
499
+ * @param userOp - UserOperation to patch.
500
+ * @returns A patch to apply to the UserOperation.
501
+ */
502
+ patchUserOperation(from: string, userOp: EthUserOperation): Promise<EthUserOperationPatch>;
503
+ /**
504
+ * Signs an UserOperation.
505
+ *
506
+ * @param from - Address of the sender.
507
+ * @param userOp - UserOperation to sign.
508
+ * @returns The signature of the UserOperation.
509
+ */
510
+ signUserOperation(from: string, userOp: EthUserOperation): Promise<string>;
379
511
  /**
380
512
  * Attempts to decrypt the current vault and load its keyrings,
381
513
  * using the given encryption key and salt.
@@ -1 +1 @@
1
- {"version":3,"file":"KeyringController.d.ts","sourceRoot":"","sources":["../src/KeyringController.ts"],"names":[],"mappings":"AAAA,OA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