From 9a28e2742d5bde4981a631774c5fce1587dfdcd5 Mon Sep 17 00:00:00 2001 From: Robert Pieter van Leeuwen Date: Mon, 11 Dec 2023 12:15:27 +0100 Subject: [PATCH 1/2] coinecta circulating --- src/tokens/cnct.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/tokens/cnct.ts diff --git a/src/tokens/cnct.ts b/src/tokens/cnct.ts new file mode 100644 index 00000000..dda2a63e --- /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 fetcher: 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 fetcher; From 616f0ac5be234849361924c339f9575ff44b57de Mon Sep 17 00:00:00 2001 From: Robert Pieter van Leeuwen Date: Mon, 11 Dec 2023 12:31:10 +0100 Subject: [PATCH 2/2] add cnct to index --- src/index.ts | 2 ++ src/tokens/cnct.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 441acc56..8b018d8c 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"; @@ -249,4 +250,5 @@ export const supplyFetchers: Record = { bbd0ec94cf9ccc1407b3dbc66bfbbff82ea49718ae4e3dceb817125f24574f524b: workFetcher, a00fdf4fb9ab6c8c2bd1533a2f14855edf12aed5ecbf96d4b5f5b9394334: c4Fetcher, + c27600f3aff3d94043464a33786429b78e6ab9df5e1d23b774acb34c434e4354: cnctFetcher, }; diff --git a/src/tokens/cnct.ts b/src/tokens/cnct.ts index dda2a63e..f9ed95fe 100644 --- a/src/tokens/cnct.ts +++ b/src/tokens/cnct.ts @@ -4,7 +4,7 @@ import { getAmountInAddresses, getBlockFrostInstance } from "../utils"; const CNCT = "c27600f3aff3d94043464a33786429b78e6ab9df5e1d23b774acb34c434e4354"; -const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => { +const cnctFetcher: SupplyFetcher = async (options = defaultFetcherOptions) => { const blockFrost = getBlockFrostInstance(options); const total = 80_000_000; const treasuryRaw = await getAmountInAddresses(blockFrost, CNCT, [ @@ -18,4 +18,4 @@ const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => { }; }; -export default fetcher; +export default cnctFetcher;