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

nebula pr mcap decimal fix #195

Closed
wants to merge 5 commits into from
Closed
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
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import mntFetcher from "./tokens/mnt";
import moaiFetcher from "./tokens/moai";
import mtcFetcher from "./tokens/mtc";
import myieldFetcher from "./tokens/myield";
import nebulaFetcher from "./tokens/nebula";
import newmFetcher from "./tokens/newm";
import nftcFetcher from "./tokens/nftc";
import ninjazFetcher from "./tokens/ninjaz";
Expand Down Expand Up @@ -241,4 +242,6 @@ export const supplyFetchers: Record<string, SupplyFetcher> = {
f6696363e9196289ef4f2b4bf34bc8acca5352cdc7509647afe6888f54454459: tedyFetcher,
"94cbb4fcbcaa2975779f273b263eb3b5f24a9951e446d6dc4c13586452455655":
revuFetcher,
"3744d5e39333c384505214958c4ed66591a052778512e56caf420f624e4542554c41":
nebulaFetcher,
};
28 changes: 28 additions & 0 deletions src/nebula.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 NEBULA =
"3744d5e39333c384505214958c4ed66591a052778512e56caf420f624e4542554c41";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const total = 1e9;
const treasuryRaw = await getAmountInAddresses(blockFrost, NEBULA, [
"addr1qyruqqptlds9ruwxq45y28669y7q4qu233hmzt2ck260f2s296su9q00c29c8ud846jhyayzeprsa4fygumw0ycrmgssxu8q3z",
"addr1q8s7yqngv2lpwrf6e3wn0qplz6dsw2f9scdex78uxfg58xv69yv7hnkjauqsj33hktr6ygamt58m7rsjm4elpmlaycssdyaju6",
]);

const burnRaw = await getAmountInAddresses(blockFrost, NEBULA, [
"addr1qxte5udxtcgd32grn4pd2w2faw7cax3p4lj22e6exmftu28ezkp45z5cs5g5yfpksh8uupjrzkjjyv3c2t23ah04s0tq40n2va",
]);

const treasury = Number(treasuryRaw);
const burn = Number(burnRaw);

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

export default fetcher;
28 changes: 28 additions & 0 deletions src/tokens/nebula.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 NEBULA =
"3744d5e39333c384505214958c4ed66591a052778512e56caf420f624e4542554c41";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const total = 1_000_000_000;
const treasuryRaw = await getAmountInAddresses(blockFrost, NEBULA, [
"stake1uy9zagwzs8hu9zur7xn6aftjwjpvs3cw65jywdh8jvpa5ggvvlr08",
"stake1uxdzjx0temfw7qgfgcmm93azywa46ralpcfd6ulsal7jvggjrk6ew",
]);

const burnRaw = await getAmountInAddresses(blockFrost, NEBULA, [
"stake1u8u3tq66p2vg2y2zysmgtn7wqep3tffzxgu994g7mh6c84skgl0g7",
]);

const treasury = Number(treasuryRaw);
const burn = Number(burnRaw);

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

export default fetcher;