diff --git a/pkg/types/account.go b/pkg/types/account.go index 27faf273e..b00c1a67f 100644 --- a/pkg/types/account.go +++ b/pkg/types/account.go @@ -15,6 +15,14 @@ type Balance struct { Locked fixedpoint.Value `json:"locked"` } +func (b Balance) String() string { + if b.Locked > 0 { + return fmt.Sprintf("%s: %f (locked %f)", b.Currency, b.Available.Float64(), b.Locked.Float64()) + } + + return fmt.Sprintf("%s: %f", b.Currency, b.Available.Float64()) +} + type BalanceMap map[string]Balance func (m BalanceMap) Print() {