Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: update network controller
  • Loading branch information
stanleyyconsensys committed Dec 8, 2025
commit b1ecdef15325439b35ebf2d2a65adc467c61aed9
23 changes: 21 additions & 2 deletions packages/network-controller/src/NetworkController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -824,9 +824,28 @@ function getDefaultInfuraNetworkConfigurationsByChainId(): Record<
Hex,
NetworkConfiguration
> {
const reverseFallbackInfuraNetworkTypeMapping = Object.entries(
FALLBACK_INFURA_NETWORK_TYPE_MAPPING,
).reduce<Record<InfuraNetworkType, string>>(
(reversed, [key, value]) => {
reversed[value] = key;
return reversed;
},
{} as Record<InfuraNetworkType, string>,
);

return Object.values(InfuraNetworkType).reduce<
Record<Hex, NetworkConfiguration>
>((obj, infuraNetworkType) => {
>((obj, _infuraNetworkType) => {
let infuraNetworkType = _infuraNetworkType;
if (
hasProperty(reverseFallbackInfuraNetworkTypeMapping, infuraNetworkType)
) {
infuraNetworkType = reverseFallbackInfuraNetworkTypeMapping[
infuraNetworkType
] as InfuraNetworkType;
}

const chainId = ChainId[infuraNetworkType];

// Skip deprecated network as default network.
Expand All @@ -846,7 +865,7 @@ function getDefaultInfuraNetworkConfigurationsByChainId(): Record<
rpcEndpoints: [
{
failoverUrls: [],
networkClientId: infuraNetworkType,
networkClientId: _infuraNetworkType,
type: RpcEndpointType.Infura,
url: rpcEndpointUrl,
},
Expand Down
Loading