Builds an Amount from a currency and a minor-unit count. Throws AMOUNT_OVERFLOW when the count falls outside the signed 64-bit range the ledger's BIGINT columns store, so an unstorable amount fails at construction rather than at the database.
Amount
const price = toAmount('CREDIT', 1_500_000n); // 15,000 creditsconst cash = toAmount('USD', 10_000n); // $100.00 Copy
const price = toAmount('CREDIT', 1_500_000n); // 15,000 creditsconst cash = toAmount('USD', 10_000n); // $100.00
Builds an
Amountfrom a currency and a minor-unit count. Throws AMOUNT_OVERFLOW when the count falls outside the signed 64-bit range the ledger's BIGINT columns store, so an unstorable amount fails at construction rather than at the database.