@ethersphere/bee-js
Version:
Javascript client for Bee
78 lines (77 loc) • 2.32 kB
TypeScript
import { NumberString } from '..';
export declare class BZZ {
static readonly DIGITS = 16;
private state;
private constructor();
static fromDecimalString(string: string): BZZ;
static fromPLUR(plur: NumberString | string | bigint): BZZ;
toPLURString(): string;
toPLURBigInt(): bigint;
toDecimalString(): string;
toSignificantDigits(digits: number): string;
/**
* Does not mutate the current BZZ instance.
*
* @param other BZZ instance, or amount in PLUR
* @returns New BZZ instance
*/
plus(other: BZZ | NumberString | string | bigint): BZZ;
/**
* Does not mutate the current BZZ instance.
*
* @param other BZZ instance, or amount in PLUR
* @returns New BZZ instance
*/
minus(other: BZZ | NumberString | string | bigint): BZZ;
/**
* Does not mutate the current BZZ instance.
*
* @param other Divisor
* @returns New BZZ instance
*/
divide(other: bigint): BZZ;
gt(other: BZZ): boolean;
gte(other: BZZ): boolean;
lt(other: BZZ): boolean;
lte(other: BZZ): boolean;
eq(other: BZZ): boolean;
exchangeToDAI(daiPerBzz: DAI): DAI;
}
export declare class DAI {
static readonly DIGITS = 18;
private state;
private constructor();
static fromDecimalString(string: string): DAI;
static fromWei(wei: NumberString | string | bigint): DAI;
toWeiString(): string;
toWeiBigInt(): bigint;
toDecimalString(): string;
toSignificantDigits(digits: number): string;
/**
* Does not mutate the current DAI instance.
*
* @param other DAI instance, or amount in PLUR
* @returns New DAI instance
*/
plus(other: DAI | NumberString | string | bigint): DAI;
/**
* Does not mutate the current DAI instance.
*
* @param other DAI instance, or amount in PLUR
* @returns New DAI instance
*/
minus(other: DAI | NumberString | string | bigint): DAI;
/**
* Does not mutate the current DAI instance.
*
* @param other Divisor
* @returns New DAI instance
*/
divide(other: bigint): DAI;
gt(other: DAI): boolean;
gte(other: DAI): boolean;
lt(other: DAI): boolean;
lte(other: DAI): boolean;
eq(other: DAI): boolean;
exchangeToBZZ(daiPerBzz: DAI): BZZ;
}