Skip to content

Commit 00e7750

Browse files
authored
Make balance output consistent (#5309)
Also remove things that are not visible in `wallet:status`
1 parent 0567590 commit 00e7750

File tree

2 files changed

+13
-23
lines changed

2 files changed

+13
-23
lines changed

ironfish-cli/src/commands/wallet/balance.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,7 @@ Balance is your coins from all of your transactions, even if they are on forks o
102102
this.log(
103103
ui.card({
104104
Account: response.content.account,
105-
'Head Hash': response.content.blockHash || 'NULL',
106-
'Head Sequence': response.content.sequence || 'NULL',
107-
Available: renderedAvailable,
105+
Balance: renderedAvailable,
108106
Confirmed: renderedConfirmed,
109107
Unconfirmed: renderedUnconfirmed,
110108
Pending: renderedPending,
@@ -116,7 +114,7 @@ Balance is your coins from all of your transactions, even if they are on forks o
116114
this.log(
117115
ui.card({
118116
Account: response.content.account,
119-
'Available Balance': renderedAvailable,
117+
Balance: renderedAvailable,
120118
}),
121119
)
122120
}

ironfish-cli/src/commands/wallet/balances.ts

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class BalancesCommand extends IronfishCommand {
6666

6767
let columns: TableColumns<AssetBalancePairs> = {
6868
assetName: {
69-
header: 'Asset Name',
69+
header: 'Asset',
7070
get: ({ asset }) =>
7171
renderAssetWithVerificationStatus(
7272
BufferUtils.toHuman(Buffer.from(asset.name, 'hex')),
@@ -76,12 +76,8 @@ export class BalancesCommand extends IronfishCommand {
7676
},
7777
),
7878
},
79-
'asset.id': {
80-
header: 'Asset Id',
81-
get: ({ asset }) => asset.id,
82-
},
8379
available: {
84-
header: 'Available Balance',
80+
header: 'Balance',
8581
get: ({ asset, balance }) =>
8682
CurrencyUtils.render(balance.available, false, asset.id, asset.verification),
8783
},
@@ -90,32 +86,28 @@ export class BalancesCommand extends IronfishCommand {
9086
if (flags.all) {
9187
columns = {
9288
...columns,
93-
availableNotes: {
94-
header: 'Available Notes',
95-
get: ({ balance }) => balance.availableNoteCount,
96-
},
9789
confirmed: {
98-
header: 'Confirmed Balance',
90+
header: 'Confirmed',
9991
get: ({ asset, balance }) =>
10092
CurrencyUtils.render(balance.confirmed, false, asset.id, asset.verification),
10193
},
10294
unconfirmed: {
103-
header: 'Unconfirmed Balance',
95+
header: 'Unconfirmed',
10496
get: ({ asset, balance }) =>
10597
CurrencyUtils.render(balance.unconfirmed, false, asset.id, asset.verification),
10698
},
10799
pending: {
108-
header: 'Pending Balance',
100+
header: 'Pending',
109101
get: ({ asset, balance }) =>
110102
CurrencyUtils.render(balance.pending, false, asset.id, asset.verification),
111103
},
112-
blockHash: {
113-
header: 'Head Hash',
114-
get: ({ balance }) => balance.blockHash || 'NULL',
104+
availableNotes: {
105+
header: 'Notes',
106+
get: ({ balance }) => balance.availableNoteCount,
115107
},
116-
sequence: {
117-
header: 'Head Sequence',
118-
get: ({ balance }) => balance.sequence || 'NULL',
108+
'asset.id': {
109+
header: 'Asset Id',
110+
get: ({ asset }) => asset.id,
119111
},
120112
}
121113
}

0 commit comments

Comments
 (0)