Skip to content

fix: code-fence multichain network selector #30722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 5, 2025
Merged
Changes from 3 commits
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
12 changes: 10 additions & 2 deletions ui/selectors/multichain/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,22 @@ export const getIsNonEvmNetworksEnabled = createDeepEqualSelector(

export const getMultichainNetworkConfigurationsByChainId =
createDeepEqualSelector(
///: BEGIN:ONLY_INCLUDE_IF(multichain)
getIsNonEvmNetworksEnabled,
getNonEvmMultichainNetworkConfigurationsByChainId,
///: END:ONLY_INCLUDE_IF
getNetworkConfigurationsByChainId,
getIsNonEvmNetworksEnabled,
(
///: BEGIN:ONLY_INCLUDE_IF(multichain)
isNonEvmNetworksEnabled,
nonEvmNetworkConfigurationsByChainId,
///: END:ONLY_INCLUDE_IF
networkConfigurationsByChainId,
isNonEvmNetworksEnabled,
): [
Record<CaipChainId, InternalMultichainNetworkConfiguration>,
Record<Hex, InternalNetworkConfiguration>,
] => {
///: BEGIN:ONLY_INCLUDE_IF(multichain)
const filteredNonEvmNetworkConfigurationsByChainId: Record<
CaipChainId,
InternalMultichainNetworkConfiguration
Expand All @@ -130,6 +135,7 @@ export const getMultichainNetworkConfigurationsByChainId =
filteredNonEvmNetworkConfigurationsByChainId[SolScope.Mainnet] =
nonEvmNetworkConfigurationsByChainId[SolScope.Mainnet];
}
///: END:ONLY_INCLUDE_IF

// There's a fallback for EVM network names/nicknames, in case the network
// does not have a name/nickname the fallback is the first rpc endpoint url.
Expand All @@ -148,7 +154,9 @@ export const getMultichainNetworkConfigurationsByChainId =
);

const networks = {
///: BEGIN:ONLY_INCLUDE_IF(multichain)
...filteredNonEvmNetworkConfigurationsByChainId,
///: END:ONLY_INCLUDE_IF
...evmNetworks,
};

Expand Down
Loading