UNPKG

lotus-sdk

Version:

Central repository for several classes of tools for integrating with, and building for, the Lotusia ecosystem

44 lines 1.39 kB
declare const UNITS: { readonly XPI: readonly [1000000, 6]; readonly mXPI: readonly [1000, 3]; readonly uXPI: readonly [100, 2]; readonly bits: readonly [100, 2]; readonly satoshis: readonly [1, 0]; }; export interface UnitData { amount: number; code: string; } export type UnitCode = keyof typeof UNITS; export declare class Unit { private _value; static readonly XPI = "XPI"; static readonly mXPI = "mXPI"; static readonly uXPI = "uXPI"; static readonly bits = "bits"; static readonly satoshis = "satoshis"; constructor(amount: number, code: UnitCode | number); static fromObject(data: UnitData): Unit; static fromXPI(amount: number): Unit; static fromMillis(amount: number): Unit; static fromMilis: typeof Unit.fromMillis; static fromMicros(amount: number): Unit; static fromBits: typeof Unit.fromMicros; static fromSatoshis(amount: number | bigint): Unit; static fromFiat(amount: number, rate: number): Unit; private _from; to(code: UnitCode | number): number; toXPI(): number; toMillis(): number; toMilis: () => number; toMicros(): number; toBits: () => number; toSatoshis(): bigint; atRate(rate: number): number; toString(): string; toObject(): UnitData; toJSON: () => UnitData; inspect(): string; } export {}; //# sourceMappingURL=unit.d.ts.map