UNPKG

@plasma-fi/sdk

Version:

🛠 An SDK for building dapp on PlasmaSwap.

38 lines (37 loc) • 1.7 kB
import JSBI from 'jsbi'; import { BigintIsh, ChainId, Rounding } from '../constants/constants'; import { Currency, Native, Token } from '../entities/currency'; import { Fraction } from './fraction'; declare abstract class AbstractCurrencyAmount extends Fraction { readonly currency: Currency; protected constructor(currency: Currency, amount: BigintIsh); abstract add(other: CurrencyAmount): CurrencyAmount; abstract subtract(other: CurrencyAmount): CurrencyAmount; wrapped(): TokenAmount; unwrapped(): CurrencyAmount; toSignificant(significantDigits?: number, format?: object, rounding?: Rounding): string; toFixed(decimalPlaces?: number, format?: object, rounding?: Rounding): string; toExact(format?: object): string; get raw(): JSBI; } export declare class NativeAmount extends AbstractCurrencyAmount { /** * Helper that calls the constructor with the ETHER currency * @param chainId * @param amount ether amount in wei */ static native(chainId: ChainId, amount: BigintIsh): NativeAmount; static native(currency: Native, amount: BigintIsh): NativeAmount; protected constructor(currency: Currency, amount: BigintIsh); add(other: NativeAmount): NativeAmount; subtract(other: NativeAmount): NativeAmount; } export declare class TokenAmount extends AbstractCurrencyAmount { readonly token: Token; constructor(token: Token, amount: BigintIsh); add(other: TokenAmount): TokenAmount; subtract(other: TokenAmount): TokenAmount; } export declare type CurrencyAmount = NativeAmount | TokenAmount; export declare function isCurrencyAmount(obj?: any): boolean; export {};