From 5daeddfa7c1991c7d09162b4bfd21e2eb42f729a Mon Sep 17 00:00:00 2001 From: jdivo10 <17180522+jdivo10@users.noreply.github.com> Date: Wed, 26 Jun 2024 20:40:35 -0400 Subject: [PATCH] Add CTV (#332) * Add $CTV Initial add of ctv.ts and inclusion to index.ts * Clean Up clean up * import fix import fix * Update Index for ctvFetcher Update Index for ctvFetcher * Update index.ts * Update index.ts * Update index.ts * Cleanup * Update index.ts --------- Co-authored-by: ctvvaultkeeper --- src/index.ts | 2 ++ src/tokens/ctv.ts | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/tokens/ctv.ts diff --git a/src/index.ts b/src/index.ts index 7fc9b14a..ef04a2fa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -34,6 +34,7 @@ import cnctFetcher from "./tokens/cnct"; import cnetaFetcher from "./tokens/cneta"; import copiFetcher from "./tokens/copi"; import cswapFetcher from "./tokens/cswap"; +import ctvFetcher from "./tokens/ctv"; import daddyFetcher from "./tokens/daddy"; import danaFetcher from "./tokens/dana"; import derpFetcher from "./tokens/derp"; @@ -305,6 +306,7 @@ export const supplyFetchers: Record = { snepeFetcher, "51a5e236c4de3af2b8020442e2a26f454fda3b04cb621c1294a0ef34424f4f4b": bookFetcher, + "9f452e23804df3040b352b478039357b506ad3b50d2ce0d7cbd5f806435456": ctvFetcher, "5c1c91a65bedac56f245b8184b5820ced3d2f1540e521dc1060fa6834a454c4c59": jellyFetcher, "961f2cac0bb1967d74691af179350c1e1062c7298d1f7be1e4696e312444455250": diff --git a/src/tokens/ctv.ts b/src/tokens/ctv.ts new file mode 100644 index 00000000..5248a107 --- /dev/null +++ b/src/tokens/ctv.ts @@ -0,0 +1,22 @@ +import { defaultFetcherOptions, SupplyFetcher } from "../types"; +import { getAmountInAddresses, getBlockFrostInstance } from "../utils"; + +const CTV = "9f452e23804df3040b352b478039357b506ad3b50d2ce0d7cbd5f806435456"; + +const TREASURY_ADDRESSES = [ + "addr1qyjwhsj246x8nf9evkadxtt0crgg2qjp7mk76zdnm38r0qp397a6yhn3qpzwt3ekwvtmptfxd8427egmlrrmufxvkgtsna5evs", // $ctv4vaults - Vault Seeker NFT Staking Rewards + "addr1qy5u9xul7vfhn3gvk68zzqfxxl6uxy5n7j3kq39aet06f4qh8u90v36crqhfj4stq2vmj98lyqzryd5nfg4j5ca6cjmqq9xzgt", // $ctv_reserve - CTV Community Controlled Reserves +]; + +const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => { + const blockFrost = getBlockFrostInstance(options); + const total = 100_000_000; + const treasury = + Number(await getAmountInAddresses(blockFrost, CTV, TREASURY_ADDRESSES)); + return { + circulating: (total - treasury).toString(), + total: total.toString(), + }; +}; + +export default fetcher; \ No newline at end of file