@fuel-infrastructure/fuel-hyperlane-registry
Version:
A collection of configs, artifacts, and schemas for Hyperlane
39 lines (38 loc) • 1.72 kB
TypeScript
import type { ChainMap, ChainName, WarpCoreConfig } from '@hyperlane-xyz/sdk';
import { ChainAddresses, WarpRouteId } from '../types.js';
import { WarpRouteFilterParams } from './IRegistry.js';
/**
* Converts from a full warp config to a map of chain addresses.
*/
export declare function warpConfigToWarpAddresses(config: WarpCoreConfig): ChainMap<ChainAddresses>;
/**
* Gets a warp route ID from a warp route config path.
* @param configRelativePath A relative path in the deployments dir
* (e.g. `warp_routes/USDC/ethereum-arbitrum-config.yaml`)
*/
export declare function warpRouteConfigPathToId(configRelativePath: string): WarpRouteId;
/**
* Gets a warp route ID from a warp deploy config path.
* @param configRelativePath A relative path in the deployments dir
* (e.g. `warp_routes/USDC/ethereum-arbitrum-config.yaml`)
*/
export declare function warpRouteDeployConfigPathToId(configRelativePath: string): WarpRouteId;
/**
* Gets a warp route ID from a warp route config.
* This uses the first symbol in the lift. Situations where a config contains multiple
* symbols are not officially supported yet.
*/
export declare function warpRouteConfigToId(config: WarpCoreConfig): WarpRouteId;
export declare function createWarpRouteConfigId(tokenSymbol: string, chains: ChainName[]): WarpRouteId;
export declare function parseWarpRouteConfigId(routeId: WarpRouteId): {
tokenSymbol: string;
chainNames: ChainName[];
};
/**
* Filters a list of warp route IDs based on the provided filter params.
*/
export declare function filterWarpRoutesIds<T>(idMap: Record<WarpRouteId, T>, filter?: WarpRouteFilterParams): {
ids: WarpRouteId[];
values: T[];
idMap: Record<WarpRouteId, T>;
};