Builds a USD amount from a decimal string, with the full strictness of decodeAmount: more than two decimal places, digit grouping, or a value past the 64-bit range throws INVALID_AMOUNT.
decodeAmount
const price = usd('9.99'); // 999n minor unitsconst payoutValue = usd('100.00'); // what 20,000 credits cash out to at $0.005 per credit Copy
const price = usd('9.99'); // 999n minor unitsconst payoutValue = usd('100.00'); // what 20,000 credits cash out to at $0.005 per credit
Builds a USD amount from a decimal string, with the full strictness of
decodeAmount: more than two decimal places, digit grouping, or a value past the 64-bit range throws INVALID_AMOUNT.