diff --git a/scripts/networks.js b/scripts/networks.js index 517892f094..d63072f920 100644 --- a/scripts/networks.js +++ b/scripts/networks.js @@ -17,6 +17,7 @@ async function fetchData() { badgeURL } testnet + internal opStack defaultExplorer { url diff --git a/src/core/types/chains.ts b/src/core/types/chains.ts index 9b7dcd8f6d..f416f0874e 100644 --- a/src/core/types/chains.ts +++ b/src/core/types/chains.ts @@ -263,6 +263,7 @@ export interface BackendNetwork { badgeURL: string; }; testnet: boolean; + internal: boolean; opStack: boolean; defaultExplorer: { url: string; diff --git a/src/core/utils/backendNetworks.ts b/src/core/utils/backendNetworks.ts index 740943eab9..ac42861792 100644 --- a/src/core/utils/backendNetworks.ts +++ b/src/core/utils/backendNetworks.ts @@ -3,6 +3,9 @@ import { mainnet } from 'viem/chains'; import { BackendNetwork } from '../types/chains'; +const INTERNAL_BUILD = process.env.INTERNAL_BUILD === 'true'; +const IS_DEV = process.env.IS_DEV === 'true'; + const proxyBackendNetworkRpcEndpoint = (endpoint: string) => { return `${endpoint}${process.env.RPC_PROXY_API_KEY}`; }; @@ -47,5 +50,8 @@ export function transformBackendNetworksToChains( if (!networks) { return []; } - return networks.map((network) => transformBackendNetworkToChain(network)); + // include all networks for internal builds, otherwise filter out flagged as internal + return networks + .filter((network) => !network.internal || INTERNAL_BUILD || IS_DEV) + .map((network) => transformBackendNetworkToChain(network)); }