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

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create lemmiwinks.ts
Browse files Browse the repository at this point in the history
snekdotfun authored Dec 11, 2024
1 parent e6321ba commit 6a2b6ba
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/tokens/lemmiwinks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";

// Total supply of any token launched on snek.fun
const SNEKFUN_TOTAL_SUPPLY_DEFAULT = 1e9;

// The base16-encoded policyId + base16-encoded assetName
const TOKEN_SUBJECT = "b1469560aad3af043bc4e800aabac7c87840b61c8262b4a42841ee104c656d6d6977696e6b73";

// Not counted in the supply
const BURN_SNEK_ADDR = "addr1w8qmxkacjdffxah0l3qg8hq2pmvs58q8lcy42zy9kda2ylc6dy5r4";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const burnsnekAmount = Number(await getAmountInAddresses(blockFrost, TOKEN_SUBJECT, [BURN_SNEK_ADDR]));
return {
circulating: (SNEKFUN_TOTAL_SUPPLY_DEFAULT - burnsnekAmount).toString(),
total: SNEKFUN_TOTAL_SUPPLY_DEFAULT.toString(),
};
};

export default fetcher;

0 comments on commit 6a2b6ba

Please sign in to comment.