diff --git a/Adamant/Helpers/NodeGroup+Constants.swift b/Adamant/Helpers/NodeGroup+Constants.swift index 3c489ae19..4f0b5bb4a 100644 --- a/Adamant/Helpers/NodeGroup+Constants.swift +++ b/Adamant/Helpers/NodeGroup+Constants.swift @@ -129,20 +129,20 @@ extension NodeGroup { var name: String { switch self { case .btc: - return BtcWalletService.tokenNetworkSymbol + return BtcWalletService.nodeDisplayName ?? BtcWalletService.tokenNetworkSymbol case .eth: - return EthWalletService.tokenNetworkSymbol + return EthWalletService.nodeDisplayName ?? EthWalletService.tokenNetworkSymbol case .klyNode: - return KlyWalletService.tokenNetworkSymbol + return KlyWalletService.nodeDisplayName ?? KlyWalletService.tokenNetworkSymbol case .klyService: - return KlyWalletService.tokenNetworkSymbol + return KlyWalletService.indexerDisplayName ?? KlyWalletService.tokenNetworkSymbol + " " + .adamant.coinsNodesList.serviceNode case .doge: - return DogeWalletService.tokenNetworkSymbol + return DogeWalletService.nodeDisplayName ?? DogeWalletService.tokenNetworkSymbol case .dash: - return DashWalletService.tokenNetworkSymbol + return DashWalletService.nodeDisplayName ?? DashWalletService.tokenNetworkSymbol case .adm: - return AdmWalletService.tokenNetworkSymbol + return AdmWalletService.nodeDisplayName ?? AdmWalletService.tokenNetworkSymbol case .ipfs: return IPFSApiService.symbol case .infoService: diff --git a/Adamant/Modules/CoinsNodesList/CoinsNodesListFactory.swift b/Adamant/Modules/CoinsNodesList/CoinsNodesListFactory.swift index c820cc779..8757fb958 100644 --- a/Adamant/Modules/CoinsNodesList/CoinsNodesListFactory.swift +++ b/Adamant/Modules/CoinsNodesList/CoinsNodesListFactory.swift @@ -31,10 +31,10 @@ struct CoinsNodesListFactory { let view = CoinsNodesListView(viewModel: viewModel) switch context { - case .login: - return SelfRemovableHostingController(rootView: view) - case .menu: - return UIHostingController(rootView: view) + case .login: + return SelfRemovableHostingController(rootView: view) + case .menu: + return UIHostingController(rootView: view) } } } diff --git a/Adamant/Modules/Wallets/Klayr/WalletService/KlyWalletService.swift b/Adamant/Modules/Wallets/Klayr/WalletService/KlyWalletService.swift index bad47dd78..d31b43bca 100644 --- a/Adamant/Modules/Wallets/Klayr/WalletService/KlyWalletService.swift +++ b/Adamant/Modules/Wallets/Klayr/WalletService/KlyWalletService.swift @@ -56,6 +56,10 @@ final class KlyWalletService: WalletCoreProtocol, WalletStaticCoreProtocol, @unc var balanceValidInterval: Int? { Self.balanceValidInterval } + + static var indexerDisplayName: String? { + coinInfo?.services?.klyService?.displayName + } @MainActor var hasEnabledNode: Bool { diff --git a/Adamant/Modules/Wallets/WalletsService/WalletStaticCoreProtocol.swift b/Adamant/Modules/Wallets/WalletsService/WalletStaticCoreProtocol.swift index 398edc154..df3fe834b 100644 --- a/Adamant/Modules/Wallets/WalletsService/WalletStaticCoreProtocol.swift +++ b/Adamant/Modules/Wallets/WalletsService/WalletStaticCoreProtocol.swift @@ -151,4 +151,8 @@ extension WalletStaticCoreProtocol { ) } ?? [] } + + static var nodeDisplayName: String? { + coinInfo?.nodes?.displayName + } } diff --git a/AdamantWalletsKit/Sources/AdamantWalletsKit/Decoders/CoinInfoDTO.swift b/AdamantWalletsKit/Sources/AdamantWalletsKit/Decoders/CoinInfoDTO.swift index beb4daf5f..7b0bc8e5e 100644 --- a/AdamantWalletsKit/Sources/AdamantWalletsKit/Decoders/CoinInfoDTO.swift +++ b/AdamantWalletsKit/Sources/AdamantWalletsKit/Decoders/CoinInfoDTO.swift @@ -66,6 +66,7 @@ public struct CoinInfoDTO: Codable { } public struct Service: Codable { + public let displayName: String? let description: Description public let list: [Node] public let healthCheck: NodeHealthCheck? @@ -79,6 +80,7 @@ public struct CoinInfoDTO: Codable { } public struct Nodes: Codable { + public let displayName: String? public let list: [Node] public let healthCheck: NodeHealthCheck public let minVersion: String?