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

Commit

Permalink
feat: update jpg fetcher to remove vesting contract
Browse files Browse the repository at this point in the history
  • Loading branch information
joacohoyos committed Oct 6, 2023
1 parent 219602b commit c39b1fd
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/tokens/jpg.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import { SupplyFetcher } from "../types";
import { defaultFetcherOptions, SupplyFetcher } from "../types";
import { getAmountInAddresses, getBlockFrostInstance } from "../utils";

const fetcher: SupplyFetcher = async () => {
const JPG = "681b5d0383ac3b457e1bcc453223c90ccef26b234328f45fa10fd2764a5047";

const fetcher: SupplyFetcher = async (options = defaultFetcherOptions) => {
const blockFrost = getBlockFrostInstance(options);
const total = 1_000_000_000;
const circulating = 200_000_000;
const vestingRaw = await getAmountInAddresses(blockFrost, JPG, [
"addr1wxhrjawva72parlra9zn8gmv5aeceh3yz666ck7yclfl3ls3vxuqw", // vesting
]);

const vesting = Number(vestingRaw) / 10 ** 6;
return {
circulating: circulating.toString(),
circulating: (total - vesting).toString(),
total: total.toString(),
};
};
Expand Down

0 comments on commit c39b1fd

Please sign in to comment.