@pwngh/economy-lab
    Preparing search index...

    Function credits

    • Builds a CREDIT Amount from a whole number of credits: credits(120) is 12,000 minor units. A fractional count throws INVALID_AMOUNT; sub-credit amounts take toAmount with minor units. Distinct from the ledger's credit(), which builds a posting leg.

      Parameters

      • whole: number | bigint

      Returns Amount

      credits(120); // equal to toAmount('CREDIT', 12_000n)
      credits(20_000); // a payout-scale balance