@metamask/wallet 2.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -1
- package/dist/index.cjs +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -1
- package/dist/initialization/instances/accounts-controller/accounts-controller.cjs +37 -0
- package/dist/initialization/instances/accounts-controller/accounts-controller.cjs.map +1 -0
- package/dist/initialization/instances/accounts-controller/accounts-controller.d.cts +4 -0
- package/dist/initialization/instances/accounts-controller/accounts-controller.d.cts.map +1 -0
- package/dist/initialization/instances/accounts-controller/accounts-controller.d.mts +4 -0
- package/dist/initialization/instances/accounts-controller/accounts-controller.d.mts.map +1 -0
- package/dist/initialization/instances/accounts-controller/accounts-controller.mjs +34 -0
- package/dist/initialization/instances/accounts-controller/accounts-controller.mjs.map +1 -0
- package/dist/initialization/instances/approval-controller/approval-controller.cjs +39 -0
- package/dist/initialization/instances/approval-controller/approval-controller.cjs.map +1 -0
- package/dist/initialization/instances/approval-controller/approval-controller.d.cts +4 -0
- package/dist/initialization/instances/approval-controller/approval-controller.d.cts.map +1 -0
- package/dist/initialization/instances/approval-controller/approval-controller.d.mts +4 -0
- package/dist/initialization/instances/approval-controller/approval-controller.d.mts.map +1 -0
- package/dist/initialization/instances/approval-controller/approval-controller.mjs +36 -0
- package/dist/initialization/instances/approval-controller/approval-controller.mjs.map +1 -0
- package/dist/initialization/instances/approval-controller/types.cjs +3 -0
- package/dist/initialization/instances/approval-controller/types.cjs.map +1 -0
- package/dist/initialization/instances/approval-controller/types.d.cts +18 -0
- package/dist/initialization/instances/approval-controller/types.d.cts.map +1 -0
- package/dist/initialization/instances/approval-controller/types.d.mts +18 -0
- package/dist/initialization/instances/approval-controller/types.d.mts.map +1 -0
- package/dist/initialization/instances/approval-controller/types.mjs +2 -0
- package/dist/initialization/instances/approval-controller/types.mjs.map +1 -0
- package/dist/initialization/instances/connectivity-controller/always-online-adapter.cjs +40 -0
- package/dist/initialization/instances/connectivity-controller/always-online-adapter.cjs.map +1 -0
- package/dist/initialization/instances/connectivity-controller/always-online-adapter.d.cts +30 -0
- package/dist/initialization/instances/connectivity-controller/always-online-adapter.d.cts.map +1 -0
- package/dist/initialization/instances/connectivity-controller/always-online-adapter.d.mts +30 -0
- package/dist/initialization/instances/connectivity-controller/always-online-adapter.d.mts.map +1 -0
- package/dist/initialization/instances/connectivity-controller/always-online-adapter.mjs +36 -0
- package/dist/initialization/instances/connectivity-controller/always-online-adapter.mjs.map +1 -0
- package/dist/initialization/instances/connectivity-controller/connectivity-controller.cjs +17 -0
- package/dist/initialization/instances/connectivity-controller/connectivity-controller.cjs.map +1 -0
- package/dist/initialization/instances/connectivity-controller/connectivity-controller.d.cts +4 -0
- package/dist/initialization/instances/connectivity-controller/connectivity-controller.d.cts.map +1 -0
- package/dist/initialization/instances/connectivity-controller/connectivity-controller.d.mts +4 -0
- package/dist/initialization/instances/connectivity-controller/connectivity-controller.d.mts.map +1 -0
- package/dist/initialization/instances/connectivity-controller/connectivity-controller.mjs +14 -0
- package/dist/initialization/instances/connectivity-controller/connectivity-controller.mjs.map +1 -0
- package/dist/initialization/instances/connectivity-controller/types.cjs +3 -0
- package/dist/initialization/instances/connectivity-controller/types.cjs.map +1 -0
- package/dist/initialization/instances/connectivity-controller/types.d.cts +13 -0
- package/dist/initialization/instances/connectivity-controller/types.d.cts.map +1 -0
- package/dist/initialization/instances/connectivity-controller/types.d.mts +13 -0
- package/dist/initialization/instances/connectivity-controller/types.d.mts.map +1 -0
- package/dist/initialization/instances/connectivity-controller/types.mjs +2 -0
- package/dist/initialization/instances/connectivity-controller/types.mjs.map +1 -0
- package/dist/initialization/instances/index.cjs +11 -3
- package/dist/initialization/instances/index.cjs.map +1 -1
- package/dist/initialization/instances/index.d.cts +6 -2
- package/dist/initialization/instances/index.d.cts.map +1 -1
- package/dist/initialization/instances/index.d.mts +6 -2
- package/dist/initialization/instances/index.d.mts.map +1 -1
- package/dist/initialization/instances/index.mjs +6 -2
- package/dist/initialization/instances/index.mjs.map +1 -1
- package/dist/initialization/instances/{keyring-controller.cjs → keyring-controller/encryptor.cjs} +2 -18
- package/dist/initialization/instances/keyring-controller/encryptor.cjs.map +1 -0
- package/dist/initialization/instances/{keyring-controller.d.mts → keyring-controller/encryptor.d.cts} +1 -4
- package/dist/initialization/instances/keyring-controller/encryptor.d.cts.map +1 -0
- package/dist/initialization/instances/{keyring-controller.d.cts → keyring-controller/encryptor.d.mts} +1 -4
- package/dist/initialization/instances/keyring-controller/encryptor.d.mts.map +1 -0
- package/dist/initialization/instances/{keyring-controller.mjs → keyring-controller/encryptor.mjs} +1 -17
- package/dist/initialization/instances/keyring-controller/encryptor.mjs.map +1 -0
- package/dist/initialization/instances/keyring-controller/keyring-controller.cjs +21 -0
- package/dist/initialization/instances/keyring-controller/keyring-controller.cjs.map +1 -0
- package/dist/initialization/instances/keyring-controller/keyring-controller.d.cts +4 -0
- package/dist/initialization/instances/keyring-controller/keyring-controller.d.cts.map +1 -0
- package/dist/initialization/instances/keyring-controller/keyring-controller.d.mts +4 -0
- package/dist/initialization/instances/keyring-controller/keyring-controller.d.mts.map +1 -0
- package/dist/initialization/instances/keyring-controller/keyring-controller.mjs +18 -0
- package/dist/initialization/instances/keyring-controller/keyring-controller.mjs.map +1 -0
- package/dist/initialization/instances/keyring-controller/types.cjs +3 -0
- package/dist/initialization/instances/keyring-controller/types.cjs.map +1 -0
- package/dist/initialization/instances/keyring-controller/types.d.cts +22 -0
- package/dist/initialization/instances/keyring-controller/types.d.cts.map +1 -0
- package/dist/initialization/instances/keyring-controller/types.d.mts +22 -0
- package/dist/initialization/instances/keyring-controller/types.d.mts.map +1 -0
- package/dist/initialization/instances/keyring-controller/types.mjs +2 -0
- package/dist/initialization/instances/keyring-controller/types.mjs.map +1 -0
- package/dist/initialization/instances/remote-feature-flag-controller/remote-feature-flag-controller.cjs +23 -0
- package/dist/initialization/instances/remote-feature-flag-controller/remote-feature-flag-controller.cjs.map +1 -0
- package/dist/initialization/instances/remote-feature-flag-controller/remote-feature-flag-controller.d.cts +4 -0
- package/dist/initialization/instances/remote-feature-flag-controller/remote-feature-flag-controller.d.cts.map +1 -0
- package/dist/initialization/instances/remote-feature-flag-controller/remote-feature-flag-controller.d.mts +4 -0
- package/dist/initialization/instances/remote-feature-flag-controller/remote-feature-flag-controller.d.mts.map +1 -0
- package/dist/initialization/instances/remote-feature-flag-controller/remote-feature-flag-controller.mjs +20 -0
- package/dist/initialization/instances/remote-feature-flag-controller/remote-feature-flag-controller.mjs.map +1 -0
- package/dist/initialization/instances/remote-feature-flag-controller/types.cjs +3 -0
- package/dist/initialization/instances/remote-feature-flag-controller/types.cjs.map +1 -0
- package/dist/initialization/instances/remote-feature-flag-controller/types.d.cts +43 -0
- package/dist/initialization/instances/remote-feature-flag-controller/types.d.cts.map +1 -0
- package/dist/initialization/instances/remote-feature-flag-controller/types.d.mts +43 -0
- package/dist/initialization/instances/remote-feature-flag-controller/types.d.mts.map +1 -0
- package/dist/initialization/instances/remote-feature-flag-controller/types.mjs +2 -0
- package/dist/initialization/instances/remote-feature-flag-controller/types.mjs.map +1 -0
- package/dist/initialization/instances/storage-service/storage-service.cjs.map +1 -0
- package/dist/initialization/instances/{storage-service.d.cts → storage-service/storage-service.d.cts} +1 -1
- package/dist/initialization/instances/storage-service/storage-service.d.cts.map +1 -0
- package/dist/initialization/instances/{storage-service.d.mts → storage-service/storage-service.d.mts} +1 -1
- package/dist/initialization/instances/storage-service/storage-service.d.mts.map +1 -0
- package/dist/initialization/instances/storage-service/storage-service.mjs.map +1 -0
- package/dist/initialization/instances/storage-service/types.cjs +3 -0
- package/dist/initialization/instances/storage-service/types.cjs.map +1 -0
- package/dist/initialization/instances/storage-service/types.d.cts +12 -0
- package/dist/initialization/instances/storage-service/types.d.cts.map +1 -0
- package/dist/initialization/instances/storage-service/types.d.mts +12 -0
- package/dist/initialization/instances/storage-service/types.d.mts.map +1 -0
- package/dist/initialization/instances/storage-service/types.mjs +2 -0
- package/dist/initialization/instances/storage-service/types.mjs.map +1 -0
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +10 -11
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +10 -11
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/package.json +9 -4
- package/dist/initialization/instances/keyring-controller.cjs.map +0 -1
- package/dist/initialization/instances/keyring-controller.d.cts.map +0 -1
- package/dist/initialization/instances/keyring-controller.d.mts.map +0 -1
- package/dist/initialization/instances/keyring-controller.mjs.map +0 -1
- package/dist/initialization/instances/storage-service.cjs.map +0 -1
- package/dist/initialization/instances/storage-service.d.cts.map +0 -1
- package/dist/initialization/instances/storage-service.d.mts.map +0 -1
- package/dist/initialization/instances/storage-service.mjs.map +0 -1
- /package/dist/initialization/instances/{storage-service.cjs → storage-service/storage-service.cjs} +0 -0
- /package/dist/initialization/instances/{storage-service.mjs → storage-service/storage-service.mjs} +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { RemoteFeatureFlagController } from "@metamask/remote-feature-flag-controller";
|
|
2
|
+
type RemoteFeatureFlagControllerOptions = ConstructorParameters<typeof RemoteFeatureFlagController>[0];
|
|
3
|
+
/**
|
|
4
|
+
* Per-instance options for the wallet's `RemoteFeatureFlagController`.
|
|
5
|
+
* `clientConfigApiService` is required; the rest are optional and fall back to
|
|
6
|
+
* the defaults applied in the controller's `init`.
|
|
7
|
+
*/
|
|
8
|
+
export type RemoteFeatureFlagControllerInstanceOptions = {
|
|
9
|
+
/**
|
|
10
|
+
* The service that fetches remote feature flags. Required: each client
|
|
11
|
+
* injects a `ClientConfigApiService` configured for its own client type,
|
|
12
|
+
* distribution, and environment, so there is no platform-agnostic default.
|
|
13
|
+
*/
|
|
14
|
+
clientConfigApiService: RemoteFeatureFlagControllerOptions['clientConfigApiService'];
|
|
15
|
+
/**
|
|
16
|
+
* Returns the current MetaMetrics id, used for user-segmentation thresholds.
|
|
17
|
+
* Defaults to `() => ''`.
|
|
18
|
+
*/
|
|
19
|
+
getMetaMetricsId?: RemoteFeatureFlagControllerOptions['getMetaMetricsId'];
|
|
20
|
+
/**
|
|
21
|
+
* The current client version for version-based flag filtering. Must be a
|
|
22
|
+
* valid 3-part SemVer or the controller throws. Defaults to `'0.0.0'`.
|
|
23
|
+
*/
|
|
24
|
+
clientVersion?: RemoteFeatureFlagControllerOptions['clientVersion'];
|
|
25
|
+
/**
|
|
26
|
+
* The previously-run client version. When it differs from `clientVersion`,
|
|
27
|
+
* the controller invalidates its cached flags on the next update.
|
|
28
|
+
*/
|
|
29
|
+
prevClientVersion?: RemoteFeatureFlagControllerOptions['prevClientVersion'];
|
|
30
|
+
/**
|
|
31
|
+
* Milliseconds before cached flags expire. Defaults to the controller's own
|
|
32
|
+
* default (1 day).
|
|
33
|
+
*/
|
|
34
|
+
fetchInterval?: RemoteFeatureFlagControllerOptions['fetchInterval'];
|
|
35
|
+
/**
|
|
36
|
+
* Whether the controller starts disabled. Defaults to `false`. The dynamic
|
|
37
|
+
* enable/disable toggling stays client-side via the controller's exposed
|
|
38
|
+
* `enable`/`disable` actions.
|
|
39
|
+
*/
|
|
40
|
+
disabled?: RemoteFeatureFlagControllerOptions['disabled'];
|
|
41
|
+
};
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../../../src/initialization/instances/remote-feature-flag-controller/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,iDAAiD;AAE5F,KAAK,kCAAkC,GAAG,qBAAqB,CAC7D,OAAO,2BAA2B,CACnC,CAAC,CAAC,CAAC,CAAC;AAEL;;;;GAIG;AACH,MAAM,MAAM,0CAA0C,GAAG;IACvD;;;;OAIG;IACH,sBAAsB,EAAE,kCAAkC,CAAC,wBAAwB,CAAC,CAAC;IACrF;;;OAGG;IACH,gBAAgB,CAAC,EAAE,kCAAkC,CAAC,kBAAkB,CAAC,CAAC;IAC1E;;;OAGG;IACH,aAAa,CAAC,EAAE,kCAAkC,CAAC,eAAe,CAAC,CAAC;IACpE;;;OAGG;IACH,iBAAiB,CAAC,EAAE,kCAAkC,CAAC,mBAAmB,CAAC,CAAC;IAC5E;;;OAGG;IACH,aAAa,CAAC,EAAE,kCAAkC,CAAC,eAAe,CAAC,CAAC;IACpE;;;;OAIG;IACH,QAAQ,CAAC,EAAE,kCAAkC,CAAC,UAAU,CAAC,CAAC;CAC3D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../../../src/initialization/instances/remote-feature-flag-controller/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { RemoteFeatureFlagController } from '@metamask/remote-feature-flag-controller';\n\ntype RemoteFeatureFlagControllerOptions = ConstructorParameters<\n typeof RemoteFeatureFlagController\n>[0];\n\n/**\n * Per-instance options for the wallet's `RemoteFeatureFlagController`.\n * `clientConfigApiService` is required; the rest are optional and fall back to\n * the defaults applied in the controller's `init`.\n */\nexport type RemoteFeatureFlagControllerInstanceOptions = {\n /**\n * The service that fetches remote feature flags. Required: each client\n * injects a `ClientConfigApiService` configured for its own client type,\n * distribution, and environment, so there is no platform-agnostic default.\n */\n clientConfigApiService: RemoteFeatureFlagControllerOptions['clientConfigApiService'];\n /**\n * Returns the current MetaMetrics id, used for user-segmentation thresholds.\n * Defaults to `() => ''`.\n */\n getMetaMetricsId?: RemoteFeatureFlagControllerOptions['getMetaMetricsId'];\n /**\n * The current client version for version-based flag filtering. Must be a\n * valid 3-part SemVer or the controller throws. Defaults to `'0.0.0'`.\n */\n clientVersion?: RemoteFeatureFlagControllerOptions['clientVersion'];\n /**\n * The previously-run client version. When it differs from `clientVersion`,\n * the controller invalidates its cached flags on the next update.\n */\n prevClientVersion?: RemoteFeatureFlagControllerOptions['prevClientVersion'];\n /**\n * Milliseconds before cached flags expire. Defaults to the controller's own\n * default (1 day).\n */\n fetchInterval?: RemoteFeatureFlagControllerOptions['fetchInterval'];\n /**\n * Whether the controller starts disabled. Defaults to `false`. The dynamic\n * enable/disable toggling stays client-side via the controller's exposed\n * `enable`/`disable` actions.\n */\n disabled?: RemoteFeatureFlagControllerOptions['disabled'];\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-service.cjs","sourceRoot":"","sources":["../../../../src/initialization/instances/storage-service/storage-service.ts"],"names":[],"mappings":";;;AAAA,mDAAgD;AAChD,+DAA2D;AAK9C,QAAA,cAAc,GAGvB;IACF,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,CAC/B,IAAI,gCAAc,CAAC;QACjB,SAAS;QACT,OAAO,EAAE,OAAO,CAAC,OAAO;KACzB,CAAC;IACJ,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CACvB,IAAI,qBAAS,CAAC;QACZ,SAAS,EAAE,gBAAgB;QAC3B,MAAM;KACP,CAAC;CACL,CAAC","sourcesContent":["import { Messenger } from '@metamask/messenger';\nimport { StorageService } from '@metamask/storage-service';\nimport { StorageServiceMessenger } from '@metamask/storage-service';\n\nimport { InitializationConfiguration } from '../../types';\n\nexport const storageService: InitializationConfiguration<\n StorageService,\n StorageServiceMessenger\n> = {\n name: 'StorageService',\n init: ({ messenger, options }) =>\n new StorageService({\n messenger,\n storage: options.storage,\n }),\n getMessenger: (parent) =>\n new Messenger({\n namespace: 'StorageService',\n parent,\n }),\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StorageService } from "@metamask/storage-service";
|
|
2
2
|
import { StorageServiceMessenger } from "@metamask/storage-service";
|
|
3
|
-
import { InitializationConfiguration } from "
|
|
3
|
+
import { InitializationConfiguration } from "../../types.cjs";
|
|
4
4
|
export declare const storageService: InitializationConfiguration<StorageService, StorageServiceMessenger>;
|
|
5
5
|
//# sourceMappingURL=storage-service.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-service.d.cts","sourceRoot":"","sources":["../../../../src/initialization/instances/storage-service/storage-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,kCAAkC;AAEpE,OAAO,EAAE,2BAA2B,EAAE,wBAAoB;AAE1D,eAAO,MAAM,cAAc,EAAE,2BAA2B,CACtD,cAAc,EACd,uBAAuB,CAaxB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StorageService } from "@metamask/storage-service";
|
|
2
2
|
import { StorageServiceMessenger } from "@metamask/storage-service";
|
|
3
|
-
import { InitializationConfiguration } from "
|
|
3
|
+
import { InitializationConfiguration } from "../../types.mjs";
|
|
4
4
|
export declare const storageService: InitializationConfiguration<StorageService, StorageServiceMessenger>;
|
|
5
5
|
//# sourceMappingURL=storage-service.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-service.d.mts","sourceRoot":"","sources":["../../../../src/initialization/instances/storage-service/storage-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,kCAAkC;AAEpE,OAAO,EAAE,2BAA2B,EAAE,wBAAoB;AAE1D,eAAO,MAAM,cAAc,EAAE,2BAA2B,CACtD,cAAc,EACd,uBAAuB,CAaxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-service.mjs","sourceRoot":"","sources":["../../../../src/initialization/instances/storage-service/storage-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,4BAA4B;AAChD,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAK3D,MAAM,CAAC,MAAM,cAAc,GAGvB;IACF,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,CAC/B,IAAI,cAAc,CAAC;QACjB,SAAS;QACT,OAAO,EAAE,OAAO,CAAC,OAAO;KACzB,CAAC;IACJ,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CACvB,IAAI,SAAS,CAAC;QACZ,SAAS,EAAE,gBAAgB;QAC3B,MAAM;KACP,CAAC;CACL,CAAC","sourcesContent":["import { Messenger } from '@metamask/messenger';\nimport { StorageService } from '@metamask/storage-service';\nimport { StorageServiceMessenger } from '@metamask/storage-service';\n\nimport { InitializationConfiguration } from '../../types';\n\nexport const storageService: InitializationConfiguration<\n StorageService,\n StorageServiceMessenger\n> = {\n name: 'StorageService',\n init: ({ messenger, options }) =>\n new StorageService({\n messenger,\n storage: options.storage,\n }),\n getMessenger: (parent) =>\n new Messenger({\n namespace: 'StorageService',\n parent,\n }),\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../../../src/initialization/instances/storage-service/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { StorageAdapter } from '@metamask/storage-service';\n\n/**\n * Per-instance options for the wallet's `StorageService`.\n */\nexport type StorageServiceInstanceOptions = {\n /**\n * Storage adapter the service persists data through. Supplied by the\n * consumer, as the backing store differs per environment.\n */\n storage: StorageAdapter;\n};\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { StorageAdapter } from "@metamask/storage-service";
|
|
2
|
+
/**
|
|
3
|
+
* Per-instance options for the wallet's `StorageService`.
|
|
4
|
+
*/
|
|
5
|
+
export type StorageServiceInstanceOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* Storage adapter the service persists data through. Supplied by the
|
|
8
|
+
* consumer, as the backing store differs per environment.
|
|
9
|
+
*/
|
|
10
|
+
storage: StorageAdapter;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../../../src/initialization/instances/storage-service/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,kCAAkC;AAEhE;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C;;;OAGG;IACH,OAAO,EAAE,cAAc,CAAC;CACzB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { StorageAdapter } from "@metamask/storage-service";
|
|
2
|
+
/**
|
|
3
|
+
* Per-instance options for the wallet's `StorageService`.
|
|
4
|
+
*/
|
|
5
|
+
export type StorageServiceInstanceOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* Storage adapter the service persists data through. Supplied by the
|
|
8
|
+
* consumer, as the backing store differs per environment.
|
|
9
|
+
*/
|
|
10
|
+
storage: StorageAdapter;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../../../src/initialization/instances/storage-service/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,kCAAkC;AAEhE;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C;;;OAGG;IACH,OAAO,EAAE,cAAc,CAAC;CACzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../../../src/initialization/instances/storage-service/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { StorageAdapter } from '@metamask/storage-service';\n\n/**\n * Per-instance options for the wallet's `StorageService`.\n */\nexport type StorageServiceInstanceOptions = {\n /**\n * Storage adapter the service persists data through. Supplied by the\n * consumer, as the backing store differs per environment.\n */\n storage: StorageAdapter;\n};\n"]}
|
package/dist/types.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Json } from '@metamask/utils';\n\nimport type {\n DefaultActions,\n DefaultEvents,\n RootMessenger,\n} from './initialization/defaults';\nimport type { ApprovalControllerInstanceOptions } from './initialization/instances/approval-controller/types';\nimport type { ConnectivityControllerInstanceOptions } from './initialization/instances/connectivity-controller/types';\nimport type { KeyringControllerInstanceOptions } from './initialization/instances/keyring-controller/types';\nimport type { RemoteFeatureFlagControllerInstanceOptions } from './initialization/instances/remote-feature-flag-controller/types';\nimport type { StorageServiceInstanceOptions } from './initialization/instances/storage-service/types';\nimport { InitializationConfiguration } from './initialization/types';\n\nexport type WalletOptions = {\n messenger?: RootMessenger<DefaultActions, DefaultEvents>;\n state?: Record<string, Record<string, Json> | undefined>;\n initializationConfigurations?: InitializationConfiguration<\n unknown,\n unknown\n >[];\n instanceOptions: InstanceSpecificOptions;\n};\n\nexport type InstanceSpecificOptions = {\n approvalController?: ApprovalControllerInstanceOptions;\n connectivityController: ConnectivityControllerInstanceOptions;\n keyringController?: KeyringControllerInstanceOptions;\n remoteFeatureFlagController: RemoteFeatureFlagControllerInstanceOptions;\n storageService: StorageServiceInstanceOptions;\n};\n"]}
|
package/dist/types.d.cts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { KeyringControllerOptions } from "@metamask/keyring-controller";
|
|
2
|
-
import { StorageAdapter } from "@metamask/storage-service";
|
|
3
1
|
import type { Json } from "@metamask/utils";
|
|
4
2
|
import type { DefaultActions, DefaultEvents, RootMessenger } from "./initialization/defaults.cjs";
|
|
5
|
-
import {
|
|
3
|
+
import type { ApprovalControllerInstanceOptions } from "./initialization/instances/approval-controller/types.cjs";
|
|
4
|
+
import type { ConnectivityControllerInstanceOptions } from "./initialization/instances/connectivity-controller/types.cjs";
|
|
5
|
+
import type { KeyringControllerInstanceOptions } from "./initialization/instances/keyring-controller/types.cjs";
|
|
6
|
+
import type { RemoteFeatureFlagControllerInstanceOptions } from "./initialization/instances/remote-feature-flag-controller/types.cjs";
|
|
7
|
+
import type { StorageServiceInstanceOptions } from "./initialization/instances/storage-service/types.cjs";
|
|
6
8
|
import { InitializationConfiguration } from "./initialization/types.cjs";
|
|
7
9
|
export type WalletOptions = {
|
|
8
10
|
messenger?: RootMessenger<DefaultActions, DefaultEvents>;
|
|
@@ -11,13 +13,10 @@ export type WalletOptions = {
|
|
|
11
13
|
instanceOptions: InstanceSpecificOptions;
|
|
12
14
|
};
|
|
13
15
|
export type InstanceSpecificOptions = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
storageService: {
|
|
20
|
-
storage: StorageAdapter;
|
|
21
|
-
};
|
|
16
|
+
approvalController?: ApprovalControllerInstanceOptions;
|
|
17
|
+
connectivityController: ConnectivityControllerInstanceOptions;
|
|
18
|
+
keyringController?: KeyringControllerInstanceOptions;
|
|
19
|
+
remoteFeatureFlagController: RemoteFeatureFlagControllerInstanceOptions;
|
|
20
|
+
storageService: StorageServiceInstanceOptions;
|
|
22
21
|
};
|
|
23
22
|
//# sourceMappingURL=types.d.cts.map
|
package/dist/types.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,aAAa,EACd,sCAAkC;AACnC,OAAO,KAAK,EAAE,iCAAiC,EAAE,iEAA6D;AAC9G,OAAO,KAAK,EAAE,qCAAqC,EAAE,qEAAiE;AACtH,OAAO,KAAK,EAAE,gCAAgC,EAAE,gEAA4D;AAC5G,OAAO,KAAK,EAAE,0CAA0C,EAAE,4EAAwE;AAClI,OAAO,KAAK,EAAE,6BAA6B,EAAE,6DAAyD;AACtG,OAAO,EAAE,2BAA2B,EAAE,mCAA+B;AAErE,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,CAAC,EAAE,aAAa,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;IACzD,4BAA4B,CAAC,EAAE,2BAA2B,CACxD,OAAO,EACP,OAAO,CACR,EAAE,CAAC;IACJ,eAAe,EAAE,uBAAuB,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,kBAAkB,CAAC,EAAE,iCAAiC,CAAC;IACvD,sBAAsB,EAAE,qCAAqC,CAAC;IAC9D,iBAAiB,CAAC,EAAE,gCAAgC,CAAC;IACrD,2BAA2B,EAAE,0CAA0C,CAAC;IACxE,cAAc,EAAE,6BAA6B,CAAC;CAC/C,CAAC"}
|
package/dist/types.d.mts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { KeyringControllerOptions } from "@metamask/keyring-controller";
|
|
2
|
-
import { StorageAdapter } from "@metamask/storage-service";
|
|
3
1
|
import type { Json } from "@metamask/utils";
|
|
4
2
|
import type { DefaultActions, DefaultEvents, RootMessenger } from "./initialization/defaults.mjs";
|
|
5
|
-
import {
|
|
3
|
+
import type { ApprovalControllerInstanceOptions } from "./initialization/instances/approval-controller/types.mjs";
|
|
4
|
+
import type { ConnectivityControllerInstanceOptions } from "./initialization/instances/connectivity-controller/types.mjs";
|
|
5
|
+
import type { KeyringControllerInstanceOptions } from "./initialization/instances/keyring-controller/types.mjs";
|
|
6
|
+
import type { RemoteFeatureFlagControllerInstanceOptions } from "./initialization/instances/remote-feature-flag-controller/types.mjs";
|
|
7
|
+
import type { StorageServiceInstanceOptions } from "./initialization/instances/storage-service/types.mjs";
|
|
6
8
|
import { InitializationConfiguration } from "./initialization/types.mjs";
|
|
7
9
|
export type WalletOptions = {
|
|
8
10
|
messenger?: RootMessenger<DefaultActions, DefaultEvents>;
|
|
@@ -11,13 +13,10 @@ export type WalletOptions = {
|
|
|
11
13
|
instanceOptions: InstanceSpecificOptions;
|
|
12
14
|
};
|
|
13
15
|
export type InstanceSpecificOptions = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
storageService: {
|
|
20
|
-
storage: StorageAdapter;
|
|
21
|
-
};
|
|
16
|
+
approvalController?: ApprovalControllerInstanceOptions;
|
|
17
|
+
connectivityController: ConnectivityControllerInstanceOptions;
|
|
18
|
+
keyringController?: KeyringControllerInstanceOptions;
|
|
19
|
+
remoteFeatureFlagController: RemoteFeatureFlagControllerInstanceOptions;
|
|
20
|
+
storageService: StorageServiceInstanceOptions;
|
|
22
21
|
};
|
|
23
22
|
//# sourceMappingURL=types.d.mts.map
|
package/dist/types.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,aAAa,EACd,sCAAkC;AACnC,OAAO,KAAK,EAAE,iCAAiC,EAAE,iEAA6D;AAC9G,OAAO,KAAK,EAAE,qCAAqC,EAAE,qEAAiE;AACtH,OAAO,KAAK,EAAE,gCAAgC,EAAE,gEAA4D;AAC5G,OAAO,KAAK,EAAE,0CAA0C,EAAE,4EAAwE;AAClI,OAAO,KAAK,EAAE,6BAA6B,EAAE,6DAAyD;AACtG,OAAO,EAAE,2BAA2B,EAAE,mCAA+B;AAErE,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,CAAC,EAAE,aAAa,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;IACzD,4BAA4B,CAAC,EAAE,2BAA2B,CACxD,OAAO,EACP,OAAO,CACR,EAAE,CAAC;IACJ,eAAe,EAAE,uBAAuB,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,kBAAkB,CAAC,EAAE,iCAAiC,CAAC;IACvD,sBAAsB,EAAE,qCAAqC,CAAC;IAC9D,iBAAiB,CAAC,EAAE,gCAAgC,CAAC;IACrD,2BAA2B,EAAE,0CAA0C,CAAC;IACxE,cAAc,EAAE,6BAA6B,CAAC;CAC/C,CAAC"}
|
package/dist/types.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Json } from '@metamask/utils';\n\nimport type {\n DefaultActions,\n DefaultEvents,\n RootMessenger,\n} from './initialization/defaults';\nimport type { ApprovalControllerInstanceOptions } from './initialization/instances/approval-controller/types';\nimport type { ConnectivityControllerInstanceOptions } from './initialization/instances/connectivity-controller/types';\nimport type { KeyringControllerInstanceOptions } from './initialization/instances/keyring-controller/types';\nimport type { RemoteFeatureFlagControllerInstanceOptions } from './initialization/instances/remote-feature-flag-controller/types';\nimport type { StorageServiceInstanceOptions } from './initialization/instances/storage-service/types';\nimport { InitializationConfiguration } from './initialization/types';\n\nexport type WalletOptions = {\n messenger?: RootMessenger<DefaultActions, DefaultEvents>;\n state?: Record<string, Record<string, Json> | undefined>;\n initializationConfigurations?: InitializationConfiguration<\n unknown,\n unknown\n >[];\n instanceOptions: InstanceSpecificOptions;\n};\n\nexport type InstanceSpecificOptions = {\n approvalController?: ApprovalControllerInstanceOptions;\n connectivityController: ConnectivityControllerInstanceOptions;\n keyringController?: KeyringControllerInstanceOptions;\n remoteFeatureFlagController: RemoteFeatureFlagControllerInstanceOptions;\n storageService: StorageServiceInstanceOptions;\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask/wallet",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Provides a shared framework for building MetaMask wallets",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ethereum",
|
|
@@ -53,13 +53,18 @@
|
|
|
53
53
|
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
+
"@metamask/accounts-controller": "^39.0.2",
|
|
57
|
+
"@metamask/approval-controller": "^9.0.2",
|
|
56
58
|
"@metamask/base-controller": "^9.1.0",
|
|
57
59
|
"@metamask/browser-passworder": "^6.0.0",
|
|
58
|
-
"@metamask/
|
|
60
|
+
"@metamask/connectivity-controller": "^0.2.0",
|
|
61
|
+
"@metamask/controller-utils": "^12.3.0",
|
|
62
|
+
"@metamask/keyring-controller": "^27.1.0",
|
|
59
63
|
"@metamask/messenger": "^1.2.0",
|
|
64
|
+
"@metamask/remote-feature-flag-controller": "^4.2.2",
|
|
60
65
|
"@metamask/scure-bip39": "^2.1.1",
|
|
61
|
-
"@metamask/storage-service": "^1.0.
|
|
62
|
-
"@metamask/utils": "^11.
|
|
66
|
+
"@metamask/storage-service": "^1.0.2",
|
|
67
|
+
"@metamask/utils": "^11.11.0"
|
|
63
68
|
},
|
|
64
69
|
"devDependencies": {
|
|
65
70
|
"@metamask/auto-changelog": "^6.1.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-controller.cjs","sourceRoot":"","sources":["../../../src/initialization/instances/keyring-controller.ts"],"names":[],"mappings":";;;AAKA,qEAYsC;AAEtC,qEAGsC;AACtC,mDAAgD;AAIhD;;;;;;GAMG;AACH,MAAM,cAAc,GAClB,CAAC,UAAkB,EAAE,EAAE,CACvB,KAAK,EACH,QAAgB,EAChB,IAAa,EACb,GAA+B,EAC/B,IAAa,EACI,EAAE,CACnB,IAAA,4BAAO,EAAC,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE;IACjC,SAAS,EAAE,QAAQ;IACnB,MAAM,EAAE;QACN,UAAU;KACX;CACF,CAAC,CAAC;AAEP;;;;;;GAMG;AACH,MAAM,wBAAwB,GAC5B,CAAC,UAAkB,EAAE,EAAE,CACvB,KAAK,EACH,QAAgB,EAChB,MAAe,EACf,IAAa,EACsB,EAAE,CACrC,IAAA,sCAAiB,EAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE;IACxC,SAAS,EAAE,QAAQ;IACnB,MAAM,EAAE;QACN,UAAU;KACX;CACF,CAAC,CAAC;AAEP;;;;;;;;;GASG;AACH,MAAM,sBAAsB,GAC1B,CAAC,UAAkB,EAAE,EAAE,CACvB,KAAK,EACH,QAAgB,EAChB,IAAY,EACZ,UAAoB,EACpB,IAA2B,EACH,EAAE,CAC1B,IAAA,oCAAe,EACb,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,IAAI,IAAI;IACN,SAAS,EAAE,QAAQ;IACnB,MAAM,EAAE;QACN,UAAU;KACX;CACF,CACF,CAAC;AAEN;;;;;;GAMG;AACH,MAAM,qBAAqB,GACzB,CAAC,UAAkB,EAAE,EAAE,CACvB,CAAC,KAAa,EAAW,EAAE,CACzB,IAAA,mCAAc,EAAC,KAAK,EAAE;IACpB,SAAS,EAAE,QAAQ;IACnB,MAAM,EAAE;QACN,UAAU;KACX;CACF,CAAC,CAAC;AAEP;;;;;;;;GAQG;AACI,MAAM,gBAAgB,GAAG,CAAC,UAAkB,EAAa,EAAE,CAAC,CAAC;IAClE,OAAO,EAAE,cAAc,CAAC,UAAU,CAAC;IACnC,cAAc,EAAd,mCAAc;IACd,iBAAiB,EAAE,wBAAwB,CAAC,UAAU,CAAC;IACvD,OAAO,EAAP,4BAAO;IACP,cAAc,EAAd,mCAAc;IACd,iBAAiB,EAAjB,sCAAiB;IACjB,eAAe,EAAE,sBAAsB,CAAC,UAAU,CAAC;IACnD,cAAc,EAAE,qBAAqB,CAAC,UAAU,CAAC;IACjD,SAAS,EAAT,8BAAS;IACT,SAAS,EAAT,8BAAS;IACT,YAAY,EAAZ,iCAAY;CACb,CAAC,CAAC;AAZU,QAAA,gBAAgB,oBAY1B;AAyBU,QAAA,iBAAiB,GAG1B;IACF,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,CACtC,IAAI,sCAAiB,CAAC;QACpB,KAAK;QACL,SAAS;QACT,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;QAC5C,SAAS,EAAE,CAAC,OAAO,CAAC,SAAS,IAAI,IAAA,wBAAgB,EAAC,MAAO,CAAC,CAEzD;KACF,CAAC;IACJ,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CACvB,IAAI,qBAAS,CAAC;QACZ,SAAS,EAAE,mBAAmB;QAC9B,MAAM;KACP,CAAC;CACL,CAAC","sourcesContent":["import type {\n DetailedEncryptionResult,\n EncryptionKey,\n KeyDerivationOptions,\n} from '@metamask/browser-passworder';\nimport {\n encrypt,\n encryptWithDetail,\n encryptWithKey,\n decrypt,\n decryptWithDetail,\n decryptWithKey,\n isVaultUpdated,\n keyFromPassword,\n importKey,\n exportKey,\n generateSalt,\n} from '@metamask/browser-passworder';\nimport type { Encryptor } from '@metamask/keyring-controller';\nimport {\n KeyringController,\n KeyringControllerMessenger,\n} from '@metamask/keyring-controller';\nimport { Messenger } from '@metamask/messenger';\n\nimport { InitializationConfiguration } from '../types';\n\n/**\n * A factory function for the encrypt method of the browser-passworder library,\n * that encrypts with a given number of iterations.\n *\n * @param iterations - The number of iterations to use for the PBKDF2 algorithm.\n * @returns A function that encrypts with the given number of iterations.\n */\nconst encryptFactory =\n (iterations: number) =>\n async (\n password: string,\n data: unknown,\n key?: EncryptionKey | CryptoKey,\n salt?: string,\n ): Promise<string> =>\n encrypt(password, data, key, salt, {\n algorithm: 'PBKDF2',\n params: {\n iterations,\n },\n });\n\n/**\n * A factory function for the encryptWithDetail method of the browser-passworder library,\n * that encrypts with a given number of iterations.\n *\n * @param iterations - The number of iterations to use for the PBKDF2 algorithm.\n * @returns A function that encrypts with the given number of iterations.\n */\nconst encryptWithDetailFactory =\n (iterations: number) =>\n async (\n password: string,\n object: unknown,\n salt?: string,\n ): Promise<DetailedEncryptionResult> =>\n encryptWithDetail(password, object, salt, {\n algorithm: 'PBKDF2',\n params: {\n iterations,\n },\n });\n\n/**\n * A factory function for the keyFromPassword method of the browser-passworder library,\n * that generates a key from a password and a salt.\n *\n * This factory function overrides the default key derivation options with the specified\n * number of iterations, unless existing key derivation options are passed in.\n *\n * @param iterations - The number of iterations to use for the PBKDF2 algorithm.\n * @returns A function that generates a key with a potentially overriden number of iterations.\n */\nconst keyFromPasswordFactory =\n (iterations: number) =>\n async (\n password: string,\n salt: string,\n exportable?: boolean,\n opts?: KeyDerivationOptions,\n ): Promise<EncryptionKey> =>\n keyFromPassword(\n password,\n salt,\n exportable,\n opts ?? {\n algorithm: 'PBKDF2',\n params: {\n iterations,\n },\n },\n );\n\n/**\n * A factory function for the isVaultUpdated method of the browser-passworder library,\n * that checks if the given vault was encrypted with the given number of iterations.\n *\n * @param iterations - The number of iterations to use for the PBKDF2 algorithm.\n * @returns A function that checks if the vault was encrypted with the given number of iterations.\n */\nconst isVaultUpdatedFactory =\n (iterations: number) =>\n (vault: string): boolean =>\n isVaultUpdated(vault, {\n algorithm: 'PBKDF2',\n params: {\n iterations,\n },\n });\n\n/**\n * A factory function that returns an encryptor with the given number of iterations.\n *\n * The returned encryptor is a wrapper around the browser-passworder library, that\n * calls the encrypt and encryptWithDetail methods with the given number of iterations.\n *\n * @param iterations - The number of iterations to use for the PBKDF2 algorithm.\n * @returns An encryptor set with the given number of iterations.\n */\nexport const encryptorFactory = (iterations: number): Encryptor => ({\n encrypt: encryptFactory(iterations),\n encryptWithKey,\n encryptWithDetail: encryptWithDetailFactory(iterations),\n decrypt,\n decryptWithKey,\n decryptWithDetail,\n keyFromPassword: keyFromPasswordFactory(iterations),\n isVaultUpdated: isVaultUpdatedFactory(iterations),\n importKey,\n exportKey,\n generateSalt,\n});\n\ntype MobileEncryptionKey = {\n key: string;\n lib: string;\n exportable: boolean;\n keyMetadata: KeyDerivationOptions;\n};\n\ntype MobileEncryptionResult = {\n cipher: string;\n iv: string;\n salt?: string;\n lib?: string;\n keyMetadata?: KeyDerivationOptions;\n};\n\nexport type GenericEncryptor =\n | Encryptor<EncryptionKey | CryptoKey>\n | Encryptor<\n MobileEncryptionKey,\n KeyDerivationOptions,\n MobileEncryptionResult\n >;\n\nexport const keyringController: InitializationConfiguration<\n KeyringController,\n KeyringControllerMessenger\n> = {\n name: 'KeyringController',\n init: ({ state, messenger, options }) =>\n new KeyringController({\n state,\n messenger,\n keyringBuilders: options.keyringBuilders,\n keyringV2Builders: options.keyringV2Builders,\n encryptor: (options.encryptor ?? encryptorFactory(600_000)) as Encryptor<\n EncryptionKey | CryptoKey\n >,\n }),\n getMessenger: (parent) =>\n new Messenger({\n namespace: 'KeyringController',\n parent,\n }),\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-controller.d.cts","sourceRoot":"","sources":["../../../src/initialization/instances/keyring-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EACb,oBAAoB,EACrB,qCAAqC;AActC,OAAO,KAAK,EAAE,SAAS,EAAE,qCAAqC;AAC9D,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC3B,qCAAqC;AAGtC,OAAO,EAAE,2BAA2B,EAAE,qBAAiB;AA4FvD;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,eAAgB,MAAM,KAAG,SAYpD,CAAC;AAEH,KAAK,mBAAmB,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,oBAAoB,CAAC;CACnC,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,oBAAoB,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GACxB,SAAS,CAAC,aAAa,GAAG,SAAS,CAAC,GACpC,SAAS,CACP,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,CACvB,CAAC;AAEN,eAAO,MAAM,iBAAiB,EAAE,2BAA2B,CACzD,iBAAiB,EACjB,0BAA0B,CAkB3B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-controller.d.mts","sourceRoot":"","sources":["../../../src/initialization/instances/keyring-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EACb,oBAAoB,EACrB,qCAAqC;AActC,OAAO,KAAK,EAAE,SAAS,EAAE,qCAAqC;AAC9D,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC3B,qCAAqC;AAGtC,OAAO,EAAE,2BAA2B,EAAE,qBAAiB;AA4FvD;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,eAAgB,MAAM,KAAG,SAYpD,CAAC;AAEH,KAAK,mBAAmB,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,oBAAoB,CAAC;CACnC,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,oBAAoB,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GACxB,SAAS,CAAC,aAAa,GAAG,SAAS,CAAC,GACpC,SAAS,CACP,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,CACvB,CAAC;AAEN,eAAO,MAAM,iBAAiB,EAAE,2BAA2B,CACzD,iBAAiB,EACjB,0BAA0B,CAkB3B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-controller.mjs","sourceRoot":"","sources":["../../../src/initialization/instances/keyring-controller.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,eAAe,EACf,SAAS,EACT,SAAS,EACT,YAAY,EACb,qCAAqC;AAEtC,OAAO,EACL,iBAAiB,EAElB,qCAAqC;AACtC,OAAO,EAAE,SAAS,EAAE,4BAA4B;AAIhD;;;;;;GAMG;AACH,MAAM,cAAc,GAClB,CAAC,UAAkB,EAAE,EAAE,CACvB,KAAK,EACH,QAAgB,EAChB,IAAa,EACb,GAA+B,EAC/B,IAAa,EACI,EAAE,CACnB,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE;IACjC,SAAS,EAAE,QAAQ;IACnB,MAAM,EAAE;QACN,UAAU;KACX;CACF,CAAC,CAAC;AAEP;;;;;;GAMG;AACH,MAAM,wBAAwB,GAC5B,CAAC,UAAkB,EAAE,EAAE,CACvB,KAAK,EACH,QAAgB,EAChB,MAAe,EACf,IAAa,EACsB,EAAE,CACrC,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE;IACxC,SAAS,EAAE,QAAQ;IACnB,MAAM,EAAE;QACN,UAAU;KACX;CACF,CAAC,CAAC;AAEP;;;;;;;;;GASG;AACH,MAAM,sBAAsB,GAC1B,CAAC,UAAkB,EAAE,EAAE,CACvB,KAAK,EACH,QAAgB,EAChB,IAAY,EACZ,UAAoB,EACpB,IAA2B,EACH,EAAE,CAC1B,eAAe,CACb,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,IAAI,IAAI;IACN,SAAS,EAAE,QAAQ;IACnB,MAAM,EAAE;QACN,UAAU;KACX;CACF,CACF,CAAC;AAEN;;;;;;GAMG;AACH,MAAM,qBAAqB,GACzB,CAAC,UAAkB,EAAE,EAAE,CACvB,CAAC,KAAa,EAAW,EAAE,CACzB,cAAc,CAAC,KAAK,EAAE;IACpB,SAAS,EAAE,QAAQ;IACnB,MAAM,EAAE;QACN,UAAU;KACX;CACF,CAAC,CAAC;AAEP;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,UAAkB,EAAa,EAAE,CAAC,CAAC;IAClE,OAAO,EAAE,cAAc,CAAC,UAAU,CAAC;IACnC,cAAc;IACd,iBAAiB,EAAE,wBAAwB,CAAC,UAAU,CAAC;IACvD,OAAO;IACP,cAAc;IACd,iBAAiB;IACjB,eAAe,EAAE,sBAAsB,CAAC,UAAU,CAAC;IACnD,cAAc,EAAE,qBAAqB,CAAC,UAAU,CAAC;IACjD,SAAS;IACT,SAAS;IACT,YAAY;CACb,CAAC,CAAC;AAyBH,MAAM,CAAC,MAAM,iBAAiB,GAG1B;IACF,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,CACtC,IAAI,iBAAiB,CAAC;QACpB,KAAK;QACL,SAAS;QACT,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;QAC5C,SAAS,EAAE,CAAC,OAAO,CAAC,SAAS,IAAI,gBAAgB,CAAC,MAAO,CAAC,CAEzD;KACF,CAAC;IACJ,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CACvB,IAAI,SAAS,CAAC;QACZ,SAAS,EAAE,mBAAmB;QAC9B,MAAM;KACP,CAAC;CACL,CAAC","sourcesContent":["import type {\n DetailedEncryptionResult,\n EncryptionKey,\n KeyDerivationOptions,\n} from '@metamask/browser-passworder';\nimport {\n encrypt,\n encryptWithDetail,\n encryptWithKey,\n decrypt,\n decryptWithDetail,\n decryptWithKey,\n isVaultUpdated,\n keyFromPassword,\n importKey,\n exportKey,\n generateSalt,\n} from '@metamask/browser-passworder';\nimport type { Encryptor } from '@metamask/keyring-controller';\nimport {\n KeyringController,\n KeyringControllerMessenger,\n} from '@metamask/keyring-controller';\nimport { Messenger } from '@metamask/messenger';\n\nimport { InitializationConfiguration } from '../types';\n\n/**\n * A factory function for the encrypt method of the browser-passworder library,\n * that encrypts with a given number of iterations.\n *\n * @param iterations - The number of iterations to use for the PBKDF2 algorithm.\n * @returns A function that encrypts with the given number of iterations.\n */\nconst encryptFactory =\n (iterations: number) =>\n async (\n password: string,\n data: unknown,\n key?: EncryptionKey | CryptoKey,\n salt?: string,\n ): Promise<string> =>\n encrypt(password, data, key, salt, {\n algorithm: 'PBKDF2',\n params: {\n iterations,\n },\n });\n\n/**\n * A factory function for the encryptWithDetail method of the browser-passworder library,\n * that encrypts with a given number of iterations.\n *\n * @param iterations - The number of iterations to use for the PBKDF2 algorithm.\n * @returns A function that encrypts with the given number of iterations.\n */\nconst encryptWithDetailFactory =\n (iterations: number) =>\n async (\n password: string,\n object: unknown,\n salt?: string,\n ): Promise<DetailedEncryptionResult> =>\n encryptWithDetail(password, object, salt, {\n algorithm: 'PBKDF2',\n params: {\n iterations,\n },\n });\n\n/**\n * A factory function for the keyFromPassword method of the browser-passworder library,\n * that generates a key from a password and a salt.\n *\n * This factory function overrides the default key derivation options with the specified\n * number of iterations, unless existing key derivation options are passed in.\n *\n * @param iterations - The number of iterations to use for the PBKDF2 algorithm.\n * @returns A function that generates a key with a potentially overriden number of iterations.\n */\nconst keyFromPasswordFactory =\n (iterations: number) =>\n async (\n password: string,\n salt: string,\n exportable?: boolean,\n opts?: KeyDerivationOptions,\n ): Promise<EncryptionKey> =>\n keyFromPassword(\n password,\n salt,\n exportable,\n opts ?? {\n algorithm: 'PBKDF2',\n params: {\n iterations,\n },\n },\n );\n\n/**\n * A factory function for the isVaultUpdated method of the browser-passworder library,\n * that checks if the given vault was encrypted with the given number of iterations.\n *\n * @param iterations - The number of iterations to use for the PBKDF2 algorithm.\n * @returns A function that checks if the vault was encrypted with the given number of iterations.\n */\nconst isVaultUpdatedFactory =\n (iterations: number) =>\n (vault: string): boolean =>\n isVaultUpdated(vault, {\n algorithm: 'PBKDF2',\n params: {\n iterations,\n },\n });\n\n/**\n * A factory function that returns an encryptor with the given number of iterations.\n *\n * The returned encryptor is a wrapper around the browser-passworder library, that\n * calls the encrypt and encryptWithDetail methods with the given number of iterations.\n *\n * @param iterations - The number of iterations to use for the PBKDF2 algorithm.\n * @returns An encryptor set with the given number of iterations.\n */\nexport const encryptorFactory = (iterations: number): Encryptor => ({\n encrypt: encryptFactory(iterations),\n encryptWithKey,\n encryptWithDetail: encryptWithDetailFactory(iterations),\n decrypt,\n decryptWithKey,\n decryptWithDetail,\n keyFromPassword: keyFromPasswordFactory(iterations),\n isVaultUpdated: isVaultUpdatedFactory(iterations),\n importKey,\n exportKey,\n generateSalt,\n});\n\ntype MobileEncryptionKey = {\n key: string;\n lib: string;\n exportable: boolean;\n keyMetadata: KeyDerivationOptions;\n};\n\ntype MobileEncryptionResult = {\n cipher: string;\n iv: string;\n salt?: string;\n lib?: string;\n keyMetadata?: KeyDerivationOptions;\n};\n\nexport type GenericEncryptor =\n | Encryptor<EncryptionKey | CryptoKey>\n | Encryptor<\n MobileEncryptionKey,\n KeyDerivationOptions,\n MobileEncryptionResult\n >;\n\nexport const keyringController: InitializationConfiguration<\n KeyringController,\n KeyringControllerMessenger\n> = {\n name: 'KeyringController',\n init: ({ state, messenger, options }) =>\n new KeyringController({\n state,\n messenger,\n keyringBuilders: options.keyringBuilders,\n keyringV2Builders: options.keyringV2Builders,\n encryptor: (options.encryptor ?? encryptorFactory(600_000)) as Encryptor<\n EncryptionKey | CryptoKey\n >,\n }),\n getMessenger: (parent) =>\n new Messenger({\n namespace: 'KeyringController',\n parent,\n }),\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage-service.cjs","sourceRoot":"","sources":["../../../src/initialization/instances/storage-service.ts"],"names":[],"mappings":";;;AAAA,mDAAgD;AAChD,+DAA2D;AAK9C,QAAA,cAAc,GAGvB;IACF,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,CAC/B,IAAI,gCAAc,CAAC;QACjB,SAAS;QACT,OAAO,EAAE,OAAO,CAAC,OAAO;KACzB,CAAC;IACJ,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CACvB,IAAI,qBAAS,CAAC;QACZ,SAAS,EAAE,gBAAgB;QAC3B,MAAM;KACP,CAAC;CACL,CAAC","sourcesContent":["import { Messenger } from '@metamask/messenger';\nimport { StorageService } from '@metamask/storage-service';\nimport { StorageServiceMessenger } from '@metamask/storage-service';\n\nimport { InitializationConfiguration } from '../types';\n\nexport const storageService: InitializationConfiguration<\n StorageService,\n StorageServiceMessenger\n> = {\n name: 'StorageService',\n init: ({ messenger, options }) =>\n new StorageService({\n messenger,\n storage: options.storage,\n }),\n getMessenger: (parent) =>\n new Messenger({\n namespace: 'StorageService',\n parent,\n }),\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage-service.d.cts","sourceRoot":"","sources":["../../../src/initialization/instances/storage-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,kCAAkC;AAEpE,OAAO,EAAE,2BAA2B,EAAE,qBAAiB;AAEvD,eAAO,MAAM,cAAc,EAAE,2BAA2B,CACtD,cAAc,EACd,uBAAuB,CAaxB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage-service.d.mts","sourceRoot":"","sources":["../../../src/initialization/instances/storage-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,kCAAkC;AAEpE,OAAO,EAAE,2BAA2B,EAAE,qBAAiB;AAEvD,eAAO,MAAM,cAAc,EAAE,2BAA2B,CACtD,cAAc,EACd,uBAAuB,CAaxB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage-service.mjs","sourceRoot":"","sources":["../../../src/initialization/instances/storage-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,4BAA4B;AAChD,OAAO,EAAE,cAAc,EAAE,kCAAkC;AAK3D,MAAM,CAAC,MAAM,cAAc,GAGvB;IACF,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,CAC/B,IAAI,cAAc,CAAC;QACjB,SAAS;QACT,OAAO,EAAE,OAAO,CAAC,OAAO;KACzB,CAAC;IACJ,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CACvB,IAAI,SAAS,CAAC;QACZ,SAAS,EAAE,gBAAgB;QAC3B,MAAM;KACP,CAAC;CACL,CAAC","sourcesContent":["import { Messenger } from '@metamask/messenger';\nimport { StorageService } from '@metamask/storage-service';\nimport { StorageServiceMessenger } from '@metamask/storage-service';\n\nimport { InitializationConfiguration } from '../types';\n\nexport const storageService: InitializationConfiguration<\n StorageService,\n StorageServiceMessenger\n> = {\n name: 'StorageService',\n init: ({ messenger, options }) =>\n new StorageService({\n messenger,\n storage: options.storage,\n }),\n getMessenger: (parent) =>\n new Messenger({\n namespace: 'StorageService',\n parent,\n }),\n};\n"]}
|
/package/dist/initialization/instances/{storage-service.cjs → storage-service/storage-service.cjs}
RENAMED
|
File without changes
|
/package/dist/initialization/instances/{storage-service.mjs → storage-service/storage-service.mjs}
RENAMED
|
File without changes
|