Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added catnip #356

Merged
merged 6 commits into from
Aug 12, 2024
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
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import btnFetcher from "./tokens/btn";
import bubbleFetcher from "./tokens/bubble";
import c3Fetcher from "./tokens/c3";
import c4Fetcher from "./tokens/c4";
import catnipFetcher from "./tokens/catnip";
import catsFetcher from "./tokens/cats";
import catskyFetcher from "./tokens/catsky";
import cblpFetcher from "./tokens/cblp";
Expand Down Expand Up @@ -169,6 +170,8 @@ export * from "./types";
export const supplyFetchers: Record<string, SupplyFetcher> = {
"338c17dffaaefdb97ace91100724836178c3f9dd994a4798a66f546d4d414e4e59":
mannyFetcher,
"633f2e2c5280417c6b76055eda54fc07de984c122c01573ea4a9e8234361746e6970":
catnipFetcher,
"29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c64d494e": minFetcher,
"577f0b1342f8f8f4aed3388b80a8535812950c7a892495c0ecdf0f1e0014df10464c4454":
fldtFetcher,
Expand Down
25 changes: 25 additions & 0 deletions src/tokens/catnip.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 CATNIP = "633f2e2c5280417c6b76055eda54fc07de984c122c01573ea4a9e8234361746e6970";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const total = 900_000_000;
const treasuryRaw = await getAmountInAddresses(blockFrost, CATNIP, [
"stake178lgmc2vgwkvr9dll5keap2fvga7f6sanu0rt0902skr3ms56772e", // Treasury
]);

const burnRaw = await getAmountInAddresses(blockFrost, CATNIP, [
"addr1w8qmxkacjdffxah0l3qg8hq2pmvs58q8lcy42zy9kda2ylc6dy5r4", // burn address
]);

const treasury = Number(treasuryRaw);
const burn = Number(burnRaw);
return {
circulating: (total - treasury - burn).toString(),
total: (total - burn).toString(),
};
};

export default fetcher;
Loading