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

Added Tool.ts to remove treasury address from circulating supply. #227

Closed
wants to merge 4 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 @@ -83,6 +83,7 @@ import spfFetcher from "./tokens/spf";
import stableFetcher from "./tokens/stable";
import sundaeFetcher from "./tokens/sundae";
import tedyFetcher from "./tokens/tedy";
import toolFetcher from "./tokens/tool";
import trtlFetcher from "./tokens/trtl";
import utilFetcher from "./tokens/util";
import vnmFetcher from "./tokens/vnm";
Expand Down Expand Up @@ -263,4 +264,5 @@ export const supplyFetchers: Record<string, SupplyFetcher> = {
pugchipFetcher,
c7dcfa416c127f630b263c7e0fe0564430cfa9c56bba43e1a37c6915474f4b4559:
gokeyFetcher,
ac015c38917f306a84748c2d646bed90bdd64421c592163e60702d735453555255: toolFetcher,
};
20 changes: 20 additions & 0 deletions src/tokens/tool.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";

const TOOL = "ac015c38917f306a84748c2d646bed90bdd64421c592163e60702d735453555255";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const total = 1_000_000_000;
const treasuryRaw = await getAmountInAddresses(blockFrost, TOOL, [
"addr1vxndsnat5pgddcaqcddu3epun8gvh42yt4z6ekcr8p58wagnl5ek7", // TOOL TREASURY
]);
const treasury = Number(treasuryRaw);

return {
circulating: (total - treasury).toString(),
total: total.toString(),
};
};

export default fetcher;
Loading