Skip to content

Commit

Permalink
add default account label to account list
Browse files Browse the repository at this point in the history
  • Loading branch information
jowparks committed Oct 28, 2024
1 parent 7513b1a commit 026a818
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ironfish-cli/src/commands/wallet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ export class AccountsCommand extends IronfishCommand {
header: 'Account',
minWidth: 11,
},
default: {
get: (row) => (row.default ? chalk.green('✓') : ''),
header: 'Default',
},
viewOnly: {
get: (row) => (row.viewOnly ? chalk.green('✓') : ''),
header: 'View Only',
Expand Down Expand Up @@ -73,7 +77,6 @@ export class AccountsCommand extends IronfishCommand {
{
...flags,
printLine: this.log.bind(this),
'no-header': flags['no-header'] ?? !flags.extended,
},
)

Expand Down
1 change: 1 addition & 0 deletions ironfish/src/rpc/routes/wallet/serializers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,5 +170,6 @@ export async function serializeRpcAccountStatus(
: null,
scanningEnabled: account.scanningEnabled,
viewOnly: !account.isSpendingAccount(),
default: wallet.getDefaultAccount()?.id === account.id,
}
}
2 changes: 2 additions & 0 deletions ironfish/src/rpc/routes/wallet/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ export type RpcAccountStatus = {
} | null
scanningEnabled: boolean
viewOnly: boolean
default: boolean
}

export const RpcAccountStatusSchema: yup.ObjectSchema<RpcAccountStatus> = yup
Expand All @@ -188,5 +189,6 @@ export const RpcAccountStatusSchema: yup.ObjectSchema<RpcAccountStatus> = yup
.defined(),
scanningEnabled: yup.boolean().defined(),
viewOnly: yup.boolean().defined(),
default: yup.boolean().defined(),
})
.defined()

0 comments on commit 026a818

Please sign in to comment.