interlay / interbtc-squid

Subquid GraphQL schema and indexer for the Interlay and Kintsugi networks
Apache License 2.0
4 stars 7 forks source link

Circulating supply INTR/KINT #94

Closed nud3l closed 1 year ago

nud3l commented 1 year ago

Calculate the circulating supply of INTR and KINT and make it available via an API.

Getting the circulating supply:

const vestingSchedules = await api.query.vesting.vestingSchedules.entries();
const vestingAccounts = vestingSchedules.map(([key, _]) => key.args[0].toHuman());
const escrowLocked = await api.query.escrow.locked.entries();
const escrowAccounts = escrowLocked.map(([key, _]) => key.args[0].toHuman());

Publish the circulating supply via an API (update https://github.com/interlay/interbtc-ui/blob/master/api/supply_info.py)