Skip to content

Commit

Permalink
Add proxies token (minswap#177)
Browse files Browse the repository at this point in the history
* Add proxies token

* add formatting

---------

Co-authored-by: Patrik <[email protected]>
  • Loading branch information
gmaz98 and shadowkora authored Dec 3, 2023
1 parent dcae3f8 commit a310905
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import optFetcher from "./tokens/opt";
import optimFetcher from "./tokens/optim";
import paviaFetcher from "./tokens/pavia";
import pepeblueFetcher from "./tokens/pepeblue";
import proxiesFetcher from "./tokens/proxies";
import prsprFetcher from "./tokens/prspr";
import revuFetcher from "./tokens/revu";
import rjvFetcher from "./tokens/rjv";
Expand Down Expand Up @@ -233,6 +234,8 @@ export const supplyFetchers: Record<string, SupplyFetcher> = {
"961f2cac0bb1967d74691af179350c1e1062c7298d1f7be1e4696e312444455250":
derpFetcher,
"2d587111358801114f04df83dc0015de0a740b462b75cce5170fc935434749": cgiFetcher,
"20cd68533b47565f3c61efb39c30fdace9963bfa4c0060b613448e3c50524f584945":
proxiesFetcher,
f6ac48c64aa7af16434d9f84e014d11fba38525b436acc338ff20b0d4d7463: mtcFetcher,
"03c2eb4f942703fa965df42ba8ac57e27c5e86802d058da63f4d888b4c4343": lccFetcher,
f6696363e9196289ef4f2b4bf34bc8acca5352cdc7509647afe6888f54454459: tedyFetcher,
Expand Down
21 changes: 21 additions & 0 deletions src/tokens/proxies.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";

const PROXIES = "20cd68533b47565f3c61efb39c30fdace9963bfa4c0060b613448e3c50524f584945";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const total = Number(21000000000000);
const treasuryRaw = await getAmountInAddresses(blockFrost, PROXIES, [
"stake1uxrtzq4epgjxz7xulm97ups30rml843trc5x8zulxxzf2rq7effsj", // Treasury
]);
const treasury = Number(treasuryRaw);

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


export default fetcher;

0 comments on commit a310905

Please sign in to comment.