Skip to content

Commit

Permalink
Update fet.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
FractionEstate authored Sep 21, 2023
1 parent 50eae7e commit 6fa8adf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/tokens/fet.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
```
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";
Expand All @@ -7,6 +8,8 @@ const FET =
const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const total = 200e6;
const blockFrost = getBlockFrostInstance(options);
const assetInfo = await blockFrost.assetsById(FET);
const onchainSupply = Number(assetInfo?.quantity) / 1e10;
const treasuryRaw = await getAmountInAddresses(blockFrost, FET, [
"stake1uyyxjvthz4udwdrzr9pkkudpylasg99ufdzu7gpdfckxf2s5peell",
"stake1ux94pdq42nwx0g24ea3myjcnd8tvl354ku4ygedtgm7sfgc2hugz9",
Expand All @@ -18,9 +21,10 @@ const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
]);
const treasury = Number(treasuryRaw) / 1e10;
return {
circulating: (total - treasury).toString(),
circulating: (onchainSupply - treasury).toString(),
total: total.toString(),
};
};
export default fetcher;
```

0 comments on commit 6fa8adf

Please sign in to comment.