Skip to content

@lelantos-org/sdk / index / toCircuitUnits

Function: toCircuitUnits() โ€‹

ts
function toCircuitUnits(
   tokenAmount, 
   scale, 
   opts?
): CircuitAmount;

Defined in: @lelantos-org/sdk/dist/core/units.d.ts:34

ERC-20 base units โ†’ circuit units.

Parameters โ€‹

ParameterType
tokenAmountTokenAmount
scalebigint
opts?{ round?: "exact" | "down"; }
opts.round?"exact" | "down"

Returns โ€‹

CircuitAmount

Throws โ€‹

when the amount is not a whole number of circuit units. Pass { round: "down" } to floor instead; the remainder is dropped without notice, so use it only where dust does not matter.

Lelantosno cookies ๐Ÿช ยท no tracking ๐Ÿ‘๏ธ ยท no accounts ๐Ÿ‘คwalletexplorer4536080GitHub