UNPKG

@plasma-fi/sdk

Version:

🛠 An SDK for building dapp on PlasmaSwap.

28 lines (27 loc) • 1.1 kB
import { BigintIsh, Rounding } from '../constants/constants'; import { Route } from '../entities/route'; import { Currency } from '../entities/currency'; import { Fraction } from './fraction'; import { NativeAmount } from './currency-amount'; export declare class Price extends Fraction { readonly baseCurrency: Currency; readonly quoteCurrency: Currency; readonly scalar: Fraction; static fromRoute(route: Route): Price; constructor(baseCurrency: Currency, quoteCurrency: Currency, denominator: BigintIsh, numerator: BigintIsh); get raw(): Fraction; get adjusted(): Fraction; invert(): Price; multiply(other: Price): Price; /** * Performs floor division on overflow * @param currencyAmount */ quote(currencyAmount: NativeAmount): NativeAmount; /** * Returns quote per one baseCurrency */ quotePerOne(): NativeAmount; toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string; toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string; }