Converting Token Amounts
Between native and pool dimensions
Native to Shielded
async weiToShieldedAmount(amountWei: bigint): Promise<bigint>Parameters
Returns
Example
// ...working on BOB-sepolia pool...
const nativeAmount = 123456789123456789123n; // ~123.46 BOB
const shieldedAmount = await zkClient.weiToShieldedAmount(nativeAmount);
console.log(`${nativeAmount} native tokens -> ${shieldedAmount} shielded tokens`);
// output: 123456789123456789123 native tokens -> 123456789123 shielded tokensShielded to Native
Parameters
Returns
Example
Last updated
Was this helpful?