import { providers } from 'ethers';
import { Address } from '@hyperlane-xyz/utils';
import { IsmConfig } from '../ism/types.js';
import { ResolvedTokenFeeConfigInput, TokenFeeConfigInput } from '../fee/types.js';
import { HookConfig } from '../hook/types.js';
import { MultiProvider } from '../providers/MultiProvider.js';
import { DestinationGas, RemoteRouters } from '../router/types.js';
import { ChainMap } from '../types.js';
import { WarpCoreConfig } from '../warp/types.js';
import { DerivedWarpRouteDeployConfig, HypTokenConfig, HypTokenRouterConfig, HypTokenRouterVirtualConfig, MovableTokenConfig, WarpRouteDeployConfig, WarpRouteDeployConfigMailboxRequired } from './types.js';
/**
* Returns default router addresses and gas values for cross-chain communication.
* For each remote chain:
* - Sets up router addresses for message routing
* - Configures gas values for message processing
*/
export declare function getDefaultRemoteRouterAndDestinationGasConfig(multiProvider: MultiProvider, chain: string, deployedRoutersAddresses: ChainMap
, warpDeployConfig: WarpRouteDeployConfig): [RemoteRouters, DestinationGas];
export type ResolvedRebalanceConfig = {
rebalanceTargets: Record;
rebalanceRecipients: Record;
};
export declare function resolveAndValidateRebalanceConfig(multiProvider: MultiProvider, chain: string, config: HypTokenRouterConfig): ResolvedRebalanceConfig;
export declare function getRouterAddressesFromWarpCoreConfig(warpCoreConfig: WarpCoreConfig): ChainMap;
/**
* Gets the chain names from a WarpCoreConfig
*/
export declare function getChainsFromWarpCoreConfig(warpCoreConfig: WarpCoreConfig): string[];
/**
* Checks if a WarpCoreConfig includes all specified chains
* @param config - The warp core config to check
* @param chains - Array of chain names that must all be present
* @returns true if the config spans all specified chains
*/
export declare function warpCoreConfigMatchesChains(config: WarpCoreConfig, chains: string[]): boolean;
/**
* Filters a map of WarpCoreConfigs to only include routes that span all specified chains
* @param configMap - Record of route IDs to WarpCoreConfig
* @param chains - Array of chain names that must all be present in each route
* @returns Filtered record containing only routes that span all specified chains.
* If `chains` is empty, returns `configMap` unchanged (treated as no filter).
*/
export declare function filterWarpCoreConfigMapByChains(configMap: Record, chains: string[]): Record;
type AllowedRebalancingBridges = NonNullable;
/**
* Canonicalizes `allowedRebalancingBridges` keys to domain ids, mirroring
* remoteRouters/destinationGas, so a name-keyed source config does not read as
* drift against the domain-id-keyed on-chain state.
*
* A source config may key the same destination by both chain name and domain
* id; both canonicalize to one key. Bridges are merged by bridge identity —
* unioning approvedTokens — so a bridge listed under both keys does not expand
* to a duplicate that reads as permanent drift against the deduplicated
* on-chain state. Keys the resolver does not recognize are kept as-is rather
* than erroring the whole route check.
*/
export declare function canonicalizeAllowedRebalancingBridges(allowedRebalancingBridges: AllowedRebalancingBridges, resolveDomainId: (domainOrChain: string) => number | undefined): AllowedRebalancingBridges;
/**
* Canonicalizes the keys of a domain-or-chain-name keyed map to domain ids,
* mirroring canonicalizeAllowedRebalancingBridges, so a name-keyed source
* config does not read as drift against the domain-id-keyed on-chain state.
* When two source keys collapse to the same domain their values are combined
* via `merge`. Keys the resolver does not recognize are kept as-is rather than
* erroring the whole route check.
*/
export declare function canonicalizeDomainKeyedMap(map: Record, resolveDomainId: (domainOrChain: string) => number | undefined, merge: (existing: V | undefined, incoming: V) => V): Record;
export declare function mergeRebalanceTargets(existing: string[] | undefined, incoming: string[]): string[];
/**
* Mirrors the completed hybrid ISM leaf into its hook-tree declaration. The
* route preflight requires exactly one identical leaf on both surfaces; using
* the already-completed ISM node here keeps warpRouter/default ownership and
* derived remoteIsms resolution single-sourced.
*/
export declare function completeHybridHookNodesFromIsm(hook: HookConfig, completedIsm: IsmConfig): HookConfig;
export declare function expandWarpDeployConfig(params: {
multiProvider: MultiProvider;
warpDeployConfig: WarpRouteDeployConfigMailboxRequired;
deployedRoutersAddresses: ChainMap;
expandedOnChainWarpConfig?: WarpRouteDeployConfigMailboxRequired;
validateScale?: boolean;
}): Promise;
export declare function normalizeWarpDeployConfigForCheck(params: {
multiProvider: MultiProvider;
warpDeployConfig: WarpRouteDeployConfigMailboxRequired;
}): WarpRouteDeployConfigMailboxRequired;
export declare function resolveTokenFeeAddress(feeConfig: TokenFeeConfigInput, routerAddress: Address, tokenConfig: HypTokenConfig, provider: providers.Provider): Promise;
export declare function expandVirtualWarpDeployConfig(params: {
multiProvider: MultiProvider;
onChainWarpConfig: DerivedWarpRouteDeployConfig;
deployedRoutersAddresses: ChainMap;
}): Promise>>;
/**
* transforms the provided {@link HypTokenRouterConfig}, removing the address, totalSupply and ownerOverrides
* field where they are not required for the config comparison
*/
export declare function transformConfigToCheck(obj: HypTokenRouterConfig): HypTokenRouterConfig;
/**
* Splits warp deploy config into existing and extended configurations based on warp core chains
* for the warp apply process.
*/
export declare function splitWarpCoreAndExtendedConfigs(warpDeployConfig: WarpRouteDeployConfigMailboxRequired, warpCoreChains: string[]): [
WarpRouteDeployConfigMailboxRequired,
WarpRouteDeployConfigMailboxRequired
];
export {};
//# sourceMappingURL=configUtils.d.ts.map