fix eslint and types

This commit is contained in:
João Geonizeli
2021-08-15 12:51:09 -03:00
parent 890fbddd82
commit 3c3d2862d3
22 changed files with 255 additions and 71 deletions

View File

@@ -19,4 +19,4 @@ export const getApr = (
const apr = totalRewardPricePerYear.div(totalStakingTokenInPool).times(100);
return apr.isNaN() || !apr.isFinite() ? null : apr.toNumber();
};
};

View File

@@ -1,13 +1,13 @@
import type { Contract } from "ethers";
import { ethers } from "ethers";
import { tokens } from "../constants/pancake/Tokens";
import type { Token } from "../constants/pancake/Tokens";
import type { BscContext } from "../contexts/BscProvider";
// 1 Wei = 1*10^18 Ether
const ONE_BUSD_IN_WEI = ethers.utils.parseUnits("1", 18);
export const getPriceInBusd = async (router: any, token: Token) => {
export const getPriceInBusd = async (router: Contract, token: Token) => {
try {
const result = await router.getAmountsOut(ONE_BUSD_IN_WEI, [
token.address["56"],
@@ -18,4 +18,4 @@ export const getPriceInBusd = async (router: any, token: Token) => {
} catch {
return 0;
}
};
};

View File

@@ -2,7 +2,6 @@ import { ethers } from "ethers";
import BigNumber from "bignumber.js";
import erc20 from "../abi/erc20.json";
import { Token } from "../constants/pancake/Tokens";
import type { PoolConfig } from "../types";
export const getTotalStaked = async (
@@ -27,4 +26,4 @@ export const getTotalStaked = async (
} catch {
return 0;
}
};
};