@lelantos-org/sdk / index / parseAmount
Function: parseAmount() โ
ts
function parseAmount(value, asset): CircuitAmount;Defined in: @lelantos-org/sdk/dist/wallet/assets.d.ts:60
Human decimal string โ circuit units, ready to pass as amount.
ts
const weth = await wallet.asset(1n);
await wallet.deposit({ asset: weth.id, amount: parseAmount("0.25", weth) });Parameters โ
| Parameter | Type |
|---|---|
value | string | number | bigint |
asset | AssetInfo |
Returns โ
Throws โ
when the value is finer-grained than one circuit unit.
Throws โ
when the chain adapter resolved no decimals.