fix eslint and types
This commit is contained in:
@@ -19,4 +19,4 @@ export const getApr = (
|
||||
const apr = totalRewardPricePerYear.div(totalStakingTokenInPool).times(100);
|
||||
|
||||
return apr.isNaN() || !apr.isFinite() ? null : apr.toNumber();
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user