Skip to content

Commit

Permalink
Add burnz token fetcher and integrate into supplyFetchers (#381)
Browse files Browse the repository at this point in the history
  • Loading branch information
realdecimalist authored Nov 5, 2024
1 parent 145261d commit 6cd07a1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
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;

0 comments on commit 6cd07a1

Please sign in to comment.