diff --git a/unstoppable-ios-app/domains-manager-ios-preview/Entities/PreviewNetworkService.swift b/unstoppable-ios-app/domains-manager-ios-preview/Entities/PreviewNetworkService.swift index 328fb51ea..99b0edc83 100644 --- a/unstoppable-ios-app/domains-manager-ios-preview/Entities/PreviewNetworkService.swift +++ b/unstoppable-ios-app/domains-manager-ios-preview/Entities/PreviewNetworkService.swift @@ -253,6 +253,10 @@ extension NetworkService: DomainProfileNetworkServiceProtocol { func getTrendingDomains() async throws -> SerializedRankingDomainsResponse { MockEntitiesFabric.Explore.createTrendingProfiles() } + + func fetchReverseResolution(for address: HexAddress) async throws -> DomainName? { + "oleg.x" + } } // MARK: - WalletTransactionsNetworkServiceProtocol diff --git a/unstoppable-ios-app/domains-manager-ios/Entities/DomainProfileDisplayInfo.swift b/unstoppable-ios-app/domains-manager-ios/Entities/DomainProfileDisplayInfo.swift index 0e5070157..786af087b 100644 --- a/unstoppable-ios-app/domains-manager-ios/Entities/DomainProfileDisplayInfo.swift +++ b/unstoppable-ios-app/domains-manager-ios/Entities/DomainProfileDisplayInfo.swift @@ -32,6 +32,12 @@ struct DomainProfileDisplayInfo: Hashable { } } + var pfpInfo: DomainPFPInfo { + DomainPFPInfo(domainName: domainName, + pfpURL: pfpURL?.absoluteString, + imageType: imageType) + } + } extension DomainProfileDisplayInfo { diff --git a/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/BlockchainType+Extension.swift b/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/BlockchainType+Extension.swift index 9d7b988df..dc7467bfc 100644 --- a/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/BlockchainType+Extension.swift +++ b/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/BlockchainType+Extension.swift @@ -56,6 +56,8 @@ extension SemiSupportedBlockchainType { .bitcoinIcon case .Solana: .solanaIcon + case .Base: + .baseIcon } } } diff --git a/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/BlockchainType.swift b/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/BlockchainType.swift index a5b721fb2..f96e2cb2d 100644 --- a/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/BlockchainType.swift +++ b/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/BlockchainType.swift @@ -31,6 +31,7 @@ enum BlockchainType: String, CaseIterable, Codable, Hashable { enum SemiSupportedBlockchainType: String, CaseIterable, Codable, Hashable { case Bitcoin = "BTC" case Solana = "SOL" + case Base = "BASE" var fullName: String { switch self { @@ -38,6 +39,8 @@ enum SemiSupportedBlockchainType: String, CaseIterable, Codable, Hashable { return "Bitcoin" case .Solana: return "Solana" + case .Base: + return "Base" } } } diff --git a/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Preview.swift b/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Preview.swift index 70f4cb358..f4efdaa13 100644 --- a/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Preview.swift +++ b/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Preview.swift @@ -222,6 +222,7 @@ extension String { static let viewInBrowser = "VIEW_IN_BROWSER" static let tokens = "TOKENS" static let collectibles = "COLLECTIBLES" + static let collectible = "COLLECTIBLE" static let receive = "RECEIVE" static let profile = "PROFILE" static let more = "MORE" @@ -1196,6 +1197,7 @@ extension String { static let noRecordsToSendCryptoPullUpTitle = "NO_RECORDS_TO_SEND_CRYPTO_PULL_UP_TITLE" static let noRecordsToSendCryptoMessage = "NO_RECORDS_TO_SEND_CRYPTO_MESSAGE" static let sentSuccessfully = "SENT_SUCCESSFULLY" + static let receivedSuccessfully = "RECEIVED_SUCCESSFULLY" // Import MPC static let importMPCWalletTitle = "IMPORT_MPC_WALLET_TITLE" diff --git a/unstoppable-ios-app/domains-manager-ios/Extensions/UIImage.swift b/unstoppable-ios-app/domains-manager-ios/Extensions/UIImage.swift index 757fb6a9d..b8340f7e2 100644 --- a/unstoppable-ios-app/domains-manager-ios/Extensions/UIImage.swift +++ b/unstoppable-ios-app/domains-manager-ios/Extensions/UIImage.swift @@ -17,6 +17,7 @@ extension UIImage { static let warningIcon = UIImage(named: "warningIcon")! static let ethereumIcon = UIImage(named: "ethereumIcon")! static let polygonIcon = UIImage(named: "polygonIcon")! + static let baseIcon = UIImage(named: "baseIcon")! static let externalWalletIndicator = UIImage(named: "externalWalletIndicator")! static let cloudIcon = UIImage(named: "cloudIcon")! static let checkCircleWhite = UIImage(named: "checkCircleWhite")! diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/Home/Activity/WalletTransactionDisplayInfoListItemView.swift b/unstoppable-ios-app/domains-manager-ios/Modules/Home/Activity/WalletTransactionDisplayInfoListItemView.swift index 326711dd0..3288d7ed7 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/Home/Activity/WalletTransactionDisplayInfoListItemView.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/Home/Activity/WalletTransactionDisplayInfoListItemView.swift @@ -158,8 +158,7 @@ private extension WalletTransactionDisplayInfoListItemView { if transaction.isDomainNFT { nftTxValueViewWith(name: String.Constants.domain.localized()) } else { - nftTxValueViewWith(name: "NFT") - + nftTxValueViewWith(name: String.Constants.collectible.localized()) } } diff --git a/unstoppable-ios-app/domains-manager-ios/Services/DomainProfilesService/DomainProfilesService.swift b/unstoppable-ios-app/domains-manager-ios/Services/DomainProfilesService/DomainProfilesService.swift index 184bf68f7..fd9b7f80b 100644 --- a/unstoppable-ios-app/domains-manager-ios/Services/DomainProfilesService/DomainProfilesService.swift +++ b/unstoppable-ios-app/domains-manager-ios/Services/DomainProfilesService/DomainProfilesService.swift @@ -57,6 +57,14 @@ extension DomainProfilesService: DomainProfilesServiceProtocol { try? storage.retrieveProfileFor(domainName: domainName) } + func fetchResolvedDomainProfileDisplayInfo(for walletAddress: HexAddress) async throws -> DomainProfileDisplayInfo { + let domainName = try await networkService.fetchReverseResolution(for: walletAddress) + guard let domainName else { + throw DomainProfilesServiceError.noDomainForWalletAddress + } + return try await fetchDomainProfileDisplayInfo(for: domainName) + } + func fetchDomainProfileDisplayInfo(for domainName: DomainName) async throws -> DomainProfileDisplayInfo { let serializedProfile = try await getSerializedPublicDomainProfile(for: domainName) let profile = DomainProfileDisplayInfo(serializedProfile: serializedProfile) @@ -259,6 +267,7 @@ private extension DomainProfilesService { extension DomainProfilesService { enum DomainProfilesServiceError: String, LocalizedError { case noDomainForSocialDetails + case noDomainForWalletAddress public var errorDescription: String? { return rawValue diff --git a/unstoppable-ios-app/domains-manager-ios/Services/DomainProfilesService/DomainProfilesServiceProtocol.swift b/unstoppable-ios-app/domains-manager-ios/Services/DomainProfilesService/DomainProfilesServiceProtocol.swift index 79f2a9f11..3a9cb371f 100644 --- a/unstoppable-ios-app/domains-manager-ios/Services/DomainProfilesService/DomainProfilesServiceProtocol.swift +++ b/unstoppable-ios-app/domains-manager-ios/Services/DomainProfilesService/DomainProfilesServiceProtocol.swift @@ -13,6 +13,7 @@ protocol DomainProfilesServiceProtocol { func getCachedDomainProfileDisplayInfo(for domainName: String) -> DomainProfileDisplayInfo? func fetchDomainProfileDisplayInfo(for domainName: DomainName) async throws -> DomainProfileDisplayInfo + func fetchResolvedDomainProfileDisplayInfo(for walletAddress: HexAddress) async throws -> DomainProfileDisplayInfo func getCachedAndRefreshDomainProfileStream(for domainName: DomainName) -> AsyncThrowingStream @discardableResult func updateUserDomainProfile(for domain: DomainDisplayInfo, diff --git a/unstoppable-ios-app/domains-manager-ios/Services/DomainProfilesService/Network/DomainProfileNetworkServiceProtocol.swift b/unstoppable-ios-app/domains-manager-ios/Services/DomainProfilesService/Network/DomainProfileNetworkServiceProtocol.swift index 823261b80..76a752f7a 100644 --- a/unstoppable-ios-app/domains-manager-ios/Services/DomainProfilesService/Network/DomainProfileNetworkServiceProtocol.swift +++ b/unstoppable-ios-app/domains-manager-ios/Services/DomainProfilesService/Network/DomainProfileNetworkServiceProtocol.swift @@ -22,4 +22,5 @@ protocol DomainProfileNetworkServiceProtocol { func getProfileSuggestions(for domainName: DomainName) async throws -> SerializedDomainProfileSuggestionsResponse func getTrendingDomains() async throws -> SerializedRankingDomainsResponse + func fetchReverseResolution(for address: HexAddress) async throws -> DomainName? } diff --git a/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/baseIcon.imageset/Contents.json b/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/baseIcon.imageset/Contents.json new file mode 100644 index 000000000..349cefea9 --- /dev/null +++ b/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/baseIcon.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "baseIcon.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "template-rendering-intent" : "original" + } +} diff --git a/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/baseIcon.imageset/baseIcon.svg b/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/baseIcon.imageset/baseIcon.svg new file mode 100644 index 000000000..8bb293aa6 --- /dev/null +++ b/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/baseIcon.imageset/baseIcon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/bitcoinIcon.imageset/bitcoinIcon.svg b/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/bitcoinIcon.imageset/bitcoinIcon.svg index b8325a9f6..b08caf5f8 100644 --- a/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/bitcoinIcon.imageset/bitcoinIcon.svg +++ b/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/bitcoinIcon.imageset/bitcoinIcon.svg @@ -1,3 +1,5 @@ - - + + + + diff --git a/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/solanaIcon.imageset/Contents.json b/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/solanaIcon.imageset/Contents.json index fb35f15b5..1d31706ad 100644 --- a/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/solanaIcon.imageset/Contents.json +++ b/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/solanaIcon.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "solanaIcon.pdf", + "filename" : "solanaIcon.svg", "idiom" : "universal" } ], diff --git a/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/solanaIcon.imageset/solanaIcon.pdf b/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/solanaIcon.imageset/solanaIcon.pdf deleted file mode 100644 index 48cbb0055..000000000 Binary files a/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/solanaIcon.imageset/solanaIcon.pdf and /dev/null differ diff --git a/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/solanaIcon.imageset/solanaIcon.svg b/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/solanaIcon.imageset/solanaIcon.svg new file mode 100644 index 000000000..b0e9497b7 --- /dev/null +++ b/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/solanaIcon.imageset/solanaIcon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Localization/en.lproj/Localizable.strings b/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Localization/en.lproj/Localizable.strings index 2092d1c84..45c2316a9 100644 --- a/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Localization/en.lproj/Localizable.strings +++ b/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Localization/en.lproj/Localizable.strings @@ -160,6 +160,7 @@ "VIEW_IN_BROWSER" = "View in browser"; "TOKENS" = "Tokens"; "COLLECTIBLES" = "Collectibles"; +"COLLECTIBLE" = "Collectible"; "RECEIVE" = "Receive"; "PROFILE" = "Profile"; "MORE" = "More"; @@ -1091,6 +1092,7 @@ More tabs are coming in the next updates."; "NO_RECORDS_TO_SEND_CRYPTO_PULL_UP_TITLE" = "%@ hasn't added an address for the crypto you wish to send"; "NO_RECORDS_TO_SEND_CRYPTO_MESSAGE" = "To prevent loss of funds we restrict sending of crypto if an address hasn't been added to the domain by it's owner. Kindly inform the domain owner so you can send them funds."; "SENT_SUCCESSFULLY" = "Sent successfully"; +"RECEIVED_SUCCESSFULLY" = "Received successfully"; // Import MPC "IMPORT_MPC_WALLET_TITLE" = "Import %@"; diff --git a/unstoppable-ios-app/domains-manager-ios/SwiftUI/ViewModifiers/ViewPullUp/Custom pull up views/TransactionDetailsPullUpView.swift b/unstoppable-ios-app/domains-manager-ios/SwiftUI/ViewModifiers/ViewPullUp/Custom pull up views/TransactionDetailsPullUpView.swift index a1890296a..f5dc36382 100644 --- a/unstoppable-ios-app/domains-manager-ios/SwiftUI/ViewModifiers/ViewPullUp/Custom pull up views/TransactionDetailsPullUpView.swift +++ b/unstoppable-ios-app/domains-manager-ios/SwiftUI/ViewModifiers/ViewPullUp/Custom pull up views/TransactionDetailsPullUpView.swift @@ -59,7 +59,7 @@ private extension TransactionDetailsPullUpView { @ViewBuilder func titleViews() -> some View { VStack(spacing: 8) { - Text(String.Constants.sentSuccessfully.localized()) + Text(title) .textAttributes(color: .foregroundDefault, fontSize: 22, fontWeight: .bold) HStack { Text(tx.time, style: .date) @@ -70,6 +70,15 @@ private extension TransactionDetailsPullUpView { } } + var title: String { + switch tx.type { + case .tokenDeposit, .nftDeposit: + String.Constants.receivedSuccessfully.localized() + case .tokenWithdrawal, .nftWithdrawal: + String.Constants.sentSuccessfully.localized() + } + } + @ViewBuilder func txVisualisationsView() -> some View { ZStack { @@ -185,7 +194,7 @@ private extension TransactionDetailsPullUpView { if tx.isDomainNFT { String.Constants.domain.localized() } else { - "NFT" + String.Constants.collectible.localized() } } } @@ -216,9 +225,11 @@ private extension TransactionDetailsPullUpView { struct TxReceiverVisualisationView: View { @Environment(\.imageLoadingService) var imageLoadingService + @Environment(\.domainProfilesService) var domainProfilesService let tx: WalletTransactionDisplayInfo @State private var icon: UIImage? + @State private var profile: DomainProfileDisplayInfo? var body: some View { BaseVisualisationView(title: title, @@ -246,7 +257,7 @@ private extension TransactionDetailsPullUpView { var subtitle: String { if receiverDomainName == nil { - return "Recepient" + return String.Constants.recipient.localized() } return tx.to.address.walletAddressTruncated } @@ -268,24 +279,23 @@ private extension TransactionDetailsPullUpView { } private var receiverDomainName: String? { - if let domainName = tx.to.domainName { - return domainName + if let profile { + return profile.domainName } return nil } private func loadIcon() { Task { - if let receiverDomainName { - icon = await imageLoadingService.loadImage(from: .domainNameInitials(receiverDomainName, + if let profile = try? await domainProfilesService.fetchResolvedDomainProfileDisplayInfo(for: tx.to.address) { + self.profile = profile + icon = await imageLoadingService.loadImage(from: .domainNameInitials(profile.domainName, size: .default), downsampleDescription: .mid) - - if let pfp = await imageLoadingService.loadImage(from: .walletDomain(tx.to.address), - downsampleDescription: .mid) { - icon = pfp - } + icon = await imageLoadingService.loadImage(from: .domainPFPSource(profile.pfpInfo.source), + downsampleDescription: .mid) } + } } }