ethereum-org-website
ethereum-org-website copied to clipboard
Refactor fetchCryptoStats method
Is your feature request related to a problem? Please describe.
- As suggested in https://github.com/ethereum/ethereum-org-website/pull/7122, we should filter down the data for l2 fees to only be the L2 networks we are listing. For example, right now we are getting Metis fees in the current implementation but took them off the L2 page given the current implementation not using Ethereum for DA.
Current implementation in layer-2.tsx:
// Average eth transfer fee from L2's supported by cryptostats API
const feeDataResponse = await getData<FeeDataResponse>(
"https://api.cryptostats.community/api/v1/l2-fees/feeTransferEth?metadata=false"
)
// filtering out L2's we arent listing
const feeData = feeDataResponse.data.filter((l2) => l2.id !== "hermez")
Describe the solution you'd like
- Instead of trying to filter our L2's from this endpoint, we should filter to include only the networks we are listing. Additive instead of subtractive.
Additional context
- To find listed L2 projects check out the layer-2.json file
- Info on L2 fees API being used: https://cryptostats.community/discover/l2-fees
Want to contribute?
We love contributions from the Ethereum community! Please comment on an issue if you're interested in helping out with a PR.