Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Add CNCT (Coinecta) #204

Merged
merged 2 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -249,4 +250,5 @@ export const supplyFetchers: Record<string, SupplyFetcher> = {
bbd0ec94cf9ccc1407b3dbc66bfbbff82ea49718ae4e3dceb817125f24574f524b:
workFetcher,
a00fdf4fb9ab6c8c2bd1533a2f14855edf12aed5ecbf96d4b5f5b9394334: c4Fetcher,
c27600f3aff3d94043464a33786429b78e6ab9df5e1d23b774acb34c434e4354: cnctFetcher,
};
21 changes: 21 additions & 0 deletions src/tokens/cnct.ts
Original file line number Diff line number Diff line change
@@ -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;