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

    Type Alias Amount

    A money value: a currency plus an amount in minor units (cents for dollars). minor is a bigint so it stays exact for the large totals that platform accounts reach, beyond the point where number loses precision.

    __brand makes a plain { currency, minor } unassignable to Amount. That forces every amount through toAmount or decodeAmount, so the rules here cannot be bypassed.

    The money model for the exact-integer minor-unit design.

    type Amount = {
        __brand: "Amount";
        currency: Currency;
        minor: bigint;
    }
    Index
    __brand: "Amount"
    currency: Currency
    minor: bigint