@pangolindex/sdk
Version:
🛠An SDK for building applications on top of Pangolin.
28 lines (27 loc) • 1.24 kB
TypeScript
import { Currency } from '../currency';
import JSBI from 'jsbi';
import { BigintIsh, Rounding } from '../../constants';
import { Fraction } from './fraction';
import { ChainId } from '../../chains';
export declare class CurrencyAmount extends Fraction {
readonly currency: Currency;
/**
* Helper that calls the constructor with the ETHER currency
* @param amount ether amount in wei
* @param chainId
*/
static ether(amount: BigintIsh, chainId: ChainId): CurrencyAmount;
protected constructor(currency: Currency, amount: BigintIsh);
get raw(): JSBI;
/**
* Returns a new currency amount instance from the unitless amount of token, i.e. the raw amount
* @param currency the currency in the amount
* @param rawAmount the raw token or ether amount
*/
static fromRawAmount(currency: Currency, rawAmount: BigintIsh): CurrencyAmount;
add(other: CurrencyAmount): CurrencyAmount;
subtract(other: CurrencyAmount): CurrencyAmount;
toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string;
toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string;
toExact(format?: object): string;
}