UNPKG

defi-utils

Version:
41 lines (40 loc) 1.76 kB
import BigNumber from "bignumber.js"; export declare namespace DefiUtils { interface Config extends BigNumber.Config { } interface Format extends BigNumber.Format { } interface Instance extends BigNumber.Instance { } type Constructor = BigNumber.Constructor; type ModuloMode = BigNumber.ModuloMode; type RoundingMode = BigNumber.RoundingMode; type Value = BigNumber.Value; } export declare class DefiUtils extends BigNumber { static WAD: string; static WAD_WAD: string; static SECONDS_PER_DAY: string; constructor(n: DefiUtils.Value, base?: number); plus: (n: DefiUtils.Value, base?: number | undefined) => DefiUtils; minus: (n: DefiUtils.Value, base?: number | undefined) => DefiUtils; pow: (n: DefiUtils.Value, m?: DefiUtils.Value) => DefiUtils; div: (n: DefiUtils.Value, base?: number) => DefiUtils; dividedBy: (n: DefiUtils.Value, base?: number) => DefiUtils; multipliedBy: (n: DefiUtils.Value, base?: number) => DefiUtils; toBasicUnits: (decimals: DefiUtils.Value) => DefiUtils; toFullDecimals: (decimals: DefiUtils.Value) => DefiUtils; toUnderlying: (exchangeRate: DefiUtils.Value) => DefiUtils; toTokens: (exchangeRate: DefiUtils.Value) => DefiUtils; toUSD: (priceUSD: DefiUtils.Value) => DefiUtils; fromUSD: (priceUSD: DefiUtils.Value) => DefiUtils; toAPY: () => DefiUtils; toAPR: () => DefiUtils; removeScientificNotation: () => string; toSafeFixed: (decimalPlaces: number, roundingMode?: DefiUtils.RoundingMode | undefined) => string; toSafeString: () => string; toSafeNumber: () => number; static min(...n: DefiUtils.Value[]): DefiUtils; static max(...n: DefiUtils.Value[]): DefiUtils; } export default DefiUtils;