bridge/functions/toBaseUnits.md
toBaseUnits(
amount,decimals):bigint
Convert a decimal amount to base units (smallest denomination)
Parameters
| Parameter | Type | Description |
|---|---|---|
amount | string | The decimal amount as a string (e.g., "1.5") |
decimals | number | The number of decimal places |
Returns
bigint
The amount in base units as a bigint
Throws
GalaSDKError INVALID_BRIDGE_AMOUNT: not_a_number, or too_many_decimals when it
cannot be represented with the given decimals (it is never rounded)
invalid bridge amount not number too many decimals