@metamask-previews/network-controller 23.2.0-preview-cabccf7 → 23.2.0-preview-7a1bf6a5

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
@@ -10,7 +10,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
10
10
  ### Added
11
11
 
12
12
  - Add optional `getBlockTrackerOptions` argument to NetworkController constructor ([#5702](https://github.com/MetaMask/core/pull/5702))
13
- - Add Monad Testnet as default network ([#5724](https://github.com/MetaMask/core/pull/5724))
14
13
 
15
14
  ### Changed
16
15
 
@@ -161,35 +161,25 @@ function getDefaultInfuraNetworkConfigurationsByChainId() {
161
161
  * @returns The `networkConfigurationsByChainId` object of all custom networks.
162
162
  */
163
163
  function getDefaultCustomNetworkConfigurationsByChainId() {
164
- return Object.values(controller_utils_1.CustomNetworkType).reduce((obj, customNetworkType) => {
165
- const chainId = controller_utils_1.ChainId[customNetworkType];
166
- const { ticker, rpcPrefs } = controller_utils_1.BUILT_IN_NETWORKS[customNetworkType];
167
- // It converts client id to upper case and replace '-' with '_'
168
- // to match the key in BUILT_IN_CUSTOM_NETWORKS_RPC
169
- // e.g. 'megaeth-testnet' to 'MEGAETH_TESTNET'
170
- // e.g. 'monad-testnet' to 'MONAD_TESTNET'
171
- // TODO: Refactor controller-utils to use the same format as others
172
- const rpcEndpointUrlKey = customNetworkType
173
- .toUpperCase()
174
- .replace('-', '_');
175
- const networkConfiguration = {
164
+ const { ticker, rpcPrefs } = controller_utils_1.BUILT_IN_NETWORKS[controller_utils_1.BuiltInNetworkName.MegaETHTestnet];
165
+ return {
166
+ [controller_utils_1.ChainId[controller_utils_1.BuiltInNetworkName.MegaETHTestnet]]: {
176
167
  blockExplorerUrls: [rpcPrefs.blockExplorerUrl],
177
- chainId: controller_utils_1.ChainId[customNetworkType],
168
+ chainId: controller_utils_1.ChainId[controller_utils_1.BuiltInNetworkName.MegaETHTestnet],
178
169
  defaultRpcEndpointIndex: 0,
179
170
  defaultBlockExplorerUrlIndex: 0,
180
- name: controller_utils_1.NetworkNickname[customNetworkType],
171
+ name: controller_utils_1.NetworkNickname[controller_utils_1.BuiltInNetworkName.MegaETHTestnet],
181
172
  nativeCurrency: ticker,
182
173
  rpcEndpoints: [
183
174
  {
184
175
  failoverUrls: [],
185
- networkClientId: customNetworkType,
176
+ networkClientId: controller_utils_1.BuiltInNetworkName.MegaETHTestnet,
186
177
  type: RpcEndpointType.Custom,
187
- url: controller_utils_1.BUILT_IN_CUSTOM_NETWORKS_RPC[rpcEndpointUrlKey],
178
+ url: controller_utils_1.BUILT_IN_CUSTOM_NETWORKS_RPC.MEGAETH_TESTNET,
188
179
  },
189
180
  ],
190
- };
191
- return { ...obj, [chainId]: networkConfiguration };
192
- }, {});
181
+ },
182
+ };
193
183
  }
194
184
  /**
195
185
  * Constructs properties for the NetworkController state whose values will be