From 1c9c62f5a6b909ed7738e23507fb806bc6d42107 Mon Sep 17 00:00:00 2001 From: bravedawgs Date: Wed, 8 Nov 2023 07:29:54 +0600 Subject: [PATCH] Updated CC --- src/index.ts | 4 +++- src/tokens/jelly.ts | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 src/tokens/jelly.ts diff --git a/src/index.ts b/src/index.ts index 33c54ae7..810e9465 100644 --- a/src/index.ts +++ b/src/index.ts @@ -79,6 +79,7 @@ import wozFetcher from "./tokens/woz"; import wrtFetcher from "./tokens/wrt"; import xvyfiFetcher from "./tokens/xvyfi"; import yummiFetcher from "./tokens/yummi"; +import jellyFetcher from "./tokens/jelly"; import { SupplyFetcher } from "./types"; export * from "./types"; @@ -222,5 +223,6 @@ export const supplyFetchers: Record = { snepeFetcher, "51a5e236c4de3af2b8020442e2a26f454fda3b04cb621c1294a0ef34424f4f4b": bookFetcher, - "961f2cac0bb1967d74691af179350c1e1062c7298d1f7be1e4696e31": derpFetcher, + "961f2cac0bb1967d74691af179350c1e1062c7298d1f7be1e4696e31": derpFetcher, + "5c1c91a65bedac56f245b8184b5820ced3d2f1540e521dc1060fa6834a454c4c59": jellyFetcher, }; diff --git a/src/tokens/jelly.ts b/src/tokens/jelly.ts new file mode 100644 index 00000000..32f3cbb7 --- /dev/null +++ b/src/tokens/jelly.ts @@ -0,0 +1,22 @@ +import { defaultFetcherOptions, SupplyFetcher } from "../types"; +import { getAmountInAddresses, getBlockFrostInstance } from "../utils"; + +const JELLY = "5c1c91a65bedac56f245b8184b5820ced3d2f1540e521dc1060fa6834a454c4c59"; + +const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => { + const blockFrost = getBlockFrostInstance(options); + const total = 39_000_000; + const treasuryRaw = await getAmountInAddresses(blockFrost, JELLY, [ + "stake1u8yjy30a56m2838092c37spgjnnhpunttpdkzlvrr86kr8crgcuhe", // $jelly.pool Jelly Chunk Reserve Pool + "addr1w8qmxkacjdffxah0l3qg8hq2pmvs58q8lcy42zy9kda2ylc6dy5r4", // Burn wallet + ]); + + const treasury = Number(treasuryRaw) / 1e6; + + return { + circulating: (total - treasury).toString(), + total: total.toString(), + }; +}; + +export default fetcher;