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 VNM circulating supply #106

Merged
merged 1 commit into from
Sep 19, 2023
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 @@ -52,6 +52,7 @@ import snowFetcher from "./tokens/snow";
import societyFetcher from "./tokens/society";
import stableFetcher from "./tokens/stable";
import sundaeFetcher from "./tokens/sundae";
import vnmFetcher from "./tokens/vnm";
import vyfiFetcher from "./tokens/vyfi";
import wmtFetcher from "./tokens/wmt";
import wozFetcher from "./tokens/woz";
Expand Down Expand Up @@ -166,4 +167,5 @@ export const supplyFetchers: Record<string, SupplyFetcher> = {
"1ddcb9c9de95361565392c5bdff64767492d61a96166cb16094e54be4f5054": optFetcher,
b316f8f668aca7359ecc6073475c0c8106239bf87e05a3a1bd5697647856594649:
xvyfiFetcher,
"2d92af60ee429bce238d3fd9f2531b45457301d74dad1bcf3f9d1dca564e4d": vnmFetcher,
};
19 changes: 19 additions & 0 deletions src/tokens/vnm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";

const VNM = "2d92af60ee429bce238d3fd9f2531b45457301d74dad1bcf3f9d1dca564e4d";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const total = 150e6;
const blockFrost = getBlockFrostInstance(options);
const treasuryRaw = await getAmountInAddresses(blockFrost, VNM, [
"stake1u8uv6eaj6ulpymd7ua6ag203fet6ypv9xj7aj8525vnjwyqlqyqsp",
]);
const treasury = Number(treasuryRaw) / 1e4;
return {
circulating: (total - treasury).toString(),
total: total.toString(),
};
};

export default fetcher;
Loading