diff --git a/website/src/pages/en/index.json b/website/src/pages/en/index.json index 3a514cbb1908..3d575aa7a1fc 100644 --- a/website/src/pages/en/index.json +++ b/website/src/pages/en/index.json @@ -72,6 +72,28 @@ "substreams": "Substreams", "firehose": "Firehose", "tokenApi": "Token API" + }, + "tableLegend": { + "subgraphs": { + "basic": "Subgraph Studio (No issuance)", + "full": "The Graph Network (Issuance)" + }, + "substreams": { + "basic": "Base", + "full": "Extended (EVM Only)" + }, + "firehose": { + "basic": "Base", + "full": "Extended (EVM Only)" + }, + "tokenApi": { + "supported": "All endpoints supported" + }, + "icons": { + "checkmark": "Checkmark", + "checkmarks": "Checkmarks" + }, + "legendTitle": "Table Legend" } }, "networkGuides": { diff --git a/website/src/supportedNetworks/NetworksTable.tsx b/website/src/supportedNetworks/NetworksTable.tsx index 8750e9a6b8f5..316709e443a1 100644 --- a/website/src/supportedNetworks/NetworksTable.tsx +++ b/website/src/supportedNetworks/NetworksTable.tsx @@ -11,7 +11,7 @@ import { Text, useDebounce, } from '@edgeandnode/gds' -import { Check, EyeClosed } from '@edgeandnode/gds/icons' +import { Check, Checks, EyeClosed } from '@edgeandnode/gds/icons' import { NetworkIcon } from '@edgeandnode/go' import { Callout, Table } from '@/components' @@ -24,6 +24,13 @@ export function NetworksTable({ networks }: { networks: SupportedNetwork[] }) { const [immediateSearchQuery, setSearchQuery] = useState('') const [immediateShowTestnets, setShowTestnets] = useState(false) + const checkmark = ( + + ) + const checkmarks = ( + + ) + const searchQuery = useDebounce(immediateSearchQuery, 200) const showTestnets = useDebounce(immediateShowTestnets, 200) @@ -58,6 +65,57 @@ export function NetworksTable({ networks }: { networks: SupportedNetwork[] }) {

+ +
{t('index.supportedNetworks.tableHeaders.name')} - - {t('index.supportedNetworks.tableHeaders.id')} - {t('index.supportedNetworks.tableHeaders.subgraphs')} @@ -125,26 +180,44 @@ export function NetworksTable({ networks }: { networks: SupportedNetwork[] }) { className="group/table-row isolate -outline-offset-1 transition hocus-visible-within:bg-space-1600 has-[a:focus-visible]:outline-focus" > - - - - {network.shortName} - - - - - -
- {network.id} +
+ +
+ +
+ {network.shortName} + {network.id} +
+
+ +
- {network.subgraphs ? : null} - {network.substreams ? : null} - {network.firehose ? : null} - {network.tokenApi ? : null} + + {network.subgraphsSupportLevel === 'full' + ? checkmarks + : network.subgraphsSupportLevel === 'basic' + ? checkmark + : null} + + + {network.substreamsSupportLevel === 'full' + ? checkmarks + : network.substreamsSupportLevel === 'basic' + ? checkmark + : null} + + + {network.firehoseSupportLevel === 'full' + ? checkmarks + : network.firehoseSupportLevel === 'basic' + ? checkmark + : null} + + {network.tokenApi ? checkmark : null} ))} diff --git a/website/src/supportedNetworks/utils.ts b/website/src/supportedNetworks/utils.ts index 2de8d153584c..5b64b3b18354 100644 --- a/website/src/supportedNetworks/utils.ts +++ b/website/src/supportedNetworks/utils.ts @@ -1,4 +1,4 @@ -import { NetworksRegistry } from '@pinax/graph-networks-registry' +import { type Network, NetworksRegistry } from '@pinax/graph-networks-registry' // Networks that should use the "mono" icon variant (TODO: add this feature to web3icons?) export const MONO_ICON_NETWORKS = [ @@ -41,6 +41,26 @@ export const getIconVariant = (networkId: string): 'mono' | 'branded' => { return MONO_ICON_NETWORKS.includes(networkId) ? 'mono' : 'branded' } +// Support level for services +export const getSubgraphsSupportLevel = (network: Network) => { + const hasSubgraphs = Boolean(network.services.subgraphs?.length || network.services.sps?.length) + if (!hasSubgraphs) return 'none' + if (network.issuanceRewards) return 'full' + return 'basic' +} +export const getSubstreamsSupportLevel = (network: Network) => { + const substreamCount = network.services.substreams?.length || 0 + if (substreamCount === 0) return 'none' + if (substreamCount >= 2) return 'full' + return 'basic' +} +export const getFirehoseSupportLevel = (network: Network) => { + const firehoseCount = network.services.firehose?.length || 0 + if (firehoseCount === 0) return 'none' + if (firehoseCount >= 2) return 'full' + return 'basic' +} + export async function getSupportedNetworks() { const registry = await NetworksRegistry.fromLatestVersion() return registry.networks @@ -61,6 +81,10 @@ export async function getSupportedNetworks() { substreams, firehose, tokenApi, + rawNetwork: network, + subgraphsSupportLevel: getSubgraphsSupportLevel(network), + substreamsSupportLevel: getSubstreamsSupportLevel(network), + firehoseSupportLevel: getFirehoseSupportLevel(network), }, ] })