-
Notifications
You must be signed in to change notification settings - Fork 151
Supported networks table #975
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
base: main
Are you sure you want to change the base?
Conversation
@hayderkg – Can you please add a screenshot to your PR? 🙏 |
"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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌
// Suport level for services | ||
export const getSubgraphsSupportLevel = (network: Network): 'none' | 'basic' | 'full' => { | ||
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): 'none' | 'basic' | 'full' => { | ||
const substreamCount = network.services.substreams?.length || 0 | ||
if (substreamCount === 0) return 'none' | ||
if (substreamCount >= 2) return 'full' | ||
return 'basic' | ||
} | ||
|
||
export const getFirehoseSupportLevel = (network: Network): 'none' | 'basic' | 'full' => { | ||
const firehoseCount = network.services.firehose?.length || 0 | ||
if (firehoseCount === 0) return 'none' | ||
if (firehoseCount >= 2) return 'full' | ||
return 'basic' | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Suport level for services | |
export const getSubgraphsSupportLevel = (network: Network): 'none' | 'basic' | 'full' => { | |
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): 'none' | 'basic' | 'full' => { | |
const substreamCount = network.services.substreams?.length || 0 | |
if (substreamCount === 0) return 'none' | |
if (substreamCount >= 2) return 'full' | |
return 'basic' | |
} | |
export const getFirehoseSupportLevel = (network: Network): 'none' | 'basic' | 'full' => { | |
const firehoseCount = network.services.firehose?.length || 0 | |
if (firehoseCount === 0) return 'none' | |
if (firehoseCount >= 2) return 'full' | |
return 'basic' | |
} | |
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' | |
} |
Or do you feel that the return types are helpful? Don't want to insist, I know there's some subjectivity on that topic... but I truly don't see the point; if someone accidentally changes the type that's returned in the future, I feel like TS will catch it when we actually use the value (e.g. if (network.subgraphsSupportLevel === 'none')
will error if subgraphsSupportLevel
can never be none
). I definitely have a bias for "less code is better", but I swear there are cases where I find return types helpful; I just fail to see this as one of them.
Implements logic to display Check vs double check icons in
NetworksTable
based on service support levels from network registry