From ee8c94bb7a26a6fc734dcf75e97968b5cc0fc40b Mon Sep 17 00:00:00 2001 From: Luivatra Date: Wed, 13 Dec 2023 03:06:09 +0100 Subject: [PATCH] Add CNCT (Coinecta) (#204) * coinecta circulating * add cnct to index --- src/index.ts | 2 ++ src/tokens/cnct.ts | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/tokens/cnct.ts diff --git a/src/index.ts b/src/index.ts index 66d140a7..0e216c6a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -14,6 +14,7 @@ import cgiFetcher from "./tokens/cgi"; import chryFetcher from "./tokens/chry"; import clapFetcher from "./tokens/clap"; import clayFetcher from "./tokens/clay"; +import cnctFetcher from "./tokens/cnct"; import cnetaFetcher from "./tokens/cneta"; import copiFetcher from "./tokens/copi"; import cswapFetcher from "./tokens/cswap"; @@ -252,4 +253,5 @@ export const supplyFetchers: Record = { ace2ea0fe142a3687acf86f55bcded860a920864163ee0d3dda8b60252414b4552: rakerFetcher, a00fdf4fb9ab6c8c2bd1533a2f14855edf12aed5ecbf96d4b5f5b9394334: c4Fetcher, + c27600f3aff3d94043464a33786429b78e6ab9df5e1d23b774acb34c434e4354: cnctFetcher, }; diff --git a/src/tokens/cnct.ts b/src/tokens/cnct.ts new file mode 100644 index 00000000..f9ed95fe --- /dev/null +++ b/src/tokens/cnct.ts @@ -0,0 +1,21 @@ +import { defaultFetcherOptions, SupplyFetcher } from "../types"; +import { getAmountInAddresses, getBlockFrostInstance } from "../utils"; + +const CNCT = + "c27600f3aff3d94043464a33786429b78e6ab9df5e1d23b774acb34c434e4354"; + +const cnctFetcher: SupplyFetcher = async (options = defaultFetcherOptions) => { + const blockFrost = getBlockFrostInstance(options); + const total = 80_000_000; + const treasuryRaw = await getAmountInAddresses(blockFrost, CNCT, [ + "addr1qy0yswstqah6zwxvd5csh0gyty80pcpfqf0ghe24n798r07hdz6r6fp6z96rgh8dvu6yjx8smmany40anu8264r0ek3ssujtw9", + ]); + + const treasury = Number(treasuryRaw) / 10_000; + return { + circulating: (total - treasury).toString(), + total: total.toString(), + }; +}; + +export default cnctFetcher;