Skip to content

Commit

Permalink
feat: basic migration
Browse files Browse the repository at this point in the history
  • Loading branch information
HinsonSIDAN committed Feb 12, 2024
1 parent e9825cb commit 83e6a79
Show file tree
Hide file tree
Showing 85 changed files with 674 additions and 330 deletions.
45 changes: 31 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"homepage": "https://github.com/minswap/market-cap#readme",
"dependencies": {
"@blockfrost/blockfrost-js": "^5.2.0",
"@maestro-org/typescript-sdk": "^1.4.1",
"axios": "^1.3.3"
},
"lint-staged": {
Expand Down
6 changes: 3 additions & 3 deletions src/tokens/aada.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";
import { getAmountInAddresses, getMaestroClient } from "../utils";

const AADA = "8fef2d34078659493ce161a6c7fba4b56afefa8535296a5743f6958741414441";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const maestro = getMaestroClient(options);
const total = 29_500_000;
const treasuryRaw = await getAmountInAddresses(blockFrost, AADA, [
const treasuryRaw = await getAmountInAddresses(maestro, AADA, [
"stake1u98ak0va7tgd23rl62tphdare6z602e0vx5m0fw4gdr65kq875eec",
"stake1uyt8x8wwvn5ze8aw6eqs35w2znyh4xnn9xsu3jxjk503nxcmdkjuz",
"stake1u9hqmm7neuayxpm9962kk09x27yu5kmcx6h9f98tc4r2mzsyaeh40",
Expand Down
6 changes: 3 additions & 3 deletions src/tokens/angels.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";
import { getAmountInAddresses, getMaestroClient } from "../utils";

const ANGELS =
"285b65ae63d4fad36321384ec61edfd5187b8194fff89b5abe9876da414e47454c53";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const maestro = getMaestroClient(options);
const total = 496_000;
const treasuryRaw = await getAmountInAddresses(blockFrost, ANGELS, [
const treasuryRaw = await getAmountInAddresses(maestro, ANGELS, [
"stake1uykqzz8gny3g5ar9upqhuvgjy7uw0fcxyp66cj8sgm9uyjq7h2xtc",
"addr1qxpfunlur9rcr7zzvzqeha5mahfjc09zwc03u9uj6z6qdkeef44f0ar7f54mp0dkw0erpjddyq3ar4vhx6ye8acjg4eqr7jmz9",
]);
Expand Down
6 changes: 3 additions & 3 deletions src/tokens/ashib.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";
import { getAmountInAddresses, getMaestroClient } from "../utils";

const ASHIB =
"afc910d7a306d20c12903979d4935ae4307241d03245743548e767834153484942";
Expand All @@ -9,10 +9,10 @@ const TREASURY_ADDRESSES = [
];

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const maestro = getMaestroClient(options);
const total = 109e9; // 109 billion
const treasury =
Number(await getAmountInAddresses(blockFrost, ASHIB, TREASURY_ADDRESSES)) /
Number(await getAmountInAddresses(maestro, ASHIB, TREASURY_ADDRESSES)) /
1e6;
return {
circulating: (total - treasury).toString(),
Expand Down
8 changes: 4 additions & 4 deletions src/tokens/awoo.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";
import { getAmountInAddresses, getMaestroClient } from "../utils";

const AWOO = "09f5f55fcad17503e6b7acc81de7c80f84b76e76d17085f0e32f1ce241574f4f";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const maestro = getMaestroClient(options);
const total = 69_000_000;
const treasuryRaw = await getAmountInAddresses(blockFrost, AWOO, [
const treasuryRaw = await getAmountInAddresses(maestro, AWOO, [
"stake1uy2s0etue4vgt6gz66t84zzgf8r6fgggc0prf4hsay3rvfcam00kg", // $unbothered
"stake1uxh23dnmd2lzvxqr06vvuxtsgh4l4dxnrrcvj2fx6f53rkc70lmqh", // $uwstaking
]);

const burnRaw = await getAmountInAddresses(blockFrost, AWOO, [
const burnRaw = await getAmountInAddresses(maestro, AWOO, [
"addr1w8qmxkacjdffxah0l3qg8hq2pmvs58q8lcy42zy9kda2ylc6dy5r4", //$burnawoo
]);

Expand Down
6 changes: 3 additions & 3 deletions src/tokens/bank.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";
import { getAmountInAddresses, getMaestroClient } from "../utils";

const BANK = "2b28c81dbba6d67e4b5a997c6be1212cba9d60d33f82444ab8b1f21842414e4b";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const maestro = getMaestroClient(options);
const total = 2.5e12;
const treasuryRaw = await getAmountInAddresses(blockFrost, BANK, [
const treasuryRaw = await getAmountInAddresses(maestro, BANK, [
"stake1uxq7mehxxywwzf0cczf7tq4surcphjdd53ngw5ev6qxf7hstnt9qf", // $bankercoinada
]);
const treasury = Number(treasuryRaw);
Expand Down
6 changes: 3 additions & 3 deletions src/tokens/book.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";
import { getAmountInAddresses, getMaestroClient } from "../utils";

const BOOK = "51a5e236c4de3af2b8020442e2a26f454fda3b04cb621c1294a0ef34424f4f4b";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const maestro = getMaestroClient(options);
const total = 10_000_000_000;
const treasuryRaw = await getAmountInAddresses(blockFrost, BOOK, [
const treasuryRaw = await getAmountInAddresses(maestro, BOOK, [
"addr1v8dyqna76l9uh3sg93hvp8h40c8h0ecsw0yfa5dtq5hgvzc5572e2", // swap send in
"addr1w99gfdcmxwe2ahe9ncjekntn2fhcpusj55874g4m7f4c7kqy3rq23", // swap contract
"addr1w9223trzcvg75wwlaeprls9zwcf8nu8l5y92t9kk2all2jqk6sg93", // lock contract
Expand Down
6 changes: 3 additions & 3 deletions src/tokens/cblp.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";
import { getAmountInAddresses, getMaestroClient } from "../utils";

const CBLP = "ee0633e757fdd1423220f43688c74678abde1cead7ce265ba8a24fcd43424c50";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const maestro = getMaestroClient(options);
const total = 1e9;
const treasuryRaw = await getAmountInAddresses(blockFrost, CBLP, [
const treasuryRaw = await getAmountInAddresses(maestro, CBLP, [
"stake1u80gm88pyu78rr2ee3p7mn482xza6thtnvg3k3c0y43syrsdzm0lw", // $yam_treasury
"stake1uy02585lgl0j9pfzz2jxqmdckar2jqlpwre899j9304l3ysezxnjj", // $yam_community
"stake1uxxghepgwfmtq9spaxf46ucxvns54pyvcqtrpk4888dtqdqhth0sj", // $yam_misc
Expand Down
8 changes: 5 additions & 3 deletions src/tokens/cbtc.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getBlockFrostInstance } from "../utils";
import { getMaestroClient } from "../utils";

const CBTC = "4190b2941d9be04acc69c39739bd5acc66d60ccab480d8e20bc87e3763425443";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const total = await blockFrost.assetsById(CBTC).then((res) => res.quantity);
const maestro = getMaestroClient(options);
const total = await maestro.assets
.assetInfo(CBTC)
.then((res) => res.data.data.total_supply);
const totalWithDecimals = Number(total) / 1e8;
return {
circulating: totalWithDecimals.toString(),
Expand Down
7 changes: 3 additions & 4 deletions src/tokens/cgi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";
import { getAmountInAddresses, getMaestroClient } from "../utils";

const CGI = "2d587111358801114f04df83dc0015de0a740b462b75cce5170fc935434749";
const TREASURY_ADDRESSES = [
Expand All @@ -12,11 +12,10 @@ const TREASURY_ADDRESSES = [
];

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const maestro = getMaestroClient(options);
const total = 5e6; // 5 million
const treasury =
Number(await getAmountInAddresses(blockFrost, CGI, TREASURY_ADDRESSES)) /
1e6;
Number(await getAmountInAddresses(maestro, CGI, TREASURY_ADDRESSES)) / 1e6;
return {
circulating: (total - treasury).toString(),
total: total.toString(),
Expand Down
6 changes: 3 additions & 3 deletions src/tokens/chry.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";
import { getAmountInAddresses, getMaestroClient } from "../utils";

const CHRY = "75fcc276057db5fc48eae0e11453c773c8a54604c3086bf9d95ac1b743485259";
const TREASURY_ADDRESSES = [
Expand All @@ -8,10 +8,10 @@ const TREASURY_ADDRESSES = [
];

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const maestro = getMaestroClient(options);
const total = 88e6; // 88 million
const treasury = Number(
await getAmountInAddresses(blockFrost, CHRY, TREASURY_ADDRESSES)
await getAmountInAddresses(maestro, CHRY, TREASURY_ADDRESSES)
);

return {
Expand Down
6 changes: 3 additions & 3 deletions src/tokens/clap.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";
import { getAmountInAddresses, getMaestroClient } from "../utils";

const CLAP = "db30c7905f598ed0154de14f970de0f61f0cb3943ed82c891968480a434c4150";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const maestro = getMaestroClient(options);
const total = 1e9; // 1 billion
const treasuryRaw = await getAmountInAddresses(blockFrost, CLAP, [
const treasuryRaw = await getAmountInAddresses(maestro, CLAP, [
"addr1qxkcc74fpfvdenelc7m4zxtezrgvnhmd7z78jlkgr4gy9x9cjxt7rq9rfwqqh3wv24adfv2hex0ttwu3zh7e276xmcesgw34jc",
]);
const treasury = Number(treasuryRaw) / 1e3;
Expand Down
7 changes: 3 additions & 4 deletions src/tokens/clay.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";
import { getAmountInAddresses, getMaestroClient } from "../utils";

const CLAY = "38ad9dc3aec6a2f38e220142b9aa6ade63ebe71f65e7cc2b7d8a8535434c4159";
const TREASURY_ADDRESSES = [
Expand All @@ -11,10 +11,9 @@ const TREASURY_ADDRESSES = [

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const total = 2.5e9; // 2.5 billion
const blockFrost = getBlockFrostInstance(options);
const maestro = getMaestroClient(options);
const treasury =
Number(await getAmountInAddresses(blockFrost, CLAY, TREASURY_ADDRESSES)) /
1e4;
Number(await getAmountInAddresses(maestro, CLAY, TREASURY_ADDRESSES)) / 1e4;
return {
circulating: (total - treasury).toString(),
total: total.toString(),
Expand Down
9 changes: 4 additions & 5 deletions src/tokens/cnct.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";
import { getAmountInAddresses, getMaestroClient } from "../utils";

const CNCT =
"c27600f3aff3d94043464a33786429b78e6ab9df5e1d23b774acb34c434e4354";
const CNCT = "c27600f3aff3d94043464a33786429b78e6ab9df5e1d23b774acb34c434e4354";

const cnctFetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const maestro = getMaestroClient(options);
const total = 80_000_000;
const treasuryRaw = await getAmountInAddresses(blockFrost, CNCT, [
const treasuryRaw = await getAmountInAddresses(maestro, CNCT, [
"addr1qy0yswstqah6zwxvd5csh0gyty80pcpfqf0ghe24n798r07hdz6r6fp6z96rgh8dvu6yjx8smmany40anu8264r0ek3ssujtw9",
]);

Expand Down
6 changes: 3 additions & 3 deletions src/tokens/cneta.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";
import { getAmountInAddresses, getMaestroClient } from "../utils";

const CNETA =
"b34b3ea80060ace9427bda98690a73d33840e27aaa8d6edb7f0c757a634e455441";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const maestro = getMaestroClient(options);
// source: https://docs.anetabtc.io/docs/user-guides/tokenomics/
const total = 1_000_000_000n;
const totalOnCardano = 1_000_000_000n;
const treasury = await getAmountInAddresses(blockFrost, CNETA, [
const treasury = await getAmountInAddresses(maestro, CNETA, [
"stake1u8ypd7vtdsst25v65ddqgdgt7w9plww0zyqgktfrr0apscqepfcnm",
"stake1uxpa2qrzplzsmq5d492xc3ge6g5hfsvymkakznvva5fcznsjy5ed5",
]);
Expand Down
8 changes: 4 additions & 4 deletions src/tokens/cswap.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";
import { getAmountInAddresses, getMaestroClient } from "../utils";

const CSWAP =
"bf524874448cbf52be3a26133b0a0edf5eb65c09ffed383b881ad3274353574150";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const maestro = getMaestroClient(options);
const total = 2_500_000_000;
const treasuryRaw = await getAmountInAddresses(blockFrost, CSWAP, [
const treasuryRaw = await getAmountInAddresses(maestro, CSWAP, [
"addr1xxdulr2pxqx07pwjasfw2y6dl20wmyq4yhfggdf99x4jvnnk6wr84sntzxn3s943vlnqqrey6cmuzrz2m3tz3yj3n4vssyvg45",
"addr1x8283erf082rna7etqkjfeelsm6vpu928y0kqklemu5ntvqtqyzh4ykrev5jvj5l33pw852v3jk6khm9a54sdzjkavqsmc6ntp",
"addr1v93mxm3f82l5fle2r94lnwnaqm47macfvf6y4707yyl7l0c9c62ny",
Expand All @@ -26,7 +26,7 @@ const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
"addr1xy4slu8t7aqe6jkcl9vs8nhanwcupd6c6txkt4gupyps2rfjjna9mvvl26ka09s5yt30nkzvvgkad22vastvw9hpd9wsx5dvw9",
"addr1xx62pdtpmkmyd0n63v9vvn8y7r2vnw36gxj2cjhccgr75anqefhd3zhkxv0c9jdwsd7vahl5eep53xgn9up4yafm8f8qw8yku8",
]);
const lockedRaw = await getAmountInAddresses(blockFrost, CSWAP, [
const lockedRaw = await getAmountInAddresses(maestro, CSWAP, [
"addr1z9k092kv0jga3tmell0l47kp3endnlt8x048tr25n0t3qn9f0924s2rfv0k2zvncgs7nxyd6ym55ar9x0hplm98arw6qt9q42l",
]);
const treasury = Number(treasuryRaw) / 1_000_000;
Expand Down
Loading

0 comments on commit 83e6a79

Please sign in to comment.