createCuratorGroup.ts 692 B

123456789101112131415161718
  1. import ContentDirectoryCommandBase from '../../base/ContentDirectoryCommandBase'
  2. import chalk from 'chalk'
  3. export default class CreateCuratorGroupCommand extends ContentDirectoryCommandBase {
  4. static description = 'Create new Curator Group.'
  5. static aliases = ['createCuratorGroup']
  6. async run() {
  7. const account = await this.getRequiredSelectedAccount()
  8. await this.requireLead()
  9. await this.requestAccountDecoding(account)
  10. await this.buildAndSendExtrinsic(account, 'content', 'createCuratorGroup')
  11. const newGroupId = (await this.getApi().nextCuratorGroupId()) - 1
  12. console.log(chalk.green(`New group succesfully created! (ID: ${chalk.white(newGroupId)})`))
  13. }
  14. }