Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Create peepee.ts #221

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/tokens/peepee.ts
Original file line number Diff line number Diff line change
@@ -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;