/** * Vault — unified class for all interactions with a single VaultV2 instance. * * Reads match the contract function names directly (e.g. `vault.totalAssets()`, * `vault.absoluteCap(id)`). * * Writes: * - Owner-only setters are direct (`setName`, `setOwner`, ...). * - Curator setters are timelocked, exposed as a triplet: * submitX(...) → schedules * X(...) → executes (after timelock has expired) * instantX(...) → submit + execute via multicall (only if timelock = 0) * - Allocator and user actions are direct. * * `vault.multicall([...])` accepts an array of `Action` (string | string[]) * built from the `Actions` namespace, and bundles everything into one tx. */ import { type ethers } from "ethers"; import type { Action, TimelockFunction } from "./actions"; import type { MarketParams } from "./clients/adapters"; export declare class Vault { readonly address: string; readonly contract: ethers.Contract; private readonly runner; constructor(address: string, runner: ethers.ContractRunner); /** * Bundle multiple actions into a single transaction via the contract's * `multicall(bytes[])`. Accepts a mix of single calldatas and arrays * (returned by `instantX` actions); the array is flattened automatically. * * @example * await vault.multicall([ * Actions.owner.setName("Byzantine USDC"), * Actions.curator.instantAddAdapter(adapter), * Actions.curator.instantIncreaseAbsoluteCap(idData, cap), * Actions.allocator.setMaxRate(rate), * ]); */ multicall(actions: readonly Action[]): Promise; asset(): Promise; decimals(): Promise; name(): Promise; symbol(): Promise; owner(): Promise; curator(): Promise; totalAssets(): Promise; totalSupply(): Promise; virtualShares(): Promise; maxRate(): Promise; lastUpdate(): Promise; balanceOf(account: string): Promise; allowance(owner: string, spender: string): Promise; previewDeposit(assets: bigint): Promise; previewMint(shares: bigint): Promise; previewWithdraw(assets: bigint): Promise; previewRedeem(shares: bigint): Promise; convertToShares(assets: bigint): Promise; convertToAssets(shares: bigint): Promise; adaptersLength(): Promise; adapter(index: number): Promise; isAdapter(account: string): Promise; adapterRegistry(): Promise; absoluteCap(id: string): Promise; relativeCap(id: string): Promise; allocation(id: string): Promise; isAllocator(account: string): Promise; isSentinel(account: string): Promise; receiveSharesGate(): Promise; sendSharesGate(): Promise; receiveAssetsGate(): Promise; sendAssetsGate(): Promise; performanceFee(): Promise; performanceFeeRecipient(): Promise; managementFee(): Promise; managementFeeRecipient(): Promise; forceDeallocatePenalty(adapter: string): Promise; liquidityAdapter(): Promise; liquidityData(): Promise; timelock(fn: TimelockFunction): Promise; executableAt(data: string): Promise; abdicated(fn: TimelockFunction): Promise; /** Underlying-asset balance of an arbitrary account. */ assetBalance(account: string): Promise; /** Allowance granted to the vault by `owner` on the underlying asset. */ assetAllowance(owner: string): Promise; /** Underlying-asset balance currently sitting idle in the vault. */ idleBalance(): Promise; /** Build the `idData` blob for cap-related actions. */ idData(type: "this", adapter: string): string; idData(type: "collateralToken", token: string): string; idData(type: "this/marketParams", adapter: string, marketParams: MarketParams): string; setOwner(newOwner: string): Promise; setCurator(newCurator: string): Promise; setIsSentinel(account: string, is: boolean): Promise; setName(newName: string): Promise; setSymbol(newSymbol: string): Promise; /** Set name + symbol in a single tx via multicall. */ setNameAndSymbol(newName: string, newSymbol: string): Promise; /** Submit any pre-encoded calldata for timelock. */ submit(data: string): Promise; /** Revoke a pending timelocked submission. */ revoke(data: string): Promise; submitAddAdapter(adapter: string): Promise; addAdapter(adapter: string): Promise; instantAddAdapter(adapter: string): Promise; submitRemoveAdapter(adapter: string): Promise; removeAdapter(adapter: string): Promise; instantRemoveAdapter(adapter: string): Promise; submitIncreaseAbsoluteCap(idData: string, cap: bigint): Promise; increaseAbsoluteCap(idData: string, cap: bigint): Promise; instantIncreaseAbsoluteCap(idData: string, cap: bigint): Promise; /** Decrease is callable by curator OR sentinel without timelock. */ decreaseAbsoluteCap(idData: string, cap: bigint): Promise; submitIncreaseRelativeCap(idData: string, cap: bigint): Promise; increaseRelativeCap(idData: string, cap: bigint): Promise; instantIncreaseRelativeCap(idData: string, cap: bigint): Promise; /** Decrease is callable by curator OR sentinel without timelock. */ decreaseRelativeCap(idData: string, cap: bigint): Promise; submitSetIsAllocator(account: string, is: boolean): Promise; setIsAllocator(account: string, is: boolean): Promise; instantSetIsAllocator(account: string, is: boolean): Promise; submitSetReceiveSharesGate(gate: string): Promise; setReceiveSharesGate(gate: string): Promise; instantSetReceiveSharesGate(gate: string): Promise; submitSetSendSharesGate(gate: string): Promise; setSendSharesGate(gate: string): Promise; instantSetSendSharesGate(gate: string): Promise; submitSetReceiveAssetsGate(gate: string): Promise; setReceiveAssetsGate(gate: string): Promise; instantSetReceiveAssetsGate(gate: string): Promise; submitSetSendAssetsGate(gate: string): Promise; setSendAssetsGate(gate: string): Promise; instantSetSendAssetsGate(gate: string): Promise; submitSetAdapterRegistry(registry: string): Promise; setAdapterRegistry(registry: string): Promise; instantSetAdapterRegistry(registry: string): Promise; submitSetPerformanceFee(fee: bigint): Promise; setPerformanceFee(fee: bigint): Promise; instantSetPerformanceFee(fee: bigint): Promise; submitSetManagementFee(fee: bigint): Promise; setManagementFee(fee: bigint): Promise; instantSetManagementFee(fee: bigint): Promise; submitSetPerformanceFeeRecipient(r: string): Promise; setPerformanceFeeRecipient(r: string): Promise; instantSetPerformanceFeeRecipient(r: string): Promise; submitSetManagementFeeRecipient(r: string): Promise; setManagementFeeRecipient(r: string): Promise; instantSetManagementFeeRecipient(r: string): Promise; submitSetForceDeallocatePenalty(adapter: string, penalty: bigint): Promise; setForceDeallocatePenalty(adapter: string, penalty: bigint): Promise; instantSetForceDeallocatePenalty(adapter: string, penalty: bigint): Promise; submitIncreaseTimelock(fn: TimelockFunction, duration: bigint): Promise; increaseTimelock(fn: TimelockFunction, duration: bigint): Promise; instantIncreaseTimelock(fn: TimelockFunction, duration: bigint): Promise; submitDecreaseTimelock(fn: TimelockFunction, duration: bigint): Promise; decreaseTimelock(fn: TimelockFunction, duration: bigint): Promise; instantDecreaseTimelock(fn: TimelockFunction, duration: bigint): Promise; submitAbdicate(fn: TimelockFunction): Promise; abdicate(fn: TimelockFunction): Promise; allocate(adapter: string, data: string, assets: bigint): Promise; deallocate(adapter: string, data: string, assets: bigint): Promise; setLiquidityAdapterAndData(adapter: string, data: string): Promise; setMaxRate(rate: bigint): Promise; deposit(assets: bigint, onBehalf: string): Promise; mint(shares: bigint, onBehalf: string): Promise; withdraw(assets: bigint, receiver: string, onBehalf: string): Promise; redeem(shares: bigint, receiver: string, onBehalf: string): Promise; transfer(to: string, shares: bigint): Promise; transferFrom(from: string, to: string, shares: bigint): Promise; approve(spender: string, shares: bigint): Promise; permit(owner: string, spender: string, shares: bigint, deadline: bigint, v: number, r: string, s: string): Promise; forceDeallocate(adapter: string, data: string, assets: bigint, onBehalf: string): Promise; accrueInterest(): Promise; /** * Approve the underlying asset to be spent by the vault. * Convenience helper: targets the asset contract, not the vault. */ approveAsset(amount: bigint): Promise; }