@hyperlane-xyz/cli
Version:
A command-line utility for common Hyperlane operations
22 lines • 848 B
JavaScript
import { EvmCoreReader } from '@hyperlane-xyz/sdk';
import { assert } from '@hyperlane-xyz/utils';
import { errorRed } from '../logger.js';
export async function executeCoreRead({ context, chain, mailbox, }) {
const addresses = await context.registry.getChainAddresses(chain);
if (!mailbox) {
mailbox = addresses?.mailbox;
assert(mailbox, `${chain} mailbox not provided and none found in registry.`);
}
const evmCoreReader = new EvmCoreReader(context.multiProvider, chain);
try {
return evmCoreReader.deriveCoreConfig({
mailbox,
interchainAccountRouter: addresses?.interchainAccountRouter,
});
}
catch (e) {
errorRed(`❌ Failed to read core config for mailbox ${mailbox} on ${chain}:`, e);
process.exit(1);
}
}
//# sourceMappingURL=core.js.map