From 7c6a5c5d26267f39a939cf7f168dcb24449f88f2 Mon Sep 17 00:00:00 2001 From: Clark Alesna Date: Sat, 25 Nov 2023 20:49:26 +0800 Subject: [PATCH] Add TEDY --- src/index.ts | 2 ++ src/tokens/tedy.ts | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/tokens/tedy.ts diff --git a/src/index.ts b/src/index.ts index e4f89574..88c10059 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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"; @@ -230,4 +231,5 @@ export const supplyFetchers: Record = { "961f2cac0bb1967d74691af179350c1e1062c7298d1f7be1e4696e31": derpFetcher, "2d587111358801114f04df83dc0015de0a740b462b75cce5170fc935434749": cgiFetcher, "03c2eb4f942703fa965df42ba8ac57e27c5e86802d058da63f4d888b4c4343": lccFetcher, + f6696363e9196289ef4f2b4bf34bc8acca5352cdc7509647afe6888f: tedyFetcher, }; diff --git a/src/tokens/tedy.ts b/src/tokens/tedy.ts new file mode 100644 index 00000000..910f94d4 --- /dev/null +++ b/src/tokens/tedy.ts @@ -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;