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

Create lemmiwinks.ts #398

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ import jellyFetcher from "./tokens/jelly";
import jorgeFetcher from "./tokens/jorge";
import jpgFetcher from "./tokens/jpg";
import kitupFetcher from "./tokens/kitup";
import lemmiwinksFetcher from "./tokens/lemmiwinks.ts";
import lccFetcher from "./tokens/lcc";
import lifiFetcher from "./tokens/lifi";
import lobsterFetcher from "./tokens/lobster";
Expand Down Expand Up @@ -362,4 +363,5 @@ export const supplyFetchers: Record<string, SupplyFetcher> = {
"86340a33acf14b5c967584c9a20e984695ab3289696d138048f572be4255524e5a": burnzFetcher,
"766fce8055f39d40fcfc19721677b3deb2e7846950ae08dce757f1e753554741522042555348": sugarBushFetcher,
"5df9a1b9af5172602cbf8e4ba9c2a608c3820fc6e5d8c5e48f2d907c5468652047697261666665": chipsFetcher,
"b1469560aad3af043bc4e800aabac7c87840b61c8262b4a42841ee104c656d6d6977696e6b73": lemmiwinksFetcher,
};
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;
Loading