@hyperlane-xyz/cli
Version:
A command-line utility for common Hyperlane operations
24 lines • 919 B
JavaScript
import { readWarpCoreConfig } from '../config/warp.js';
import { logRed } from '../logger.js';
import { selectRegistryWarpRoute } from './tokens.js';
/**
* Gets a {@link WarpCoreConfig} based on the provided path or prompts the user to choose one:
* - if `symbol` is provided the user will have to select one of the available warp routes.
* - if `warp` is provided the config will be read by the provided file path.
* - if none is provided the CLI will exit.
*/
export async function getWarpCoreConfigOrExit({ context, symbol, warp, }) {
let warpCoreConfig;
if (symbol) {
warpCoreConfig = await selectRegistryWarpRoute(context.registry, symbol);
}
else if (warp) {
warpCoreConfig = readWarpCoreConfig(warp);
}
else {
logRed(`Please specify either a symbol or warp config`);
process.exit(0);
}
return warpCoreConfig;
}
//# sourceMappingURL=warp.js.map