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

Commit

Permalink
Add WORK token fetcher (#198)
Browse files Browse the repository at this point in the history
fix: add work token fetcher
  • Loading branch information
workingdeadnft authored Dec 4, 2023
1 parent a70c7ea commit ad5d2ee
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ import vnmFetcher from "./tokens/vnm";
import vyfiFetcher from "./tokens/vyfi";
import wmtFetcher from "./tokens/wmt";
import wolfFetcher from "./tokens/wolf";
import workFetcher from "./tokens/work";
import wozFetcher from "./tokens/woz";
import wrtFetcher from "./tokens/wrt";
import xvyfiFetcher from "./tokens/xvyfi";
Expand Down Expand Up @@ -244,4 +245,6 @@ export const supplyFetchers: Record<string, SupplyFetcher> = {
revuFetcher,
"3744d5e39333c384505214958c4ed66591a052778512e56caf420f624e4542554c41":
nebulaFetcher,
bbd0ec94cf9ccc1407b3dbc66bfbbff82ea49718ae4e3dceb817125f24574f524b:
workFetcher,
};
23 changes: 23 additions & 0 deletions src/tokens/work.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";

const WORK =
"bbd0ec94cf9ccc1407b3dbc66bfbbff82ea49718ae4e3dceb817125f24574f524b";

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

const treasury = await getAmountInAddresses(blockFrost, WORK, [
"stake1u9l0ry8y7a4nl70sjjsg4v76p59sdq43cf7yh9ew9xxp0lg7vyqjw",
"addr1v8d9p0fqrwxkp63nspcv47esgrmjhv9hjfv8z6ptyludlnqhwdlhh",
"addr1vxauj43mtwwfh0nxfht2g7z6cpt4ksmsaqwrugdeeanv4cgltw6dp",
]);

return {
circulating: (total - treasury).toString(),
total: total.toString(),
};
};

export default fetcher;

0 comments on commit ad5d2ee

Please sign in to comment.