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

Add TEDY #183

Merged
merged 1 commit into from
Nov 25, 2023
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
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;
Loading