Utils

The Utils module in the Zky Toolkit provides utility functions that can help with common tasks when working with wallets and blockchain data. As the toolkit grows, more utilities will be added.

Available Utilities

Currently, the Utils module includes the following utility:

formatEther

This function is imported from the viem library and allows you to format values from Wei (the smallest unit of Ether) into readable Ether values.

Example Usage

Here's an example of how to use the formatEther utility:

import { Utils } from "@kondor-finance/zky-toolkit";

const weiValue = 1000000000000000000n; // 1 Ether in Wei (bigint)
const etherValue = Utils.formatEther(weiValue);

console.log(`The value in Ether is: ${etherValue} ETH`);
// Output: The value in Ether is: 1 ETH

Last updated