From 129bd871de301e47d8ba5a76c0a65631b940832e Mon Sep 17 00:00:00 2001 From: Lee <6251863+ltyu@users.noreply.github.com> Date: Sun, 16 Jun 2024 18:07:32 -0400 Subject: [PATCH] feat: `hyperlane config create chain` prompts for `displayName` (#3969) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Description - Add logic to `hyperlane config create chain` to prompt for `displayName` ![Screenshot 2024-06-14 at 4 33 26 PM](https://github.com/hyperlane-xyz/hyperlane-monorepo/assets/6251863/36e00fc4-f41a-4069-911f-4966bbb6f6e6) ### Backward compatibility Yes ### Testing Manual --- .changeset/new-timers-applaud.md | 5 +++++ typescript/cli/src/config/chain.ts | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 .changeset/new-timers-applaud.md diff --git a/.changeset/new-timers-applaud.md b/.changeset/new-timers-applaud.md new file mode 100644 index 000000000..af8820eac --- /dev/null +++ b/.changeset/new-timers-applaud.md @@ -0,0 +1,5 @@ +--- +'@hyperlane-xyz/cli': minor +--- + +Add chain displayName prompt with default diff --git a/typescript/cli/src/config/chain.ts b/typescript/cli/src/config/chain.ts index dbda2eb9f..bcedd179c 100644 --- a/typescript/cli/src/config/chain.ts +++ b/typescript/cli/src/config/chain.ts @@ -61,6 +61,11 @@ export async function createChainConfig({ validate: (chainName) => ZChainName.safeParse(chainName).success, }); + const displayName = await input({ + message: 'Enter chain display name', + default: name[0].toUpperCase() + name.slice(1), + }); + const chainId = parseInt( await detectAndConfirmOrPrompt( async () => { @@ -76,6 +81,7 @@ export async function createChainConfig({ const metadata: ChainMetadata = { name, + displayName, chainId, domainId: chainId, protocol: ProtocolType.Ethereum,