diff --git a/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj b/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj index 88f5ee87cd..49c8f63355 100644 --- a/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj +++ b/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj @@ -9408,7 +9408,7 @@ repositoryURL = "https://github.com/horizontalsystems/Chart.Swift"; requirement = { kind = exactVersion; - version = 1.0.4; + version = 1.0.5; }; }; D3604E8028F03C6B0066C366 /* XCRemoteSwiftPackageReference "FeeRateKit" */ = { diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/Coin/Analytics/CoinAnalyticsViewController.swift b/UnstoppableWallet/UnstoppableWallet/Modules/Coin/Analytics/CoinAnalyticsViewController.swift index d767c01075..3afc8547c0 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/Coin/Analytics/CoinAnalyticsViewController.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/Coin/Analytics/CoinAnalyticsViewController.swift @@ -214,7 +214,7 @@ class CoinAnalyticsViewController: ThemeViewController { } private func openMajorHolders(blockchain: Blockchain) { - let viewController = CoinMajorHoldersModule.viewController(coinUid: viewModel.coin.uid, blockchain: blockchain) + let viewController = CoinMajorHoldersModule.viewController(coin: viewModel.coin, blockchain: blockchain) parentNavigationController?.present(viewController, animated: true) } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/Coin/CoinMajorHolders/CoinMajorHolderChartCell.swift b/UnstoppableWallet/UnstoppableWallet/Modules/Coin/CoinMajorHolders/CoinMajorHolderChartCell.swift index 80d6ca154e..e26c3857a5 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/Coin/CoinMajorHolders/CoinMajorHolderChartCell.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/Coin/CoinMajorHolders/CoinMajorHolderChartCell.swift @@ -13,10 +13,19 @@ class CoinMajorHolderChartCell: BaseThemeCell { override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) + wrapperView.addSubview(countLabel) + countLabel.snp.makeConstraints { maker in + maker.leading.equalToSuperview().inset(CGFloat.margin16) + maker.top.equalToSuperview() + } + + countLabel.font = .subhead2 + countLabel.textColor = .themeGray + wrapperView.addSubview(percentLabel) percentLabel.snp.makeConstraints { maker in maker.leading.equalToSuperview().inset(CGFloat.margin16) - maker.top.equalToSuperview() + maker.top.equalTo(countLabel.snp.bottom).offset(CGFloat.margin12) } percentLabel.font = .headline1 @@ -31,15 +40,6 @@ class CoinMajorHolderChartCell: BaseThemeCell { descriptionLabel.font = .subhead1 descriptionLabel.textColor = .themeGray descriptionLabel.text = "coin_analytics.holders.in_top_10_addresses".localized - - wrapperView.addSubview(countLabel) - countLabel.snp.makeConstraints { maker in - maker.leading.equalToSuperview().inset(CGFloat.margin16) - maker.top.equalTo(percentLabel.snp.bottom).offset(CGFloat.margin12) - } - - countLabel.font = .subhead2 - countLabel.textColor = .themeGray } required init?(coder aDecoder: NSCoder) { diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/Coin/CoinMajorHolders/CoinMajorHoldersModule.swift b/UnstoppableWallet/UnstoppableWallet/Modules/Coin/CoinMajorHolders/CoinMajorHoldersModule.swift index 667c33271f..6592d32082 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/Coin/CoinMajorHolders/CoinMajorHoldersModule.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/Coin/CoinMajorHolders/CoinMajorHoldersModule.swift @@ -4,8 +4,8 @@ import MarketKit struct CoinMajorHoldersModule { - static func viewController(coinUid: String, blockchain: Blockchain) -> UIViewController { - let service = CoinMajorHoldersService(coinUid: coinUid, blockchain: blockchain, marketKit: App.shared.marketKit, evmLabelManager: App.shared.evmLabelManager) + static func viewController(coin: Coin, blockchain: Blockchain) -> UIViewController { + let service = CoinMajorHoldersService(coin: coin, blockchain: blockchain, marketKit: App.shared.marketKit, evmLabelManager: App.shared.evmLabelManager) let viewModel = CoinMajorHoldersViewModel(service: service) let urlManager = UrlManager(inApp: true) let viewController = CoinMajorHoldersViewController(viewModel: viewModel, urlManager: urlManager) diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/Coin/CoinMajorHolders/CoinMajorHoldersService.swift b/UnstoppableWallet/UnstoppableWallet/Modules/Coin/CoinMajorHolders/CoinMajorHoldersService.swift index b8add67547..65e344d321 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/Coin/CoinMajorHolders/CoinMajorHoldersService.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/Coin/CoinMajorHolders/CoinMajorHoldersService.swift @@ -3,7 +3,7 @@ import RxRelay import MarketKit class CoinMajorHoldersService { - private let coinUid: String + let coin: Coin let blockchain: Blockchain private let marketKit: Kit private let evmLabelManager: EvmLabelManager @@ -16,8 +16,8 @@ class CoinMajorHoldersService { } } - init(coinUid: String, blockchain: Blockchain, marketKit: Kit, evmLabelManager: EvmLabelManager) { - self.coinUid = coinUid + init(coin: Coin, blockchain: Blockchain, marketKit: Kit, evmLabelManager: EvmLabelManager) { + self.coin = coin self.blockchain = blockchain self.marketKit = marketKit self.evmLabelManager = evmLabelManager @@ -30,7 +30,7 @@ class CoinMajorHoldersService { state = .loading - marketKit.tokenHoldersSingle(coinUid: coinUid, blockchainUid: blockchain.uid) + marketKit.tokenHoldersSingle(coinUid: coin.uid, blockchainUid: blockchain.uid) .subscribeOn(ConcurrentDispatchQueueScheduler(qos: .userInitiated)) .subscribe(onSuccess: { [weak self] holders in self?.state = .completed(holders) diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/Coin/CoinMajorHolders/CoinMajorHoldersViewController.swift b/UnstoppableWallet/UnstoppableWallet/Modules/Coin/CoinMajorHolders/CoinMajorHoldersViewController.swift index 449172bffd..9a1060fe7f 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/Coin/CoinMajorHolders/CoinMajorHoldersViewController.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/Coin/CoinMajorHolders/CoinMajorHoldersViewController.swift @@ -138,8 +138,8 @@ extension CoinMajorHoldersViewController: SectionsDataSource { var sections: [SectionProtocol] = [ Section( id: "info", - headerState: .margin(height: .margin16), - footerState: .margin(height: .margin16), + headerState: .margin(height: .margin12), + footerState: .margin(height: .margin12), rows: [ Row( id: "info", diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/Coin/CoinMajorHolders/CoinMajorHoldersViewModel.swift b/UnstoppableWallet/UnstoppableWallet/Modules/Coin/CoinMajorHolders/CoinMajorHoldersViewModel.swift index 6e2eda70e4..3f18f8edb1 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/Coin/CoinMajorHolders/CoinMajorHoldersViewModel.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/Coin/CoinMajorHolders/CoinMajorHoldersViewModel.swift @@ -53,7 +53,7 @@ class CoinMajorHoldersViewModel { ViewItem( order: "\(index + 1)", percent: percentFormatter.string(from: (item.percentage / 100) as NSNumber), - quantity: ValueFormatter.instance.formatShort(value: item.balance), + quantity: ValueFormatter.instance.formatShort(value: item.balance, decimalCount: 0, symbol: service.coin.code), labeledAddress: service.labeled(address: item.address), address: item.address ) diff --git a/UnstoppableWallet/UnstoppableWallet/en.lproj/Localizable.strings b/UnstoppableWallet/UnstoppableWallet/en.lproj/Localizable.strings index 75661d6b98..c6fb73fe19 100644 --- a/UnstoppableWallet/UnstoppableWallet/en.lproj/Localizable.strings +++ b/UnstoppableWallet/UnstoppableWallet/en.lproj/Localizable.strings @@ -647,8 +647,8 @@ Go to Settings - > Unstoppable and allow access to the camera."; "coin_analytics.holders.info1" = "Total number of unique addresses holding the token on various blockchains."; "coin_analytics.holders.info2" = "Top 10 wallets holding the token on each blockchain."; "coin_analytics.holders.tracked_blockchains" = "Tracked blockchains: Ethereum, Binance Smart Chain, Optimism, Arbitrum, Celo, Cronos, Avalanche, Fantom, Polygon"; -"coin_analytics.holders.in_top_10_addresses" = "in top 10 addresses"; -"coin_analytics.holders.count" = "Holders: %@"; +"coin_analytics.holders.in_top_10_addresses" = "in top 10 holders"; +"coin_analytics.holders.count" = "Total Holders: %@"; "coin_analytics.holders.see_all" = "See All"; "coin_analytics.project_tvl" = "Project TVL";