qbit-rpc
    Preparing search index...

    Class JsonNumber

    A JSON number as it appeared in a node reply, kept as its source text so no precision is lost. call() and batch() with requests.raw() return every number in this form; convert with the method that matches what the field holds. Arithmetic on it throws (valueOf refuses), so it cannot silently become a float. JSON.stringify writes the original text back.

    Index
    source: string

    The number's text, as the node wrote it.

    • What util.inspect and console.log show: JsonNumber(<text>).

      Returns string

    • A QBT amount (as qbit Core prints them, for example 0.00000001) as bits. Negative amounts, which wallet replies use for sends and fees, are allowed; magnitudes above 210,000,000 QBT and more than 8 decimals throw.

      Returns bigint

    • Lets JSON.stringify write the number's text as it is, without loss.

      Returns unknown

    • The value as a finite JS number. May round: never use it for amounts.

      Returns number

    • An integer literal within the safe-integer range as a JS number.

      Returns number

    • Throws a TypeError: arithmetic and comparisons need an explicit conversion.

      Returns never