An advanced Ethereum/EVM mobile wallet
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
alpha-wallet-ios/Trust/Accounts/ViewModels/AccountViewModel.swift

28 lines
688 B

// Copyright SIX DAY LLC. All rights reserved.
import Foundation
import TrustKeystore
import UIKit
struct AccountViewModel {
let wallet: Wallet
let current: Wallet?
let walletBalance: Balance?
init(wallet: Wallet, current: Wallet?, walletBalance: Balance?) {
self.wallet = wallet
self.current = current
self.walletBalance = walletBalance
}
var isWatch: Bool {
return wallet.type == .watch(wallet.address)
}
var balance: String {
return walletBalance?.amountFull ?? "--"
}
var title: String {
return wallet.address.description
}
var isActive: Bool {
return wallet == current
}
}