Skip to content
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

Update dependencies to refresh Supported Networks (+ sort them by name) #791

Merged
merged 3 commits into from
Oct 8, 2024
Merged
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
Next Next commit
Sort supported networks by name + unhide Soneium Testnet
  • Loading branch information
benface committed Oct 8, 2024
commit f2d88e0500143bf61c82ea324dcfabdfa46a2401
62 changes: 30 additions & 32 deletions website/src/supportedNetworks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,41 +25,39 @@ export async function getSupportedNetworks() {
)
}

return Array.from(SupportedNetworkMap.values()).flatMap((network) =>
Array.from(network.chains)
.flatMap((chain) => {
const supportedOnStudio = chain.productDeployStatus.studio === ChainProductStatus.ALLOWED
const integrationType = ['evm', 'near', 'cosmos', 'osmosis', 'ar'].includes(chain.network)
? chain.network
: 'substreams'
return Array.from(SupportedNetworkMap.values())
.flatMap((network) =>
Array.from(network.chains)
.flatMap((chain) => {
const supportedOnStudio = chain.productDeployStatus.studio === ChainProductStatus.ALLOWED
const integrationType = ['evm', 'near', 'cosmos', 'osmosis', 'ar'].includes(chain.network)
? chain.network
: 'substreams'

if (
!chain.graphCliName ||
(!supportedOnStudio && integrationType !== 'substreams') ||
chain.uid === 'evm-1946'
) {
return []
}
if (!chain.graphCliName || (!supportedOnStudio && integrationType !== 'substreams')) {
return []
}

const fullySupportedOnNetwork =
network.id === 'evm' && fullySupportedNetworkIds.includes(`eip155:${chain.chainId}`)
const fullySupportedOnNetwork =
network.id === 'evm' && fullySupportedNetworkIds.includes(`eip155:${chain.chainId}`)

return [
{
uid: chain.uid,
name: chain.name,
cliName: chain.graphCliName,
chainId: chain.chainId,
testnet: chain.testnet,
supportedOnStudio,
fullySupportedOnNetwork,
substreams: chain.substreams ?? [],
integrationType,
},
]
})
.filter(Boolean),
)
return [
{
uid: chain.uid,
name: chain.name,
cliName: chain.graphCliName,
chainId: chain.chainId,
testnet: chain.testnet,
supportedOnStudio,
fullySupportedOnNetwork,
substreams: chain.substreams ?? [],
integrationType,
},
]
})
.filter(Boolean),
)
.sort((a, b) => a.name.localeCompare(b.name))
}

export function SupportedNetworksTable({ networks }: { networks: Awaited<ReturnType<typeof getSupportedNetworks>> }) {
Expand Down