mirror of
https://github.com/jwinterm/grin-wallet.git
synced 2026-11-17 20:53:54 +01:00
Accounts balances (#815)
Co-authored-by: wiesche <wiesche89@googlemail.com>
This commit is contained in:
committed by
GitHub
co-authored by
wiesche
parent
452a3ec51b
commit
2d87b8c894
@@ -540,13 +540,20 @@ pub fn accounts(acct_mappings: Vec<AcctPathMapping>) {
|
||||
mMG->"Name",
|
||||
bMG->"Parent Output Key",
|
||||
bMG->"Slatepack Address (Index 0)",
|
||||
bMG->"Spendable balance",
|
||||
]);
|
||||
for m in acct_mappings {
|
||||
let slatepack_path = address::address_derivation_path(&m.path, 0).to_bip_32_string();
|
||||
let spendable = if let Some(info) = m.info {
|
||||
amount_to_hr_string(info.amount_currently_spendable, true)
|
||||
} else {
|
||||
"-".to_string()
|
||||
};
|
||||
table.add_row(row![
|
||||
bFC->m.label,
|
||||
bGC->m.path.to_bip_32_string(),
|
||||
bGC->slatepack_path,
|
||||
bGC->spendable,
|
||||
]);
|
||||
}
|
||||
table.set_format(
|
||||
@@ -562,6 +569,7 @@ pub fn accounts(acct_mappings: Vec<AcctPathMapping>) {
|
||||
let width = table.to_string().find('\n').unwrap_or(0);
|
||||
println!("{:^1$}", "BIP-32 Derivation Path", width);
|
||||
table.printstd();
|
||||
println!("Balances use local data and may be out of date.");
|
||||
println!();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user