@metamask-previews/network-controller 27.0.0-preview-2cd68d1 → 27.0.0-preview-db01d69

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.
@@ -278,6 +278,12 @@ function deriveInfuraNetworkNameFromRpcEndpointUrl(rpcEndpointUrl) {
278
278
  if ((0, controller_utils_1.isInfuraNetworkType)(match.groups.networkName)) {
279
279
  return match.groups.networkName;
280
280
  }
281
+ // Infura URL can be inserted by user manually,
282
+ // in case the network name extra from URL is not mapped to InfuraNetworkType,
283
+ // we should add a fallback mapping here.
284
+ if ((0, utils_1.hasProperty)(constants_1.FALLBACK_INFURA_NETWORK_TYPE_MAPPING, match.groups.networkName)) {
285
+ return constants_1.FALLBACK_INFURA_NETWORK_TYPE_MAPPING[match.groups.networkName];
286
+ }
281
287
  throw new Error(`Unknown Infura network '${match.groups.networkName}'`);
282
288
  }
283
289
  throw new Error('Could not derive Infura network from RPC endpoint URL');