Describes an amount of any type or currency using the lowest possible unit.
It uses a BigInt to represent the basis points of the amount, a decimal number
to know how to interpret the basis points, and an identifier to know what
type of amount we are dealing with.
Custom type parameters can be used to represent specific types of amounts.
For example:
Amount<'SOL', 9> represents an amount of SOL in lamports.
Amount<'USD', 2> represents an amount of USD in cents.
Amount<'%', 2> represents a percentage with 2 decimals.
Describes an amount of any type or currency using the lowest possible unit. It uses a BigInt to represent the basis points of the amount, a decimal number to know how to interpret the basis points, and an identifier to know what type of amount we are dealing with.
Custom type parameters can be used to represent specific types of amounts. For example: