diff --git a/cli/commands/create-contract-position-fetcher.ts b/cli/commands/create-contract-position-fetcher.ts index 0027a4691..8c526ff9e 100644 --- a/cli/commands/create-contract-position-fetcher.ts +++ b/cli/commands/create-contract-position-fetcher.ts @@ -2,12 +2,18 @@ import { Command } from '@oclif/core'; -import { GroupType } from '../../src/app/app.interface'; +import { AppGroup, GroupType } from '../../src/app/app.interface'; import { addGroupToAppDefinition } from '../generators/generate-app-definition'; import { addContractPositionFetcherToAppModule } from '../generators/generate-app-module'; import { generateContractPositionFetcher } from '../generators/generate-contract-position-fetcher'; import { loadAppDefinition } from '../generators/utils'; -import { promptAppGroupId, promptAppNetwork, promptNewGroupId, promptNewGroupLabel } from '../prompts'; +import { + promptAppGroupId, + promptAppNetwork, + promptNewGroupId, + promptNewGroupLabel, + promptNewGroupType, +} from '../prompts'; export default class CreateContractPositionFetcher extends Command { static description = 'Creates a contract position fetcher in a given app'; @@ -24,11 +30,12 @@ export default class CreateContractPositionFetcher extends Command { const networks = Object.keys(definition.supportedNetworks); let groupId = await promptAppGroupId(groupIds); - let group = null; + let group: AppGroup | null = null; if (!groupId) { const newGroupId = await promptNewGroupId(groupIds); const newGroupLabel = await promptNewGroupLabel(); - group = { id: newGroupId, label: newGroupLabel, type: GroupType.TOKEN }; + const newGroupType = await promptNewGroupType(); + group = { id: newGroupId, label: newGroupLabel, type: GroupType.POSITION }; groupId = newGroupId; } diff --git a/cli/commands/create-token-fetcher.ts b/cli/commands/create-token-fetcher.ts index f23655e23..5e8d90f13 100644 --- a/cli/commands/create-token-fetcher.ts +++ b/cli/commands/create-token-fetcher.ts @@ -2,7 +2,7 @@ import { Command } from '@oclif/core'; -import { GroupType } from '../../src/app/app.interface'; +import { AppGroup, GroupType } from '../../src/app/app.interface'; import { addGroupToAppDefinition } from '../generators/generate-app-definition'; import { addTokenFetcherToAppModule } from '../generators/generate-app-module'; import { generateTokenFetcher } from '../generators/generate-token-fetcher'; @@ -32,7 +32,7 @@ export default class CreateTokenFetcher extends Command { const networks = Object.keys(definition.supportedNetworks); let groupId = await promptAppGroupId(groupIds); - let group = null; + let group: AppGroup | null = null; if (!groupId) { const newGroupId = await promptNewGroupId(groupIds); const newGroupLabel = await promptNewGroupLabel();