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

Commit

Permalink
Create optim.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
zygomeb authored Oct 30, 2023
1 parent 80cb857 commit 243e5ac
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/tokens/optim.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 OPTIM = "e52964af4fffdb54504859875b1827b60ba679074996156461143dc1";

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

export default fetcher;

0 comments on commit 243e5ac

Please sign in to comment.