Skip to content

Commit 380f888

Browse files
authored
add default account label to account list (#5589)
1 parent f95986d commit 380f888

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ export class AccountsCommand extends IronfishCommand {
4444
header: 'Account',
4545
minWidth: 11,
4646
},
47+
default: {
48+
get: (row) => (row.default ? chalk.green('✓') : ''),
49+
header: 'Default',
50+
},
4751
viewOnly: {
4852
get: (row) => (row.viewOnly ? chalk.green('✓') : ''),
4953
header: 'View Only',
@@ -73,7 +77,6 @@ export class AccountsCommand extends IronfishCommand {
7377
{
7478
...flags,
7579
printLine: this.log.bind(this),
76-
'no-header': flags['no-header'] ?? !flags.extended,
7780
},
7881
)
7982

ironfish/src/rpc/routes/wallet/serializers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,5 +170,6 @@ export async function serializeRpcAccountStatus(
170170
: null,
171171
scanningEnabled: account.scanningEnabled,
172172
viewOnly: !account.isSpendingAccount(),
173+
default: wallet.getDefaultAccount()?.id === account.id,
173174
}
174175
}

ironfish/src/rpc/routes/wallet/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ export type RpcAccountStatus = {
172172
} | null
173173
scanningEnabled: boolean
174174
viewOnly: boolean
175+
default: boolean
175176
}
176177

177178
export const RpcAccountStatusSchema: yup.ObjectSchema<RpcAccountStatus> = yup
@@ -188,5 +189,6 @@ export const RpcAccountStatusSchema: yup.ObjectSchema<RpcAccountStatus> = yup
188189
.defined(),
189190
scanningEnabled: yup.boolean().defined(),
190191
viewOnly: yup.boolean().defined(),
192+
default: yup.boolean().defined(),
191193
})
192194
.defined()

0 commit comments

Comments
 (0)