gill

tokenUiAmountToAmount

function tokenUiAmountToAmount(uiAmount, decimals): bigint;

Converts a UI amount (human-readable) to raw amount (BigInt)

Parameters

ParameterTypeDescription
uiAmountnumberThe human-readable token amount (e.g., 1.5)
decimalsnumberThe number of decimals for the token

Returns

bigint

BigInt representation of the amount

On this page