Skip to content

@lelantos-org/sdk / index / toBaseUnits

Function: toBaseUnits() ​

ts
function toBaseUnits(
   amount, 
   asset, 
   opts?
): TokenAmount;

Defined in: @lelantos-org/sdk/dist/wallet/assets/amount.d.ts:46

Circuit units → ERC-20 base units at the asset's display index. Default round: "down".

For a payment on a yield asset, size the pull from the pool's rate (depositTotals), not this.

Parameters ​

ParameterType
amountbigint | CircuitAmount
assetAssetUnits
opts?{ round?: "down" | "up"; }
opts.round?"down" | "up"

Returns ​

TokenAmount