// Copyright © 2022 Tokenary. All rights reserved. import WalletCore import BlockiesSwift extension Account { var croppedAddress: String { let dropFirstCount: Int switch coin { case .ethereum: dropFirstCount = 2 case .near, .solana: dropFirstCount = 0 default: fatalError(Strings.somethingWentWrong) } let withoutCommonPart = String(address.dropFirst(dropFirstCount)) return withoutCommonPart.prefix(4) + "..." + withoutCommonPart.suffix(4) } var image: Image? { if coin == .ethereum { return Blockies(seed: address.lowercased()).createImage() } else { return Images.logo(coin: coin) } } }