import { type Address, type Hex } from "viem"; import { type Market, MarketParams } from "../../market/index.js"; import type { BigIntish, Hash, MarketId } from "../../types.js"; import { CapacityLimitReason } from "../../utils.js"; import type { IAccrualVaultV2Adapter, IVaultV2Adapter } from "./VaultV2Adapter.js"; import { VaultV2Adapter } from "./VaultV2Adapter.js"; /** Plain input shape for a Vault V2 Morpho Blue market adapter using market ids. */ export interface IVaultV2MorphoMarketV1AdapterV2 extends Omit { type?: "VaultV2MorphoMarketV1AdapterV2"; marketIds: MarketId[]; adaptiveCurveIrm: Address; supplyShares: Record; } /** Represents a Vault V2 Morpho Blue market adapter using market ids. */ export declare class VaultV2MorphoMarketV1AdapterV2 extends VaultV2Adapter implements IVaultV2MorphoMarketV1AdapterV2 { readonly type: "VaultV2MorphoMarketV1AdapterV2"; /** * Returns the adapter-wide allocation-cap id. * * @param address - Adapter address. * @returns The adapter-wide allocation-cap id. * @example * ```ts * const id = VaultV2MorphoMarketV1AdapterV2.adapterCapId(adapter); * ``` */ static adapterCapId(address: Address): `0x${string}`; /** * Returns the collateral-wide allocation-cap id. * * @param address - Collateral token address. * @returns The collateral-wide allocation-cap id. * @example * ```ts * const id = VaultV2MorphoMarketV1AdapterV2.collateralCapId(collateral); * ``` */ static collateralCapId(address: Address): `0x${string}`; /** * Returns the adapter-market allocation-cap id. * * @param address - Adapter address. * @param params - Morpho Blue market parameters. * @returns The adapter-market allocation-cap id. * @example * ```ts * const id = VaultV2MorphoMarketV1AdapterV2.adapterMarketCapId( * adapter, * marketParams, * ); * ``` */ static adapterMarketCapId(address: Address, params: MarketParams): `0x${string}`; marketIds: MarketId[]; adaptiveCurveIrm: Address; supplyShares: Record; constructor({ marketIds, adaptiveCurveIrm, supplyShares, ...vaultV2Adapter }: IVaultV2MorphoMarketV1AdapterV2); /** * Returns this adapter's allocation-cap ids for a Morpho Blue market. * * @param params - Morpho Blue market parameters. * @returns A readonly tuple containing the adapter, collateral, and adapter-market * allocation-cap ids, in that order. * @example * ```ts * import { * MarketParams, * VaultV2MorphoMarketV1AdapterV2, * } from "@morpho-org/blue-sdk"; * import { ZERO_ADDRESS } from "@morpho-org/morpho-ts"; * * const marketParams = MarketParams.idle(ZERO_ADDRESS); * const adapter = new VaultV2MorphoMarketV1AdapterV2({ * address: ZERO_ADDRESS, * parentVault: ZERO_ADDRESS, * skimRecipient: ZERO_ADDRESS, * marketIds: [], * adaptiveCurveIrm: ZERO_ADDRESS, * supplyShares: {}, * }); * const [adapterCapId, collateralCapId, adapterMarketCapId] = * adapter.ids(marketParams); * ``` */ ids(params: MarketParams): readonly [ adapterCapId: Hash, collateralCapId: Hash, adapterMarketCapId: Hash ]; } /** Plain input shape for an accrued Vault V2 Morpho Blue market-id adapter. */ export interface IAccrualVaultV2MorphoMarketV1AdapterV2 extends IVaultV2MorphoMarketV1AdapterV2 { } /** Represents an accrued Vault V2 Morpho Blue market-id adapter. */ export declare class AccrualVaultV2MorphoMarketV1AdapterV2 extends VaultV2MorphoMarketV1AdapterV2 implements IAccrualVaultV2MorphoMarketV1AdapterV2, IAccrualVaultV2Adapter { markets: Market[]; constructor(adapter: IAccrualVaultV2MorphoMarketV1AdapterV2, markets: Market[]); /** {@inheritDoc IAccrualVaultV2Adapter.realAssets} */ realAssets(timestamp?: BigIntish): bigint; /** * Returns a new adapter whose underlying markets have been accrued up to the * given timestamp. * Past timestamps and markets already ahead of `timestamp` keep their snapshots * without throwing. Zero-share markets are left unchanged. * @param timestamp The timestamp at which to accrue interest. * @returns A new `AccrualVaultV2MorphoMarketV1AdapterV2` with contributing * markets accrued to `timestamp`. * @throws {UnsupportedMarketIrmError} when forward projection of a market with * positive debt requires an unsupported IRM. * @example * ```ts * import { AccrualVaultV2MorphoMarketV1AdapterV2 } from "@morpho-org/blue-sdk"; * import { fetchAccrualVaultV2 } from "@morpho-org/blue-sdk-viem"; * import { createPublicClient, http } from "viem"; * import { base } from "viem/chains"; * * const client = createPublicClient({ chain: base, transport: http() }); * const vault = await fetchAccrualVaultV2( * "0x4C7b69b4a82e9E5D8ec60E96516f7A0E17CBC55C", * client, * ); * const adapter = vault.accrualAdapters.find( * (a): a is AccrualVaultV2MorphoMarketV1AdapterV2 => * a instanceof AccrualVaultV2MorphoMarketV1AdapterV2, * )!; * const accrued = adapter.accrueInterest(adapter.markets[0]!.lastUpdate); * // accrued.markets[0]!.lastUpdate === the passed timestamp * ``` */ accrueInterest(timestamp: BigIntish): AccrualVaultV2MorphoMarketV1AdapterV2; maxDeposit(_data: Hex, assets: BigIntish): { value: bigint; limiter: CapacityLimitReason; }; maxWithdraw(data: Hex): import("../../utils.js").CapacityLimit; }