Collection of utilities for working with Haveno.

Hierarchy

  • HavenoUtils

Constructors

Properties

AU_PER_XMR: bigint = ...
lastLogTimeMs: number = 0
logLevel: number = 0
months: string[] = ...

Methods

  • Convert atomic units to XMR.

    Returns

    amount in XMR

    Parameters

    • amountAtomicUnits: string | BigInt

      amount in atomic units to convert to XMR

    Returns number

  • Divide one bigint by another.

    Returns

    the result

    Parameters

    • a: bigint

      dividend

    • b: bigint

      divisor

    Returns number

  • Format a timestamp as e.g. Jul-07 hh:mm:ss:ms. // TODO: move to GenUtils?

    Returns

    the formatted timestamp

    Parameters

    • timestamp: number

      the timestamp in milliseconds to format

    Returns string

  • Kill the given process.

    TODO (woodser): move this to monero-javascript GenUtils.js as common utility

    Parameters

    • process: any

      the nodejs child process to child

    • Optional signal: string

      the kill signal, e.g. SIGTERM, SIGKILL, SIGINT (default)

    Returns Promise<void>

  • Log a message. // TODO (woodser): switch to log library?

    Parameters

    • level: number

      log level of the message

    • msg: string

      message to log

    Returns void

  • Set the log level with 0 being least verbose.

    Parameters

    • level: number

      the log level

    Returns Promise<void>

  • Wait for the duration.

    Parameters

    • durationMs: number

      the duration to wait for in milliseconds

    Returns Promise<unknown>

  • Convert XMR to atomic units.

    Returns

    amount in atomic units

    Parameters

    • amountXmr: string | number

      amount in XMR to convert to atomic units

    Returns bigint

Generated using TypeDoc