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

Add $Chad token #395

Closed
wants to merge 5 commits into from
Closed
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 @@ -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";
Expand Down Expand Up @@ -360,4 +361,5 @@ export const supplyFetchers: Record<string, SupplyFetcher> = {
"30d2ebdb2fec06142ee84e5120c2717b4d68a91bffd924420d94ddea43484950": chipFetcher,
"86340a33acf14b5c967584c9a20e984695ab3289696d138048f572be4255524e5a": burnzFetcher,
"766fce8055f39d40fcfc19721677b3deb2e7846950ae08dce757f1e753554741522042555348": sugarBushFetcher,
"97075bf380e65f3c63fb733267adbb7d42eec574428a754d2abca55b436861726c6573207468652043686164": chadFetcher,
};
25 changes: 25 additions & 0 deletions src/tokens/chad.ts
Original file line number Diff line number Diff line change
@@ -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;
Loading