|
|
|
@ -16,11 +16,12 @@ struct TokensViewModel { |
|
|
|
|
self.tickers = tickers |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var amount: String? { |
|
|
|
|
private var amount: String? { |
|
|
|
|
var totalAmount: Double = 0 |
|
|
|
|
tokens.forEach { token in |
|
|
|
|
totalAmount += amount(for: token) |
|
|
|
|
} |
|
|
|
|
guard totalAmount != 0 else { return "--" } |
|
|
|
|
return CurrencyFormatter.formatter.string(from: NSNumber(value: totalAmount)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -32,8 +33,8 @@ struct TokensViewModel { |
|
|
|
|
return tokenValue * price |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var headerBalance: String { |
|
|
|
|
return amount ?? "--" |
|
|
|
|
var headerBalance: String? { |
|
|
|
|
return amount |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var headerBalanceTextColor: UIColor { |
|
|
|
|