Skip to content

Commit

Permalink
fix(cli): exclude intents from cli
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandomg committed Mar 5, 2025
1 parent 65c9bd8 commit 3fc778f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 12 deletions.
28 changes: 18 additions & 10 deletions typescript/cli/src/config/warp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ import {

import { createAdvancedIsmConfig } from './ism.js';

const TYPE_DESCRIPTIONS: Record<TokenType, string> = {
const TYPE_DESCRIPTIONS: Record<
Exclude<TokenType, TokenType.intent | TokenType.intentNative>,
string
> = {
[TokenType.synthetic]: 'A new ERC20 with remote transfer functionality',
[TokenType.syntheticRebase]: `A rebasing ERC20 with remote transfer functionality. Must be paired with ${TokenType.collateralVaultRebase}`,
[TokenType.collateral]:
Expand All @@ -59,15 +62,20 @@ const TYPE_DESCRIPTIONS: Record<TokenType, string> = {
[TokenType.fastCollateral]: '',
[TokenType.collateralUri]: '',
[TokenType.nativeScaled]: '',
[TokenType.intent]: '',
[TokenType.intentNative]: '',
};

const TYPE_CHOICES = Object.values(TokenType).map((type) => ({
name: type,
value: type,
description: TYPE_DESCRIPTIONS[type],
}));
const TYPE_CHOICES = Object.values(TokenType)
.filter(
(type) => type !== TokenType.intent && type !== TokenType.intentNative,
)
.map((type) => ({
name: type,
value: type,
description:
TYPE_DESCRIPTIONS[
type as Exclude<TokenType, TokenType.intent | TokenType.intentNative>
],
}));

async function fillDefaults(
context: CommandContext,
Expand Down Expand Up @@ -178,10 +186,10 @@ export async function createWarpRouteDeployConfig({
interchainSecurityModule = createDefaultWarpIsmConfig(owner);
}

const type = await select({
const type = (await select({
message: `Select ${chain}'s token type`,
choices: typeChoices,
});
})) as Exclude<TokenType, TokenType.intent | TokenType.intentNative>;

// TODO: restore NFT prompting
const isNft =
Expand Down
13 changes: 11 additions & 2 deletions typescript/cli/src/verify/warp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,22 @@ async function getWarpRouteFactory(
factory: ContractFactory;
tokenType: Exclude<
TokenType,
TokenType.syntheticUri | TokenType.collateralUri
| TokenType.syntheticUri
| TokenType.collateralUri
| TokenType.intent
| TokenType.intentNative
>;
}> {
const warpRouteReader = new EvmERC20WarpRouteReader(multiProvider, chainName);
const tokenType = (await warpRouteReader.deriveTokenType(
warpRouteAddress,
)) as Exclude<TokenType, TokenType.syntheticUri | TokenType.collateralUri>;
)) as Exclude<
TokenType,
| TokenType.syntheticUri
| TokenType.collateralUri
| TokenType.intent
| TokenType.intentNative
>;

const factory = objFilter(
hypERC20factories,
Expand Down

0 comments on commit 3fc778f

Please sign in to comment.