import { type Address, type Hash, type Hex } from "viem"; import { type RoundingDirection } from "../../math/index.js"; import { type IToken, WrappedToken } from "../../token/index.js"; import type { BigIntish } from "../../types.js"; import { type CapacityLimit } from "../../utils.js"; import type { IAccrualVaultV2Adapter } from "./VaultV2Adapter.js"; export interface IVaultV2Allocation { id: Hash; absoluteCap: bigint; relativeCap: bigint; allocation: bigint; } export interface IVaultV2 extends IToken { asset: Address; /** * The total assets, *including* virtually accrued interest. */ totalAssets: bigint; /** * The total assets, *excluding* virtually accrued interest. */ _totalAssets: bigint; /** * The total supply of shares. */ totalSupply: bigint; virtualShares: bigint; maxRate: bigint; lastUpdate: bigint; adapters: Address[]; liquidityAdapter: Address; liquidityData: Hex; liquidityAllocations: IVaultV2Allocation[] | undefined; performanceFee: bigint; managementFee: bigint; performanceFeeRecipient: Address; managementFeeRecipient: Address; } export declare class VaultV2 extends WrappedToken implements IVaultV2 { readonly asset: Address; totalAssets: bigint; _totalAssets: bigint; totalSupply: bigint; virtualShares: bigint; maxRate: bigint; lastUpdate: bigint; adapters: `0x${string}`[]; liquidityAdapter: `0x${string}`; liquidityData: `0x${string}`; liquidityAllocations: IVaultV2Allocation[] | undefined; performanceFee: bigint; managementFee: bigint; performanceFeeRecipient: `0x${string}`; managementFeeRecipient: `0x${string}`; constructor({ asset, totalAssets, _totalAssets, totalSupply, virtualShares, maxRate, lastUpdate, adapters, liquidityAdapter, liquidityData, liquidityAllocations, performanceFee, managementFee, performanceFeeRecipient, managementFeeRecipient, ...config }: IVaultV2); toAssets(shares: BigIntish): bigint; toShares(assets: BigIntish): bigint; protected _wrap(amount: BigIntish, rounding: RoundingDirection): bigint; protected _unwrap(amount: BigIntish, rounding: RoundingDirection): bigint; } export interface IAccrualVaultV2 extends Omit { } export declare class AccrualVaultV2 extends VaultV2 implements IAccrualVaultV2 { accrualLiquidityAdapter: IAccrualVaultV2Adapter | undefined; accrualAdapters: IAccrualVaultV2Adapter[]; assetBalance: bigint; /** * The force deallocate penalty for each adapter, keyed by adapter address. */ forceDeallocatePenalties: Record; constructor(vault: IAccrualVaultV2, accrualLiquidityAdapter: IAccrualVaultV2Adapter | undefined, accrualAdapters: IAccrualVaultV2Adapter[], assetBalance: bigint, /** * The force deallocate penalty for each adapter, keyed by adapter address. */ forceDeallocatePenalties: Record); /** * Returns the maximum amount of assets that can be deposited to the vault. * @param assets The maximum amount of assets to deposit. */ maxDeposit(assets: BigIntish): CapacityLimit; /** * Returns the maximum amount of assets that can be withdrawn from the vault. * @param shares The maximum amount of shares to redeem. */ maxWithdraw(shares: BigIntish): CapacityLimit; /** * Returns a new vault derived from this vault, whose interest has been accrued up to the given timestamp. * @param timestamp The timestamp at which to accrue interest. Must be greater than or equal to the vault's `lastUpdate`. */ accrueInterest(timestamp: BigIntish): { vault: AccrualVaultV2; performanceFeeShares: bigint; managementFeeShares: bigint; }; }