import { Address } from '@hyperlane-xyz/utils'; import { HookConfig } from '../hook/types.js'; import { IsmConfig } from '../ism/types.js'; import { MultiProvider } from '../providers/MultiProvider.js'; import { WarpRouteDeployConfigMailboxRequired } from '../token/types.js'; import { ChainMap, ChainName } from '../types.js'; import { HybridHookIsmConfig } from '../utils/ism.js'; /** * One chain's share of a route's hybrid hook/ISM composition, resolved before * any gas is spent. * * A hybrid is a single contract instance installed as BOTH the router's hook * and its ISM — it meters flow on dispatch and preverifies on delivery out of * the same bucket state — so it is declared on both surfaces and both * declarations must name the same instance. This is the paired result. */ export type WarpHybridChainPlan = { chain: ChainName; /** * The agreed node, taken from the schema-parsed ISM tree. The hook tree's * declaration was compared against it field by field (canonicalHybridNode) * and carries no information this one lacks. */ node: HybridHookIsmConfig; /** The schema-parsed ISM tree the node was found in. */ ismTree: IsmConfig; /** The schema-parsed hook tree the node was found in. */ hookTree: HookConfig; }; /** The chains of a route that install a hybrid hook/ISM, keyed by chain. */ export type WarpHybridPlan = ChainMap; /** * The slice of a chain's warp config the hybrid rules read. Kept structural so * `warp apply`, which holds an expected config rather than a deploy config, can * be validated by exactly the same code. */ export type HybridChainConfig = { interchainSecurityModule?: unknown; hook?: unknown; owner?: Address; feeHook?: Address; type?: WarpRouteDeployConfigMailboxRequired[string]['type']; foreignDeployment?: string; predicateWrapper?: unknown; }; /** * Resolves the hybrid hook/ISM composition of a warp route without spending * any gas: it parses both config trees through their full schemas, finds the * hybrid node on each surface, checks that the two declarations describe one * instance, and validates everything about that instance which is decidable * from the config (protocol, token type, hook position, no competing * predicate wrapper, not a foreignDeployment). * * Every check here is per chain, so the result on a subset of a route is the * same as on the whole route. The invariants whose verdict depends on WHICH * chains the config contains — a delayed-flow route needs an instance on every * leg, and external `remoteRouters` need explicit peers — live in * `assertDelayedFlowRouteCoverage`, which only the whole-route entry points * run. */ export declare function planWarpRouteHybrids({ multiProvider, warpDeployConfig, }: { multiProvider: MultiProvider; warpDeployConfig: WarpRouteDeployConfigMailboxRequired; }): WarpHybridPlan; /** * `planWarpRouteHybrids` for a single chain. `warp apply` reaches this directly: * it plans one router at a time and must apply exactly the same rules the * deploy path does, including the schema refinement, so that a config it * accepts is one a fresh deploy would accept too. */ export declare function planChainHybrid({ multiProvider, chain, config, }: { multiProvider: MultiProvider; chain: ChainName; config: HybridChainConfig; }): WarpHybridChainPlan | undefined; /** * The config the hybrid leaf is deployed from: the planned node bound to the * router it guards, with the ownership the deploy needs while it is still * wiring things up. * * Every hybrid stays owned by the deployer here so its owner matches the * freshly deployed warp router throughout route wiring. Ownership moves to the * configured owner in the route's final pass. */ export declare function hybridLeafDeployConfig({ entry, warpRouter, deployerAddress, }: { entry: WarpHybridChainPlan; warpRouter: Address; deployerAddress: Address; }): HybridHookIsmConfig; /** * The parent trees to hand to EvmIsmModule / EvmHookModule once the shared * instance exists: the same trees the plan captured, with the hybrid node on * each surface replaced by that one address. * * Substituting rather than re-declaring is the point — a second declaration * would deploy a second contract with its own bucket, and the router would * meter dispatches against one while preverifying deliveries against the * other. */ export declare function resolveHybridTrees(entry: WarpHybridChainPlan, hybridAddress: Address): { ism: IsmConfig; hook: HookConfig; }; //# sourceMappingURL=warpHybridPlan.d.ts.map