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 MAYZ circulating supply #128

Closed
wants to merge 2 commits into from
Closed
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
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import iusdFetcher from "./tokens/iusd";
import lifiFetcher from "./tokens/lifi";
import lobsterFetcher from "./tokens/lobster";
import liqwidFetcher from "./tokens/lq";
import mayzFetcher from "./tokens/mayz";
import meldFetcher from "./tokens/meld";
import milkFetcher from "./tokens/milk";
import minFetcher from "./tokens/min";
Expand Down Expand Up @@ -182,4 +183,6 @@ export const supplyFetchers: Record<string, SupplyFetcher> = {
utilFetcher,
a3931691f5c4e65d01c429e473d0dd24c51afdb6daf88e632a6c1e516f7263666178746f6b656e:
factFetcher,
"9e975c76508686eb2d57985dbaea7e3843767a31b4dcf4e99e5646834d41595a":
mayzFetcher,
};
26 changes: 26 additions & 0 deletions src/tokens/mayz.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";

const MAYZ = "9e975c76508686eb2d57985dbaea7e3843767a31b4dcf4e99e5646834d41595a";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);

const total = 1e9;
const treasuryRaw = await getAmountInAddresses(blockFrost, MAYZ, [
"stake1u8yrsk8fn672hr0xhtzslppvnl5jfdgpggn0862yq903u0c7w7e06",
"stake1u9pj8cpxn8xpxk9qlpwsuv08w3mr8pky4r6e7xkwfh20zcqx8dahf",
"stake1uy2pglk3g4lqwnu2d5qwvpkf85zl94eq3s20zgqtxy0n9kqmts464",
"stake1u9eyhfzur7lvgmgmeky0gzqsq80jvu0n9qfqeydff802adsr8sjkn",
"stake1u83dyusvcs4ju9tqts8q20x3k7zakm5tk32pr3t32e09dqg9s2jqw",
"stake1u9gum7a7eanxdh0zmuaytt66xdfz63qshw584mn3xq0j80csu4k48",
"stake1uxhx6z2s9dpmss9e7ks0l065kmd22uwgjzdgl78ygwvl25gm9l8gm",
]);
const treasury = Number(treasuryRaw) / 1e6;
return {
circulating: (total - treasury).toString(),
total: total.toString(),
};
};

export default fetcher;