@metamask/snaps-utils 5.1.1 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -51,14 +51,19 @@ export declare const PermissionsStruct: Struct<{
51
51
  coinType: number;
52
52
  }[] | undefined;
53
53
  snap_getEntropy?: {} | undefined;
54
+ snap_getLocale?: {} | undefined;
54
55
  snap_manageAccounts?: {} | undefined;
55
56
  snap_manageState?: {} | undefined;
56
57
  snap_notify?: {} | undefined;
57
58
  wallet_snap?: Record<string, {
58
59
  version?: string | undefined;
59
60
  }> | undefined;
61
+ 'endowment:ethereum-provider'?: {} | undefined;
60
62
  'endowment:network-access'?: {} | undefined;
61
63
  'endowment:webassembly'?: {} | undefined;
64
+ 'endowment:signature-insight'?: {
65
+ allowSignatureOrigin?: boolean | undefined;
66
+ } | undefined;
62
67
  'endowment:transaction-insight'?: {
63
68
  allowTransactionOrigin?: boolean | undefined;
64
69
  } | undefined;
@@ -84,8 +89,14 @@ export declare const PermissionsStruct: Struct<{
84
89
  } | undefined;
85
90
  snap_confirm?: {} | undefined;
86
91
  }, {
92
+ 'endowment:ethereum-provider': Struct<{} | undefined, {}>;
87
93
  'endowment:network-access': Struct<{} | undefined, {}>;
88
94
  'endowment:webassembly': Struct<{} | undefined, {}>;
95
+ 'endowment:signature-insight': Struct<{
96
+ allowSignatureOrigin?: boolean | undefined;
97
+ } | undefined, {
98
+ allowSignatureOrigin: Struct<boolean | undefined, null>;
99
+ }>;
89
100
  'endowment:transaction-insight': Struct<{
90
101
  allowTransactionOrigin?: boolean | undefined;
91
102
  } | undefined, {
@@ -187,12 +198,15 @@ export declare const PermissionsStruct: Struct<{
187
198
  coinType: Struct<number, null>;
188
199
  }>>;
189
200
  snap_getEntropy: Struct<{} | undefined, {}>;
201
+ snap_getLocale: Struct<{} | undefined, {}>;
190
202
  wallet_snap: Struct<Record<string, {
191
203
  version?: string | undefined;
192
204
  }> | undefined, null>;
193
205
  }>;
194
206
  export declare type SnapPermissions = InferMatching<typeof PermissionsStruct, InitialPermissions>;
195
207
  export declare const SnapAuxilaryFilesStruct: Struct<string[], Struct<string, null>>;
208
+ export declare const InitialConnectionsStruct: Struct<Record<string & URL, {}>, null>;
209
+ export declare type InitialConnections = Infer<typeof InitialConnectionsStruct>;
196
210
  export declare const SnapManifestStruct: Struct<{
197
211
  description: string;
198
212
  version: import("@metamask/utils").SemVerVersion;
@@ -224,14 +238,19 @@ export declare const SnapManifestStruct: Struct<{
224
238
  coinType: number;
225
239
  }[] | undefined;
226
240
  snap_getEntropy?: {} | undefined;
241
+ snap_getLocale?: {} | undefined;
227
242
  snap_manageAccounts?: {} | undefined;
228
243
  snap_manageState?: {} | undefined;
229
244
  snap_notify?: {} | undefined;
230
245
  wallet_snap?: Record<string, {
231
246
  version?: string | undefined;
232
247
  }> | undefined;
248
+ 'endowment:ethereum-provider'?: {} | undefined;
233
249
  'endowment:network-access'?: {} | undefined;
234
250
  'endowment:webassembly'?: {} | undefined;
251
+ 'endowment:signature-insight'?: {
252
+ allowSignatureOrigin?: boolean | undefined;
253
+ } | undefined;
235
254
  'endowment:transaction-insight'?: {
236
255
  allowTransactionOrigin?: boolean | undefined;
237
256
  } | undefined;
@@ -262,6 +281,7 @@ export declare const SnapManifestStruct: Struct<{
262
281
  type: string;
263
282
  url: string;
264
283
  } | undefined;
284
+ initialConnections?: Record<string & URL, {}> | undefined;
265
285
  $schema?: string | undefined;
266
286
  }, {
267
287
  version: Struct<import("@metamask/utils").SemVerVersion, null>;
@@ -311,6 +331,7 @@ export declare const SnapManifestStruct: Struct<{
311
331
  files: Struct<string[] | undefined, Struct<string, null>>;
312
332
  locales: Struct<string[] | undefined, Struct<string, null>>;
313
333
  }>;
334
+ initialConnections: Struct<Record<string & URL, {}> | undefined, null>;
314
335
  initialPermissions: Struct<{
315
336
  snap_dialog?: {} | undefined;
316
337
  snap_getBip32Entropy?: {
@@ -325,14 +346,19 @@ export declare const SnapManifestStruct: Struct<{
325
346
  coinType: number;
326
347
  }[] | undefined;
327
348
  snap_getEntropy?: {} | undefined;
349
+ snap_getLocale?: {} | undefined;
328
350
  snap_manageAccounts?: {} | undefined;
329
351
  snap_manageState?: {} | undefined;
330
352
  snap_notify?: {} | undefined;
331
353
  wallet_snap?: Record<string, {
332
354
  version?: string | undefined;
333
355
  }> | undefined;
356
+ 'endowment:ethereum-provider'?: {} | undefined;
334
357
  'endowment:network-access'?: {} | undefined;
335
358
  'endowment:webassembly'?: {} | undefined;
359
+ 'endowment:signature-insight'?: {
360
+ allowSignatureOrigin?: boolean | undefined;
361
+ } | undefined;
336
362
  'endowment:transaction-insight'?: {
337
363
  allowTransactionOrigin?: boolean | undefined;
338
364
  } | undefined;
@@ -358,8 +384,14 @@ export declare const SnapManifestStruct: Struct<{
358
384
  } | undefined;
359
385
  snap_confirm?: {} | undefined;
360
386
  }, {
387
+ 'endowment:ethereum-provider': Struct<{} | undefined, {}>;
361
388
  'endowment:network-access': Struct<{} | undefined, {}>;
362
389
  'endowment:webassembly': Struct<{} | undefined, {}>;
390
+ 'endowment:signature-insight': Struct<{
391
+ allowSignatureOrigin?: boolean | undefined;
392
+ } | undefined, {
393
+ allowSignatureOrigin: Struct<boolean | undefined, null>;
394
+ }>;
363
395
  'endowment:transaction-insight': Struct<{
364
396
  allowTransactionOrigin?: boolean | undefined;
365
397
  } | undefined, {
@@ -461,6 +493,7 @@ export declare const SnapManifestStruct: Struct<{
461
493
  coinType: Struct<number, null>;
462
494
  }>>;
463
495
  snap_getEntropy: Struct<{} | undefined, {}>;
496
+ snap_getLocale: Struct<{} | undefined, {}>;
464
497
  wallet_snap: Struct<Record<string, {
465
498
  version?: string | undefined;
466
499
  }> | undefined, null>;
@@ -79,6 +79,18 @@ export declare type Snap = TruncatedSnap & {
79
79
  * Localization files which are used to translate the manifest.
80
80
  */
81
81
  localizationFiles?: LocalizationFile[];
82
+ /**
83
+ * Flag to signal whether this snap was preinstalled or not.
84
+ *
85
+ * A lack of specifying this option will be deemed as not preinstalled.
86
+ */
87
+ preinstalled?: boolean;
88
+ /**
89
+ * Flag to signal whether this snap is removable or not.
90
+ *
91
+ * A lack of specifying this option will be deemed as removable.
92
+ */
93
+ removable?: boolean;
82
94
  };
83
95
  export declare type TruncatedSnapFields = 'id' | 'initialPermissions' | 'version' | 'enabled' | 'blocked';
84
96
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/snaps-utils",
3
- "version": "5.1.1",
3
+ "version": "5.2.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/MetaMask/snaps.git"
@@ -67,14 +67,14 @@
67
67
  "dependencies": {
68
68
  "@babel/core": "^7.23.2",
69
69
  "@babel/types": "^7.23.0",
70
- "@metamask/base-controller": "^4.0.0",
70
+ "@metamask/base-controller": "^4.1.0",
71
71
  "@metamask/key-tree": "^9.0.0",
72
- "@metamask/permission-controller": "^7.0.0",
72
+ "@metamask/permission-controller": "^7.1.0",
73
73
  "@metamask/rpc-errors": "^6.1.0",
74
74
  "@metamask/slip44": "^3.1.0",
75
75
  "@metamask/snaps-registry": "^3.0.0",
76
- "@metamask/snaps-sdk": "^1.3.1",
77
- "@metamask/utils": "^8.2.1",
76
+ "@metamask/snaps-sdk": "^1.4.0",
77
+ "@metamask/utils": "^8.3.0",
78
78
  "@noble/hashes": "^1.3.1",
79
79
  "@scure/base": "^1.1.1",
80
80
  "chalk": "^4.1.2",
@@ -84,15 +84,15 @@
84
84
  "is-svg": "^4.4.0",
85
85
  "rfdc": "^1.3.0",
86
86
  "semver": "^7.5.4",
87
- "ses": "^0.18.8",
87
+ "ses": "^1.1.0",
88
88
  "superstruct": "^1.0.3",
89
89
  "validate-npm-package-name": "^5.0.0"
90
90
  },
91
91
  "devDependencies": {
92
92
  "@esbuild-plugins/node-globals-polyfill": "^0.2.3",
93
93
  "@esbuild-plugins/node-modules-polyfill": "^0.2.2",
94
- "@lavamoat/allow-scripts": "^2.5.1",
95
- "@metamask/auto-changelog": "^3.4.3",
94
+ "@lavamoat/allow-scripts": "^3.0.0",
95
+ "@metamask/auto-changelog": "^3.4.4",
96
96
  "@metamask/eslint-config": "^12.1.0",
97
97
  "@metamask/eslint-config-jest": "^12.1.0",
98
98
  "@metamask/eslint-config-nodejs": "^12.1.0",