@iexec/iapp
Version:
A CLI to guide you through the process of building an iExec iApp
16 lines (15 loc) • 903 B
JavaScript
import { DEFAULT_CHAIN, DEPRECATED_CHAINS } from '../config/config.js';
import { getChainConfig } from '../utils/iAppConfigFile.js';
import { command as colorCommand, file as colorFile } from './color.js';
import { warnBox } from './box.js';
export const resolveChainConfig = ({ chain, defaultChain, spinner, }) => {
const config = getChainConfig(chain ?? defaultChain);
spinner.info(`Using chain ${colorFile(config.name)}`);
if (DEPRECATED_CHAINS.includes(config.name)) {
spinner.log(warnBox(`The selected chain ${colorFile(config.name)} is deprecated and may not be supported in future versions.
Please consider switching to ${colorFile(DEFAULT_CHAIN)} or another supported chain.
run ${colorCommand('iapp chain select <name>')} to change default chain or use ${colorCommand('--chain <name>')} option.`));
}
return config;
};
//# sourceMappingURL=resolveChainConfig.js.map