@metamask-previews/keyring-api 8.1.0-preview-7b3e0a5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +428 -0
  2. package/README.md +401 -0
  3. package/package.json +85 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,428 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [8.1.0]
11
+
12
+ ### Added
13
+
14
+ - Add optional `nameLastUpdatedAt` metadata field ([#366](https://github.com/MetaMask/keyring-api/pull/366))
15
+
16
+ ### Changed
17
+
18
+ - Bump @metamask/snaps-sdk from 6.1.0 to 6.2.0 ([#367](https://github.com/MetaMask/keyring-api/pull/367))
19
+ - Bump @metamask/providers from 17.1.1 to 17.1.2 ([#362](https://github.com/MetaMask/keyring-api/pull/362))
20
+
21
+ ## [8.0.2]
22
+
23
+ ### Changed
24
+
25
+ - Bump `@metamask/snaps-sdk` from `^6.0.0` to `^6.1.0` ([#358](https://github.com/MetaMask/keyring-api/pull/358))
26
+
27
+ ## [8.0.1]
28
+
29
+ ### Changed
30
+
31
+ - Migrate to @metamask/superstruct and update required dependencies ([#355](https://github.com/MetaMask/keyring-api/pull/355)).
32
+ - Bump @metamask/providers from 17.1.0 to 17.1.1 ([#354](https://github.com/MetaMask/keyring-api/pull/354)).
33
+ - Bump @metamask/key-tree from 9.1.1 to 9.1.2 ([#351](https://github.com/MetaMask/keyring-api/pull/351)).
34
+ - Bump @metamask/rpc-errors from 6.3.0 to 6.3.1 ([#350](https://github.com/MetaMask/keyring-api/pull/350)).
35
+ - Bump @metamask/providers from 17.0.0 to 17.1.0 ([#348](https://github.com/MetaMask/keyring-api/pull/348)).
36
+ - Bump @metamask/snaps-sdk from 4.4.2 to 6.0.0 ([#347](https://github.com/MetaMask/keyring-api/pull/347)).
37
+ - Bump braces from 3.0.2 to 3.0.3 ([#345](https://github.com/MetaMask/keyring-api/pull/345)).
38
+
39
+ ## [8.0.0]
40
+
41
+ ### Changed
42
+
43
+ - **BREAKING:** Revert "feat: allow multiple address per account (#315)" ([#342](https://github.com/MetaMask/keyring-api/pull/342)).
44
+
45
+ ## [7.0.0]
46
+
47
+ ### Added
48
+
49
+ - Add `getAccountBalances` to `KeyringClient` ([#340](https://github.com/MetaMask/keyring-api/pull/340)).
50
+ - **BREAKING:** Allow multiple address per account ([#315](https://github.com/MetaMask/keyring-api/pull/315)).
51
+
52
+ ### Changed
53
+
54
+ - **BREAKING:** Keep all ETH methods in the same `enum` ([#313](https://github.com/MetaMask/keyring-api/pull/313)).
55
+ - Bump @metamask/snaps-sdk from 4.4.1 to 4.4.2 ([#339](https://github.com/MetaMask/keyring-api/pull/339)).
56
+ - Bump @metamask/rpc-errors from 6.2.1 to 6.3.0 ([#337](https://github.com/MetaMask/keyring-api/pull/337)).
57
+ - Bump @metamask/json-rpc-middleware-stream from 7.0.1 to 7.0.2 ([#333](https://github.com/MetaMask/keyring-api/pull/333)).
58
+ - Bump @metamask/snaps-sdk from 4.4.0 to 4.4.1 ([#334](https://github.com/MetaMask/keyring-api/pull/334)).
59
+
60
+ ### Fixed
61
+
62
+ - Allow stale action to be run manually and fix permissions ([#336](https://github.com/MetaMask/keyring-api/pull/336)).
63
+
64
+ ## [6.4.0]
65
+
66
+ ### Changed
67
+
68
+ - **BREAKING:** Keep all ETH methods in the same `enum` ([#313](https://github.com/MetaMask/keyring-api/pull/313)).
69
+ - Add support for `@metamask/providers` v17 ([#329](https://github.com/MetaMask/keyring-api/pull/329)).
70
+
71
+ ## [6.3.1]
72
+
73
+ ### Changed
74
+
75
+ - **BREAKING:** Keep all ETH methods in the same `enum` ([#313](https://github.com/MetaMask/keyring-api/pull/313)).
76
+
77
+ ### Fixed
78
+
79
+ - Export `Caip*` types used in the API ([#325](https://github.com/MetaMask/keyring-api/pull/325)).
80
+
81
+ ## [6.3.0]
82
+
83
+ ### Added
84
+
85
+ - Add `getAccountBalances` method to `Keyring` interface ([#320](https://github.com/MetaMask/keyring-api/pull/320)).
86
+ - Add CAIP-19 types to `utils` ([#321](https://github.com/MetaMask/keyring-api/pull/321)).
87
+
88
+ ### Changed
89
+
90
+ - **BREAKING:** Keep all ETH methods in the same `enum` ([#313](https://github.com/MetaMask/keyring-api/pull/313)).
91
+ - Bump @metamask/snaps-sdk from 4.2.0 to 4.3.0 ([#323](https://github.com/MetaMask/keyring-api/pull/323)).
92
+ - Split `api.ts` into different files ([#319](https://github.com/MetaMask/keyring-api/pull/319)).
93
+ - Make the `KeyringAccount` type less rigid ([#311](https://github.com/MetaMask/keyring-api/pull/311)).
94
+
95
+ ### Fixed
96
+
97
+ - Ensure that errors are JSON-serializable ([#162](https://github.com/MetaMask/keyring-api/pull/162)).
98
+ - Don't use internal types in the public API ([#312](https://github.com/MetaMask/keyring-api/pull/312)).
99
+
100
+ ## [6.2.1]
101
+
102
+ ### Changed
103
+
104
+ - Bump @metamask/key-tree from 9.1.0 to 9.1.1 ([#310](https://github.com/MetaMask/keyring-api/pull/310)).
105
+
106
+ ### Fixed
107
+
108
+ - Use internal `object` function instead of the upstream one ([#316](https://github.com/MetaMask/keyring-api/pull/316)).
109
+
110
+ ## [6.2.0]
111
+
112
+ ### Added
113
+
114
+ - Add `accountNameSuggestion` field to the `AccountCreatedEvent` ([#291](https://github.com/MetaMask/keyring-api/pull/291))
115
+ - Add `displayConfirmation` field to the `AccountCreatedEvent` ([#307](https://github.com/MetaMask/keyring-api/pull/307))
116
+
117
+ ## [6.1.1]
118
+
119
+ ### Changed
120
+
121
+ - Fix `isEvmAccountType` accountType type to `string` or `InternalAccountType` ([#304](https://github.com/MetaMask/keyring-api/pull/304))
122
+ - Bump @metamask/snaps-sdk from ^4.0.0 to ^4.2.0 ([#305](https://github.com/MetaMask/keyring-api/pull/305))
123
+
124
+ ## [6.1.0]
125
+
126
+ ### Added
127
+
128
+ - Add `isEvmAccountType` helper ([#297](https://github.com/MetaMask/keyring-api/pull/297))
129
+ - Add `bip121:p2wpkh` account support ([#294](https://github.com/MetaMask/keyring-api/pull/294))
130
+
131
+ ### Changed
132
+
133
+ - Remove incorrect `SignTransaction` from `EthErc4337Account` ([#300](https://github.com/MetaMask/keyring-api/pull/300))
134
+ - Bump @metamask/providers from 16.0.0 to 16.1.0 ([#298](https://github.com/MetaMask/keyring-api/pull/298))
135
+ - Bump @metamask/snaps-sdk from 4.0.0 to 4.0.1 ([#292](https://github.com/MetaMask/keyring-api/pull/292))
136
+ - Split account types (EOA + Erc4337) ([#293](https://github.com/MetaMask/keyring-api/pull/293))
137
+
138
+ ## [6.0.0]
139
+
140
+ ### Changed
141
+
142
+ - **BREAKING**: Add `importTime` property to `InternalAccount` metadata ([#289](https://github.com/MetaMask/keyring-api/pull/289))
143
+ - Bump tar from 6.1.15 to 6.2.1 ([#286](https://github.com/MetaMask/keyring-api/pull/286))
144
+ - Bump @metamask/snaps-sdk from 3.2.0 to 4.0.0 ([#287](https://github.com/MetaMask/keyring-api/pull/287))
145
+ - Add documentation for `eth_decodeUserOperationCallData` ([#254](https://github.com/MetaMask/keyring-api/pull/254))
146
+ - Bump @metamask/snaps-sdk from 3.1.1 to 3.2.0 ([#284](https://github.com/MetaMask/keyring-api/pull/284))
147
+
148
+ ## [5.1.0]
149
+
150
+ ### Changed
151
+
152
+ - Use @metamask/providers as a peer dependency ([#282](https://github.com/MetaMask/keyring-api/pull/282))
153
+ - Bump @metamask/utils from 8.3.0 to 8.4.0 ([#280](https://github.com/MetaMask/keyring-api/pull/280))
154
+ - Add stale CI workflow to close issues and PRs ([#279](https://github.com/MetaMask/keyring-api/pull/279))
155
+
156
+ ## [5.0.0]
157
+
158
+ ### Changed
159
+
160
+ - **BREAKING**: Add new `KeyringExecutionContext` to user operation methods ([#275](https://github.com/MetaMask/keyring-api/pull/275))
161
+ - Fix bundler type (defined as `string` now) ([#277](https://github.com/MetaMask/keyring-api/pull/277))
162
+ - Bump @metamask/providers from 15.0.0 to 16.0.0 ([#276](https://github.com/MetaMask/keyring-api/pull/276))
163
+ - Bump @metamask/safe-event-emitter from 3.1.0 to 3.1.1 ([#274](https://github.com/MetaMask/keyring-api/pull/274))
164
+
165
+ ## [4.0.2]
166
+
167
+ ### Changed
168
+
169
+ - Bump @metamask/snaps-sdk to ^3.1.1 ([#271](https://github.com/MetaMask/keyring-api/pull/271))
170
+ - Bump @metamask/safe-event-emitter from 3.0.0 to 3.1.0 ([#270](https://github.com/MetaMask/keyring-api/pull/270))
171
+ - Fix bundler URL validation ([#262](https://github.com/MetaMask/keyring-api/pull/262))
172
+
173
+ ## [4.0.1]
174
+
175
+ ### Changed
176
+
177
+ - Bump @metamask/providers to 15.0.0, @metamask/snaps-sdk to ^3.1.0 and @@metamask/utils to ^8.3.0([#266](https://github.com/MetaMask/keyring-api/pull/266))
178
+ - Bump @metamask/json-rpc-engine from 7.3.2 to 7.3.3 ([#264](https://github.com/MetaMask/keyring-api/pull/264))
179
+ - Bump @metamask/snaps-sdk from 3.0.0 to 3.0.1 ([#261](https://github.com/MetaMask/keyring-api/pull/261))
180
+ - Bump @metamask/snaps-sdk from 1.4.0 to 3.0.0 ([#259](https://github.com/MetaMask/keyring-api/pull/259))
181
+ - Bump @metamask/rpc-errors from 6.1.0 to 6.2.1 ([#258](https://github.com/MetaMask/keyring-api/pull/258))
182
+
183
+ ## [4.0.0]
184
+
185
+ ### Changed
186
+
187
+ - **BREAKING** Update node min version to 18.x ([#247](https://github.com/MetaMask/keyring-api/pull/247))
188
+ - Update `eth_patchUserOperation` to return optional gas limit values ([#250](https://github.com/MetaMask/keyring-api/pull/250))
189
+ - Bump `ip` from 2.0.0 to 2.0.1 ([#253](https://github.com/MetaMask/keyring-api/pull/253))
190
+ - Bump `@metamask/json-rpc-engine` from 7.3.1 to 7.3.2 ([#246](https://github.com/MetaMask/keyring-api/pull/246))
191
+ - Bump `@metamask/snaps-sdk` from 1.3.2 to 1.4.0 ([#243](https://github.com/MetaMask/keyring-api/pull/243))
192
+
193
+ ## [3.0.0]
194
+
195
+ ### Changed
196
+
197
+ - Bump `@metamask/utils` from 8.2.1 to 8.3.0 ([#238](https://github.com/MetaMask/keyring-api/pull/238))
198
+ - Bump Snap dependencies ([#236](https://github.com/MetaMask/keyring-api/pull/236))
199
+ - Bump `@metamask/snaps-controllers` to ^4.0.0
200
+ - Bump `@metamask/snaps-sdk` to ^1.3.2
201
+ - Bump `@metamask/snaps-utils` to ^5.1.2
202
+ - Bump `@metamask/approval-controller` from 5.0.0 to 5.1.1 ([#225](https://github.com/MetaMask/keyring-api/pull/225))
203
+ - Bump `@metamask/base-controller` from 4.0.0 to 4.0.1 ([#226](https://github.com/MetaMask/keyring-api/pull/226))
204
+ - Bump `@metamask/json-rpc-engine` from 7.3.0 to 7.3.1 ([#227](https://github.com/MetaMask/keyring-api/pull/227))
205
+ - Bump `@metamask/auto-changelog` from 3.4.3 to 3.4.4 ([#223](https://github.com/MetaMask/keyring-api/pull/223))
206
+ - Bump `@metamask/snaps-sdk` from 1.3.0 to 1.3.1 ([#222](https://github.com/MetaMask/keyring-api/pull/222))
207
+
208
+ ### Removed
209
+
210
+ - **BREAKING**: remove `KeyringSnapControllerClient` class to fix dependency problems ([#241](https://github.com/MetaMask/keyring-api/pull/241))
211
+
212
+ ## [2.0.0]
213
+
214
+ ### Added
215
+
216
+ - **BREAKING**: Add support for ERC-4337 transactions ([#213](https://github.com/MetaMask/keyring-api/pull/213))
217
+ - Enum `EthMethods` has been extended with `eth_prepareUserOperation`, `eth_patchUserOperation`, `eth_signUserOperation`
218
+ - Enum `EthAccountType` has been extended with `eip155:erc4337`
219
+
220
+ ### Changed
221
+
222
+ - **BREAKING**: Update `@metamask/providers` from `^13.0.0` to `^14.0.1` ([#209](https://github.com/MetaMask/keyring-api/pull/209))
223
+ - Consolidation on `readable-stream@^3.6.2`. Users should upgrade to `extension-port-stream@^3.0.0` and `json-rpc-middleware-stream@^5.0.0`.
224
+ - Replace deprecated `@metamask/snaps-ui` with `@metamask/snaps-sdk` ([#204](https://github.com/MetaMask/keyring-api/pull/204))
225
+ - Replace `@metamask/snaps-rpc-methods` with `@metamask/snaps-sdk`
226
+ - Update `@metamask/snaps-controllers` and `@metamask/snaps-utils` to versions that don't rely on `@metamask/snaps-ui`
227
+ - Documentation updates ([#185](https://github.com/MetaMask/keyring-api/pull/185)) ([#201](https://github.com/MetaMask/keyring-api/pull/201))
228
+
229
+ ### Removed
230
+
231
+ - **BREAKING** `EthAccountType.Eip4337` has been removed. `eip155:eip4337` should be replaced with `erc:4337`
232
+
233
+ ### Fixed
234
+
235
+ - Exclude `*.test-d.ts` files from builds ([#184](https://github.com/MetaMask/keyring-api/pull/184))
236
+ - Remove `@metamask/snaps-ui` from dependency tree ([#204](https://github.com/MetaMask/keyring-api/pull/204))
237
+
238
+ ## [1.1.0]
239
+
240
+ ### Changed
241
+
242
+ - `UuidStruct` is now a named type ([#159](https://github.com/MetaMask/keyring-api/pull/159))
243
+ - Migrate from `@metamask/rpc-methods` to `@metamask/snaps-rpc-methods` ([#175](https://github.com/MetaMask/keyring-api/pull/175))
244
+
245
+ ### Fixed
246
+
247
+ - Allow the request ID to be a string, number or null ([#156](https://github.com/MetaMask/keyring-api/pull/156))
248
+ - Documentation fixes ([#160](https://github.com/MetaMask/keyring-api/pull/160)) ([#174](https://github.com/MetaMask/keyring-api/pull/174)) ([#173](https://github.com/MetaMask/keyring-api/pull/173)) ([#172](https://github.com/MetaMask/keyring-api/pull/172))
249
+ - Use `UuidStruct` for IDs in the internal API ([#158](https://github.com/MetaMask/keyring-api/pull/158))
250
+ - Bump `@metamask/json-rpc-engine` from `^7.1.1` to `^7.2.0` ([#164](https://github.com/MetaMask/keyring-api/pull/164))
251
+
252
+ ## [1.0.0]
253
+
254
+ ### Added
255
+
256
+ - Add migration steps to 1.0.0 ([#149](https://github.com/MetaMask/keyring-api/pull/149)).
257
+ - Add Account Snaps security guidelines ([#143](https://github.com/MetaMask/keyring-api/pull/143)).
258
+
259
+ ### Changed
260
+
261
+ - Bump @metamask/rpc-errors from 6.0.0 to 6.1.0 ([#151](https://github.com/MetaMask/keyring-api/pull/151)).
262
+ - Bump postcss from 8.4.24 to 8.4.31 ([#150](https://github.com/MetaMask/keyring-api/pull/150)).
263
+
264
+ ## [1.0.0-rc.1]
265
+
266
+ ### Added
267
+
268
+ - Document how to migrate from API 0.1.x to 0.2.x ([#124](https://github.com/MetaMask/keyring-api/pull/124)).
269
+
270
+ ### Changed
271
+
272
+ - **BREAKING:** Use the `onKeyringRequest` snap export ([#145](https://github.com/MetaMask/keyring-api/pull/145)).
273
+ - **BREAKING:** Change the events' prefix to `notify:` ([#139](https://github.com/MetaMask/keyring-api/pull/139)).
274
+
275
+ ## [0.2.7]
276
+
277
+ ### Added
278
+
279
+ - Export events types ([#125](https://github.com/MetaMask/keyring-api/pull/125))
280
+
281
+ ## [0.2.6]
282
+
283
+ ### Changed
284
+
285
+ - Remove unused lavamoat allowed scripts ([#122](https://github.com/MetaMask/keyring-api/pull/122)).
286
+ - Update events in sequence diagram ([#121](https://github.com/MetaMask/keyring-api/pull/121)).
287
+ - Update Snap and ESLint dependencies ([#117](https://github.com/MetaMask/keyring-api/pull/117)).
288
+ - Bump @metamask/rpc-methods from 0.38.1-flask.1 to 2.0.0 ([#120](https://github.com/MetaMask/keyring-api/pull/120)).
289
+
290
+ ## [0.2.5]
291
+
292
+ ### Changed
293
+
294
+ - Remove `buildHandlersChain` ([#114](https://github.com/MetaMask/keyring-api/pull/114)).
295
+ - Update doc for `eth_signTransaction` ([#111](https://github.com/MetaMask/keyring-api/pull/111)).
296
+ - Remove un-versioned `eth_signTypedData` method ([#113](https://github.com/MetaMask/keyring-api/pull/113)).
297
+
298
+ ## [0.2.4]
299
+
300
+ ### Changed
301
+
302
+ - Fix linting and compatibility with older `tsc` ([#108](https://github.com/MetaMask/keyring-api/pull/108)).
303
+
304
+ ## [0.2.3]
305
+
306
+ ### Added
307
+
308
+ - Add redirection message to snap async response ([#102](https://github.com/MetaMask/keyring-api/pull/102)).
309
+
310
+ ### Changed
311
+
312
+ - Use `Omit` instead of `OmitUnion` ([#106](https://github.com/MetaMask/keyring-api/pull/106)).
313
+ - Update `KeyringResponse` comment ([#103](https://github.com/MetaMask/keyring-api/pull/103)).
314
+ - Use `KeyringRpcMethod` enum instead of string ([#105](https://github.com/MetaMask/keyring-api/pull/105)).
315
+ - Refactor tests to match superstruct examples ([#104](https://github.com/MetaMask/keyring-api/pull/104)).
316
+ - Add `exactOptional()` superstruct type ([#100](https://github.com/MetaMask/keyring-api/pull/100)).
317
+ - Bump @metamask/providers from 11.1.2 to 12.0.0 ([#99](https://github.com/MetaMask/keyring-api/pull/99)).
318
+ - Bump @metamask/providers from 11.1.1 to 11.1.2 ([#98](https://github.com/MetaMask/keyring-api/pull/98)).
319
+
320
+ ## [0.2.2]
321
+
322
+ ### Added
323
+
324
+ - Add architecture and EVM methods docs ([#86](https://github.com/MetaMask/keyring-api/pull/86)).
325
+ - Add `lastSelected` and `lastActive` to metadata ([#92](https://github.com/MetaMask/keyring-api/pull/92)).
326
+
327
+ ### Changed
328
+
329
+ - Make request `params` optional ([#96](https://github.com/MetaMask/keyring-api/pull/96)).
330
+ - Remove `lastActive` field from internal account model ([#95](https://github.com/MetaMask/keyring-api/pull/95)).
331
+ - Move request ID to outer request ([#94](https://github.com/MetaMask/keyring-api/pull/94)).
332
+
333
+ ## [0.2.1]
334
+
335
+ ### Changed
336
+
337
+ - Set `snap` object keys to be mandatory and move `name` to `metadata` ([#87](https://github.com/MetaMask/keyring-api/pull/87)).
338
+
339
+ ## [0.2.0]
340
+
341
+ ### Added
342
+
343
+ - Add `InternalAccount` type and create submodule `internal` ([#65](https://github.com/MetaMask/keyring-api/pull/65)).
344
+ - Add keyring events and helper functions ([#74](https://github.com/MetaMask/keyring-api/pull/74)).
345
+ - Add a `redirect` field to asynchronous request responses ([#75](https://github.com/MetaMask/keyring-api/pull/75)).
346
+ - Add `exportAccount` method ([#60](https://github.com/MetaMask/keyring-api/pull/60)).
347
+ - Add `getController` to client ([#43](https://github.com/MetaMask/keyring-api/pull/43)).
348
+
349
+ ### Changed
350
+
351
+ - Rename `erc4337` -> `eip4337` ([#42](https://github.com/MetaMask/keyring-api/pull/42)).
352
+ - Make `options` a mandatory field of `KeyringAccount` ([#30](https://github.com/MetaMask/keyring-api/pull/30)).
353
+ - Make `approveRequest` and `rejectRequest` optional ([#63](https://github.com/MetaMask/keyring-api/pull/63)).
354
+ - Make `exportAccount`, `listRequests` and `getRequest` optional ([#73](https://github.com/MetaMask/keyring-api/pull/73)).
355
+ - Export enums with account methods and types ([#66](https://github.com/MetaMask/keyring-api/pull/66)).
356
+ - Make `approveRequest` accept a `result` argument ([#59](https://github.com/MetaMask/keyring-api/pull/59)).
357
+ - Remove account name from `KeyringAccount` type ([#55](https://github.com/MetaMask/keyring-api/pull/55)).
358
+ - Remove `eth_sendTransaction` method ([#50](https://github.com/MetaMask/keyring-api/pull/50)).
359
+ - Rename `supportedMethods` to `methods` ([#35](https://github.com/MetaMask/keyring-api/pull/35)).
360
+
361
+ ## [0.1.3]
362
+
363
+ ### Changed
364
+
365
+ - Downgrade snaps dependencies to `0.35.2-flask.1` ([#25](https://github.com/MetaMask/keyring-api/pull/25)).
366
+
367
+ ## [0.1.2]
368
+
369
+ ### Changed
370
+
371
+ - Update snaps dependencies ([#21](https://github.com/MetaMask/keyring-api/pull/21)).
372
+
373
+ ## [0.1.1]
374
+
375
+ ### Added
376
+
377
+ - Validate snap responses for type correctness ([#15](https://github.com/MetaMask/keyring-api/pull/15)).
378
+
379
+ ### Changed
380
+
381
+ - Rename RPC handling functions ([#16](https://github.com/MetaMask/keyring-api/pull/16)).
382
+
383
+ ## [0.1.0] - 2023-06-20
384
+
385
+ ### Added
386
+
387
+ - Usage examples to [`README.md`](./README.md).
388
+ - Keyring API definition.
389
+ - JSON-RPC snap keyring client. It is intended to be used by a snap's companion dapp to send requests to the snap.
390
+ - SnapController keyring client. It is intended to be used by MetaMask to talk to the snap.
391
+ - Helper functions to create keyring handler in the snap.
392
+
393
+ [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@8.1.0...HEAD
394
+ [8.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@8.0.2...@metamask/keyring-api@8.1.0
395
+ [8.0.2]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@8.0.1...@metamask/keyring-api@8.0.2
396
+ [8.0.1]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@8.0.0...@metamask/keyring-api@8.0.1
397
+ [8.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@7.0.0...@metamask/keyring-api@8.0.0
398
+ [7.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@6.4.0...@metamask/keyring-api@7.0.0
399
+ [6.4.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@6.3.1...@metamask/keyring-api@6.4.0
400
+ [6.3.1]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@6.3.0...@metamask/keyring-api@6.3.1
401
+ [6.3.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@6.2.1...@metamask/keyring-api@6.3.0
402
+ [6.2.1]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@6.2.0...@metamask/keyring-api@6.2.1
403
+ [6.2.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@6.1.1...@metamask/keyring-api@6.2.0
404
+ [6.1.1]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@6.1.0...@metamask/keyring-api@6.1.1
405
+ [6.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@6.0.0...@metamask/keyring-api@6.1.0
406
+ [6.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@5.1.0...@metamask/keyring-api@6.0.0
407
+ [5.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@5.0.0...@metamask/keyring-api@5.1.0
408
+ [5.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@4.0.2...@metamask/keyring-api@5.0.0
409
+ [4.0.2]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@4.0.1...@metamask/keyring-api@4.0.2
410
+ [4.0.1]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@4.0.0...@metamask/keyring-api@4.0.1
411
+ [4.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@3.0.0...@metamask/keyring-api@4.0.0
412
+ [3.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@2.0.0...@metamask/keyring-api@3.0.0
413
+ [2.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@1.1.0...@metamask/keyring-api@2.0.0
414
+ [1.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@1.0.0...@metamask/keyring-api@1.1.0
415
+ [1.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@1.0.0-rc.1...@metamask/keyring-api@1.0.0
416
+ [1.0.0-rc.1]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@0.2.7...@metamask/keyring-api@1.0.0-rc.1
417
+ [0.2.7]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@0.2.6...@metamask/keyring-api@0.2.7
418
+ [0.2.6]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@0.2.5...@metamask/keyring-api@0.2.6
419
+ [0.2.5]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@0.2.4...@metamask/keyring-api@0.2.5
420
+ [0.2.4]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@0.2.3...@metamask/keyring-api@0.2.4
421
+ [0.2.3]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@0.2.2...@metamask/keyring-api@0.2.3
422
+ [0.2.2]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@0.2.1...@metamask/keyring-api@0.2.2
423
+ [0.2.1]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@0.2.0...@metamask/keyring-api@0.2.1
424
+ [0.2.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@0.1.3...@metamask/keyring-api@0.2.0
425
+ [0.1.3]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@0.1.2...@metamask/keyring-api@0.1.3
426
+ [0.1.2]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@0.1.1...@metamask/keyring-api@0.1.2
427
+ [0.1.1]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@0.1.0...@metamask/keyring-api@0.1.1
428
+ [0.1.0]: https://github.com/MetaMask/accounts/releases/tag/@metamask/keyring-api@0.1.0
package/README.md ADDED
@@ -0,0 +1,401 @@
1
+ # MetaMask Keyring API
2
+
3
+ This TypeScript module simplifies the integration of Snaps with MetaMask using
4
+ the Keyring API.
5
+
6
+ Features:
7
+
8
+ - **Keyring API Interface**: The module exposes an interface representing the
9
+ Keyring API. Snaps can implement this interface to seamlessly interact with
10
+ MetaMask and leverage its functionality.
11
+
12
+ - **Dapp Client**: The module includes a client that enables dapps to
13
+ communicate with the account Snap. This client allows dapps to send requests
14
+ to the Snap, such as retrieving account information or submitting requests.
15
+
16
+ - **MetaMask Client**: The module provides a client specifically designed for
17
+ MetaMask integration. This client enables MetaMask to send requests directly
18
+ to the account Snap, facilitating smooth interoperability between the two
19
+ applications.
20
+
21
+ - **Request Handler Helper Functions**: The module offers a set of helper
22
+ functions to simplify the implementation of the request handler in the
23
+ account Snap. These functions assist in processing incoming requests,
24
+ validating data, and handling various request types from dapps and MetaMask.
25
+
26
+ ## Installation
27
+
28
+ ```bash
29
+ yarn add @metamask/keyring-api
30
+ ```
31
+
32
+ or
33
+
34
+ ```bash
35
+ npm install @metamask/keyring-api
36
+ ```
37
+
38
+ ## Account Snaps
39
+
40
+ > :point_up: **Important**: Before implementing your Snap, please make sure to
41
+ > read the [security recommendations](./docs/security.md) and the [architecture
42
+ > document](./docs/architecture.md).
43
+
44
+ Starting with MetaMask 11.4, Snaps can implement the Keyring API. This allows
45
+ users to manage their accounts in a more flexible way, and enables developers
46
+ to build new types of accounts.
47
+
48
+ > :pencil2: **Note:** You can also build MetaMask from [source][extension-repo]
49
+ > from the `develop` branch.
50
+
51
+ Follow these steps to implement the Keyring API in your Snap. Please note that
52
+ these instruction assume that you are already familiar with the process of
53
+ [developing a Snap](https://docs.metamask.io/snaps/).
54
+
55
+ 1. **Implement the Keyring API:**
56
+
57
+ Inside your Snap, implement the `Keyring` API:
58
+
59
+ ```typescript
60
+ class MySnapKeyring implements Keyring {
61
+ // Implement the required methods here...
62
+ }
63
+ ```
64
+
65
+ > :point_up: **Important**: Ensure that your keyring implements the [methods
66
+ > called by MetaMask][exposed-methods], otherwise some features may not
67
+ > work.
68
+
69
+ 2. **Handle requests submitted by MetaMask:**
70
+
71
+ MetaMask will submit requests through the `submitRequest` method of your the
72
+ Keyring API (check the supported [EVM methods](./docs/evm-methods.md)). Here
73
+ is an example of request:
74
+
75
+ ```json
76
+ {
77
+ "id": "d6e23af6-4bea-48dd-aeb0-7d3c30ea67f9",
78
+ "scope": "",
79
+ "account": "69438371-bef3-4957-9f91-c3f22c1d75f3",
80
+ "request": {
81
+ "method": "personal_sign",
82
+ "params": [
83
+ "0x4578616d706c652060706572736f6e616c5f7369676e60206d657373616765",
84
+ "0x5874174dcf1ab6F7Efd8496f4f09404CD1c5bA84"
85
+ ]
86
+ }
87
+ }
88
+ ```
89
+
90
+ Where:
91
+
92
+ - `id` is unique identifier for the request.
93
+
94
+ - `scope` is the CAIP-2 chain ID of the selected chain. Currently, this
95
+ property is always an empty string. Your Snap should use the chain ID
96
+ present in the request object instead.
97
+
98
+ - `account` is the ID of the account that should handle the request.
99
+
100
+ - `request` is the request object.
101
+
102
+ Your Snap must respond with either a synchronous result:
103
+
104
+ ```typescript
105
+ return { pending: false, result };
106
+ ```
107
+
108
+ Or an asynchronous result:
109
+
110
+ ```typescript
111
+ return { pending: true, redirect: { message, url } };
112
+ ```
113
+
114
+ The redirect message and URL will be displayed to the user to inform them
115
+ about how to continue the transaction flow.
116
+
117
+ 3. **Notify MetaMask about events:**
118
+
119
+ The following actions must be notified to MetaMask:
120
+
121
+ 1. When an account is created:
122
+
123
+ ```typescript
124
+ try {
125
+ emitSnapKeyringEvent(snap, KeyringEvent.AccountCreated, { account });
126
+ // Update your snap's state...
127
+ } catch (error) {
128
+ // Handle the error...
129
+ }
130
+ ```
131
+
132
+ MetaMask will return an error if the account already exists or if the
133
+ account object is invalid.
134
+
135
+ 2. When an account is updated:
136
+
137
+ ```typescript
138
+ try {
139
+ emitSnapKeyringEvent(snap, KeyringEvent.AccountUpdated, { account });
140
+ // Update your snap's state...
141
+ } catch (error) {
142
+ // Handle the error...
143
+ }
144
+ ```
145
+
146
+ MetaMask will return an error if the account does not exist, if the
147
+ account object is invalid, or if the account address changed.
148
+
149
+ 3. When an account is deleted:
150
+
151
+ ```typescript
152
+ try {
153
+ emitSnapKeyringEvent(snap, KeyringEvent.AccountDeleted, {
154
+ id: account.id,
155
+ });
156
+ // Update your snap's state...
157
+ } catch (error) {
158
+ // Handle the error...
159
+ }
160
+ ```
161
+
162
+ The delete event is idempotent, so it is safe to emit it even if the
163
+ account does not exist.
164
+
165
+ 4. When a request is approved:
166
+
167
+ ```typescript
168
+ try {
169
+ emitSnapKeyringEvent(snap, KeyringEvent.RequestApproved, {
170
+ id: request.id,
171
+ result,
172
+ });
173
+ // Update your snap's state...
174
+ } catch (error) {
175
+ // Handle the error...
176
+ }
177
+ ```
178
+
179
+ MetaMask will return an error if the request does not exist.
180
+
181
+ > :pencil2: **Note:** This only applies to Snaps that implement the
182
+ > [asynchronous transaction flow][async-flow].
183
+
184
+ 5. When a request is rejected:
185
+
186
+ ```typescript
187
+ try {
188
+ emitSnapKeyringEvent(snap, KeyringEvent.RequestRejected, {
189
+ id: request.id,
190
+ });
191
+ // Update your snap's state...
192
+ } catch (error) {
193
+ // Handle the error...
194
+ }
195
+ ```
196
+
197
+ MetaMask will return an error if the request does not exist.
198
+
199
+ > :pencil2: **Note:** This only applies to Snaps that implement the
200
+ > [asynchronous transaction flow][async-flow].
201
+
202
+ 4. **Expose the Keyring API:**
203
+
204
+ Then create a handler to expose the keyring methods to MetaMask and your dapp:
205
+
206
+ ```typescript
207
+ export const onKeyringRequest: OnKeyringRequestHandler = async ({
208
+ origin,
209
+ request,
210
+ }) => {
211
+ // Your custom logic here...
212
+ return handleKeyringRequest(keyring, request);
213
+ };
214
+ ```
215
+
216
+ 5. **Call the keyring methods from your dapp:**
217
+
218
+ Now you should be able to call your account Snap from your dapp, for
219
+ example:
220
+
221
+ ```typescript
222
+ const client = new KeyringSnapRpcClient(snapId, window.ethereum);
223
+ const accounts = await client.listAccounts();
224
+ ```
225
+
226
+ ## Migrating from 0.1.x to 0.2.x
227
+
228
+ The following changes were made to the API, which may require changes to your
229
+ implementation:
230
+
231
+ - In the `KeyringAccount` type, the `supportedMethods` property was renamed to
232
+ `methods`.
233
+
234
+ ```diff
235
+ - supportedMethods: string[];
236
+ + methods: string[];
237
+ ```
238
+
239
+ - In the `KeyringAccount` type, the `name` property was removed.
240
+
241
+ ```diff
242
+ - name: string;
243
+ ```
244
+
245
+ - In the `KeyringAccount` type, add the `options` property can no longer be
246
+ null.
247
+
248
+ ```diff
249
+ - options: Record<string, unknown> | null;
250
+ + options: Record<string, unknown>;
251
+ ```
252
+
253
+ - In the `KeyringAccount` type, the `eth_signTypedData` method was removed from
254
+ the list of available methods.
255
+
256
+ ```diff
257
+ - 'eth_signTypedData',
258
+ ```
259
+
260
+ It was an alias for the `eth_signTypedData_v1` method, which is still
261
+ present.
262
+
263
+ - Snaps should now use the `emitSnapKeyringEvent()` helper function to notify
264
+ MetaMask about events:
265
+
266
+ ```ts
267
+ // Emit an event to indicate that an account was created.
268
+ emitSnapKeyringEvent(snap, KeyringEvent.AccountCreated, { account });
269
+
270
+ // Emit an event to indicate that an account was updated.
271
+ emitSnapKeyringEvent(snap, KeyringEvent.AccountUpdated, { account });
272
+
273
+ // Emit an event to indicate that an account was deleted.
274
+ emitSnapKeyringEvent(snap, KeyringEvent.AccountDeleted, { id: account.id });
275
+
276
+ // Emit an event to indicate that a request was approved.
277
+ emitSnapKeyringEvent(snap, KeyringEvent.RequestApproved, {
278
+ id: request.id,
279
+ result,
280
+ });
281
+
282
+ // Emit an event to indicate that a request was rejected.
283
+ emitSnapKeyringEvent(snap, KeyringEvent.RequestRejected, { id: request.id });
284
+ ```
285
+
286
+ > :point_up: **Important**: For all events above, MetaMask may return an error
287
+ > indicating that the event was not handled, possibly because it contains
288
+ > invalid arguments.
289
+
290
+ - Keyrings that implement the [asynchronous transaction flow][async-flow] can
291
+ now return an optional `redirect` property that contains an URL and a message
292
+ to be displayed to the user. This will, in a future release of MetaMask, be
293
+ used to inform the user on how to continue the transaction flow.
294
+
295
+ ```ts
296
+ return {
297
+ pending: true,
298
+ redirect: {
299
+ message: 'Please go to the Snap Dapp to finish sining the transaction.',
300
+ url: 'https://example.com/sign?tx=1234',
301
+ },
302
+ };
303
+ ```
304
+
305
+ - The `buildHandlersChain` helper function was removed from the API. Instead,
306
+ you must implement your own handler. For example:
307
+
308
+ ```ts
309
+ export const onRpcRequest: OnRpcRequestHandler = async ({
310
+ request,
311
+ origin,
312
+ }) => {
313
+ // Check if origin is allowed to call the method.
314
+ if (!hasPermission(origin, request.method)) {
315
+ throw new Error(
316
+ `Origin '${origin}' is not allowed to call '${request.method}'`,
317
+ );
318
+ }
319
+
320
+ // Dispatch the request to the keyring.
321
+ return handleKeyringRequest(keyring, request);
322
+ };
323
+ ```
324
+
325
+ ## Migrating from 0.2.x to 1.x.x
326
+
327
+ The following changes were made to the API, which may require changes to your
328
+ implementation:
329
+
330
+ - Your Snap must expose the Keyring methods through the `onKeyringRequest`
331
+ export instead of the `onRpcRequest` export.
332
+
333
+ - Your Snap must request the new `endowment:keyring` endowment, and list any
334
+ dapp that should be allowed to call the Keyring methods.
335
+
336
+ For more details about the changes, please refer to the [security
337
+ guidelines](./docs/security.md).
338
+
339
+ ## API
340
+
341
+ See our documentation:
342
+
343
+ - [Latest published API documentation](https://metamask.github.io/keyring-api/latest/)
344
+ - [Latest development API documentation](https://metamask.github.io/keyring-api/staging/)
345
+
346
+ ## Contributing
347
+
348
+ ### Setup
349
+
350
+ - Install [Node.js](https://nodejs.org) version 16
351
+ - If you are using [nvm](https://github.com/creationix/nvm#installation) (recommended) running `nvm use` will automatically choose the right node version for you.
352
+ - Install [Yarn v3](https://yarnpkg.com/getting-started/install)
353
+ - Run `yarn install` to install dependencies and run any required post-install scripts
354
+
355
+ ### Testing and Linting
356
+
357
+ Run `yarn test` to run the tests once. To run tests on file changes, run `yarn test:watch`.
358
+
359
+ Run `yarn lint` to run the linter, or run `yarn lint:fix` to run the linter and fix any automatically fixable issues.
360
+
361
+ ### Release & Publishing
362
+
363
+ The project follows the same release process as the other libraries in the MetaMask organization. The GitHub Actions [`action-create-release-pr`](https://github.com/MetaMask/action-create-release-pr) and [`action-publish-release`](https://github.com/MetaMask/action-publish-release) are used to automate the release process; see those repositories for more information about how they work.
364
+
365
+ 1. Choose a release version.
366
+
367
+ - The release version should be chosen according to SemVer. Analyze the changes to see whether they include any breaking changes, new features, or deprecations, then choose the appropriate SemVer version. See [the SemVer specification](https://semver.org/) for more information.
368
+
369
+ 2. If this release is backporting changes onto a previous release, then ensure there is a major version branch for that version (e.g. `1.x` for a `v1` backport release).
370
+
371
+ - The major version branch should be set to the most recent release with that major version. For example, when backporting a `v1.0.2` release, you'd want to ensure there was a `1.x` branch that was set to the `v1.0.1` tag.
372
+
373
+ 3. Trigger the [`workflow_dispatch`](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch) event [manually](https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow) for the `Create Release Pull Request` action to create the release PR.
374
+
375
+ - For a backport release, the base branch should be the major version branch that you ensured existed in step 2. For a normal release, the base branch should be the main branch for that repository (which should be the default value).
376
+ - This should trigger the [`action-create-release-pr`](https://github.com/MetaMask/action-create-release-pr) workflow to create the release PR.
377
+
378
+ 4. Update the changelog to move each change entry into the appropriate change category ([See here](https://keepachangelog.com/en/1.0.0/#types) for the full list of change categories, and the correct ordering), and edit them to be more easily understood by users of the package.
379
+
380
+ - Generally any changes that don't affect consumers of the package (e.g. lockfile changes or development environment changes) are omitted. Exceptions may be made for changes that might be of interest despite not having an effect upon the published package (e.g. major test improvements, security improvements, improved documentation, etc.).
381
+ - Try to explain each change in terms that users of the package would understand (e.g. avoid referencing internal variables/concepts).
382
+ - Consolidate related changes into one change entry if it makes it easier to explain.
383
+ - Run `yarn auto-changelog validate --prettier --rc` to check that the changelog is correctly formatted.
384
+
385
+ 5. Review and QA the release.
386
+
387
+ - If changes are made to the base branch, the release branch will need to be updated with these changes and review/QA will need to restart again. As such, it's probably best to avoid merging other PRs into the base branch while review is underway.
388
+
389
+ 6. Squash & Merge the release.
390
+
391
+ - This should trigger the [`action-publish-release`](https://github.com/MetaMask/action-publish-release) workflow to tag the final release commit and publish the release on GitHub.
392
+
393
+ 7. Publish the release on npm.
394
+
395
+ - Wait for the `publish-release` GitHub Action workflow to finish. This should trigger a second job (`publish-npm`), which will wait for a run approval by the [`npm publishers`](https://github.com/orgs/MetaMask/teams/npm-publishers) team.
396
+ - Approve the `publish-npm` job (or ask somebody on the npm publishers team to approve it for you).
397
+ - Once the `publish-npm` job has finished, check npm to verify that it has been published.
398
+
399
+ [extension-repo]: https://github.com/MetaMask/metamask-extension
400
+ [exposed-methods]: ./docs/security.md#limit-the-methods-exposed-to-dapps
401
+ [async-flow]: ./docs/architecture.md#asynchronous-transaction-flow
package/package.json ADDED
@@ -0,0 +1,85 @@
1
+ {
2
+ "name": "@metamask-previews/keyring-api",
3
+ "version": "8.1.0-preview-7b3e0a5",
4
+ "description": "MetaMask Keyring API",
5
+ "keywords": [
6
+ "metamask",
7
+ "keyring",
8
+ "snaps"
9
+ ],
10
+ "homepage": "https://github.com/MetaMask/keyring-api#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/MetaMask/keyring-api/issues"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/MetaMask/keyring-api.git"
17
+ },
18
+ "main": "./dist/index.js",
19
+ "types": "./dist/index.d.ts",
20
+ "files": [
21
+ "dist/"
22
+ ],
23
+ "scripts": {
24
+ "build": "tsc --build tsconfig.build.json",
25
+ "build:clean": "rimraf dist && yarn build",
26
+ "build:docs": "typedoc",
27
+ "build:force": "tsc --build tsconfig.build.json --force",
28
+ "changelog:update": "../../scripts/update-changelog.sh @metamask/keyring-api",
29
+ "changelog:validate": "../../scripts/validate-changelog.sh @metamask/keyring-api",
30
+ "prepack": "./scripts/prepack.sh",
31
+ "publish:preview": "yarn npm publish --tag preview",
32
+ "test": "yarn test:source && yarn test:types",
33
+ "test:clean": "jest --clearCache",
34
+ "test:source": "jest && jest-it-up",
35
+ "test:types": "tsd",
36
+ "test:verbose": "jest --verbose",
37
+ "test:watch": "jest --watch"
38
+ },
39
+ "dependencies": {
40
+ "@metamask/snaps-sdk": "^6.1.0",
41
+ "@metamask/superstruct": "^3.1.0",
42
+ "@metamask/utils": "^9.1.0",
43
+ "@types/uuid": "^9.0.8",
44
+ "bech32": "^2.0.0",
45
+ "deepmerge": "^4.2.2",
46
+ "uuid": "^9.0.1"
47
+ },
48
+ "devDependencies": {
49
+ "@lavamoat/allow-scripts": "^3.0.4",
50
+ "@lavamoat/preinstall-always-fail": "^2.0.0",
51
+ "@metamask/auto-changelog": "^3.4.4",
52
+ "@metamask/providers": "^17.1.1",
53
+ "@types/jest": "^29.5.12",
54
+ "@types/node": "^20.12.12",
55
+ "depcheck": "^1.4.7",
56
+ "jest": "^28.1.3",
57
+ "jest-it-up": "^3.1.0",
58
+ "rimraf": "^5.0.7",
59
+ "ts-jest": "^28.0.8",
60
+ "ts-node": "^10.9.2",
61
+ "tsd": "^0.31.0",
62
+ "typedoc": "^0.25.13",
63
+ "typescript": "~4.8.4"
64
+ },
65
+ "peerDependencies": {
66
+ "@metamask/providers": ">=15 <18"
67
+ },
68
+ "engines": {
69
+ "node": "^18.18 || >=20"
70
+ },
71
+ "publishConfig": {
72
+ "access": "public",
73
+ "registry": "https://registry.npmjs.org/"
74
+ },
75
+ "lavamoat": {
76
+ "allowScripts": {
77
+ "@lavamoat/preinstall-always-fail": false,
78
+ "@metamask/snaps-utils>@metamask/permission-controller>@metamask/controller-utils>ethereumjs-util>ethereum-cryptography>keccak": false,
79
+ "@metamask/snaps-utils>@metamask/permission-controller>@metamask/controller-utils>ethereumjs-util>ethereum-cryptography>secp256k1": false
80
+ }
81
+ },
82
+ "tsd": {
83
+ "directory": "src"
84
+ }
85
+ }