Skip to main content
Version: 1.16.1

Function: fromUIAmount()

fromUIAmount(uiAmount: bigint, uiMultiplier: bigint): bigint

Defined in: utils.ts:450

Converts an ERC-8056 UI amount (e.g. shares) to the raw amount to transfer, rounding down, so the result never exceeds a raw balance that shows this UI amount. Both amounts are in the token's base units.

Parameters​

ParameterTypeDescription
uiAmountbigintUI amount.
uiMultiplierbigintThe token's UI multiplier (TokenUIMultiplier.uiMultiplier).

Returns​

bigint

The raw amount: uiAmount * 1e18 / uiMultiplier.