UNPKG

@hyperlane-xyz/cli

Version:

A command-line utility for common Hyperlane operations

107 lines 6.17 kB
/// <reference types="node" resolution-mode="require"/> /// <reference types="node" resolution-mode="require"/> import { ProcessOutput, ProcessPromise } from 'zx'; import { ERC20Test, XERC20LockboxTest, XERC20VSTest } from '@hyperlane-xyz/core'; import { ChainAddresses } from '@hyperlane-xyz/registry'; import { HypTokenRouterConfig } from '@hyperlane-xyz/sdk'; import { Address } from '@hyperlane-xyz/utils'; import { CommandContext } from '../../context/types.js'; export declare const E2E_TEST_CONFIGS_PATH = "./test-configs"; export declare const REGISTRY_PATH = "./test-configs/anvil"; export declare const TEMP_PATH = "/tmp"; export declare const ANVIL_KEY = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"; export declare const E2E_TEST_BURN_ADDRESS = "0x0000000000000000000000000000000000000001"; export declare const CHAIN_NAME_2 = "anvil2"; export declare const CHAIN_NAME_3 = "anvil3"; export declare const EXAMPLES_PATH = "./examples"; export declare const CORE_CONFIG_PATH = "./examples/core-config.yaml"; export declare const CORE_CONFIG_PATH_2 = "/tmp/anvil2/core-config.yaml"; export declare const CORE_READ_CONFIG_PATH_2 = "/tmp/anvil2/core-config-read.yaml"; export declare const CHAIN_2_METADATA_PATH = "./test-configs/anvil/chains/anvil2/metadata.yaml"; export declare const CHAIN_3_METADATA_PATH = "./test-configs/anvil/chains/anvil3/metadata.yaml"; export declare const WARP_CONFIG_PATH_EXAMPLE = "./examples/warp-route-deployment.yaml"; export declare const WARP_CONFIG_PATH_2 = "/tmp/anvil2/warp-route-deployment-anvil2.yaml"; export declare const WARP_DEPLOY_OUTPUT_PATH = "/tmp/warp-route-deployment.yaml"; export declare const WARP_CORE_CONFIG_PATH_2 = "./test-configs/anvil/deployments/warp_routes/ETH/anvil2-config.yaml"; export declare function getCombinedWarpRoutePath(tokenSymbol: string, chains: string[]): string; export declare const DEFAULT_E2E_TEST_TIMEOUT = 100000; export declare enum KeyBoardKeys { ARROW_DOWN = "\u001B[B", ARROW_UP = "\u001B[A", ENTER = "\n", TAB = "\t" } export declare function asyncStreamInputWrite(stream: NodeJS.WritableStream, data: string | Buffer): Promise<void>; export type TestPromptAction = { check: (currentOutput: string) => boolean; input: string; }; /** * Takes a {@link ProcessPromise} and a list of inputs that will be supplied * in the provided order when the check in the {@link TestPromptAction} matches the output * of the {@link ProcessPromise}. */ export declare function handlePrompts(processPromise: Readonly<ProcessPromise>, actions: TestPromptAction[]): Promise<ProcessOutput>; export declare const SELECT_ANVIL_2_FROM_MULTICHAIN_PICKER: string; export declare const SELECT_ANVIL_3_AFTER_ANVIL_2_FROM_MULTICHAIN_PICKER: string; export declare const SELECT_MAINNET_CHAIN_TYPE_STEP: TestPromptAction; export declare const SELECT_ANVIL_2_AND_ANVIL_3_STEPS: ReadonlyArray<TestPromptAction>; export declare const CONFIRM_DETECTED_OWNER_STEP: Readonly<TestPromptAction>; export declare const SETUP_CHAIN_SIGNERS_MANUALLY_STEPS: ReadonlyArray<TestPromptAction>; /** * Retrieves the deployed Warp address from the Warp core config. */ export declare function getDeployedWarpAddress(chain: string, warpCorePath: string): string | null; /** * Updates the owner of the Warp route deployment config, and then output to a file */ export declare function updateWarpOwnerConfig(chain: string, owner: Address, warpCorePath: string, warpDeployPath: string): Promise<string>; /** * Updates the Warp route deployment configuration with a new owner, and then applies the changes. */ export declare function updateOwner(owner: Address, chain: string, warpConfigPath: string, warpCoreConfigPath: string): Promise<ProcessOutput>; /** * Extends the Warp route deployment with a new warp config */ export declare function extendWarpConfig(params: { chain: string; chainToExtend: string; extendedConfig: HypTokenRouterConfig; warpCorePath: string; warpDeployPath: string; strategyUrl?: string; }): Promise<string>; /** * Sets up an incomplete warp route extension for testing purposes. * * This function creates a new warp route configuration for the second chain. */ export declare function setupIncompleteWarpRouteExtension(chain2Addresses: ChainAddresses): Promise<{ chain2DomainId: string; chain3DomainId: string; warpConfigPath: string; configToExtend: HypTokenRouterConfig; context: CommandContext; combinedWarpCorePath: string; }>; /** * Deploys new core contracts on the specified chain if it doesn't already exist, and returns the chain addresses. */ export declare function deployOrUseExistingCore(chain: string, coreInputPath: string, key: string): Promise<Record<string, string>>; export declare function getDomainId(chainName: string, key: string): Promise<string>; export declare function deployToken(privateKey: string, chain: string, decimals?: number, symbol?: string): Promise<ERC20Test>; export declare function deploy4626Vault(privateKey: string, chain: string, tokenAddress: string): Promise<import("@hyperlane-xyz/core").ERC4626Test>; export declare function deployXERC20VSToken(privateKey: string, chain: string, decimals?: number, symbol?: string): Promise<XERC20VSTest>; export declare function deployXERC20LockboxToken(privateKey: string, chain: string, token: ERC20Test): Promise<XERC20LockboxTest>; /** * Performs a round-trip warp relay between two chains using the specified warp core config. * * @param chain1 - The first chain to send the warp relay from. * @param chain2 - The second chain to send the warp relay to and back from. * @param warpCoreConfigPath - The path to the warp core config file. * @returns A promise that resolves when the round-trip warp relay is complete. */ export declare function sendWarpRouteMessageRoundTrip(chain1: string, chain2: string, warpCoreConfigPath: string): Promise<ProcessOutput>; export declare function hyperlaneSendMessage(origin: string, destination: string): Promise<ProcessOutput>; export declare function hyperlaneRelayer(chains: string[], warp?: string): ProcessPromise; //# sourceMappingURL=helpers.d.ts.map