@metamask/network-controller 23.3.0 → 23.5.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 CHANGED
@@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [23.5.0]
11
+
12
+ ### Changed
13
+
14
+ - Remove obsolete `eth_getBlockByNumber` error handling for load balancer errors ([#5808](https://github.com/MetaMask/core/pull/5808))
15
+ - Bump `@metamask/controller-utils` to `^11.9.0` ([#5812](https://github.com/MetaMask/core/pull/5812))
16
+
17
+ ### Fixed
18
+
19
+ - Improved handling of HTTP status codes to prevent unnecessary circuit breaker triggers ([#5798](https://github.com/MetaMask/core/pull/5798), [#5809](https://github.com/MetaMask/core/pull/5809))
20
+ - HTTP 4XX responses (e.g. rate limit errors) will no longer trigger the circuit breaker policy.
21
+
22
+ ## [23.4.0]
23
+
24
+ ### Added
25
+
26
+ - Add Monad Testnet as default network ([#5724](https://github.com/MetaMask/core/pull/5724))
27
+
28
+ ### Changed
29
+
30
+ - Bump `@metamask/controller-utils` to `^11.8.0` ([#5765](https://github.com/MetaMask/core/pull/5765))
31
+
10
32
  ## [23.3.0]
11
33
 
12
34
  ### Added
@@ -829,7 +851,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
829
851
 
830
852
  All changes listed after this point were applied to this package following the monorepo conversion.
831
853
 
832
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/network-controller@23.3.0...HEAD
854
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/network-controller@23.5.0...HEAD
855
+ [23.5.0]: https://github.com/MetaMask/core/compare/@metamask/network-controller@23.4.0...@metamask/network-controller@23.5.0
856
+ [23.4.0]: https://github.com/MetaMask/core/compare/@metamask/network-controller@23.3.0...@metamask/network-controller@23.4.0
833
857
  [23.3.0]: https://github.com/MetaMask/core/compare/@metamask/network-controller@23.2.0...@metamask/network-controller@23.3.0
834
858
  [23.2.0]: https://github.com/MetaMask/core/compare/@metamask/network-controller@23.1.0...@metamask/network-controller@23.2.0
835
859
  [23.1.0]: https://github.com/MetaMask/core/compare/@metamask/network-controller@23.0.0...@metamask/network-controller@23.1.0
@@ -161,24 +161,38 @@ function getDefaultInfuraNetworkConfigurationsByChainId() {
161
161
  * @returns The `networkConfigurationsByChainId` object of all custom networks.
162
162
  */
163
163
  function getDefaultCustomNetworkConfigurationsByChainId() {
164
- const { ticker, rpcPrefs } = controller_utils_1.BUILT_IN_NETWORKS[controller_utils_1.BuiltInNetworkName.MegaETHTestnet];
164
+ // Create the `networkConfigurationsByChainId` objects explicitly,
165
+ // Because it is not always guaranteed that the custom networks are included in the
166
+ // default networks.
165
167
  return {
166
- [controller_utils_1.ChainId[controller_utils_1.BuiltInNetworkName.MegaETHTestnet]]: {
167
- blockExplorerUrls: [rpcPrefs.blockExplorerUrl],
168
- chainId: controller_utils_1.ChainId[controller_utils_1.BuiltInNetworkName.MegaETHTestnet],
169
- defaultRpcEndpointIndex: 0,
170
- defaultBlockExplorerUrlIndex: 0,
171
- name: controller_utils_1.NetworkNickname[controller_utils_1.BuiltInNetworkName.MegaETHTestnet],
172
- nativeCurrency: ticker,
173
- rpcEndpoints: [
174
- {
175
- failoverUrls: [],
176
- networkClientId: controller_utils_1.BuiltInNetworkName.MegaETHTestnet,
177
- type: RpcEndpointType.Custom,
178
- url: controller_utils_1.BUILT_IN_CUSTOM_NETWORKS_RPC.MEGAETH_TESTNET,
179
- },
180
- ],
181
- },
168
+ [controller_utils_1.ChainId['megaeth-testnet']]: getCustomNetworkConfiguration(controller_utils_1.CustomNetworkType['megaeth-testnet']),
169
+ [controller_utils_1.ChainId['monad-testnet']]: getCustomNetworkConfiguration(controller_utils_1.CustomNetworkType['monad-testnet']),
170
+ };
171
+ }
172
+ /**
173
+ * Constructs a `NetworkConfiguration` object by `CustomNetworkType`.
174
+ *
175
+ * @param customNetworkType - The type of the custom network.
176
+ * @returns The `NetworkConfiguration` object.
177
+ */
178
+ function getCustomNetworkConfiguration(customNetworkType) {
179
+ const { ticker, rpcPrefs } = controller_utils_1.BUILT_IN_NETWORKS[customNetworkType];
180
+ const rpcEndpointUrl = controller_utils_1.BUILT_IN_CUSTOM_NETWORKS_RPC[customNetworkType];
181
+ return {
182
+ blockExplorerUrls: [rpcPrefs.blockExplorerUrl],
183
+ chainId: controller_utils_1.ChainId[customNetworkType],
184
+ defaultRpcEndpointIndex: 0,
185
+ defaultBlockExplorerUrlIndex: 0,
186
+ name: controller_utils_1.NetworkNickname[customNetworkType],
187
+ nativeCurrency: ticker,
188
+ rpcEndpoints: [
189
+ {
190
+ failoverUrls: [],
191
+ networkClientId: customNetworkType,
192
+ type: RpcEndpointType.Custom,
193
+ url: rpcEndpointUrl,
194
+ },
195
+ ],
182
196
  };
183
197
  }
184
198
  /**