balanceOf(address)
Returns the vault share balance (ctAssets) for a given user.
Signature
balanceOf(holder: string): Promise<bigint>
Parameters
holder(string, required): Ethereum address of the account.
Returns
bigint: balance of ctAssets (vault shares).
Example
const shares = await vault.balanceOf("0xUserAddress");
// Option 1: ethers.formatUnits
console.log("Shares:", ethers.formatUnits(shares, await vault.decimals()));
// Option 2: SDK helpers (caches decimals internally)
console.log("Shares (human):", await vault.applyDecimals(shares));
// Convert human value to a ctShares bigint
const sharesBigInt = await vault.toBigInt("1.0"); // "1.0" ctAsset
console.log("Shares BigInt:", sharesBigInt);
// Underlying conversions
console.log("Underlying (to human):", await vault.toUnderlyingDecimals(shares));
console.log("Underlying (from human):", await vault.toUnderlyingBigInt("1.0"));
Response Example
"1000000"