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.
Amount
credits(120)
toAmount
credit()
credits(120); // equal to toAmount('CREDIT', 12_000n)credits(20_000); // a payout-scale balance Copy
credits(120); // equal to toAmount('CREDIT', 12_000n)credits(20_000); // a payout-scale balance
Builds a CREDIT
Amountfrom a whole number of credits:credits(120)is 12,000 minor units. A fractional count throws INVALID_AMOUNT; sub-credit amounts taketoAmountwith minor units. Distinct from the ledger'scredit(), which builds a posting leg.