Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add burnz token fetcher and integrate into supplyFetchers #381

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import boonFetcher from "./tokens/boon";
import boxFetcher from "./tokens/box";
import bptFetcher from "./tokens/bpt";
import btnFetcher from "./tokens/btn";
import burnzFetcher from "./tokens/burnz";
import bubbleFetcher from "./tokens/bubble";
import c3Fetcher from "./tokens/c3";
import c4Fetcher from "./tokens/c4";
Expand Down Expand Up @@ -481,4 +482,5 @@ export const supplyFetchers: Record<string, SupplyFetcher> = {
piguFetcher,
"30d2ebdb2fec06142ee84e5120c2717b4d68a91bffd924420d94ddea43484950":
chipFetcher,
"86340a33acf14b5c967584c9a20e984695ab3289696d138048f572be4255524e5a": burnzFetcher,
};
21 changes: 21 additions & 0 deletions src/tokens/burnz.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";

const TOKEN =
"86340a33acf14b5c967584c9a20e984695ab3289696d138048f572be4255524e5a";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const total = 1_000_000_000;
const treasuryRaw = await getAmountInAddresses(blockFrost, TOKEN, [
"addr1qxc6u2d5ppeuhg7tkj5quf3csxp2022g98az65hpad9m6yreuxes6p3hhg880tegsg95xqwek6srgac5jq04x9rcm2qq6a6md7", // TREASURY
"addr1qxtqu8cvxjxrh035s6f9k698rglpguz4xs8gw5edja2z6fp4x79ct53d3gpl0g3w4eyvnlv09nkjqvrkspfxjza3h0eqy34flk", // team
]);
const treasury = Number(treasuryRaw);
return {
circulating: (total - treasury).toString(),
total: total.toString(),
};
};

export default fetcher;
Loading