@hyperlane-xyz/sdk
Version:
The official SDK for the Hyperlane Network
74 lines • 4.25 kB
TypeScript
import { Address } from '@hyperlane-xyz/utils';
import { ResolvedTokenFeeConfigInput, TokenFeeConfigInput } from '../fee/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, 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<Address>, warpDeployConfig: WarpRouteDeployConfig): [RemoteRouters, DestinationGas];
export declare function getRouterAddressesFromWarpCoreConfig(warpCoreConfig: WarpCoreConfig): ChainMap<Address>;
/**
* 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<T extends WarpCoreConfig>(configMap: Record<string, T>, chains: string[]): Record<string, T>;
/**
* Expands a Warp deploy config with additional data
*
* @param multiProvider
* @param warpDeployConfig - The warp deployment config
* @param deployedRoutersAddresses - Addresses of deployed routers for each chain
* @param virtualConfig - Optional virtual config to include in the warpDeployConfig
* @returns A promise resolving to an expanded Warp deploy config with derived and virtual metadata
*/
export declare function expandWarpDeployConfig(params: {
multiProvider: MultiProvider;
warpDeployConfig: WarpRouteDeployConfigMailboxRequired;
deployedRoutersAddresses: ChainMap<Address>;
expandedOnChainWarpConfig?: WarpRouteDeployConfigMailboxRequired;
validateScale?: boolean;
}): Promise<WarpRouteDeployConfigMailboxRequired>;
export declare function normalizeWarpDeployConfigForCheck(params: {
multiProvider: MultiProvider;
warpDeployConfig: WarpRouteDeployConfigMailboxRequired;
}): WarpRouteDeployConfigMailboxRequired;
export declare function resolveTokenFeeAddress(feeConfig: TokenFeeConfigInput, routerAddress: Address, tokenConfig: HypTokenConfig): ResolvedTokenFeeConfigInput;
export declare function expandVirtualWarpDeployConfig(params: {
multiProvider: MultiProvider;
onChainWarpConfig: DerivedWarpRouteDeployConfig;
deployedRoutersAddresses: ChainMap<Address>;
}): Promise<DerivedWarpRouteDeployConfig & Record<string, Partial<HypTokenRouterVirtualConfig>>>;
/**
* 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
];
//# sourceMappingURL=configUtils.d.ts.map