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

Commit

Permalink
Add Safe (#363)
Browse files Browse the repository at this point in the history
* Create safe.ts

* Update index.ts

* Update index.ts

Attempting to pass test
  • Loading branch information
NFTKri authored Aug 13, 2024
1 parent 93c4ba4 commit 44abb92
Show file tree
Hide file tree
Showing 2 changed files with 28 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 @@ -125,6 +125,7 @@ import rjvFetcher from "./tokens/rjv";
import rsbtcFetcher from "./tokens/rsbtc";
import rsergFetcher from "./tokens/rserg";
import rsrsnFetcher from "./tokens/rsrsn";
import safeFetcher from "./tokens/safe";
import scaleFetcher from "./tokens/scale";
import shardsFetcher from "./tokens/shards";
import sharkyFetcher from "./tokens/sharky";
Expand Down Expand Up @@ -453,4 +454,6 @@ export const supplyFetchers: Record<string, SupplyFetcher> = {
slopFetcher,
"7d869e0e6f936c3299a8b8df2b8f13d5233801e11676ff06e78e8dbe4649474854":
fightFetcher,
"81926a57a567c11f6dc502254c5ed2d11fdba4ed9f898916699c6f1753414645":
safeFetcher,
};
25 changes: 25 additions & 0 deletions src/tokens/safe.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";

const SAFE = "81926a57a567c11f6dc502254c5ed2d11fdba4ed9f898916699c6f1753414645";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const total = 420_698_008_135;
const treasuryRaw = await getAmountInAddresses(blockFrost, SAFE, [
"stake1u9m784lg688hwhsfp72zmff522jcsp62m9txljtatujw5hgtk80fj", // Treasury
]);

const burnRaw = await getAmountInAddresses(blockFrost, SAFE, [
"addr1w8qmxkacjdffxah0l3qg8hq2pmvs58q8lcy42zy9kda2ylc6dy5r4", // burn address
]);

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

export default fetcher;

0 comments on commit 44abb92

Please sign in to comment.