Skip to content

Commit

Permalink
internal networks filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSinclair committed Sep 25, 2024
1 parent 817e802 commit f641347
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions scripts/networks.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ async function fetchData() {
badgeURL
}
testnet
internal
opStack
defaultExplorer {
url
Expand Down
1 change: 1 addition & 0 deletions src/core/types/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ export interface BackendNetwork {
badgeURL: string;
};
testnet: boolean;
internal: boolean;
opStack: boolean;
defaultExplorer: {
url: string;
Expand Down
7 changes: 6 additions & 1 deletion src/core/utils/backendNetworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { mainnet } from 'viem/chains';

import { BackendNetwork } from '../types/chains';

const INTERNAL_BUILD = process.env.INTERNAL_BUILD === 'true';

const proxyBackendNetworkRpcEndpoint = (endpoint: string) => {
return `${endpoint}${process.env.RPC_PROXY_API_KEY}`;
};
Expand Down Expand Up @@ -47,5 +49,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)
.map((network) => transformBackendNetworkToChain(network));
}

0 comments on commit f641347

Please sign in to comment.