Skip to content

Commit d154e24

Browse files
authored
Add json support for chain:assets:info (#5186)
1 parent a641103 commit d154e24

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

ironfish-cli/src/commands/chain/assets/info.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
import { BufferUtils } from '@ironfish/sdk'
55
import { Args } from '@oclif/core'
66
import { IronfishCommand } from '../../../command'
7-
import { RemoteFlags } from '../../../flags'
7+
import { ColorFlag, ColorFlagKey, RemoteFlags } from '../../../flags'
88
import * as ui from '../../../ui'
99

1010
export default class AssetInfo extends IronfishCommand {
1111
static description = 'show asset information'
12+
static enableJsonFlag = true
1213

1314
static args = {
1415
id: Args.string({
@@ -19,9 +20,10 @@ export default class AssetInfo extends IronfishCommand {
1920

2021
static flags = {
2122
...RemoteFlags,
23+
[ColorFlagKey]: ColorFlag,
2224
}
2325

24-
async start(): Promise<void> {
26+
async start(): Promise<unknown> {
2527
const { args } = await this.parse(AssetInfo)
2628
const { id: assetId } = args
2729

@@ -39,5 +41,7 @@ export default class AssetInfo extends IronfishCommand {
3941
'Transaction Created': data.content.createdTransactionHash,
4042
}),
4143
)
44+
45+
return data.content
4246
}
4347
}

ironfish-cli/src/commands/chain/blocks/info.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import { BufferUtils, CurrencyUtils, TimeUtils } from '@ironfish/sdk'
55
import { Args } from '@oclif/core'
66
import { IronfishCommand } from '../../../command'
7+
import { ColorFlag, ColorFlagKey } from '../../../flags'
78
import * as ui from '../../../ui'
89

910
export default class BlockInfo extends IronfishCommand {
@@ -17,6 +18,10 @@ export default class BlockInfo extends IronfishCommand {
1718
}),
1819
}
1920

21+
static flags = {
22+
[ColorFlagKey]: ColorFlag,
23+
}
24+
2025
async start(): Promise<unknown> {
2126
const { args } = await this.parse(BlockInfo)
2227
const { search } = args

0 commit comments

Comments
 (0)