KlimaDAO / klimadao

Monorepo for the official KlimaDAO site, dApp, components and design system.
https://klimadao.finance
MIT License
92 stars 72 forks source link

Add supply endpoints for KLIMA and BCT #2377

Closed 0xAurelius closed 1 month ago

0xAurelius commented 2 months ago

What: add REST endpoints to the KlimaDAO app that allow for e.g. CoinGecko or CoinMarketCap to easily query the total supply of KLIMA and BCT. Technically they want both circulating supply and total supply but for both tokens those are basically the same as the supply is fully distributed (not e.g. vested with a timelock)

Why: CMC and CG and similar sites work this way

How: as easy as possible. We used to have endpoints like this on the old site but they were removed.

Expected Outcome:

Testing Criteria:

return the correct value for supply for both BCT and KLIMA, with separate values for total and circulating (that are the same number)

Atmosfearful commented 1 month ago

Great first ticket for you @must-be-carbon

As these are a bit of a one-off, we can just write these as nextjs serverless functions in the app.klimadao.finance application - (that worked well on our old klimadao website as marcus referred to in the ticket above.)

https://nextjs.org/docs/pages/building-your-application/routing/api-routes

It might be overkill, but I suggest creating a Discovery Tree in figma as well, just to follow the process.

jabby09 commented 1 month ago

https://staging-app.klimadao.finance/api/supply?type=circulating&token=bct

https://staging-app.klimadao.finance/api/supply?type=circulating&token=klima

must-be-carbon commented 1 month ago

Prod URLs https://app.klimadao.finance/api/supply?type=circulating&token=bct https://app.klimadao.finance/api/supply?type=circulating&token=klima https://app.klimadao.finance/api/supply?type=total&token=bct https://app.klimadao.finance/api/supply?type=total&token=klima