diff --git a/src/index.ts b/src/index.ts index d1002c3c..12bf6589 100644 --- a/src/index.ts +++ b/src/index.ts @@ -28,6 +28,7 @@ import cblpFetcher from "./tokens/cblp"; import cbtcFetcher from "./tokens/cbtc"; import cerraFetcher from "./tokens/cerra"; import cgiFetcher from "./tokens/cgi"; +import chadFetcher from "./tokens/chad"; import charlyFetcher from "./tokens/charly"; import chipFetcher from "./tokens/chip"; import clapFetcher from "./tokens/clap"; @@ -360,4 +361,5 @@ export const supplyFetchers: Record = { "30d2ebdb2fec06142ee84e5120c2717b4d68a91bffd924420d94ddea43484950": chipFetcher, "86340a33acf14b5c967584c9a20e984695ab3289696d138048f572be4255524e5a": burnzFetcher, "766fce8055f39d40fcfc19721677b3deb2e7846950ae08dce757f1e753554741522042555348": sugarBushFetcher, + "97075bf380e65f3c63fb733267adbb7d42eec574428a754d2abca55b436861726c6573207468652043686164": chadFetcher, }; diff --git a/src/tokens/chad.ts b/src/tokens/chad.ts new file mode 100644 index 00000000..81b29f5c --- /dev/null +++ b/src/tokens/chad.ts @@ -0,0 +1,25 @@ +import { defaultFetcherOptions, SupplyFetcher } from "../types"; +import { getAmountInAddresses, getBlockFrostInstance } from "../utils"; + +const CHAD = "97075bf380e65f3c63fb733267adbb7d42eec574428a754d2abca55b436861726c6573207468652043686164"; + +const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => { + const blockFrost = getBlockFrostInstance(options); + const total = 1_000_000_000; + const treasuryRaw = await getAmountInAddresses(blockFrost, CHAD, [ + "stake1uy0sgxfm8pzrkru97rg8pteu4j05c6dgwuwzemhg6k8te3g6h5due", // treasury + ]); + + const burnRaw = await getAmountInAddresses(blockFrost, CHAD, [ + "addr1w8qmxkacjdffxah0l3qg8hq2pmvs58q8lcy42zy9kda2ylc6dy5r4", // burn wallet + ]); + + const treasury = Number(treasuryRaw); + const burn = Number(burnRaw); + return { + circulating: (total - treasury - burn).toString(), + total: (total - burn).toString(), + }; +}; + +export default fetcher;