@metamask-previews/wallet 8.1.0-preview-0dfe3b334 → 8.1.0-preview-d548cc9a9
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 +6 -0
- package/dist/initialization/defaults.cjs.map +1 -1
- package/dist/initialization/defaults.d.cts +10 -1
- package/dist/initialization/defaults.d.cts.map +1 -1
- package/dist/initialization/defaults.d.mts +10 -1
- package/dist/initialization/defaults.d.mts.map +1 -1
- package/dist/initialization/defaults.mjs.map +1 -1
- package/dist/initialization/instances/network-controller/network-controller.cjs +3 -0
- package/dist/initialization/instances/network-controller/network-controller.cjs.map +1 -1
- package/dist/initialization/instances/network-controller/network-controller.d.cts.map +1 -1
- package/dist/initialization/instances/network-controller/network-controller.d.mts.map +1 -1
- package/dist/initialization/instances/network-controller/network-controller.mjs +3 -0
- package/dist/initialization/instances/network-controller/network-controller.mjs.map +1 -1
- package/dist/initialization/instances/network-controller/types.cjs.map +1 -1
- package/dist/initialization/instances/network-controller/types.d.cts +6 -0
- package/dist/initialization/instances/network-controller/types.d.cts.map +1 -1
- package/dist/initialization/instances/network-controller/types.d.mts +6 -0
- package/dist/initialization/instances/network-controller/types.d.mts.map +1 -1
- package/dist/initialization/instances/network-controller/types.mjs.map +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **BREAKING:** Wire analytics into the default `NetworkController` initialization ([#9270](https://github.com/MetaMask/core/pull/9270))
|
|
13
|
+
- Adds a required `instanceOptions.networkController.analyticsOptions` option (`isRpcEndpointUrlPublic` and `rpcServiceEventsSampleRate`) that the controller uses to emit `RPC Service Unavailable` and `RPC Service Degraded` events.
|
|
14
|
+
- The `Wallet` root messenger now requires the `AnalyticsController:getState` and `AnalyticsController:trackEvent` actions. Consumers must register handlers for them on the root messenger; a consumer that does not use analytics can register handlers that do nothing.
|
|
15
|
+
|
|
10
16
|
## [8.1.0]
|
|
11
17
|
|
|
12
18
|
### Changed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.cjs","sourceRoot":"","sources":["../../src/initialization/defaults.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"defaults.cjs","sourceRoot":"","sources":["../../src/initialization/defaults.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,6EAA8D;AAGrD,sDAAqB","sourcesContent":["import type {\n AnalyticsControllerGetStateAction,\n AnalyticsControllerTrackEventAction,\n} from '@metamask/analytics-controller';\nimport type {\n ActionConstraint,\n EventConstraint,\n Messenger,\n MessengerActions,\n MessengerEvents,\n} from '@metamask/messenger';\n\nimport * as defaultConfigurations from './instances/index.js';\nimport type { InitializationConfiguration, InstanceState } from './types.js';\n\nexport { defaultConfigurations };\n\n/**\n * Utility type for inferring and extracting an instance type from an initialization configuration.\n */\ntype ExtractInstance<Config> =\n Config extends InitializationConfiguration<\n infer Instance,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n infer _Messenger\n >\n ? Instance\n : never;\n\n/**\n * Utility type for inferring and extracting an instance messenger type from an initialization configuration.\n */\ntype ExtractInstanceMessenger<Config> =\n Config extends InitializationConfiguration<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n infer _Instance,\n infer InferredMessenger\n >\n ? InferredMessenger\n : never;\n\n/**\n * Utility type for inferring and extracting the name of an instance from an initialization configuration.\n */\ntype ExtractName<Config> =\n ExtractInstance<Config> extends { name: infer Name extends string }\n ? Name\n : never;\n\ntype DefaultConfigs = typeof defaultConfigurations;\n\ntype AllDefaultMessengers = ExtractInstanceMessenger<\n DefaultConfigs[keyof DefaultConfigs]\n>;\n\nexport type DefaultInstances = {\n [Key in keyof DefaultConfigs as ExtractName<\n DefaultConfigs[Key]\n >]: ExtractInstance<DefaultConfigs[Key]>;\n};\n\n/**\n * `NetworkController` calls `AnalyticsController:getState` and\n * `AnalyticsController:trackEvent` to emit RPC service analytics. `Wallet` does\n * not own an `AnalyticsController`, so these are declared explicitly here: any\n * consumer that constructs a `Wallet` must register handlers for them on the\n * root messenger (a consumer that does not use analytics can register handlers\n * that do nothing).\n */\nexport type DefaultActions =\n | MessengerActions<AllDefaultMessengers>\n | AnalyticsControllerGetStateAction\n | AnalyticsControllerTrackEventAction;\n\nexport type DefaultEvents = MessengerEvents<AllDefaultMessengers>;\n\nexport type RootMessenger<\n AllowedActions extends ActionConstraint,\n AllowedEvents extends EventConstraint,\n> = Messenger<'Root', AllowedActions, AllowedEvents>;\n\nexport type DefaultState = {\n [Key in keyof DefaultInstances]: InstanceState<DefaultInstances[Key]>;\n};\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AnalyticsControllerGetStateAction, AnalyticsControllerTrackEventAction } from "@metamask/analytics-controller";
|
|
1
2
|
import type { ActionConstraint, EventConstraint, Messenger, MessengerActions, MessengerEvents } from "@metamask/messenger";
|
|
2
3
|
import * as defaultConfigurations from "./instances/index.cjs";
|
|
3
4
|
import type { InitializationConfiguration, InstanceState } from "./types.cjs";
|
|
@@ -21,7 +22,15 @@ type AllDefaultMessengers = ExtractInstanceMessenger<DefaultConfigs[keyof Defaul
|
|
|
21
22
|
export type DefaultInstances = {
|
|
22
23
|
[Key in keyof DefaultConfigs as ExtractName<DefaultConfigs[Key]>]: ExtractInstance<DefaultConfigs[Key]>;
|
|
23
24
|
};
|
|
24
|
-
|
|
25
|
+
/**
|
|
26
|
+
* `NetworkController` calls `AnalyticsController:getState` and
|
|
27
|
+
* `AnalyticsController:trackEvent` to emit RPC service analytics. `Wallet` does
|
|
28
|
+
* not own an `AnalyticsController`, so these are declared explicitly here: any
|
|
29
|
+
* consumer that constructs a `Wallet` must register handlers for them on the
|
|
30
|
+
* root messenger (a consumer that does not use analytics can register handlers
|
|
31
|
+
* that do nothing).
|
|
32
|
+
*/
|
|
33
|
+
export type DefaultActions = MessengerActions<AllDefaultMessengers> | AnalyticsControllerGetStateAction | AnalyticsControllerTrackEventAction;
|
|
25
34
|
export type DefaultEvents = MessengerEvents<AllDefaultMessengers>;
|
|
26
35
|
export type RootMessenger<AllowedActions extends ActionConstraint, AllowedEvents extends EventConstraint> = Messenger<'Root', AllowedActions, AllowedEvents>;
|
|
27
36
|
export type DefaultState = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.cts","sourceRoot":"","sources":["../../src/initialization/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,4BAA4B;AAE7B,OAAO,KAAK,qBAAqB,8BAA6B;AAC9D,OAAO,KAAK,EAAE,2BAA2B,EAAE,aAAa,EAAE,oBAAmB;AAE7E,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC;;GAEG;AACH,KAAK,eAAe,CAAC,MAAM,IACzB,MAAM,SAAS,2BAA2B,CACxC,MAAM,QAAQ,EAEd,MAAM,UAAU,CACjB,GACG,QAAQ,GACR,KAAK,CAAC;AAEZ;;GAEG;AACH,KAAK,wBAAwB,CAAC,MAAM,IAClC,MAAM,SAAS,2BAA2B,CAExC,MAAM,SAAS,EACf,MAAM,iBAAiB,CACxB,GACG,iBAAiB,GACjB,KAAK,CAAC;AAEZ;;GAEG;AACH,KAAK,WAAW,CAAC,MAAM,IACrB,eAAe,CAAC,MAAM,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,IAAI,SAAS,MAAM,CAAA;CAAE,GAC/D,IAAI,GACJ,KAAK,CAAC;AAEZ,KAAK,cAAc,GAAG,OAAO,qBAAqB,CAAC;AAEnD,KAAK,oBAAoB,GAAG,wBAAwB,CAClD,cAAc,CAAC,MAAM,cAAc,CAAC,C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I,WAAW,CACzC,cAAc,CAAC,GAAG,CAAC,CACpB,GAAG,eAAe,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;CACzC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GACtB,gBAAgB,CAAC,oBAAoB,CAAC,GACtC,iCAAiC,GACjC,mCAAmC,CAAC;AAExC,MAAM,MAAM,aAAa,GAAG,eAAe,CAAC,oBAAoB,CAAC,CAAC;AAElE,MAAM,MAAM,aAAa,CACvB,cAAc,SAAS,gBAAgB,EACvC,aAAa,SAAS,eAAe,IACnC,SAAS,CAAC,MAAM,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;AAErD,MAAM,MAAM,YAAY,GAAG;KACxB,GAAG,IAAI,MAAM,gBAAgB,GAAG,aAAa,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;CACtE,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AnalyticsControllerGetStateAction, AnalyticsControllerTrackEventAction } from "@metamask/analytics-controller";
|
|
1
2
|
import type { ActionConstraint, EventConstraint, Messenger, MessengerActions, MessengerEvents } from "@metamask/messenger";
|
|
2
3
|
import * as defaultConfigurations from "./instances/index.mjs";
|
|
3
4
|
import type { InitializationConfiguration, InstanceState } from "./types.mjs";
|
|
@@ -21,7 +22,15 @@ type AllDefaultMessengers = ExtractInstanceMessenger<DefaultConfigs[keyof Defaul
|
|
|
21
22
|
export type DefaultInstances = {
|
|
22
23
|
[Key in keyof DefaultConfigs as ExtractName<DefaultConfigs[Key]>]: ExtractInstance<DefaultConfigs[Key]>;
|
|
23
24
|
};
|
|
24
|
-
|
|
25
|
+
/**
|
|
26
|
+
* `NetworkController` calls `AnalyticsController:getState` and
|
|
27
|
+
* `AnalyticsController:trackEvent` to emit RPC service analytics. `Wallet` does
|
|
28
|
+
* not own an `AnalyticsController`, so these are declared explicitly here: any
|
|
29
|
+
* consumer that constructs a `Wallet` must register handlers for them on the
|
|
30
|
+
* root messenger (a consumer that does not use analytics can register handlers
|
|
31
|
+
* that do nothing).
|
|
32
|
+
*/
|
|
33
|
+
export type DefaultActions = MessengerActions<AllDefaultMessengers> | AnalyticsControllerGetStateAction | AnalyticsControllerTrackEventAction;
|
|
25
34
|
export type DefaultEvents = MessengerEvents<AllDefaultMessengers>;
|
|
26
35
|
export type RootMessenger<AllowedActions extends ActionConstraint, AllowedEvents extends EventConstraint> = Messenger<'Root', AllowedActions, AllowedEvents>;
|
|
27
36
|
export type DefaultState = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.mts","sourceRoot":"","sources":["../../src/initialization/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,4BAA4B;AAE7B,OAAO,KAAK,qBAAqB,8BAA6B;AAC9D,OAAO,KAAK,EAAE,2BAA2B,EAAE,aAAa,EAAE,oBAAmB;AAE7E,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC;;GAEG;AACH,KAAK,eAAe,CAAC,MAAM,IACzB,MAAM,SAAS,2BAA2B,CACxC,MAAM,QAAQ,EAEd,MAAM,UAAU,CACjB,GACG,QAAQ,GACR,KAAK,CAAC;AAEZ;;GAEG;AACH,KAAK,wBAAwB,CAAC,MAAM,IAClC,MAAM,SAAS,2BAA2B,CAExC,MAAM,SAAS,EACf,MAAM,iBAAiB,CACxB,GACG,iBAAiB,GACjB,KAAK,CAAC;AAEZ;;GAEG;AACH,KAAK,WAAW,CAAC,MAAM,IACrB,eAAe,CAAC,MAAM,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,IAAI,SAAS,MAAM,CAAA;CAAE,GAC/D,IAAI,GACJ,KAAK,CAAC;AAEZ,KAAK,cAAc,GAAG,OAAO,qBAAqB,CAAC;AAEnD,KAAK,oBAAoB,GAAG,wBAAwB,CAClD,cAAc,CAAC,MAAM,cAAc,CAAC,CACrC,CAAC;AA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,cAAc,CAAC,GAAG,CAAC,CACpB,GAAG,eAAe,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;CACzC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GACtB,gBAAgB,CAAC,oBAAoB,CAAC,GACtC,iCAAiC,GACjC,mCAAmC,CAAC;AAExC,MAAM,MAAM,aAAa,GAAG,eAAe,CAAC,oBAAoB,CAAC,CAAC;AAElE,MAAM,MAAM,aAAa,CACvB,cAAc,SAAS,gBAAgB,EACvC,aAAa,SAAS,eAAe,IACnC,SAAS,CAAC,MAAM,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;AAErD,MAAM,MAAM,YAAY,GAAG;KACxB,GAAG,IAAI,MAAM,gBAAgB,GAAG,aAAa,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;CACtE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.mjs","sourceRoot":"","sources":["../../src/initialization/defaults.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"defaults.mjs","sourceRoot":"","sources":["../../src/initialization/defaults.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,qBAAqB,8BAA6B;AAG9D,OAAO,EAAE,qBAAqB,EAAE,CAAC","sourcesContent":["import type {\n AnalyticsControllerGetStateAction,\n AnalyticsControllerTrackEventAction,\n} from '@metamask/analytics-controller';\nimport type {\n ActionConstraint,\n EventConstraint,\n Messenger,\n MessengerActions,\n MessengerEvents,\n} from '@metamask/messenger';\n\nimport * as defaultConfigurations from './instances/index.js';\nimport type { InitializationConfiguration, InstanceState } from './types.js';\n\nexport { defaultConfigurations };\n\n/**\n * Utility type for inferring and extracting an instance type from an initialization configuration.\n */\ntype ExtractInstance<Config> =\n Config extends InitializationConfiguration<\n infer Instance,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n infer _Messenger\n >\n ? Instance\n : never;\n\n/**\n * Utility type for inferring and extracting an instance messenger type from an initialization configuration.\n */\ntype ExtractInstanceMessenger<Config> =\n Config extends InitializationConfiguration<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n infer _Instance,\n infer InferredMessenger\n >\n ? InferredMessenger\n : never;\n\n/**\n * Utility type for inferring and extracting the name of an instance from an initialization configuration.\n */\ntype ExtractName<Config> =\n ExtractInstance<Config> extends { name: infer Name extends string }\n ? Name\n : never;\n\ntype DefaultConfigs = typeof defaultConfigurations;\n\ntype AllDefaultMessengers = ExtractInstanceMessenger<\n DefaultConfigs[keyof DefaultConfigs]\n>;\n\nexport type DefaultInstances = {\n [Key in keyof DefaultConfigs as ExtractName<\n DefaultConfigs[Key]\n >]: ExtractInstance<DefaultConfigs[Key]>;\n};\n\n/**\n * `NetworkController` calls `AnalyticsController:getState` and\n * `AnalyticsController:trackEvent` to emit RPC service analytics. `Wallet` does\n * not own an `AnalyticsController`, so these are declared explicitly here: any\n * consumer that constructs a `Wallet` must register handlers for them on the\n * root messenger (a consumer that does not use analytics can register handlers\n * that do nothing).\n */\nexport type DefaultActions =\n | MessengerActions<AllDefaultMessengers>\n | AnalyticsControllerGetStateAction\n | AnalyticsControllerTrackEventAction;\n\nexport type DefaultEvents = MessengerEvents<AllDefaultMessengers>;\n\nexport type RootMessenger<\n AllowedActions extends ActionConstraint,\n AllowedEvents extends EventConstraint,\n> = Messenger<'Root', AllowedActions, AllowedEvents>;\n\nexport type DefaultState = {\n [Key in keyof DefaultInstances]: InstanceState<DefaultInstances[Key]>;\n};\n"]}
|
|
@@ -10,6 +10,7 @@ exports.networkController = {
|
|
|
10
10
|
messenger,
|
|
11
11
|
infuraProjectId: options.infuraProjectId,
|
|
12
12
|
failoverUrls: options.failoverUrls,
|
|
13
|
+
analyticsOptions: options.analyticsOptions,
|
|
13
14
|
}),
|
|
14
15
|
getMessenger: (parent) => {
|
|
15
16
|
const networkControllerMessenger = new messenger_1.Messenger({
|
|
@@ -19,6 +20,8 @@ exports.networkController = {
|
|
|
19
20
|
parent.delegate({
|
|
20
21
|
messenger: networkControllerMessenger,
|
|
21
22
|
actions: [
|
|
23
|
+
'AnalyticsController:getState',
|
|
24
|
+
'AnalyticsController:trackEvent',
|
|
22
25
|
'ConnectivityController:getState',
|
|
23
26
|
'RemoteFeatureFlagController:getState',
|
|
24
27
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network-controller.cjs","sourceRoot":"","sources":["../../../../src/initialization/instances/network-controller/network-controller.ts"],"names":[],"mappings":";;;AAAA,mDAAgD;AAChD,qEAGsC;AAIzB,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,YAAY,EAAE,OAAO,CAAC,YAAY;
|
|
1
|
+
{"version":3,"file":"network-controller.cjs","sourceRoot":"","sources":["../../../../src/initialization/instances/network-controller/network-controller.ts"],"names":[],"mappings":";;;AAAA,mDAAgD;AAChD,qEAGsC;AAIzB,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,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;KAC3C,CAAC;IACJ,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE;QACvB,MAAM,0BAA0B,GAC9B,IAAI,qBAAS,CAAC;YACZ,SAAS,EAAE,mBAAmB;YAC9B,MAAM;SACP,CAAC,CAAC;QAEL,MAAM,CAAC,QAAQ,CAAC;YACd,SAAS,EAAE,0BAA0B;YACrC,OAAO,EAAE;gBACP,8BAA8B;gBAC9B,gCAAgC;gBAChC,iCAAiC;gBACjC,sCAAsC;aACvC;YAED,MAAM,EAAE;gBACN,gDAAgD;gBAChD,yCAAyC;aAC1C;SACF,CAAC,CAAC;QAEH,OAAO,0BAA0B,CAAC;IACpC,CAAC;CACF,CAAC","sourcesContent":["import { Messenger } from '@metamask/messenger';\nimport {\n NetworkController,\n NetworkControllerMessenger,\n} from '@metamask/network-controller';\n\nimport { InitializationConfiguration } from '../../types.js';\n\nexport const networkController: InitializationConfiguration<\n NetworkController,\n NetworkControllerMessenger\n> = {\n name: 'NetworkController',\n init: ({ state, messenger, options }) =>\n new NetworkController({\n state,\n messenger,\n infuraProjectId: options.infuraProjectId,\n failoverUrls: options.failoverUrls,\n analyticsOptions: options.analyticsOptions,\n }),\n getMessenger: (parent) => {\n const networkControllerMessenger: NetworkControllerMessenger =\n new Messenger({\n namespace: 'NetworkController',\n parent,\n });\n\n parent.delegate({\n messenger: networkControllerMessenger,\n actions: [\n 'AnalyticsController:getState',\n 'AnalyticsController:trackEvent',\n 'ConnectivityController:getState',\n 'RemoteFeatureFlagController:getState',\n ],\n\n events: [\n // eslint-disable-next-line no-restricted-syntax\n 'RemoteFeatureFlagController:stateChange',\n ],\n });\n\n return networkControllerMessenger;\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network-controller.d.cts","sourceRoot":"","sources":["../../../../src/initialization/instances/network-controller/network-controller.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC3B,qCAAqC;AAEtC,OAAO,EAAE,2BAA2B,EAAE,wBAAuB;AAE7D,eAAO,MAAM,iBAAiB,EAAE,2BAA2B,CACzD,iBAAiB,EACjB,0BAA0B,
|
|
1
|
+
{"version":3,"file":"network-controller.d.cts","sourceRoot":"","sources":["../../../../src/initialization/instances/network-controller/network-controller.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC3B,qCAAqC;AAEtC,OAAO,EAAE,2BAA2B,EAAE,wBAAuB;AAE7D,eAAO,MAAM,iBAAiB,EAAE,2BAA2B,CACzD,iBAAiB,EACjB,0BAA0B,CAmC3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network-controller.d.mts","sourceRoot":"","sources":["../../../../src/initialization/instances/network-controller/network-controller.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC3B,qCAAqC;AAEtC,OAAO,EAAE,2BAA2B,EAAE,wBAAuB;AAE7D,eAAO,MAAM,iBAAiB,EAAE,2BAA2B,CACzD,iBAAiB,EACjB,0BAA0B,
|
|
1
|
+
{"version":3,"file":"network-controller.d.mts","sourceRoot":"","sources":["../../../../src/initialization/instances/network-controller/network-controller.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC3B,qCAAqC;AAEtC,OAAO,EAAE,2BAA2B,EAAE,wBAAuB;AAE7D,eAAO,MAAM,iBAAiB,EAAE,2BAA2B,CACzD,iBAAiB,EACjB,0BAA0B,CAmC3B,CAAC"}
|
|
@@ -7,6 +7,7 @@ export const networkController = {
|
|
|
7
7
|
messenger,
|
|
8
8
|
infuraProjectId: options.infuraProjectId,
|
|
9
9
|
failoverUrls: options.failoverUrls,
|
|
10
|
+
analyticsOptions: options.analyticsOptions,
|
|
10
11
|
}),
|
|
11
12
|
getMessenger: (parent) => {
|
|
12
13
|
const networkControllerMessenger = new Messenger({
|
|
@@ -16,6 +17,8 @@ export const networkController = {
|
|
|
16
17
|
parent.delegate({
|
|
17
18
|
messenger: networkControllerMessenger,
|
|
18
19
|
actions: [
|
|
20
|
+
'AnalyticsController:getState',
|
|
21
|
+
'AnalyticsController:trackEvent',
|
|
19
22
|
'ConnectivityController:getState',
|
|
20
23
|
'RemoteFeatureFlagController:getState',
|
|
21
24
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network-controller.mjs","sourceRoot":"","sources":["../../../../src/initialization/instances/network-controller/network-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,4BAA4B;AAChD,OAAO,EACL,iBAAiB,EAElB,qCAAqC;AAItC,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,YAAY,EAAE,OAAO,CAAC,YAAY;
|
|
1
|
+
{"version":3,"file":"network-controller.mjs","sourceRoot":"","sources":["../../../../src/initialization/instances/network-controller/network-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,4BAA4B;AAChD,OAAO,EACL,iBAAiB,EAElB,qCAAqC;AAItC,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,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;KAC3C,CAAC;IACJ,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE;QACvB,MAAM,0BAA0B,GAC9B,IAAI,SAAS,CAAC;YACZ,SAAS,EAAE,mBAAmB;YAC9B,MAAM;SACP,CAAC,CAAC;QAEL,MAAM,CAAC,QAAQ,CAAC;YACd,SAAS,EAAE,0BAA0B;YACrC,OAAO,EAAE;gBACP,8BAA8B;gBAC9B,gCAAgC;gBAChC,iCAAiC;gBACjC,sCAAsC;aACvC;YAED,MAAM,EAAE;gBACN,gDAAgD;gBAChD,yCAAyC;aAC1C;SACF,CAAC,CAAC;QAEH,OAAO,0BAA0B,CAAC;IACpC,CAAC;CACF,CAAC","sourcesContent":["import { Messenger } from '@metamask/messenger';\nimport {\n NetworkController,\n NetworkControllerMessenger,\n} from '@metamask/network-controller';\n\nimport { InitializationConfiguration } from '../../types.js';\n\nexport const networkController: InitializationConfiguration<\n NetworkController,\n NetworkControllerMessenger\n> = {\n name: 'NetworkController',\n init: ({ state, messenger, options }) =>\n new NetworkController({\n state,\n messenger,\n infuraProjectId: options.infuraProjectId,\n failoverUrls: options.failoverUrls,\n analyticsOptions: options.analyticsOptions,\n }),\n getMessenger: (parent) => {\n const networkControllerMessenger: NetworkControllerMessenger =\n new Messenger({\n namespace: 'NetworkController',\n parent,\n });\n\n parent.delegate({\n messenger: networkControllerMessenger,\n actions: [\n 'AnalyticsController:getState',\n 'AnalyticsController:trackEvent',\n 'ConnectivityController:getState',\n 'RemoteFeatureFlagController:getState',\n ],\n\n events: [\n // eslint-disable-next-line no-restricted-syntax\n 'RemoteFeatureFlagController:stateChange',\n ],\n });\n\n return networkControllerMessenger;\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../../../src/initialization/instances/network-controller/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Hex } from '@metamask/utils';\n\n/**\n * Per-instance options for the wallet's `NetworkController`.\n */\nexport type NetworkControllerInstanceOptions = {\n /**\n * The API key for Infura, used to make requests to Infura.\n */\n infuraProjectId: string;\n /**\n * An optional map of available failover URLs for each chain ID.\n */\n failoverUrls?: Record<Hex, string[]>;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../../../src/initialization/instances/network-controller/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { NetworkControllerAnalyticsOptions } from '@metamask/network-controller';\nimport { Hex } from '@metamask/utils';\n\n/**\n * Per-instance options for the wallet's `NetworkController`.\n */\nexport type NetworkControllerInstanceOptions = {\n /**\n * The API key for Infura, used to make requests to Infura.\n */\n infuraProjectId: string;\n /**\n * An optional map of available failover URLs for each chain ID.\n */\n failoverUrls?: Record<Hex, string[]>;\n /**\n * Configuration for the analytics events the controller emits when an RPC\n * endpoint becomes unavailable or degraded.\n */\n analyticsOptions: NetworkControllerAnalyticsOptions;\n};\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { NetworkControllerAnalyticsOptions } from "@metamask/network-controller";
|
|
1
2
|
import { Hex } from "@metamask/utils";
|
|
2
3
|
/**
|
|
3
4
|
* Per-instance options for the wallet's `NetworkController`.
|
|
@@ -11,5 +12,10 @@ export type NetworkControllerInstanceOptions = {
|
|
|
11
12
|
* An optional map of available failover URLs for each chain ID.
|
|
12
13
|
*/
|
|
13
14
|
failoverUrls?: Record<Hex, string[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Configuration for the analytics events the controller emits when an RPC
|
|
17
|
+
* endpoint becomes unavailable or degraded.
|
|
18
|
+
*/
|
|
19
|
+
analyticsOptions: NetworkControllerAnalyticsOptions;
|
|
14
20
|
};
|
|
15
21
|
//# sourceMappingURL=types.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../../../src/initialization/instances/network-controller/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,wBAAwB;AAEtC;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../../../src/initialization/instances/network-controller/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,qCAAqC;AACtF,OAAO,EAAE,GAAG,EAAE,wBAAwB;AAEtC;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;IACrC;;;OAGG;IACH,gBAAgB,EAAE,iCAAiC,CAAC;CACrD,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { NetworkControllerAnalyticsOptions } from "@metamask/network-controller";
|
|
1
2
|
import { Hex } from "@metamask/utils";
|
|
2
3
|
/**
|
|
3
4
|
* Per-instance options for the wallet's `NetworkController`.
|
|
@@ -11,5 +12,10 @@ export type NetworkControllerInstanceOptions = {
|
|
|
11
12
|
* An optional map of available failover URLs for each chain ID.
|
|
12
13
|
*/
|
|
13
14
|
failoverUrls?: Record<Hex, string[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Configuration for the analytics events the controller emits when an RPC
|
|
17
|
+
* endpoint becomes unavailable or degraded.
|
|
18
|
+
*/
|
|
19
|
+
analyticsOptions: NetworkControllerAnalyticsOptions;
|
|
14
20
|
};
|
|
15
21
|
//# sourceMappingURL=types.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../../../src/initialization/instances/network-controller/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,wBAAwB;AAEtC;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../../../src/initialization/instances/network-controller/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,qCAAqC;AACtF,OAAO,EAAE,GAAG,EAAE,wBAAwB;AAEtC;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;IACrC;;;OAGG;IACH,gBAAgB,EAAE,iCAAiC,CAAC;CACrD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../../../src/initialization/instances/network-controller/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Hex } from '@metamask/utils';\n\n/**\n * Per-instance options for the wallet's `NetworkController`.\n */\nexport type NetworkControllerInstanceOptions = {\n /**\n * The API key for Infura, used to make requests to Infura.\n */\n infuraProjectId: string;\n /**\n * An optional map of available failover URLs for each chain ID.\n */\n failoverUrls?: Record<Hex, string[]>;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../../../src/initialization/instances/network-controller/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { NetworkControllerAnalyticsOptions } from '@metamask/network-controller';\nimport { Hex } from '@metamask/utils';\n\n/**\n * Per-instance options for the wallet's `NetworkController`.\n */\nexport type NetworkControllerInstanceOptions = {\n /**\n * The API key for Infura, used to make requests to Infura.\n */\n infuraProjectId: string;\n /**\n * An optional map of available failover URLs for each chain ID.\n */\n failoverUrls?: Record<Hex, string[]>;\n /**\n * Configuration for the analytics events the controller emits when an RPC\n * endpoint becomes unavailable or degraded.\n */\n analyticsOptions: NetworkControllerAnalyticsOptions;\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/wallet",
|
|
3
|
-
"version": "8.1.0-preview-
|
|
3
|
+
"version": "8.1.0-preview-d548cc9a9",
|
|
4
4
|
"description": "Provides a shared framework for building MetaMask wallets",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ethereum",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@metamask/accounts-controller": "^39.0.5",
|
|
59
59
|
"@metamask/address-book-controller": "^7.1.2",
|
|
60
|
+
"@metamask/analytics-controller": "^1.2.1",
|
|
60
61
|
"@metamask/approval-controller": "^9.0.2",
|
|
61
62
|
"@metamask/base-controller": "^9.1.0",
|
|
62
63
|
"@metamask/browser-passworder": "^6.0.0",
|