@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 โ
| Parameter | Type |
|---|---|
tokenAmount | TokenAmount |
scale | bigint |
opts? | { round?: "exact" | "down"; } |
opts.round? | "exact" | "down" |
Returns โ
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.