@rarimo/shared
Version:
Utility functions, types and constants shared across Rarimo packages.
27 lines (26 loc) • 938 B
TypeScript
import { BN } from '@distributedlab/tools';
import type { ClassInstanceToPlainObject, Decimals } from '../types';
export declare class AmountBase {
#private;
protected constructor(value: BN);
get bn(): BN;
get value(): string;
get decimals(): Decimals;
get isZero(): boolean;
isLessThan(amount: AmountBase): boolean;
isLessThanOrEqualTo(amount: AmountBase): boolean;
isGreaterThan(amount: AmountBase): boolean;
isGreaterThanOrEqualTo(amount: AmountBase): boolean;
toString(): string;
toJSON(): {
value: string;
decimals: number;
};
}
export declare class Amount extends AmountBase {
protected constructor(value: BN);
static fromBigInt(value: string, decimals: Decimals): Amount;
static fromRaw(value: string, decimals: Decimals): Amount;
static fromBN(value: BN): Amount;
static fromPlainObject(amount: ClassInstanceToPlainObject<Amount>): Amount;
}