@metamask-previews/network-controller 24.1.0-preview-e85a6854 → 24.1.0-preview-c8856e2
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 +4 -2
- package/dist/NetworkController.cjs +3 -20
- package/dist/NetworkController.cjs.map +1 -1
- package/dist/NetworkController.d.cts +23 -1
- package/dist/NetworkController.d.cts.map +1 -1
- package/dist/NetworkController.d.mts +23 -1
- package/dist/NetworkController.d.mts.map +1 -1
- package/dist/NetworkController.mjs +3 -20
- package/dist/NetworkController.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -10,11 +10,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
10
10
|
### Added
|
|
11
11
|
|
|
12
12
|
- Add two new controller state metadata properties: `includeInStateLogs` and `usedInUi` ([#6525](https://github.com/MetaMask/core/pull/6525))
|
|
13
|
-
- Add `lookupNetwork` option to `initializeProvider`, to allow for skipping the request used to populate metadata for the globally selected network ([#6575](https://github.com/MetaMask/core/pull/6575))
|
|
13
|
+
- Add `lookupNetwork` option to `initializeProvider`, to allow for skipping the request used to populate metadata for the globally selected network ([#6575](https://github.com/MetaMask/core/pull/6575), [#6607](https://github.com/MetaMask/core/pull/6607))
|
|
14
|
+
- If `lookupNetwork` is set to `false`, the function is fully synchronous, and does not return a promise.
|
|
14
15
|
|
|
15
16
|
### Changed
|
|
16
17
|
|
|
17
|
-
- Bump `@metamask/
|
|
18
|
+
- Bump `@metamask/controller-utils` from `^11.12.0` to `^11.14.0` ([#6620](https://github.com/MetaMask/core/pull/6620), [#6629](https://github.com/MetaMask/core/pull/6629))
|
|
19
|
+
- Bump `@metamask/base-controller` from `^8.1.0` to `^8.4.0` ([#6355](https://github.com/MetaMask/core/pull/6355), [#6465](https://github.com/MetaMask/core/pull/6465), [#6632](https://github.com/MetaMask/core/pull/6632))
|
|
18
20
|
- Rephrase "circuit broken" errors so they are more user-friendly ([#6423](https://github.com/MetaMask/core/pull/6423))
|
|
19
21
|
- These are errors produced when a request is made to an RPC endpoint after it returns too many consecutive 5xx responses and the underlying circuit is open.
|
|
20
22
|
- Bump `@metamask/utils` from `^11.4.2` to `^11.8.0` ([#6588](https://github.com/MetaMask/core/pull/6588))
|
|
@@ -565,29 +565,12 @@ class NetworkController extends base_controller_1.BaseController {
|
|
|
565
565
|
}
|
|
566
566
|
return customNetworkClient;
|
|
567
567
|
}
|
|
568
|
-
|
|
569
|
-
* Creates proxies for accessing the global network client and its block
|
|
570
|
-
* tracker. You must call this method in order to use
|
|
571
|
-
* `getProviderAndBlockTracker` (or its replacement,
|
|
572
|
-
* `getSelectedNetworkClient`).
|
|
573
|
-
*
|
|
574
|
-
* @param options - Optional arguments.
|
|
575
|
-
* @param options.lookupNetwork - Usually, metadata for the global network
|
|
576
|
-
* will be populated via a call to `lookupNetwork` after creating the provider
|
|
577
|
-
* and block tracker proxies. This allows for responding to the status of the
|
|
578
|
-
* global network after initializing this controller; however, it requires
|
|
579
|
-
* making a request to the network to do so. In the clients, where controllers
|
|
580
|
-
* are initialized before the UI is shown, this may be undesirable, as it
|
|
581
|
-
* means that if the user has just installed MetaMask, their IP address may be
|
|
582
|
-
* shared with a third party before they have a chance to finish onboarding.
|
|
583
|
-
* You can pass `false` if you'd like to disable this request and call
|
|
584
|
-
* `lookupNetwork` yourself.
|
|
585
|
-
*/
|
|
586
|
-
async initializeProvider({ lookupNetwork = true, } = {}) {
|
|
568
|
+
initializeProvider({ lookupNetwork = true, } = {}) {
|
|
587
569
|
__classPrivateFieldGet(this, _NetworkController_instances, "m", _NetworkController_applyNetworkSelection).call(this, this.state.selectedNetworkClientId);
|
|
588
570
|
if (lookupNetwork) {
|
|
589
|
-
|
|
571
|
+
return this.lookupNetwork();
|
|
590
572
|
}
|
|
573
|
+
return undefined;
|
|
591
574
|
}
|
|
592
575
|
/**
|
|
593
576
|
* Uses a request for the latest block to gather the following information on
|