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

Commit

Permalink
Add Volume (#375)
Browse files Browse the repository at this point in the history
* Create Volume.ts

* Rename Volume.ts to volume.ts

* Update index.ts

* Update volume.ts
  • Loading branch information
NFTKri authored Sep 30, 2024
1 parent fffbc68 commit 91be6c5
Show file tree
Hide file tree
Showing 2 changed files with 22 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 @@ -160,6 +160,7 @@ import usaFetcher from "./tokens/usa";
import utilFetcher from "./tokens/util";
import viperFetcher from "./tokens/viper";
import vnmFetcher from "./tokens/vnm";
import volumeFetcher from "./tokens/volume";
import vyfiFetcher from "./tokens/vyfi";
import wlkFetcher from "./tokens/wlk";
import wmtFetcher from "./tokens/wmt";
Expand Down Expand Up @@ -471,6 +472,7 @@ export const supplyFetchers: Record<string, SupplyFetcher> = {
meemFetcher,
ed5517ccf67c60004355cee3c546c77226cd89a04b3aaeae6a65589e4d6f6d: momFetcher,
b9ae7e3566ad889aae93f500746869e7b3c71480329acd0a9bc01652555341: usaFetcher,
"8d94085182fb206c28850f194defe748e455a104d5ff7466d90f537c": volumeFetcher,
"9d8c863907e6e58823c9af13759e196dbf5da172b7d4ce37d5d1147950494755":
piguFetcher,
};
20 changes: 20 additions & 0 deletions src/tokens/volume.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";

const VOLUME = "8d94085182fb206c28850f194defe748e455a104d5ff7466d90f537c";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const total = 1_000_000_000;
const burnRaw = await getAmountInAddresses(blockFrost, VOLUME, [
"addr1w8qmxkacjdffxah0l3qg8hq2pmvs58q8lcy42zy9kda2ylc6dy5r4", // burn address
]);

const burn = Number(burnRaw);
return {
circulating: (total - burn).toString(),
total: (total - burn).toString(),
};
};

export default fetcher;

0 comments on commit 91be6c5

Please sign in to comment.