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

Commit

Permalink
Add CHIP token (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tenancio authored Nov 1, 2024
1 parent 8d6af27 commit b02bd74
Show file tree
Hide file tree
Showing 2 changed files with 31 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 @@ -28,6 +28,7 @@ import cbtcFetcher from "./tokens/cbtc";
import cerraFetcher from "./tokens/cerra";
import cgiFetcher from "./tokens/cgi";
import charlyFetcher from "./tokens/charly";
import chipFetcher from "./tokens/chip";
import clapFetcher from "./tokens/clap";
import clarityFetcher from "./tokens/clarity";
import clayFetcher from "./tokens/clay";
Expand Down Expand Up @@ -478,4 +479,6 @@ export const supplyFetchers: Record<string, SupplyFetcher> = {
"8d94085182fb206c28850f194defe748e455a104d5ff7466d90f537c": volumeFetcher,
"9d8c863907e6e58823c9af13759e196dbf5da172b7d4ce37d5d1147950494755":
piguFetcher,
"30d2ebdb2fec06142ee84e5120c2717b4d68a91bffd924420d94ddea43484950":
chipFetcher,
};
28 changes: 28 additions & 0 deletions src/tokens/chip.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";

const CHIP = "30d2ebdb2fec06142ee84e5120c2717b4d68a91bffd924420d94ddea43484950";

const TREASURY_ADDRESSES = [
"addr1qxsnhcavemjjes9u6pugq8x76y3fn59t7q590qf60c4k9j5ff8jck2uprunuc8jga6ehyywd6gahfhq8f7p03exzd2aqfh7dhq",
"addr1qymgg5j2mczqcyzq5yzv0wdzrtqv5eh8gj88r57uj0880k5rawe7srxf4duew8uxt9qjwg2hknkwc23g2gfncmqkqatsyrtzfs",
"addr1q8e2p26qtrz02eygsgm65d04afzfwqgn0xccq3ah6haxj4tl28ezl6703wu7fhn9hax7yyp6466hn6pnamrwjenhy4cs3hmr50",
"addr1q8rqmar56e9t05vueh5n69gdnnnfguv9m5jtvjltc6p4zu9x6n7x0yn54ckn8qwlk75pm8ewhck8kkfd56devu2lygastz5pgq",
"addr1q93zlwt4cxge5p8fhdczt8qwrva0vuy3h88yu3lzvs55j7lsw8u030madzgeflqhsevrzdp4nls3gd0g47nef8ffj02sa7gr0t",
"addr1qyy86us6kfrg3rsy0nhssrlkjyq4yw8wasn0n8qgk9gqp0lz3kqj9ut6p5c4gxlg7vehhkzsyfejj0gkpyf7w6d20ffqt2et79",
];

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockfrost = getBlockFrostInstance(options);
const total = 1.6e9;
const treasury =
Number(await getAmountInAddresses(blockfrost, CHIP, TREASURY_ADDRESSES)) /
1e6;

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

export default fetcher;

0 comments on commit b02bd74

Please sign in to comment.