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

Commit

Permalink
Add TEDY (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mercurial authored Nov 25, 2023
1 parent 34838b9 commit 5645afb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ import societyFetcher from "./tokens/society";
import spfFetcher from "./tokens/spf";
import stableFetcher from "./tokens/stable";
import sundaeFetcher from "./tokens/sundae";
import tedyFetcher from "./tokens/tedy";
import trtlFetcher from "./tokens/trtl";
import utilFetcher from "./tokens/util";
import vnmFetcher from "./tokens/vnm";
Expand Down Expand Up @@ -230,4 +231,5 @@ export const supplyFetchers: Record<string, SupplyFetcher> = {
"961f2cac0bb1967d74691af179350c1e1062c7298d1f7be1e4696e31": derpFetcher,
"2d587111358801114f04df83dc0015de0a740b462b75cce5170fc935434749": cgiFetcher,
"03c2eb4f942703fa965df42ba8ac57e27c5e86802d058da63f4d888b4c4343": lccFetcher,
f6696363e9196289ef4f2b4bf34bc8acca5352cdc7509647afe6888f: tedyFetcher,
};
22 changes: 22 additions & 0 deletions src/tokens/tedy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";

const TEDY = "f6696363e9196289ef4f2b4bf34bc8acca5352cdc7509647afe6888f54454459";
const TREASURY_ADDRESSES = [
"stake1uyjkz4wjew4vd358z4hc20fylty6uzt3vf6h4kxtgpc9naq0ndy2a",
];

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const total = 8e6; // 88 million
const treasury = Number(
await getAmountInAddresses(blockFrost, TEDY, TREASURY_ADDRESSES)
);

return {
circulating: ((total * 1e6 - treasury) / 1e6).toString(),
total: total.toString(),
};
};

export default fetcher;

0 comments on commit 5645afb

Please sign in to comment.