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

Commit

Permalink
added catnip (#356)
Browse files Browse the repository at this point in the history
* added catnip

* Update index.ts

* Update catnip.ts

* added catnip.ts and inxed

---------

Co-authored-by: NFTKri <[email protected]>
  • Loading branch information
savvycodings and NFTKri authored Aug 12, 2024
1 parent 8675bda commit dbd6ec7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
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;

0 comments on commit dbd6ec7

Please sign in to comment.