From 7a00fc36810c4bcc69f01f09c89222c673ea8900 Mon Sep 17 00:00:00 2001 From: anthgenova <111109421+anthgenova@users.noreply.github.com> Date: Wed, 3 Jan 2024 18:53:40 -0600 Subject: [PATCH] Create peepee.ts --- src/tokens/peepee.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/tokens/peepee.ts diff --git a/src/tokens/peepee.ts b/src/tokens/peepee.ts new file mode 100644 index 00000000..c0e9f6b8 --- /dev/null +++ b/src/tokens/peepee.ts @@ -0,0 +1,29 @@ +import { defaultFetcherOptions, SupplyFetcher } from "../types"; +import { getAmountInAddresses, getBlockFrostInstance } from "../utils"; + +const PEEPEE = "07ccfad78099fef727bfc64de1cf2e684c0872aab3c3bb3bed5e1081"; + +const TREASURY_ADDRESSES = [ + "addr1xxs2jlspt4u48v22rzc3p7pr9mxcnd94c97jn2chrh38g3dq49lqzhte2wc55x93zruzxtkd3x6ttsta9x43w80zw3zsz886m9", // Treasury vault +]; + +const BURN_ADDRESSES = [ + "addr1w8qmxkacjdffxah0l3qg8hq2pmvs58q8lcy42zy9kda2ylc6dy5r4", // $snekburnwallet +]; + +const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => { + const total = 3e9; // 3 billion + const blockFrost = getBlockFrostInstance(options); + const treasury = Number( + await getAmountInAddresses(blockFrost, PEEPEE, TREASURY_ADDRESSES) + ); + const burnt = Number( + await getAmountInAddresses(blockFrost, PEEPEE, BURN_ADDRESSES) + ); + return { + circulating: (total - treasury - burnt).toString(), + total: total.toString(), + }; +}; + +export default fetcher;