@metamask-previews/eth-snap-keyring 22.1.0-de887b2 → 22.2.0-c42f34c

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
@@ -7,9 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [22.2.0]
11
+
12
+ ### Added
13
+
14
+ - Add `SnapKeyringV1Adapter` to adapt Snap v2 keyrings to legacy v1 keyring operations ([#557](https://github.com/MetaMask/accounts/pull/557))
15
+ - This adapter mostly exposes EVM signing operations through `EthKeyringV1Adapter`.
16
+ - This adapter also implements `removeAccount` the way it was implemented by the legacy Snap keyring (compatible with the `KeyringController` account removal flow).
17
+
10
18
  ### Changed
11
19
 
12
20
  - Normalize `KeyringAccount`'s address with `:accountCreated` and `setAccounts` ([#556](https://github.com/MetaMask/accounts/pull/556))
21
+ - Bump `@metamask/keyring-sdk` from `^2.1.1` to `^2.2.0` ([#562](https://github.com/MetaMask/accounts/pull/562))
22
+ - Bump `@metamask/keyring-snap-sdk` from `^9.0.1` to `^9.0.2` ([#562](https://github.com/MetaMask/accounts/pull/562))
13
23
 
14
24
  ## [22.1.0]
15
25
 
@@ -69,7 +79,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
69
79
  - Support Stellar (`xlm:account`) accounts in account assertions and v1 migrations ([#483](https://github.com/MetaMask/accounts/pull/483))
70
80
  - Add `SnapKeyringV1` class, a per-snap keyring wrapper that implements the old keyring interface and flows ([#507](https://github.com/MetaMask/accounts/pull/507))
71
81
  - This will allow us to re-use the existing logic (that we still use today) as part of the new V2 implementation until we completely them.
72
- - Add `SnapKeyringV2` class, a per-snap keyring wrapper that implements `KeyringV2` with `createAccount`, `createAccounts`, `deleteAccount`, `submitRequest`, `getAccount`, and `getAccounts` ([#501](https://github.com/MetaMask/accounts/pull/501)), ([#507](https://github.com/MetaMask/accounts/pull/507))
82
+ - Add `SnapKeyringV2` class, a per-snap keyring wrapper that implements `KeyringV2` with `createAccount`, `createAccounts`, `deleteAccount`, `submitRequest`, `getAccount`, and `getAccounts` ([#501](https://github.com/MetaMask/accounts/pull/501), [#507](https://github.com/MetaMask/accounts/pull/507))
73
83
  - `SnapKeyringV2` inherits from `SnapKeyringV1` so it can replace the current `SnapKeyring` class entirely, but for a single Snap.
74
84
  - Add `@metamask/keyring-sdk` `^1.1.0` as a new dependency ([#501](https://github.com/MetaMask/accounts/pull/501))
75
85
  - Add `./v2` subpath export for keyring v2 implementation ([#513](https://github.com/MetaMask/accounts/pull/513))
@@ -82,7 +92,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
82
92
  - **BREAKING:** Bump `@metamask/keyring-api` from `^22.0.0` to `^23.0.0` ([#515](https://github.com/MetaMask/accounts/pull/515))
83
93
  - Use `DeferredPromise` from `@metamask/utils` ([#508](https://github.com/MetaMask/accounts/pull/508))
84
94
  - Refactor `SnapKeyring` to store accounts in per-snap `SnapKeyringV2` wrappers instead of a single flat map ([#501](https://github.com/MetaMask/accounts/pull/501))
85
- - Bump `@metamask/messenger` from `^0.3.0` to `^1.1.1` ([#489](https://github.com/MetaMask/accounts/pull/489)), ([#500](https://github.com/MetaMask/accounts/pull/500))
95
+ - Bump `@metamask/messenger` from `^0.3.0` to `^1.1.1` ([#489](https://github.com/MetaMask/accounts/pull/489), [#500](https://github.com/MetaMask/accounts/pull/500))
86
96
  - Bump `@metamask/snaps-controllers` from `^19.0.0` to `^19.0.1` ([#500](https://github.com/MetaMask/accounts/pull/500))
87
97
  - Bump `@metamask/snaps-utils` from `^12.1.2` to `^12.1.3` ([#500](https://github.com/MetaMask/accounts/pull/500))
88
98
  - Bump `@metamask/utils` from `^11.10.0` to `^11.11.0` ([#483](https://github.com/MetaMask/accounts/pull/483))
@@ -117,9 +127,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
117
127
  - **BREAKING:** Bump `@metamask/keyring-internal-api` from `^9.1.2` to `^10.0.0` ([#460](https://github.com/MetaMask/accounts/pull/460))
118
128
  - **BREAKING:** Bump `@metamask/keyring-internal-snap-client` from `^8.0.2` to `^9.0.0` ([#460](https://github.com/MetaMask/accounts/pull/460))
119
129
  - Bump `@metamask/keyring-api` from `^21.2.0` to `^21.4.0` ([#460](https://github.com/MetaMask/accounts/pull/460))
120
- - Bump `@metamask/snaps-controllers` from `^14.0.1` to `^18.0.0` ([#422](https://github.com/MetaMask/accounts/pull/422)), ([#461](https://github.com/MetaMask/accounts/pull/461))
121
- - Bump `@metamask/snaps-sdk` from `^9.0.0` to `^10.4.0` ([#422](https://github.com/MetaMask/accounts/pull/422)), ([#461](https://github.com/MetaMask/accounts/pull/461))
122
- - Bump `@metamask/snaps-utils` from `^11.0.0` to `^12.1.0` ([#422](https://github.com/MetaMask/accounts/pull/422)), ([#424](https://github.com/MetaMask/accounts/pull/424)), ([#461](https://github.com/MetaMask/accounts/pull/461))
130
+ - Bump `@metamask/snaps-controllers` from `^14.0.1` to `^18.0.0` ([#422](https://github.com/MetaMask/accounts/pull/422), [#461](https://github.com/MetaMask/accounts/pull/461))
131
+ - Bump `@metamask/snaps-sdk` from `^9.0.0` to `^10.4.0` ([#422](https://github.com/MetaMask/accounts/pull/422), [#461](https://github.com/MetaMask/accounts/pull/461))
132
+ - Bump `@metamask/snaps-utils` from `^11.0.0` to `^12.1.0` ([#422](https://github.com/MetaMask/accounts/pull/422), [#424](https://github.com/MetaMask/accounts/pull/424), [#461](https://github.com/MetaMask/accounts/pull/461))
123
133
 
124
134
  ### Removed
125
135
 
@@ -156,7 +166,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
156
166
 
157
167
  ### Changed
158
168
 
159
- - Add dependency to `@metamask/keyring-snap-sdk` version `^7.1.0` ([#387](https://github.com/MetaMask/accounts/pull/387)), ([#388](https://github.com/MetaMask/accounts/pull/388))
169
+ - Add dependency to `@metamask/keyring-snap-sdk` version `^7.1.0` ([#387](https://github.com/MetaMask/accounts/pull/387), [#388](https://github.com/MetaMask/accounts/pull/388))
160
170
  - Bump `@metamask/keyring-api` from `^21.0.0` to `^21.1.0` ([#388](https://github.com/MetaMask/accounts/pull/388))
161
171
 
162
172
  ## [17.2.0]
@@ -179,7 +189,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
179
189
 
180
190
  ### Changed
181
191
 
182
- - **BREAKING:** Bump `@metamask/keyring-api` from `^20.0.0` to `^21.0.0` ([#355](https://github.com/MetaMask/accounts/pull/355)), ([#356](https://github.com/MetaMask/accounts/pull/356))
192
+ - **BREAKING:** Bump `@metamask/keyring-api` from `^20.0.0` to `^21.0.0` ([#355](https://github.com/MetaMask/accounts/pull/355), [#356](https://github.com/MetaMask/accounts/pull/356))
183
193
 
184
194
  ## [16.1.0]
185
195
 
@@ -230,19 +240,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
230
240
 
231
241
  ### Changed
232
242
 
233
- - Bump `@metamask/keyring-api` from `^17.4.0` to `^17.6.0` ([#277](https://github.com/MetaMask/accounts/pull/277)), ([#288](https://github.com/MetaMask/accounts/pull/288))
243
+ - Bump `@metamask/keyring-api` from `^17.4.0` to `^17.6.0` ([#277](https://github.com/MetaMask/accounts/pull/277), [#288](https://github.com/MetaMask/accounts/pull/288))
234
244
 
235
245
  ## [12.1.1]
236
246
 
237
247
  ### Changed
238
248
 
239
- - Bump `@metamask/keyring-api` from `^17.1.0` to `^17.4.0` ([#212](https://github.com/MetaMask/accounts/pull/212)), ([#220](https://github.com/MetaMask/accounts/pull/220)), ([#263](https://github.com/MetaMask/accounts/pull/263)), ([#269](https://github.com/MetaMask/accounts/pull/269))
249
+ - Bump `@metamask/keyring-api` from `^17.1.0` to `^17.4.0` ([#212](https://github.com/MetaMask/accounts/pull/212), [#220](https://github.com/MetaMask/accounts/pull/220), [#263](https://github.com/MetaMask/accounts/pull/263), [#269](https://github.com/MetaMask/accounts/pull/269))
240
250
 
241
251
  ## [12.1.0]
242
252
 
243
253
  ### Added
244
254
 
245
- - Add new concept of "internal options" and add a new `SnapKeyring.createAccount` method ([#252](https://github.com/MetaMask/accounts/pull/252)), ([#261](https://github.com/MetaMask/accounts/pull/261))
255
+ - Add new concept of "internal options" and add a new `SnapKeyring.createAccount` method ([#252](https://github.com/MetaMask/accounts/pull/252), [#261](https://github.com/MetaMask/accounts/pull/261))
246
256
  - Those internal options can be used by the caller of that method to customize the account creation flow.
247
257
  - Add `setSelectedAccount` internal option ([#257](https://github.com/MetaMask/accounts/pull/257))
248
258
 
@@ -265,7 +275,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
265
275
 
266
276
  ### Changed
267
277
 
268
- - **BREAKING:** Make account creation asynchronous ([#207](https://github.com/MetaMask/accounts/pull/207)), ([#211](https://github.com/MetaMask/accounts/pull/211))
278
+ - **BREAKING:** Make account creation asynchronous ([#207](https://github.com/MetaMask/accounts/pull/207), [#211](https://github.com/MetaMask/accounts/pull/211))
269
279
  - We no longer wait for `saveState` to finish before resuming the Snap account execution.
270
280
  - Add `onceSaved` deferred promise to `addAccount` callback. This new promise is required so the callback can `await` the account creation.
271
281
  - Use `ts-bridge/cli@0.6.3` ([#214](https://github.com/MetaMask/accounts/pull/214))
@@ -391,7 +401,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
391
401
 
392
402
  ### Changed
393
403
 
394
- - Bump `@metamask/*` dependencies and add `@lavamoat/preinstall-always-fail` ([#65](https://github.com/MetaMask/accounts/pull/65)), ([#59](https://github.com/MetaMask/accounts/pull/59)), ([#58](https://github.com/MetaMask/accounts/pull/58))
404
+ - Bump `@metamask/*` dependencies and add `@lavamoat/preinstall-always-fail` ([#65](https://github.com/MetaMask/accounts/pull/65), [#59](https://github.com/MetaMask/accounts/pull/59), [#58](https://github.com/MetaMask/accounts/pull/58))
395
405
  - Use TypeScript 5 ([#55](https://github.com/MetaMask/accounts/pull/55))
396
406
 
397
407
  ## [4.3.6]
@@ -420,10 +430,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
420
430
 
421
431
  ### Changed
422
432
 
423
- - Bump `@metamask/snaps-controllers` from `^9.3.0` to `^9.6.0` ([#372](https://github.com/MetaMask/eth-snap-keyring/pull/372)), ([#389](https://github.com/MetaMask/eth-snap-keyring/pull/389))
433
+ - Bump `@metamask/snaps-controllers` from `^9.3.0` to `^9.6.0` ([#372](https://github.com/MetaMask/eth-snap-keyring/pull/372), [#389](https://github.com/MetaMask/eth-snap-keyring/pull/389))
424
434
  - Bump `@metamask/snaps-sdk` from `^6.1.0` to `^6.4.0` ([#389](https://github.com/MetaMask/eth-snap-keyring/pull/389))
425
435
  - Bump `@metamask/utils` from `^9.1.0` to `^9.2.1` ([#385](https://github.com/MetaMask/eth-snap-keyring/pull/385))
426
- - Bump `@metamask/keyring-api` from `^8.0.1` to `^8.1.0` ([#374](https://github.com/MetaMask/eth-snap-keyring/pull/374)), ([#376](https://github.com/MetaMask/eth-snap-keyring/pull/376))
436
+ - Bump `@metamask/keyring-api` from `^8.0.1` to `^8.1.0` ([#374](https://github.com/MetaMask/eth-snap-keyring/pull/374), [#376](https://github.com/MetaMask/eth-snap-keyring/pull/376))
427
437
 
428
438
  ## [4.3.2]
429
439
 
@@ -431,9 +441,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
431
441
 
432
442
  - Bump `@metamask/eth-sig-util` from `^7.0.1` to `^7.0.3` ([#311](https://github.com/MetaMask/eth-snap-keyring/pull/311))
433
443
  - Bump `@metamask/keyring-api` from `^8.0.0` to `^8.0.1` ([#311](https://github.com/MetaMask/eth-snap-keyring/pull/311))
434
- - Bump `@metamask/snaps-controllers` from `^8.1.1` to `^9.3.0` ([#311](https://github.com/MetaMask/eth-snap-keyring/pull/311)), ([#363](https://github.com/MetaMask/eth-snap-keyring/pull/363))
435
- - Bump `@metamask/snaps-sdk` from `^4.2.0` to `^6.1.0` ([#311](https://github.com/MetaMask/eth-snap-keyring/pull/311)), ([#363](https://github.com/MetaMask/eth-snap-keyring/pull/363))
436
- - Bump `@metamask/snaps-utils` from `^7.4.0` to `^7.8.0` ([#311](https://github.com/MetaMask/eth-snap-keyring/pull/311)), ([#363](https://github.com/MetaMask/eth-snap-keyring/pull/363))
444
+ - Bump `@metamask/snaps-controllers` from `^8.1.1` to `^9.3.0` ([#311](https://github.com/MetaMask/eth-snap-keyring/pull/311), [#363](https://github.com/MetaMask/eth-snap-keyring/pull/363))
445
+ - Bump `@metamask/snaps-sdk` from `^4.2.0` to `^6.1.0` ([#311](https://github.com/MetaMask/eth-snap-keyring/pull/311), [#363](https://github.com/MetaMask/eth-snap-keyring/pull/363))
446
+ - Bump `@metamask/snaps-utils` from `^7.4.0` to `^7.8.0` ([#311](https://github.com/MetaMask/eth-snap-keyring/pull/311), [#363](https://github.com/MetaMask/eth-snap-keyring/pull/363))
437
447
  - Bump `@metamask/utils` from `^8.4.0` to `^9.1.0` ([#311](https://github.com/MetaMask/eth-snap-keyring/pull/311))
438
448
  - Set tsconfig options `module`, `moduleResolution` to `Node16` ([#311](https://github.com/MetaMask/eth-snap-keyring/pull/311))
439
449
 
@@ -729,7 +739,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
729
739
 
730
740
  - Initial release.
731
741
 
732
- [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/eth-snap-keyring@22.1.0...HEAD
742
+ [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/eth-snap-keyring@22.2.0...HEAD
743
+ [22.2.0]: https://github.com/MetaMask/accounts/compare/@metamask/eth-snap-keyring@22.1.0...@metamask/eth-snap-keyring@22.2.0
733
744
  [22.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/eth-snap-keyring@22.0.1...@metamask/eth-snap-keyring@22.1.0
734
745
  [22.0.1]: https://github.com/MetaMask/accounts/compare/@metamask/eth-snap-keyring@22.0.0...@metamask/eth-snap-keyring@22.0.1
735
746
  [22.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/eth-snap-keyring@21.0.1...@metamask/eth-snap-keyring@22.0.0
package/dist/events.d.cts CHANGED
@@ -4,6 +4,8 @@ export declare const AccountCreatedEventStruct: import("@metamask/superstruct").
4
4
  account: {
5
5
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
6
6
  id: string;
7
+ address: string;
8
+ scopes: `${string}:${string}`[];
7
9
  options: Record<string, import("@metamask/utils").Json> & {
8
10
  entropy?: {
9
11
  type: "mnemonic";
@@ -17,8 +19,6 @@ export declare const AccountCreatedEventStruct: import("@metamask/superstruct").
17
19
  };
18
20
  exportable?: boolean;
19
21
  };
20
- address: string;
21
- scopes: `${string}:${string}`[];
22
22
  methods: string[];
23
23
  } | {
24
24
  id: string;
@@ -52,6 +52,8 @@ export declare const AccountCreatedEventStruct: import("@metamask/superstruct").
52
52
  account: {
53
53
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
54
54
  id: string;
55
+ address: string;
56
+ scopes: `${string}:${string}`[];
55
57
  options: Record<string, import("@metamask/utils").Json> & {
56
58
  entropy?: {
57
59
  type: "mnemonic";
@@ -65,8 +67,6 @@ export declare const AccountCreatedEventStruct: import("@metamask/superstruct").
65
67
  };
66
68
  exportable?: boolean;
67
69
  };
68
- address: string;
69
- scopes: `${string}:${string}`[];
70
70
  methods: string[];
71
71
  } | {
72
72
  id: string;
@@ -97,6 +97,8 @@ export declare const AccountCreatedEventStruct: import("@metamask/superstruct").
97
97
  account: import("@metamask/superstruct").Struct<{
98
98
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
99
99
  id: string;
100
+ address: string;
101
+ scopes: `${string}:${string}`[];
100
102
  options: Record<string, import("@metamask/utils").Json> & {
101
103
  entropy?: {
102
104
  type: "mnemonic";
@@ -110,8 +112,6 @@ export declare const AccountCreatedEventStruct: import("@metamask/superstruct").
110
112
  };
111
113
  exportable?: boolean;
112
114
  };
113
- address: string;
114
- scopes: `${string}:${string}`[];
115
115
  methods: string[];
116
116
  } | {
117
117
  id: string;
@@ -148,6 +148,8 @@ export declare const AccountUpdatedEventStruct: import("@metamask/superstruct").
148
148
  account: {
149
149
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
150
150
  id: string;
151
+ address: string;
152
+ scopes: `${string}:${string}`[];
151
153
  options: Record<string, import("@metamask/utils").Json> & {
152
154
  entropy?: {
153
155
  type: "mnemonic";
@@ -161,8 +163,6 @@ export declare const AccountUpdatedEventStruct: import("@metamask/superstruct").
161
163
  };
162
164
  exportable?: boolean;
163
165
  };
164
- address: string;
165
- scopes: `${string}:${string}`[];
166
166
  methods: string[];
167
167
  } | {
168
168
  id: string;
@@ -190,6 +190,8 @@ export declare const AccountUpdatedEventStruct: import("@metamask/superstruct").
190
190
  account: {
191
191
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
192
192
  id: string;
193
+ address: string;
194
+ scopes: `${string}:${string}`[];
193
195
  options: Record<string, import("@metamask/utils").Json> & {
194
196
  entropy?: {
195
197
  type: "mnemonic";
@@ -203,8 +205,6 @@ export declare const AccountUpdatedEventStruct: import("@metamask/superstruct").
203
205
  };
204
206
  exportable?: boolean;
205
207
  };
206
- address: string;
207
- scopes: `${string}:${string}`[];
208
208
  methods: string[];
209
209
  } | {
210
210
  id: string;
@@ -229,6 +229,8 @@ export declare const AccountUpdatedEventStruct: import("@metamask/superstruct").
229
229
  account: import("@metamask/superstruct").Struct<{
230
230
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
231
231
  id: string;
232
+ address: string;
233
+ scopes: `${string}:${string}`[];
232
234
  options: Record<string, import("@metamask/utils").Json> & {
233
235
  entropy?: {
234
236
  type: "mnemonic";
@@ -242,8 +244,6 @@ export declare const AccountUpdatedEventStruct: import("@metamask/superstruct").
242
244
  };
243
245
  exportable?: boolean;
244
246
  };
245
- address: string;
246
- scopes: `${string}:${string}`[];
247
247
  methods: string[];
248
248
  } | {
249
249
  id: string;
package/dist/events.d.mts CHANGED
@@ -4,6 +4,8 @@ export declare const AccountCreatedEventStruct: import("@metamask/superstruct").
4
4
  account: {
5
5
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
6
6
  id: string;
7
+ address: string;
8
+ scopes: `${string}:${string}`[];
7
9
  options: Record<string, import("@metamask/utils").Json> & {
8
10
  entropy?: {
9
11
  type: "mnemonic";
@@ -17,8 +19,6 @@ export declare const AccountCreatedEventStruct: import("@metamask/superstruct").
17
19
  };
18
20
  exportable?: boolean;
19
21
  };
20
- address: string;
21
- scopes: `${string}:${string}`[];
22
22
  methods: string[];
23
23
  } | {
24
24
  id: string;
@@ -52,6 +52,8 @@ export declare const AccountCreatedEventStruct: import("@metamask/superstruct").
52
52
  account: {
53
53
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
54
54
  id: string;
55
+ address: string;
56
+ scopes: `${string}:${string}`[];
55
57
  options: Record<string, import("@metamask/utils").Json> & {
56
58
  entropy?: {
57
59
  type: "mnemonic";
@@ -65,8 +67,6 @@ export declare const AccountCreatedEventStruct: import("@metamask/superstruct").
65
67
  };
66
68
  exportable?: boolean;
67
69
  };
68
- address: string;
69
- scopes: `${string}:${string}`[];
70
70
  methods: string[];
71
71
  } | {
72
72
  id: string;
@@ -97,6 +97,8 @@ export declare const AccountCreatedEventStruct: import("@metamask/superstruct").
97
97
  account: import("@metamask/superstruct").Struct<{
98
98
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
99
99
  id: string;
100
+ address: string;
101
+ scopes: `${string}:${string}`[];
100
102
  options: Record<string, import("@metamask/utils").Json> & {
101
103
  entropy?: {
102
104
  type: "mnemonic";
@@ -110,8 +112,6 @@ export declare const AccountCreatedEventStruct: import("@metamask/superstruct").
110
112
  };
111
113
  exportable?: boolean;
112
114
  };
113
- address: string;
114
- scopes: `${string}:${string}`[];
115
115
  methods: string[];
116
116
  } | {
117
117
  id: string;
@@ -148,6 +148,8 @@ export declare const AccountUpdatedEventStruct: import("@metamask/superstruct").
148
148
  account: {
149
149
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
150
150
  id: string;
151
+ address: string;
152
+ scopes: `${string}:${string}`[];
151
153
  options: Record<string, import("@metamask/utils").Json> & {
152
154
  entropy?: {
153
155
  type: "mnemonic";
@@ -161,8 +163,6 @@ export declare const AccountUpdatedEventStruct: import("@metamask/superstruct").
161
163
  };
162
164
  exportable?: boolean;
163
165
  };
164
- address: string;
165
- scopes: `${string}:${string}`[];
166
166
  methods: string[];
167
167
  } | {
168
168
  id: string;
@@ -190,6 +190,8 @@ export declare const AccountUpdatedEventStruct: import("@metamask/superstruct").
190
190
  account: {
191
191
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
192
192
  id: string;
193
+ address: string;
194
+ scopes: `${string}:${string}`[];
193
195
  options: Record<string, import("@metamask/utils").Json> & {
194
196
  entropy?: {
195
197
  type: "mnemonic";
@@ -203,8 +205,6 @@ export declare const AccountUpdatedEventStruct: import("@metamask/superstruct").
203
205
  };
204
206
  exportable?: boolean;
205
207
  };
206
- address: string;
207
- scopes: `${string}:${string}`[];
208
208
  methods: string[];
209
209
  } | {
210
210
  id: string;
@@ -229,6 +229,8 @@ export declare const AccountUpdatedEventStruct: import("@metamask/superstruct").
229
229
  account: import("@metamask/superstruct").Struct<{
230
230
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
231
231
  id: string;
232
+ address: string;
233
+ scopes: `${string}:${string}`[];
232
234
  options: Record<string, import("@metamask/utils").Json> & {
233
235
  entropy?: {
234
236
  type: "mnemonic";
@@ -242,8 +244,6 @@ export declare const AccountUpdatedEventStruct: import("@metamask/superstruct").
242
244
  };
243
245
  exportable?: boolean;
244
246
  };
245
- address: string;
246
- scopes: `${string}:${string}`[];
247
247
  methods: string[];
248
248
  } | {
249
249
  id: string;
@@ -16,6 +16,8 @@ export declare const SnapKeyringStateStruct: import("@metamask/superstruct").Str
16
16
  accounts: Record<string, {
17
17
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
18
18
  id: string;
19
+ address: string;
20
+ scopes: `${string}:${string}`[];
19
21
  options: Record<string, Json> & {
20
22
  entropy?: {
21
23
  type: "mnemonic";
@@ -29,8 +31,6 @@ export declare const SnapKeyringStateStruct: import("@metamask/superstruct").Str
29
31
  };
30
32
  exportable?: boolean;
31
33
  };
32
- address: string;
33
- scopes: `${string}:${string}`[];
34
34
  methods: string[];
35
35
  } | {
36
36
  id: string;
@@ -61,6 +61,8 @@ export declare const SnapKeyringStateStruct: import("@metamask/superstruct").Str
61
61
  accounts: import("@metamask/superstruct").Struct<Record<string, {
62
62
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
63
63
  id: string;
64
+ address: string;
65
+ scopes: `${string}:${string}`[];
64
66
  options: Record<string, Json> & {
65
67
  entropy?: {
66
68
  type: "mnemonic";
@@ -74,8 +76,6 @@ export declare const SnapKeyringStateStruct: import("@metamask/superstruct").Str
74
76
  };
75
77
  exportable?: boolean;
76
78
  };
77
- address: string;
78
- scopes: `${string}:${string}`[];
79
79
  methods: string[];
80
80
  } | {
81
81
  id: string;
@@ -16,6 +16,8 @@ export declare const SnapKeyringStateStruct: import("@metamask/superstruct").Str
16
16
  accounts: Record<string, {
17
17
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
18
18
  id: string;
19
+ address: string;
20
+ scopes: `${string}:${string}`[];
19
21
  options: Record<string, Json> & {
20
22
  entropy?: {
21
23
  type: "mnemonic";
@@ -29,8 +31,6 @@ export declare const SnapKeyringStateStruct: import("@metamask/superstruct").Str
29
31
  };
30
32
  exportable?: boolean;
31
33
  };
32
- address: string;
33
- scopes: `${string}:${string}`[];
34
34
  methods: string[];
35
35
  } | {
36
36
  id: string;
@@ -61,6 +61,8 @@ export declare const SnapKeyringStateStruct: import("@metamask/superstruct").Str
61
61
  accounts: import("@metamask/superstruct").Struct<Record<string, {
62
62
  type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
63
63
  id: string;
64
+ address: string;
65
+ scopes: `${string}:${string}`[];
64
66
  options: Record<string, Json> & {
65
67
  entropy?: {
66
68
  type: "mnemonic";
@@ -74,8 +76,6 @@ export declare const SnapKeyringStateStruct: import("@metamask/superstruct").Str
74
76
  };
75
77
  exportable?: boolean;
76
78
  };
77
- address: string;
78
- scopes: `${string}:${string}`[];
79
79
  methods: string[];
80
80
  } | {
81
81
  id: string;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SnapKeyringV1Adapter = void 0;
4
+ const v2_1 = require("@metamask/keyring-sdk/v2");
5
+ /**
6
+ * Adapts a v2 Snap keyring to the legacy v1 keyring API.
7
+ */
8
+ class SnapKeyringV1Adapter extends v2_1.EthKeyringV1Adapter {
9
+ /**
10
+ * Remove an account matching the given address.
11
+ *
12
+ * @param address - Address of the account to remove.
13
+ */
14
+ async removeAccount(address) {
15
+ const account = this.inner.lookupByAddress(address);
16
+ if (!account) {
17
+ throw new Error(`Account '${address}' not found`);
18
+ }
19
+ await this.inner.deleteAccount(account.id);
20
+ }
21
+ }
22
+ exports.SnapKeyringV1Adapter = SnapKeyringV1Adapter;
23
+ //# sourceMappingURL=SnapKeyringV1Adapter.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SnapKeyringV1Adapter.cjs","sourceRoot":"","sources":["../../src/v2/SnapKeyringV1Adapter.ts"],"names":[],"mappings":";;;AAAA,iDAA+D;AAI/D;;GAEG;AACH,MAAa,oBAAqB,SAAQ,wBAAgC;IACxE;;;;OAIG;IACH,KAAK,CAAC,aAAa,CAAC,OAAe;QACjC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAEpD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,YAAY,OAAO,aAAa,CAAC,CAAC;QACpD,CAAC;QAED,MAAM,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC7C,CAAC;CACF;AAfD,oDAeC","sourcesContent":["import { EthKeyringV1Adapter } from '@metamask/keyring-sdk/v2';\n\nimport type { SnapKeyring } from './SnapKeyring';\n\n/**\n * Adapts a v2 Snap keyring to the legacy v1 keyring API.\n */\nexport class SnapKeyringV1Adapter extends EthKeyringV1Adapter<SnapKeyring> {\n /**\n * Remove an account matching the given address.\n *\n * @param address - Address of the account to remove.\n */\n async removeAccount(address: string): Promise<void> {\n const account = this.inner.lookupByAddress(address);\n\n if (!account) {\n throw new Error(`Account '${address}' not found`);\n }\n\n await this.inner.deleteAccount(account.id);\n }\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import { EthKeyringV1Adapter } from "@metamask/keyring-sdk/v2";
2
+ import type { SnapKeyring } from "./SnapKeyring.cjs";
3
+ /**
4
+ * Adapts a v2 Snap keyring to the legacy v1 keyring API.
5
+ */
6
+ export declare class SnapKeyringV1Adapter extends EthKeyringV1Adapter<SnapKeyring> {
7
+ /**
8
+ * Remove an account matching the given address.
9
+ *
10
+ * @param address - Address of the account to remove.
11
+ */
12
+ removeAccount(address: string): Promise<void>;
13
+ }
14
+ //# sourceMappingURL=SnapKeyringV1Adapter.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SnapKeyringV1Adapter.d.cts","sourceRoot":"","sources":["../../src/v2/SnapKeyringV1Adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,iCAAiC;AAE/D,OAAO,KAAK,EAAE,WAAW,EAAE,0BAAsB;AAEjD;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,mBAAmB,CAAC,WAAW,CAAC;IACxE;;;;OAIG;IACG,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CASpD"}
@@ -0,0 +1,14 @@
1
+ import { EthKeyringV1Adapter } from "@metamask/keyring-sdk/v2";
2
+ import type { SnapKeyring } from "./SnapKeyring.mjs";
3
+ /**
4
+ * Adapts a v2 Snap keyring to the legacy v1 keyring API.
5
+ */
6
+ export declare class SnapKeyringV1Adapter extends EthKeyringV1Adapter<SnapKeyring> {
7
+ /**
8
+ * Remove an account matching the given address.
9
+ *
10
+ * @param address - Address of the account to remove.
11
+ */
12
+ removeAccount(address: string): Promise<void>;
13
+ }
14
+ //# sourceMappingURL=SnapKeyringV1Adapter.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SnapKeyringV1Adapter.d.mts","sourceRoot":"","sources":["../../src/v2/SnapKeyringV1Adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,iCAAiC;AAE/D,OAAO,KAAK,EAAE,WAAW,EAAE,0BAAsB;AAEjD;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,mBAAmB,CAAC,WAAW,CAAC;IACxE;;;;OAIG;IACG,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CASpD"}
@@ -0,0 +1,19 @@
1
+ import { EthKeyringV1Adapter } from "@metamask/keyring-sdk/v2";
2
+ /**
3
+ * Adapts a v2 Snap keyring to the legacy v1 keyring API.
4
+ */
5
+ export class SnapKeyringV1Adapter extends EthKeyringV1Adapter {
6
+ /**
7
+ * Remove an account matching the given address.
8
+ *
9
+ * @param address - Address of the account to remove.
10
+ */
11
+ async removeAccount(address) {
12
+ const account = this.inner.lookupByAddress(address);
13
+ if (!account) {
14
+ throw new Error(`Account '${address}' not found`);
15
+ }
16
+ await this.inner.deleteAccount(account.id);
17
+ }
18
+ }
19
+ //# sourceMappingURL=SnapKeyringV1Adapter.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SnapKeyringV1Adapter.mjs","sourceRoot":"","sources":["../../src/v2/SnapKeyringV1Adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,iCAAiC;AAI/D;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,mBAAgC;IACxE;;;;OAIG;IACH,KAAK,CAAC,aAAa,CAAC,OAAe;QACjC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAEpD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,YAAY,OAAO,aAAa,CAAC,CAAC;QACpD,CAAC;QAED,MAAM,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["import { EthKeyringV1Adapter } from '@metamask/keyring-sdk/v2';\n\nimport type { SnapKeyring } from './SnapKeyring';\n\n/**\n * Adapts a v2 Snap keyring to the legacy v1 keyring API.\n */\nexport class SnapKeyringV1Adapter extends EthKeyringV1Adapter<SnapKeyring> {\n /**\n * Remove an account matching the given address.\n *\n * @param address - Address of the account to remove.\n */\n async removeAccount(address: string): Promise<void> {\n const account = this.inner.lookupByAddress(address);\n\n if (!account) {\n throw new Error(`Account '${address}' not found`);\n }\n\n await this.inner.deleteAccount(account.id);\n }\n}\n"]}
package/dist/v2/index.cjs CHANGED
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./SnapKeyring.cjs"), exports);
18
+ __exportStar(require("./SnapKeyringV1Adapter.cjs"), exports);
18
19
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAA8B","sourcesContent":["export * from './SnapKeyring';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAA8B;AAC9B,6DAAuC","sourcesContent":["export * from './SnapKeyring';\nexport * from './SnapKeyringV1Adapter';\n"]}
@@ -1,2 +1,3 @@
1
1
  export * from "./SnapKeyring.cjs";
2
+ export * from "./SnapKeyringV1Adapter.cjs";
2
3
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":"AAAA,kCAA8B"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":"AAAA,kCAA8B;AAC9B,2CAAuC"}
@@ -1,2 +1,3 @@
1
1
  export * from "./SnapKeyring.mjs";
2
+ export * from "./SnapKeyringV1Adapter.mjs";
2
3
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":"AAAA,kCAA8B"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":"AAAA,kCAA8B;AAC9B,2CAAuC"}
package/dist/v2/index.mjs CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from "./SnapKeyring.mjs";
2
+ export * from "./SnapKeyringV1Adapter.mjs";
2
3
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":"AAAA,kCAA8B","sourcesContent":["export * from './SnapKeyring';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":"AAAA,kCAA8B;AAC9B,2CAAuC","sourcesContent":["export * from './SnapKeyring';\nexport * from './SnapKeyringV1Adapter';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/eth-snap-keyring",
3
- "version": "22.1.0-de887b2",
3
+ "version": "22.2.0-c42f34c",
4
4
  "description": "Snaps keyring bridge",
5
5
  "keywords": [
6
6
  "keyring",
@@ -69,11 +69,11 @@
69
69
  "dependencies": {
70
70
  "@ethereumjs/tx": "^5.4.0",
71
71
  "@metamask/eth-sig-util": "^8.2.0",
72
- "@metamask/keyring-api": "23.1.0",
72
+ "@metamask/keyring-api": "23.2.0",
73
73
  "@metamask/keyring-internal-api": "11.0.1",
74
74
  "@metamask/keyring-internal-snap-client": "10.0.3",
75
- "@metamask/keyring-sdk": "2.1.1",
76
- "@metamask/keyring-snap-sdk": "9.0.1",
75
+ "@metamask/keyring-sdk": "2.2.0",
76
+ "@metamask/keyring-snap-sdk": "9.0.2",
77
77
  "@metamask/keyring-utils": "3.3.1",
78
78
  "@metamask/messenger": "^1.1.1",
79
79
  "@metamask/snaps-controllers": "^19.0.1",
@@ -89,7 +89,7 @@
89
89
  "@lavamoat/allow-scripts": "^3.2.1",
90
90
  "@lavamoat/preinstall-always-fail": "^2.1.0",
91
91
  "@metamask/auto-changelog": "^6.1.0",
92
- "@metamask/keyring-api": "23.1.0",
92
+ "@metamask/keyring-api": "23.2.0",
93
93
  "@ts-bridge/cli": "^0.6.3",
94
94
  "@types/jest": "^29.5.12",
95
95
  "@types/node": "^20.12.12",