chaingate
Version:
A complete TypeScript library for connecting to and making transactions on different blockchains
22 lines (21 loc) • 1.03 kB
TypeScript
import { CurrencyInfo } from '../CurrencyInfo';
import { FiatCurrencies } from '../FiatCurrencies';
import { GlobalMarketsResponse } from '../../Client';
import { TtlCache } from '../../InternalUtils/TtlCache';
import Decimal from 'decimal.js';
export declare class CurrencyAmount<CI extends CurrencyInfo> {
private readonly currencyInfo;
private readonly markets;
readonly baseAmount: Decimal;
get baseSymbol(): string;
get minimalUnitAmount(): Decimal;
get minimalUnitSymbol(): string;
get str(): string;
readonly decimals: number;
constructor(currencyInfo: CI, baseAmount: Decimal, markets: TtlCache<GlobalMarketsResponse>);
plus(currencyAmount: CurrencyAmount<CI>): CurrencyAmount<CI>;
minus(currencyAmount: CurrencyAmount<CI>): CurrencyAmount<CI>;
div(currencyAmount: CurrencyAmount<CI>): CurrencyAmount<CI>;
mul(currencyAmount: CurrencyAmount<CI>): CurrencyAmount<CI>;
toFiat(fiatCurrency: (typeof FiatCurrencies)[number], useCache?: boolean): Promise<Decimal>;
}