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

Commit

Permalink
Add CNCT (Coinecta) (#204)
Browse files Browse the repository at this point in the history
* coinecta circulating

* add cnct to index
  • Loading branch information
Luivatra authored Dec 13, 2023
1 parent 9a79ee0 commit ee8c94b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
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 @@ -252,4 +253,5 @@ export const supplyFetchers: Record<string, SupplyFetcher> = {
ace2ea0fe142a3687acf86f55bcded860a920864163ee0d3dda8b60252414b4552:
rakerFetcher,
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;

0 comments on commit ee8c94b

Please sign in to comment.