From 099a70179a5e67213bb71fbe9ed71163543ccb65 Mon Sep 17 00:00:00 2001 From: zygomeb <87449555+zygomeb@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:32:48 +0100 Subject: [PATCH] Add the O token (#389) add the O token --- src/tokens/o.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/tokens/o.ts diff --git a/src/tokens/o.ts b/src/tokens/o.ts new file mode 100644 index 00000000..4311e33f --- /dev/null +++ b/src/tokens/o.ts @@ -0,0 +1,19 @@ +import { defaultFetcherOptions, SupplyFetcher } from "../types"; +import { getAmountInAddresses, getBlockFrostInstance } from "../utils"; + +const O = "2852268cf6e2db42e20f2fd3125f541e5d6c5a3d70b4dda17c2daa82"; + +const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => { + const blockFrost = getBlockFrostInstance(options); + const total = 25e6; + const treasuryRaw = await getAmountInAddresses(blockFrost, O, [ + "stake178j4fcxw7pwgxw92yu28c2zqmjxnumumj52hxr9jtr6qwngf2ve5n", // O Vesting Multisig + ]); + const treasury = Number(treasuryRaw) / 1e6; + return { + circulating: (total - treasury).toString(), + total: total.toString(), + }; +}; + +export default fetcher;