-
Notifications
You must be signed in to change notification settings - Fork 115
/
updateVideoStateBloatBond.ts
33 lines (25 loc) · 1.22 KB
/
updateVideoStateBloatBond.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import chalk from 'chalk'
import ContentDirectoryCommandBase from '../../base/ContentDirectoryCommandBase'
export default class UpdateVideoStateBloatBondCommand extends ContentDirectoryCommandBase {
static description = 'Update video state bloat bond.'
static args = [
{
name: 'value',
required: true,
description: 'New state bloat bond value',
},
]
async run(): Promise<void> {
const { value } = this.parse(UpdateVideoStateBloatBondCommand).args
// Context
const lead = await this.getRequiredLeadContext()
const keypair = await this.getDecodedPair(lead.roleAccount)
this.jsonPrettyPrint(JSON.stringify({ newVideoStateBloatBond: value }))
await this.requireConfirmation('Do you confirm the provided input?', true)
const result = await this.sendAndFollowNamedTx(keypair, 'content', 'updateVideoStateBloatBond', [value])
const videoStateBloatBondValueUpdatedEvent = this.getEvent(result, 'content', 'VideoStateBloatBondValueUpdated')
const videoStateBloatBondValue = videoStateBloatBondValueUpdatedEvent.data[0]
this.log(chalk.green(`Updated video state bloat bond is ${chalk.cyanBright(videoStateBloatBondValue.toString())}!`))
this.output(value.toString())
}
}