From d61c1e7fbc65469a6183601693911de28e3a6aa3 Mon Sep 17 00:00:00 2001 From: eric821031 <103044393+eric821031@users.noreply.github.com> Date: Sat, 25 Nov 2023 03:34:45 -0500 Subject: [PATCH] Add LCC Token (#181) * add Token LCC Add import lccFetcher from ""./tokens/lcc; on line 43 * Add LCC Token * Update index.ts * Update index.ts --- src/index.ts | 2 ++ src/tokens/lcc.ts | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 src/tokens/lcc.ts diff --git a/src/index.ts b/src/index.ts index 4f136e3c..a14b0270 100644 --- a/src/index.ts +++ b/src/index.ts @@ -40,6 +40,7 @@ import iethFetcher from "./tokens/ieth"; import indyFetcher from "./tokens/indy"; import iusdFetcher from "./tokens/iusd"; import jpgFetcher from "./tokens/jpg"; +import lccFetcher from "./tokens/lcc"; import lifiFetcher from "./tokens/lifi"; import lobsterFetcher from "./tokens/lobster"; import liqwidFetcher from "./tokens/lq"; @@ -225,4 +226,5 @@ export const supplyFetchers: Record = { bookFetcher, "961f2cac0bb1967d74691af179350c1e1062c7298d1f7be1e4696e31": derpFetcher, "2d587111358801114f04df83dc0015de0a740b462b75cce5170fc935434749": cgiFetcher, + "03c2eb4f942703fa965df42ba8ac57e27c5e86802d058da63f4d888b4c4343": lccFetcher, }; diff --git a/src/tokens/lcc.ts b/src/tokens/lcc.ts new file mode 100644 index 00000000..97bdab91 --- /dev/null +++ b/src/tokens/lcc.ts @@ -0,0 +1,19 @@ +import { defaultFetcherOptions, SupplyFetcher } from "../types"; +import { getAmountInAddresses, getBlockFrostInstance } from "../utils"; + +const LCC = "03c2eb4f942703fa965df42ba8ac57e27c5e86802d058da63f4d888b4c4343"; + +const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => { + const blockFrost = getBlockFrostInstance(options); + const total = 450_000_000; + const treasuryRaw = await getAmountInAddresses(blockFrost, LCC, [ + "stake1ux8xh8xc4clp7nl7qplnz48y5za46dez0wmnr5z5fkrk8ks4ncp2w", + ]); + const treasury = Number(treasuryRaw); + return { + circulating: (total - treasury).toString(), + total: total.toString(), + }; +}; + +export default fetcher;