import type { ethers } from "ethers"; import { ContractProvider } from "../../utils"; import * as CompoundV3 from "./CompoundV3Adapters"; import * as ERC4626 from "./ERC4626Adapters"; import type { DeployAdapterResult } from "./GlobalAdapters"; import * as MorphoMarketV1 from "./MorphoMarketV1Adapters"; export type AdapterType = "erc4626" | "erc4626Merkl" | "compoundV3" | "morphoMarketV1"; /** * Factory client — deploys adapters and looks them up by underlying. * * Owns nothing chain-specific: it delegates to per-type modules and the * shared `_contracts` helper. */ export declare class AdaptersFactoryClient { private cp; constructor(provider: ethers.Provider, signer?: ethers.Signer); /** Deploy an adapter of the specified type. */ deployAdapter(type: AdapterType, parentVault: string, underlying: string, cometRewards?: string): Promise; /** * Find an existing adapter for `(parentVault, underlying)`. * If `type` is omitted, every supported type is tried in turn and the * first match (non-zero address) is returned. */ findAdapter(parentVault: string, underlying: string, options?: { type?: AdapterType; cometRewards?: string; }): Promise; /** Check whether an account is a registered adapter of the given type. */ isAdapter(type: AdapterType, account: string): Promise; getERC4626Factory(): Promise; getERC4626MerklFactory(): Promise; getCompoundV3Factory(): Promise; getMorphoMarketV1Factory(): Promise; } /** * Per-adapter introspection client — wraps a single adapter address + * type and exposes the relevant reads. */ export declare class AdaptersClient { private cp; constructor(provider: ethers.Provider, signer?: ethers.Signer); adapter(adapterAddress: string, type: AdapterType): AdapterInstance; /** * Generic instance when the type is unknown — used for cross-type reads * like `getAdapterType()` and `getAdapterFactoryAddress()` which only * need a `factory()` getter (selector identical across types). */ globalAdapter(adapterAddress: string): AdapterInstance; } export declare class AdapterInstance { readonly address: string; readonly type: AdapterType; readonly contract: ethers.Contract; private readonly cp; constructor(cp: ContractProvider, address: string, type: AdapterType); getIdsERC4626(): Promise; getUnderlyingERC4626(): Promise; getVaultStateERC4626(): Promise; getIdsERC4626Merkl(): Promise; getUnderlyingERC4626Merkl(): Promise; getVaultStateERC4626Merkl(): Promise; getIdsCompoundV3(): Promise; getUnderlyingCompoundV3(): Promise; getCometState(): Promise; getIdsMarketV1(marketParams: MorphoMarketV1.MarketParams): Promise; getUnderlyingMarketFromAdapterV1(): Promise; getMarketIdsLength(): Promise; getMarketId(index: number): Promise; getMarketState(id: string): Promise; /** Read the on-chain `adapterId` (bytes32) — implemented by every adapter type. */ getAdapterId(): Promise; getAdapterFactoryAddress(): Promise; getAdapterType(): Promise; /** * Live value of the adapter's investments (pending interest included). * `realAssets()` is required by `IAdapter`, so this works for any type. */ getRealAssets(): Promise; /** Parent vault address, exposed by every adapter type. */ getParentVault(): Promise; /** * Vault-side tracked allocation for the adapter's lone id (single-id * types). Lazy: excludes interest/losses since the last (de)allocate, * use `getRealAssets()` for the live value. For morphoMarketV1 the * allocation is per-market: use `getAllocationMarketV1(marketParams)`. */ getAllocation(): Promise; /** Vault-side tracked allocation of one market (`this/marketParams` id). */ getAllocationMarketV1(marketParams: MorphoMarketV1.MarketParams): Promise; /** * Live value of the adapter's position on one market by id (bytes32), * pending interest included: the per-market term of `realAssets()`. */ getExpectedSupplyAssets(marketId: string): Promise; /** Adapter's raw supply shares on one market by id (bytes32). */ getSupplyShares(marketId: string): Promise; /** Adaptive-curve IRM address baked into the adapter. */ getAdaptiveCurveIrm(): Promise; /** Underlying asset of the adapter (morphoMarketV1 / compoundV3 only). */ getAsset(): Promise; getSkimRecipient(): Promise; setSkimRecipient(newSkimRecipient: string): Promise; skim(token: string): Promise; getClaimer(): Promise; setClaimer(newClaimer: string): Promise; claim(data: string): Promise; getCometRewards(): Promise; getMerklDistributor(): Promise; getTimelock(selector: string): Promise; getAbdicated(selector: string): Promise; getExecutableAt(data: string): Promise; submit(data: string): Promise; revoke(data: string): Promise; abdicate(selector: string): Promise; /** * Write off the adapter's recorded supply shares on a market (bad debt). * Timelocked, must be `submit`'d first. */ burnShares(marketId: string): Promise; increaseTimelock(selector: string, newDuration: bigint): Promise; decreaseTimelock(selector: string, newDuration: bigint): Promise; private requireType; }