UNPKG

@starkdefi/core-sdk

Version:

SDK for building StarkDefi applications

24 lines (23 loc) • 962 B
import { BigNumberish } from '../../constants'; export declare class Fraction { readonly numerator: bigint; readonly denominator: bigint; constructor(numerator: BigNumberish, denominator?: BigNumberish); private static tryParseFraction; get quotient(): bigint; get remainder(): Fraction; invert(): Fraction; add(other: Fraction | BigNumberish): Fraction; subtract(other: Fraction | BigNumberish): Fraction; lessThan(other: Fraction | BigNumberish): boolean; equalTo(other: Fraction | BigNumberish): boolean; greaterThan(other: Fraction | BigNumberish): boolean; multiply(other: Fraction | BigNumberish): Fraction; divide(other: Fraction | BigNumberish): Fraction; toSignificant(significantDigits: number): string; toFixed(decimalPlaces: number): string; /** * Helper method for converting any super class back to a fraction */ get asFraction(): Fraction; }