From df4b1878e116442753cb028029a23bf20ead5304 Mon Sep 17 00:00:00 2001 From: rommex Date: Mon, 4 Mar 2024 16:11:29 +0200 Subject: [PATCH 1/9] removed fetchZilDomains() --- .../NetworkEnvironment/MobileAPIAccess.swift | 6 ------ .../Services/UDDomainsService/UDDomainsService.swift | 9 ++------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/unstoppable-ios-app/domains-manager-ios/NetworkEnvironment/MobileAPIAccess.swift b/unstoppable-ios-app/domains-manager-ios/NetworkEnvironment/MobileAPIAccess.swift index 41b6ffe45..1d8c66370 100644 --- a/unstoppable-ios-app/domains-manager-ios/NetworkEnvironment/MobileAPIAccess.swift +++ b/unstoppable-ios-app/domains-manager-ios/NetworkEnvironment/MobileAPIAccess.swift @@ -271,12 +271,6 @@ extension NetworkService { return try await fetchDomains(for: ownerUnsAddresses) } - public func fetchZilDomains(for wallets: [UDWallet]) async throws -> [DomainItem] { - let ownerZilAddresses = wallets.compactMap({ $0.extractZilWallet()?.address.normalized}) - guard !ownerZilAddresses.isEmpty else { return [] } - return try await fetchDomains(for: ownerZilAddresses) - } - private func fetchDomains(for ownerAddresses: [HexAddress]) async throws -> [DomainItem] { try await fetchAllPagesWithLimit(for: ownerAddresses, limit: Self.postRequestLimit) } diff --git a/unstoppable-ios-app/domains-manager-ios/Services/UDDomainsService/UDDomainsService.swift b/unstoppable-ios-app/domains-manager-ios/Services/UDDomainsService/UDDomainsService.swift index 677d9fbec..297fa3d26 100644 --- a/unstoppable-ios-app/domains-manager-ios/Services/UDDomainsService/UDDomainsService.swift +++ b/unstoppable-ios-app/domains-manager-ios/Services/UDDomainsService/UDDomainsService.swift @@ -31,22 +31,17 @@ extension UDDomainsService: UDDomainsServiceProtocol { guard !wallets.isEmpty else { return [] } async let fetchUNSDomainsTask = NetworkService().fetchUnsDomains(for: wallets) - async let fetchZILDomainsTask = NetworkService().fetchZilDomains(for: wallets) let start = Date() - let (unsDomainArray, zilDomainsArray) = try await (fetchUNSDomainsTask, fetchZILDomainsTask) - let combinedDomains = unsDomainArray + zilDomainsArray + let unsDomainArray = try await fetchUNSDomainsTask Debugger.printTimeSensitiveInfo(topic: .Domain, - "to load \((combinedDomains).count) domains for \(wallets.count) wallets", + "to load \((unsDomainArray).count) domains for \(wallets.count) wallets", startDate: start, timeout: 2) try await storage.updateDomainsToCache_Blocking(unsDomainArray, of: .UNS, for: wallets) - try await storage.updateDomainsToCache_Blocking(zilDomainsArray, - of: .ZNS, - for: wallets) let domains = getCachedDomainsFor(wallets: wallets) return domains From 314d8051f6c1da1a4843a909caf5b2480ebbed9d Mon Sep 17 00:00:00 2001 From: rommex Date: Tue, 5 Mar 2024 13:08:51 +0200 Subject: [PATCH 2/9] removed .zil blockchain type --- .../Entities/Domains/DomainDisplayInfo.swift | 6 +--- .../Entities/Domains/DomainItem.swift | 8 ++---- .../Entities/Domains/NamingService.swift | 1 - .../Entities/TransactionItem.swift | 1 - .../Entities/Wallets/BlockchainType.swift | 7 ----- .../Entities/Wallets/UDWallet.swift | 28 ++----------------- .../Extensions/Extension-String+Common.swift | 2 +- .../Extensions/UIImage.swift | 6 ---- .../DomainsCollectionListCell.swift | 3 -- .../Modules/Home/HomeTabRouter.swift | 6 ---- .../Subviews/HomeWalletDomainCellView.swift | 2 -- .../NetworkEnvironment/MobileAPIAccess.swift | 1 - .../Protocols/BlockChainItem.swift | 5 +--- .../MockUDDomainsService.swift | 3 +- 14 files changed, 8 insertions(+), 71 deletions(-) diff --git a/unstoppable-ios-app/domains-manager-ios/Entities/Domains/DomainDisplayInfo.swift b/unstoppable-ios-app/domains-manager-ios/Entities/Domains/DomainDisplayInfo.swift index 76819e89b..a689d5956 100644 --- a/unstoppable-ios-app/domains-manager-ios/Entities/Domains/DomainDisplayInfo.swift +++ b/unstoppable-ios-app/domains-manager-ios/Entities/Domains/DomainDisplayInfo.swift @@ -131,15 +131,12 @@ extension DomainDisplayInfo { enum UsageType: Equatable { case normal, newNonInteractable(tld: String), - zil, deprecated(tld: String), parked(status: DomainParkingStatus) } var usageType: UsageType { - if isZilliqaBased { - return .zil - } else if let tld = name.getTldName(), Constants.newNonInteractableTLDs.contains(tld) { + if let tld = name.getTldName(), Constants.newNonInteractableTLDs.contains(tld) { return .newNonInteractable(tld: tld) } else if let tld = name.getTldName(), Constants.deprecatedTLDs.contains(tld) { @@ -149,7 +146,6 @@ extension DomainDisplayInfo { } return .normal } - var isZilliqaBased: Bool { blockchain == .Zilliqa } var isInteractable: Bool { usageType == .normal } var isAbleToSetAsRR: Bool { usageType == .normal && blockchain == .Matic } var isAbleToTransfer: Bool { usageType == .normal && blockchain == .Matic } diff --git a/unstoppable-ios-app/domains-manager-ios/Entities/Domains/DomainItem.swift b/unstoppable-ios-app/domains-manager-ios/Entities/Domains/DomainItem.swift index ed6541dba..66e4b5209 100644 --- a/unstoppable-ios-app/domains-manager-ios/Entities/Domains/DomainItem.swift +++ b/unstoppable-ios-app/domains-manager-ios/Entities/Domains/DomainItem.swift @@ -81,7 +81,7 @@ extension DomainItem { static func isValidTxCost(blockchain: BlockchainType, txCost: NetworkService.TxCost?) -> Bool { switch blockchain { case .Ethereum: return txCost != nil - case .Zilliqa, .Matic: return txCost == nil + case .Matic: return txCost == nil } } } @@ -149,10 +149,6 @@ extension Array where Element == DomainItem { } extension Array where Element == DomainItem { - func filterZilCoOwned(by ownerAddress: HexAddress) -> Self { - return filterCoOwned(by: ownerAddress, in: .ZNS) - } - func filterCoOwned(by ownerAddress: HexAddress, in namingService: NamingService) -> Self { return self.filter({$0.namingService == namingService && $0.ownerWallet?.normalized == ownerAddress.normalized}) } @@ -165,7 +161,7 @@ extension DomainItem { func doesRequirePayment() -> Bool { switch self.getBlockchainType() { case .Ethereum: return true - case .Zilliqa, .Matic: return false + case .Matic: return false } } } diff --git a/unstoppable-ios-app/domains-manager-ios/Entities/Domains/NamingService.swift b/unstoppable-ios-app/domains-manager-ios/Entities/Domains/NamingService.swift index 08b1ada88..fd63aa2d1 100644 --- a/unstoppable-ios-app/domains-manager-ios/Entities/Domains/NamingService.swift +++ b/unstoppable-ios-app/domains-manager-ios/Entities/Domains/NamingService.swift @@ -9,7 +9,6 @@ import Foundation enum NamingService: String, Codable, CaseIterable { case UNS - case ZNS = "zil" static let cases = NamingService.allCases } diff --git a/unstoppable-ios-app/domains-manager-ios/Entities/TransactionItem.swift b/unstoppable-ios-app/domains-manager-ios/Entities/TransactionItem.swift index 73c1868c9..be1f368db 100644 --- a/unstoppable-ios-app/domains-manager-ios/Entities/TransactionItem.swift +++ b/unstoppable-ios-app/domains-manager-ios/Entities/TransactionItem.swift @@ -152,7 +152,6 @@ struct TransactionItem: Codable { switch domain.namingService { case .UNS: return domainName == domain.name - case .ZNS: return self.isPendingZilDomain(domain) } } 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 e2663828c..88d6c638e 100644 --- a/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/BlockchainType.swift +++ b/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/BlockchainType.swift @@ -9,7 +9,6 @@ import UIKit enum BlockchainType: String, CaseIterable, Codable, Hashable { case Ethereum = "ETH" - case Zilliqa = "ZIL" case Matic = "MATIC" static let cases = Self.allCases @@ -28,8 +27,6 @@ enum BlockchainType: String, CaseIterable, Codable, Hashable { switch self { case .Ethereum: return UIImage(named: String.BlockChainIcons.ethereum.rawValue)! - case .Zilliqa: - return UIImage(named: String.BlockChainIcons.zilliqa.rawValue)! case .Matic: return UIImage(named: String.BlockChainIcons.matic.rawValue)! } @@ -39,8 +36,6 @@ enum BlockchainType: String, CaseIterable, Codable, Hashable { switch self { case .Ethereum: return "Ethereum" - case .Zilliqa: - return "Zilliqa" case .Matic: return "Polygon" } @@ -52,8 +47,6 @@ enum BlockchainType: String, CaseIterable, Codable, Hashable { return isTestNet ? 5 : 1 // Goerly or Mainnet case .Matic: return isTestNet ? 80001 : 137 // Mumbai or - case .Zilliqa: - return nil } } diff --git a/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/UDWallet.swift b/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/UDWallet.swift index 64d593548..6b3ebfd2c 100644 --- a/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/UDWallet.swift +++ b/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/UDWallet.swift @@ -153,11 +153,6 @@ struct UDWallet: Codable, @unchecked Sendable { type: .importedUnverified, ethWallet: wallet, zilWallet: nil) - case .Zilliqa: let wallet = UDWalletZil.createUnverified(address: response.address, humanAddress: response.humanAddress) - return UDWallet(aliasName: aliasName, - type: .importedUnverified, - ethWallet: nil, - zilWallet: wallet) } } @@ -294,7 +289,6 @@ struct UDWallet: Codable, @unchecked Sendable { func getAddress(for namingService: NamingService) -> String? { switch namingService { case .UNS: return self.extractEthWallet()?.address - case .ZNS: return self.extractZilWallet()?.address } } @@ -353,10 +347,6 @@ struct UDWallet: Codable, @unchecked Sendable { func extractEthWallet() -> UDWalletEthereum? { return ethWallet } - - func extractZilWallet() -> UDWalletZil? { - return zilWallet - } } extension UDWallet { @@ -387,11 +377,9 @@ extension UDWallet { extension Array where Element == UDWallet { func pickOwnedDomains(from domains: [DomainItem]) -> [DomainItem] { let ethWalletAddresses = self.compactMap({$0.extractEthWallet()?.address.normalized}) - let zilWalletAddresses = self.compactMap({$0.extractZilWallet()?.address.normalized}) - let walletAddresses = ethWalletAddresses + zilWalletAddresses let selected = domains.filter { guard let ownerWallet = $0.ownerWallet else { return false } - return walletAddresses.contains(ownerWallet.normalized) + return ethWalletAddresses.contains(ownerWallet.normalized) } return selected } @@ -402,8 +390,6 @@ extension Array where Element == UDWallet { switch namingService { case .UNS: walletAddresses = self.compactMap({$0.extractEthWallet()?.address.normalized}) - case .ZNS: - walletAddresses = self.compactMap({$0.extractZilWallet()?.address.normalized}) } let selected = domains.filter { guard let ownerWallet = $0.ownerWallet else { return false } @@ -419,19 +405,11 @@ extension UDWallet { return self.address.normalized == domainWalletAddress || self.address.normalized == domainWalletAddress } - var activeZilAddress: String? { - switch UDWalletZil.network { - case .mainnet: return self.extractZilWallet()?.bech32addressMainnet - case .testnet: return self.extractZilWallet()?.bech32addressTestnet - } - } - func getActiveAddress(for namingService: NamingService) -> String? { let etereumStyleAddress = self.extractEthWallet()?.address.normalized switch namingService { case .UNS: return etereumStyleAddress - case .ZNS: return self.activeZilAddress } } @@ -475,15 +453,13 @@ extension UDWallet { extension UDWallet: Equatable { static func == (lhs: UDWallet, rhs: UDWallet) -> Bool { let resultEth = (lhs.extractEthWallet()?.address == rhs.extractEthWallet()?.address) && lhs.extractEthWallet()?.address != nil - let resultZil = (lhs.extractZilWallet()?.address == rhs.extractZilWallet()?.address) && lhs.extractZilWallet()?.address != nil - return resultEth || resultZil + return resultEth } } extension UDWallet: Hashable { func hash(into hasher: inout Hasher) { hasher.combine(extractEthWallet()?.address) - hasher.combine(extractZilWallet()?.address) hasher.combine(aliasName) hasher.combine(hasBeenBackedUp) hasher.combine(walletState) diff --git a/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Common.swift b/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Common.swift index e852c61ee..91bbc9229 100644 --- a/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Common.swift +++ b/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Common.swift @@ -101,7 +101,7 @@ extension DomainName { } static func isZilByExtension(ext: String) -> Bool { - ext.lowercased() == NamingService.ZNS.rawValue.lowercased() + ext.lowercased() == "zil" } } diff --git a/unstoppable-ios-app/domains-manager-ios/Extensions/UIImage.swift b/unstoppable-ios-app/domains-manager-ios/Extensions/UIImage.swift index d03b65bd8..0e82cb7b6 100644 --- a/unstoppable-ios-app/domains-manager-ios/Extensions/UIImage.swift +++ b/unstoppable-ios-app/domains-manager-ios/Extensions/UIImage.swift @@ -230,9 +230,6 @@ extension UIImage { return .ethBGLarge case .Matic: return .maticBGLarge - case .Zilliqa: - Debugger.printFailure("Trying to connect unsupported Zilliqa network", critical: true) - return nil } } @@ -242,9 +239,6 @@ extension UIImage { return .ethBGSmall case .Matic: return .maticBGSmall - case .Zilliqa: - Debugger.printFailure("Trying to connect unsupported Zilliqa network", critical: true) - return nil } } diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/DomainsList/Cells/DomainsCollectionListCell/DomainsCollectionListCell.swift b/unstoppable-ios-app/domains-manager-ios/Modules/DomainsList/Cells/DomainsCollectionListCell/DomainsCollectionListCell.swift index be076a8b8..e46496057 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/DomainsList/Cells/DomainsCollectionListCell/DomainsCollectionListCell.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/DomainsList/Cells/DomainsCollectionListCell/DomainsCollectionListCell.swift @@ -47,9 +47,6 @@ extension DomainsCollectionListCell { setPrimaryLabelWith(name: domainItem.name) switch domainItem.usageType { - case .zil: - statusMessage.setComponent(.bridgeDomainToPolygon) - statusMessage.isHidden = false case .deprecated(let tld): statusMessage.setComponent(.deprecated(tld: tld)) statusMessage.isHidden = false diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/Home/HomeTabRouter.swift b/unstoppable-ios-app/domains-manager-ios/Modules/Home/HomeTabRouter.swift index 6d3a9f36f..001739a79 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/Home/HomeTabRouter.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/Home/HomeTabRouter.swift @@ -127,12 +127,6 @@ extension HomeTabRouter { let domain = domain.toDomainItem() let domainPublicInfo = PublicDomainDisplayInfo(walletAddress: walletAddress, name: domain.name) showPublicDomainProfile(of: domainPublicInfo, by: wallet, preRequestedAction: nil) - case .zil: - do { - try await appContext.pullUpViewService.showZilDomainsNotSupportedPullUp(in: topVC) - await topVC.dismissPullUpMenu() - UDRouter().showUpgradeToPolygonTutorialScreen(in: topVC) - } catch { } case .deprecated(let tld): do { try await appContext.pullUpViewService.showDomainTLDDeprecatedPullUp(tld: tld, in: topVC) diff --git a/unstoppable-ios-app/domains-manager-ios/Modules/Home/HomeWalletView/Subviews/HomeWalletDomainCellView.swift b/unstoppable-ios-app/domains-manager-ios/Modules/Home/HomeWalletView/Subviews/HomeWalletDomainCellView.swift index 275ed00f3..06f21fb23 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/Home/HomeWalletView/Subviews/HomeWalletDomainCellView.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/Home/HomeWalletView/Subviews/HomeWalletDomainCellView.swift @@ -91,8 +91,6 @@ private extension HomeWalletDomainCellView { return nil case .deprecated(let tld): return .deprecated(tld: tld) - case .zil: - return .deprecated(tld: "zil") } case .updatingRecords, .updatingReverseResolution: return .updatingRecords diff --git a/unstoppable-ios-app/domains-manager-ios/NetworkEnvironment/MobileAPIAccess.swift b/unstoppable-ios-app/domains-manager-ios/NetworkEnvironment/MobileAPIAccess.swift index 1d8c66370..876ec66a3 100644 --- a/unstoppable-ios-app/domains-manager-ios/NetworkEnvironment/MobileAPIAccess.swift +++ b/unstoppable-ios-app/domains-manager-ios/NetworkEnvironment/MobileAPIAccess.swift @@ -114,7 +114,6 @@ extension NetworkService { switch blockchain { case .Ethereum, .Matic: return .UNS - case .Zilliqa: return .ZNS } } } diff --git a/unstoppable-ios-app/domains-manager-ios/Protocols/BlockChainItem.swift b/unstoppable-ios-app/domains-manager-ios/Protocols/BlockChainItem.swift index 267d0f09c..7fc317e84 100644 --- a/unstoppable-ios-app/domains-manager-ios/Protocols/BlockChainItem.swift +++ b/unstoppable-ios-app/domains-manager-ios/Protocols/BlockChainItem.swift @@ -19,10 +19,7 @@ extension DomainEntity { } var namingService: NamingService { - let blockchain = getBlockchainType() - if blockchain == .Zilliqa { - return NamingService.ZNS - } +// Leave this till when other chains are introduced return NamingService.UNS } diff --git a/unstoppable-ios-app/domains-manager-ios/Services/UDDomainsService/MockUDDomainsService.swift b/unstoppable-ios-app/domains-manager-ios/Services/UDDomainsService/MockUDDomainsService.swift index ecebfc60e..4de6f7d5f 100644 --- a/unstoppable-ios-app/domains-manager-ios/Services/UDDomainsService/MockUDDomainsService.swift +++ b/unstoppable-ios-app/domains-manager-ios/Services/UDDomainsService/MockUDDomainsService.swift @@ -116,8 +116,7 @@ private extension MockUDDomainsService { isMinting: Bool = false, wallet: String? = nil) -> DomainItem? { if self.domains.count < self.DomainsLimit { - let isZil = blockchain == .Zilliqa - let tld = isZil ? "zil" : "x" + let tld = "x" var newDomain = DomainItem(name: "coolguy_\(self.domains.count)_\(suffix).\(tld)") newDomain.blockchain = blockchain if let wallet { From 7f64ae80edd48bd9b51cbc62d11adea1592438be Mon Sep 17 00:00:00 2001 From: rommex Date: Tue, 5 Mar 2024 13:20:43 +0200 Subject: [PATCH 3/9] removed zil from constructors --- .../Entities/Wallets/UDWallet.swift | 91 ++++--------------- .../Wallets/UDWalletWithPrivateSeed.swift | 32 ++----- 2 files changed, 27 insertions(+), 96 deletions(-) diff --git a/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/UDWallet.swift b/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/UDWallet.swift index db1f10605..5a9645852 100644 --- a/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/UDWallet.swift +++ b/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/UDWallet.swift @@ -88,7 +88,6 @@ struct UDWallet: Codable, @unchecked Sendable { private init(aliasName: String, type: WalletType, ethWallet: UDWalletEthereum?, - zilWallet: UDWalletZil?, hasBeenBackedUp: Bool = false) { self.aliasName = aliasName self.type = type @@ -149,8 +148,7 @@ struct UDWallet: Codable, @unchecked Sendable { case .Ethereum, .Matic: let wallet = UDWalletEthereum.createUnverified(address: response.address) return UDWallet(aliasName: aliasName, type: .importedUnverified, - ethWallet: wallet, - zilWallet: nil) + ethWallet: wallet) } } @@ -160,8 +158,7 @@ struct UDWallet: Codable, @unchecked Sendable { let wallet = UDWalletEthereum.createUnverified(address: address) return UDWallet(aliasName: name, type: .importedUnverified, - ethWallet: wallet, - zilWallet: nil) + ethWallet: wallet) } static func createLinked(aliasName: String, @@ -170,8 +167,7 @@ struct UDWallet: Codable, @unchecked Sendable { let ethWallet = UDWalletEthereum.createUnverified(address: address) var udWallet = UDWallet(aliasName: aliasName, type: .importedUnverified, - ethWallet: ethWallet, - zilWallet: nil) + ethWallet: ethWallet) udWallet.walletConnectionInfo = UDWallet.WalletConnectionInfo(externalWallet: externalWallet) return udWallet @@ -193,8 +189,7 @@ struct UDWallet: Codable, @unchecked Sendable { static func createEmpty(aliasName: String) -> UDWallet { let generatedWallet = UDWallet(aliasName: aliasName, type: .generatedLocally, - ethWallet: nil, - zilWallet: nil) + ethWallet: nil) return generatedWallet } @@ -213,7 +208,7 @@ struct UDWallet: Codable, @unchecked Sendable { throw error } - return try await create(with: wrappedWallet, + return try create(with: wrappedWallet, aliasName: aliasName, privateKeyEthereum: privateKeyEthereum, type: type, @@ -232,7 +227,7 @@ struct UDWallet: Codable, @unchecked Sendable { throw error } - return try await create(with: wrappedWallet, + return try create(with: wrappedWallet, aliasName: aliasName, privateKeyEthereum: privateKeyEthereum, @@ -244,43 +239,29 @@ struct UDWallet: Codable, @unchecked Sendable { aliasName: String, privateKeyEthereum: String, type: WalletType, - hasBeenBackedUp: Bool = false) async throws -> UDWallet { + hasBeenBackedUp: Bool = false) throws -> UDWallet { let address = wrappedWallet.ethWallet.address guard !UDWalletsStorage.instance.doesWalletExist(address: address, namingService: .UNS) else { throw WalletError.ethWalletAlreadyExists(address) } - return try await withSafeCheckedThrowingContinuation { completion in - - UDWalletZil.create(privateKey: privateKeyEthereum) { zil in - guard let zilWallet = zil else { - Debugger.printFailure("Failed to init UDWalletZil with priv key", critical: true) - completion(.failure(WalletError.zilWalletFailedInit)) - return - } - - // all checks done, 2 subwallets created -- storing to Keychain - let privateSeedString: String = wrappedWallet.privateSeed - KeychainPrivateKeyStorage.instance.store(privateKey: privateSeedString, for: address) - - let udWallet: UDWallet = Self.create(aliasName: aliasName, - type: type, - ethWallet: wrappedWallet.ethWallet, - zilWallet: zilWallet, - hasBeenBackedUp: hasBeenBackedUp) - completion(.success(udWallet)) - } - } + + let privateSeedString: String = wrappedWallet.privateSeed + KeychainPrivateKeyStorage.instance.store(privateKey: privateSeedString, for: address) + + let udWallet: UDWallet = Self.create(aliasName: aliasName, + type: type, + ethWallet: wrappedWallet.ethWallet, + hasBeenBackedUp: hasBeenBackedUp) + return udWallet } static func create(aliasName: String, type: WalletType, ethWallet: UDWalletEthereum, - zilWallet: UDWalletZil?, hasBeenBackedUp: Bool = false) -> UDWallet { return UDWallet(aliasName: aliasName, type: type, ethWallet: ethWallet, - zilWallet: zilWallet, hasBeenBackedUp: hasBeenBackedUp) } @@ -289,45 +270,7 @@ struct UDWallet: Codable, @unchecked Sendable { case .UNS: return self.extractEthWallet()?.address } } - - static func create (aliasName: String, - type: WalletType, - keyStoreZil: String, - encryptionPassword: String) async throws -> UDWallet { - return try await withSafeCheckedThrowingContinuation { completion in - UDWalletZil.create(keystoreJson: keyStoreZil, - encryptionPassword: encryptionPassword) { zil, prKey in - guard let zilWallet = zil, - let privateKey = prKey else { - completion(.failure(WalletZilError.failedToRestoreFromJson)) - return - } - let privateKeyEthereum = privateKey - let wrappedWallet: UDWalletEthereumWithPrivateSeed - - do { wrappedWallet = try UDWalletEthereum.createVerified(privateKey: privateKeyEthereum) } catch { - completion(.failure(WalletError.EthWalletFailedInit)) - return - } - - let address = wrappedWallet.ethWallet.address - guard !UDWalletsStorage.instance.doesWalletExist(address: address, namingService: .UNS) else { - completion(.failure(WalletError.ethWalletAlreadyExists(address))) - return - } - - let privateSeedString: String = wrappedWallet.privateSeed - KeychainPrivateKeyStorage.instance.store(privateKey: privateSeedString, for: address) - - let udWallet = UDWallet(aliasName: aliasName, - type: type, - ethWallet: wrappedWallet.ethWallet, - zilWallet: zilWallet) - completion(.success(udWallet)) - } - } - } - + func setNameAsAddress() -> UDWallet { var _wallet = self _wallet.aliasName = self.getActiveAddress(for: .UNS) ?? "Wallet" diff --git a/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/UDWalletWithPrivateSeed.swift b/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/UDWalletWithPrivateSeed.swift index 76adf1b3c..c3f9089cf 100644 --- a/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/UDWalletWithPrivateSeed.swift +++ b/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/UDWalletWithPrivateSeed.swift @@ -39,7 +39,7 @@ struct UDWalletWithPrivateSeed { throw error } - return try await create(with: wrappedWallet, + return try create(with: wrappedWallet, aliasName: aliasName, privateKeyEthereum: privateKeyEthereum, type: type, @@ -58,7 +58,7 @@ struct UDWalletWithPrivateSeed { throw error } - return try await create(with: wrappedWallet, + return try create(with: wrappedWallet, aliasName: aliasName, privateKeyEthereum: privateKeyEthereum, type: type, @@ -80,7 +80,6 @@ struct UDWalletWithPrivateSeed { let udWallet = UDWallet.create(aliasName: aliasName, type: type, ethWallet: wrappedWallet.ethWallet, - zilWallet: nil, hasBeenBackedUp: hasBeenBackedUp) return UDWalletWithPrivateSeed(udWallet: udWallet, privateSeed: wrappedWallet.privateSeed) } @@ -100,31 +99,20 @@ struct UDWalletWithPrivateSeed { let udWallet = UDWallet.create(aliasName: aliasName, type: type, ethWallet: wrappedWallet.ethWallet, - zilWallet: nil, hasBeenBackedUp: hasBeenBackedUp) return UDWalletWithPrivateSeed(udWallet: udWallet, privateSeed: wrappedWallet.privateSeed) } static private func create(with wrappedEthereumWallet: UDWalletEthereumWithPrivateSeed, aliasName: String, - privateKeyEthereum: String, - type: WalletType, - hasBeenBackedUp: Bool = false) async throws -> UDWalletWithPrivateSeed { + privateKeyEthereum: String, + type: WalletType, + hasBeenBackedUp: Bool = false) throws -> UDWalletWithPrivateSeed { - return try await withSafeCheckedThrowingContinuation { completion in - UDWalletZil.create(privateKey: privateKeyEthereum) { zil in - guard let zilWallet = zil else { - Debugger.printFailure("Failed to init UDWalletZil with priv key", critical: true) - completion(.failure(WalletError.zilWalletFailedInit)) - return - } - let udWallet = UDWallet.create(aliasName: aliasName, - type: type, - ethWallet: wrappedEthereumWallet.ethWallet, - zilWallet: zilWallet, - hasBeenBackedUp: hasBeenBackedUp) - completion(.success(UDWalletWithPrivateSeed(udWallet: udWallet, privateSeed: wrappedEthereumWallet.privateSeed))) - } - } + let udWallet = UDWallet.create(aliasName: aliasName, + type: type, + ethWallet: wrappedEthereumWallet.ethWallet, + hasBeenBackedUp: hasBeenBackedUp) + return UDWalletWithPrivateSeed(udWallet: udWallet, privateSeed: wrappedEthereumWallet.privateSeed) } } From 810537de65166cca99bee3f7a7a09e36778c5935 Mon Sep 17 00:00:00 2001 From: rommex Date: Tue, 5 Mar 2024 13:29:12 +0200 Subject: [PATCH 4/9] removed core zil methods --- .../project.pbxproj | 4 - .../Entities/TransactionItem.swift | 1 - .../Entities/Wallets/UDWallet.swift | 1 - .../Entities/Wallets/UDWalletZil.swift | 108 ------------------ .../Entities/Wallets/WalletError.swift | 1 - .../Extensions/Extension-String+Preview.swift | 1 - .../Extensions/UIImage.swift | 1 - .../Entities/WalletCopyAddressAction.swift | 9 +- 8 files changed, 1 insertion(+), 125 deletions(-) delete mode 100644 unstoppable-ios-app/domains-manager-ios/Entities/Wallets/UDWalletZil.swift diff --git a/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj b/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj index 226f5174c..39ca5734e 100644 --- a/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj +++ b/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj @@ -75,7 +75,6 @@ 30784C8E27F455350034FA4A /* UDTextView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 30784C8D27F455350034FA4A /* UDTextView.xib */; }; 307852642771FB030039FF40 /* DeepLinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 307852632771FB020039FF40 /* DeepLinks.swift */; }; 307B1CEA2602775D007B14C3 /* UDWallet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 307B1CE92602775C007B14C3 /* UDWallet.swift */; }; - 307B1D322603C087007B14C3 /* UDWalletZil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 307B1D312603C087007B14C3 /* UDWalletZil.swift */; }; 307B1D392603C0C4007B14C3 /* UDWalletEthereum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 307B1D382603C0C4007B14C3 /* UDWalletEthereum.swift */; }; 307B1D5A2603C8E0007B14C3 /* BigInt in Frameworks */ = {isa = PBXBuildFile; productRef = 307B1D592603C8E0007B14C3 /* BigInt */; }; 307EC19B25383EF600D62BA1 /* TransactionItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 307EC19A25383EF600D62BA1 /* TransactionItem.swift */; }; @@ -2396,7 +2395,6 @@ 307852632771FB020039FF40 /* DeepLinks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeepLinks.swift; sourceTree = ""; }; 307B1C7D25FA258F007B14C3 /* Env-Demo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Env-Demo.swift"; sourceTree = ""; }; 307B1CE92602775C007B14C3 /* UDWallet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UDWallet.swift; sourceTree = ""; }; - 307B1D312603C087007B14C3 /* UDWalletZil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UDWalletZil.swift; sourceTree = ""; }; 307B1D382603C0C4007B14C3 /* UDWalletEthereum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UDWalletEthereum.swift; sourceTree = ""; }; 307CFF7E279AEF2B003A6AF1 /* ArrayExtensionsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayExtensionsTests.swift; sourceTree = ""; }; 307EC19A25383EF600D62BA1 /* TransactionItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionItem.swift; sourceTree = ""; }; @@ -4620,7 +4618,6 @@ 29AEA05429367785003BB5B4 /* UDWallet+Signing.swift */, 2959AC4629A61916006387DD /* UDWallet+SigningTransaction.swift */, 307B1D382603C0C4007B14C3 /* UDWalletEthereum.swift */, - 307B1D312603C087007B14C3 /* UDWalletZil.swift */, 3004E32626D528D300B9CB6A /* LegacyUnitaryWallet.swift */, C616C2D72806DBC600C212DC /* ExternalWalletMake.swift */, C617FDA02B58E75B00B93433 /* WalletEntity.swift */, @@ -8974,7 +8971,6 @@ C692C30E282E0C7500C31393 /* CreateBackupPasswordToBackupWalletPresenter.swift in Sources */, 30E549C32886DA27009833FB /* DefaultsStorage.swift in Sources */, C600AB8329F807F60089107B /* DomainTransferService.swift in Sources */, - 307B1D322603C087007B14C3 /* UDWalletZil.swift in Sources */, C6456F202800303D00A517D5 /* ConfirmWordConfirmationCell.swift in Sources */, C6F6AF6928A4D20A00A7B571 /* TitleVisibilityAfterLimitNavBarScrollingBehaviour.swift in Sources */, C6D646DF2B1ED46200D724AC /* WalletConnectController.swift in Sources */, diff --git a/unstoppable-ios-app/domains-manager-ios/Entities/TransactionItem.swift b/unstoppable-ios-app/domains-manager-ios/Entities/TransactionItem.swift index be1f368db..d5e636dc5 100644 --- a/unstoppable-ios-app/domains-manager-ios/Entities/TransactionItem.swift +++ b/unstoppable-ios-app/domains-manager-ios/Entities/TransactionItem.swift @@ -9,7 +9,6 @@ import Foundation import BigInt enum TxType: String, Codable { - case zilTx = "ZilTx" case ethTx = "EthTx" case maticTx = "MaticTx" } diff --git a/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/UDWallet.swift b/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/UDWallet.swift index 5a9645852..933005c11 100644 --- a/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/UDWallet.swift +++ b/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/UDWallet.swift @@ -62,7 +62,6 @@ struct UDWallet: Codable, @unchecked Sendable { case failedToSignMessage = "Failed to Sign Message" case noWalletOwner = "No Owner Wallet Specified" case failedToFindWallet = "Failed to Find a Wallet" - case zilNotSupported = "Zilliqua not supported" case failedSignature } diff --git a/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/UDWalletZil.swift b/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/UDWalletZil.swift deleted file mode 100644 index 1d3779b5c..000000000 --- a/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/UDWalletZil.swift +++ /dev/null @@ -1,108 +0,0 @@ -// -// UDWalletZil.swift -// domains-manager-ios -// -// Created by Roman Medvid on 18.03.2021. -// - -import Foundation -import Zesame - -class UDWalletZil: AddressContainer, Codable { - var address: String - var hasPrivateKey: Bool? - - var bech32addressMainnet: String - var bech32addressTestnet: String - static let defaultPassword = "1234567890" - static var network: Network { - return .mainnet - } - - private init(address: String, bech32addressMainnet: String?, bech32addressTestnet: String?) { - self.address = address - if let bech32main = bech32addressMainnet, - let bech32test = bech32addressTestnet { - self.bech32addressMainnet = bech32main - self.bech32addressTestnet = bech32test - } else { - self.bech32addressMainnet = "bech32 address failed" - self.bech32addressTestnet = "bech32 address failed" - Debugger.printFailure("Bech32 failed to create for address: \(address)", critical: true) - } - self.hasPrivateKey = false - } - - static func createUnverified(address: String, humanAddress: String) -> UDWalletZil { - let wallet = UDWalletZil(address: address, bech32addressMainnet: humanAddress, bech32addressTestnet: humanAddress) - wallet.hasPrivateKey = false - return wallet - } - - private static func create(restoration: Zesame.KeyRestoration, completion: @escaping (UDWalletZil?, String?) -> Void) { - switch restoration { - case .keystore(let keystore, let password): - let wallet = Wallet(keystore: keystore) - wallet.keystore.decryptPrivateKeyWith(password: password) { prKeyResult in - switch prKeyResult { - case .success(let key): - let bech32StringMain = try? Bech32Address(ethStyleAddress: wallet.address, network: .mainnet).asString - let bech32StringTest = try? Bech32Address(ethStyleAddress: wallet.address, network: .testnet).asString - let udZilWallet = UDWalletZil(address: wallet.address.asHex, - bech32addressMainnet: bech32StringMain, - bech32addressTestnet: bech32StringTest) - udZilWallet.hasPrivateKey = true - completion(udZilWallet, key.asHex()) - case .failure: completion(nil, nil) - } - } - case .privateKey(let privateKey, let newPassword, let kdf): - do { - try Keystore.from(privateKey: privateKey, encryptBy: newPassword, kdf: kdf) { - guard case .success(let keystore) = $0 else { - completion(nil, nil) - return - } - let wallet = Wallet(keystore: keystore) - let bech32StringMain = try? Bech32Address(ethStyleAddress: wallet.address, network: .mainnet).asString - let bech32StringTest = try? Bech32Address(ethStyleAddress: wallet.address, network: .testnet).asString - let udZilWallet = UDWalletZil(address: wallet.address.asHex, - bech32addressMainnet: bech32StringMain, - bech32addressTestnet: bech32StringTest) - udZilWallet.hasPrivateKey = true - completion(udZilWallet, privateKey.asHex()) - } - } catch { - completion(nil, nil) - } - } - } - - static func create(keystoreJson: String, - encryptionPassword: String, - completion: @escaping (UDWalletZil?, String?)->Void) { - guard let keyRestoration = try? KeyRestoration(keyStoreJSON: keystoreJson.data(using: .utf8)!, encryptedBy: encryptionPassword) else { - completion(nil, nil) - return - } - create(restoration: keyRestoration) { zil, privateKey in - completion(zil, privateKey) - } - } - - static func create(privateKey: String, completion: @escaping (UDWalletZil?)->Void){ - let keyHex = privateKey.droppingLeading0x().uppercased() - guard let keyRestoration = try? KeyRestoration(privateKeyHexString: keyHex, encryptBy: defaultPassword) else { - completion(nil) - return - } - create(restoration: keyRestoration) { zil, _ in - completion(zil) - } - } -} - -enum WalletZilError: String, Swift.Error { - case failedToRestoreFromJson = "Failed to restore ZIL wallet from JSON" - case failedToRestoreFromPrivateKey = "Failed to restore ZIL wallet from private key" -} diff --git a/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/WalletError.swift b/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/WalletError.swift index bcd702de2..544ff2f92 100644 --- a/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/WalletError.swift +++ b/unstoppable-ios-app/domains-manager-ios/Entities/Wallets/WalletError.swift @@ -13,7 +13,6 @@ enum WalletError: Error { case EthWalletFailedInit case EthWalletPrivateKeyNotFound case EthWalletMnemonicsNotFound - case zilWalletFailedInit case migrationError case failedGetPrivateKeyFromNonHdWallet case ethWalletAlreadyExists (HexAddress) 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 a7cd32fbe..c6534920b 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 @@ -468,7 +468,6 @@ extension String { static let removeWalletAlertSubtitlePrivateKey = "REMOVE_WALLET_ALERT_SUBTITLE_PRIVATE_KEY" static let copyAddress = "COPY_ADDRESS" static let ethAddress = "ETH_ADDRESS" - static let zilAddress = "ZIL_ADDRESS" static let importConnectedWalletDescription = "IMPORT_CONNECTED_WALLET_DESCRIPTION" static let walletWasDisconnectedMessage = "WALLET_WAS_DISCONNECTED_MESSAGE" static let addToBackupNewWalletSubtitle = "ADD_TO_BACKUP_NEW_WALLET_SUBTITLE" diff --git a/unstoppable-ios-app/domains-manager-ios/Extensions/UIImage.swift b/unstoppable-ios-app/domains-manager-ios/Extensions/UIImage.swift index 0e82cb7b6..d0023b703 100644 --- a/unstoppable-ios-app/domains-manager-ios/Extensions/UIImage.swift +++ b/unstoppable-ios-app/domains-manager-ios/Extensions/UIImage.swift @@ -17,7 +17,6 @@ extension UIImage { static let warningIcon = UIImage(named: "warningIcon")! static let ethereumIcon = UIImage(named: "ethereumIcon")! static let polygonIcon = UIImage(named: "polygonIcon")! - static let zilIcon = UIImage(named: "zilIcon")! 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/WalletDetails/Entities/WalletCopyAddressAction.swift b/unstoppable-ios-app/domains-manager-ios/Modules/WalletDetails/Entities/WalletCopyAddressAction.swift index 9ee2a52aa..19f0c3c13 100644 --- a/unstoppable-ios-app/domains-manager-ios/Modules/WalletDetails/Entities/WalletCopyAddressAction.swift +++ b/unstoppable-ios-app/domains-manager-ios/Modules/WalletDetails/Entities/WalletCopyAddressAction.swift @@ -9,14 +9,12 @@ import UIKit enum WalletCopyAddressAction: PullUpCollectionViewCellItem { - case ethereum(address: String), zil(address: String) + case ethereum(address: String) var title: String { switch self { case .ethereum: return String.Constants.ethAddress.localized() - case .zil: - return String.Constants.zilAddress.localized() } } @@ -24,8 +22,6 @@ enum WalletCopyAddressAction: PullUpCollectionViewCellItem { switch self { case .ethereum(let address): return address.walletAddressTruncated - case .zil(let address): - return address.walletAddressTruncated } } @@ -33,8 +29,6 @@ enum WalletCopyAddressAction: PullUpCollectionViewCellItem { switch self { case .ethereum: return .ethereumIcon - case .zil: - return .zilIcon } } @@ -42,7 +36,6 @@ enum WalletCopyAddressAction: PullUpCollectionViewCellItem { var analyticsName: String { switch self { case .ethereum: return "ethereum" - case .zil: return "zil" } } } From e08fd6c555275456ccd8f4acb745bc5b44285dd1 Mon Sep 17 00:00:00 2001 From: rommex Date: Tue, 5 Mar 2024 13:45:37 +0200 Subject: [PATCH 5/9] fixed spillover from base64 lib ;( --- .../NetworkEnvironment/ApiRequestBuilder.swift | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/unstoppable-ios-app/domains-manager-ios/NetworkEnvironment/ApiRequestBuilder.swift b/unstoppable-ios-app/domains-manager-ios/NetworkEnvironment/ApiRequestBuilder.swift index 803c9477b..b74195cd4 100644 --- a/unstoppable-ios-app/domains-manager-ios/NetworkEnvironment/ApiRequestBuilder.swift +++ b/unstoppable-ios-app/domains-manager-ios/NetworkEnvironment/ApiRequestBuilder.swift @@ -546,9 +546,13 @@ extension Endpoint { let req = OwnerArrayRequest(owner: owners) guard let json = try? JSONEncoder().encode(req) else { return nil } + guard let body = String(data: json, encoding: .utf8) else { + Debugger.printWarning("Failed to stringify data") + return nil + } return composeResolutionEndpoint(paramQueryItems: paramQueryItems, requestType: .domains, - body: String(data: json)) + body: body) } struct DomainArray: Encodable { @@ -572,11 +576,14 @@ extension Endpoint { let req = TxsArrayRequest(txs: DomainArray(domain: domains.map({ $0 }), status: status)) guard let json = try? JSONEncoder().encode(req) else { return nil } - + guard let body = String(data: json, encoding: .utf8) else { + Debugger.printWarning("Failed to stringify data") + return nil + } return composeResolutionEndpoint(paramQueryItems: paramQueryItems, apiType: .resellers, requestType: .transactions, - body: String(data: json)) + body: body) } static private func composeResolutionEndpoint(paramQueryItems: [URLQueryItem], @@ -859,7 +866,6 @@ extension Endpoint { // MARK: - Open methods extension Endpoint { - static func getCryptoPortfolio(for wallet: String) -> Endpoint { //https://api.ud-staging.com/profile/user/0xcd0dadab45baf9a06ce1279d1342ecc3f44845af/wallets let queryItems: [URLQueryItem] = [.init(name: "walletFields", value: "native,token")] @@ -872,5 +878,5 @@ extension Endpoint { headers: NetworkService.profilesAPIHeader ) } - } + From 0dcfc29b296339584d49ffe59fb197a8f80e15c2 Mon Sep 17 00:00:00 2001 From: rommex Date: Tue, 5 Mar 2024 14:05:16 +0200 Subject: [PATCH 6/9] fixed spillover from Alamofire ;( --- .../Services/Networking/NetworkService.swift | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/unstoppable-ios-app/domains-manager-ios/Services/Networking/NetworkService.swift b/unstoppable-ios-app/domains-manager-ios/Services/Networking/NetworkService.swift index 40ef31dc6..194ea08d7 100644 --- a/unstoppable-ios-app/domains-manager-ios/Services/Networking/NetworkService.swift +++ b/unstoppable-ios-app/domains-manager-ios/Services/Networking/NetworkService.swift @@ -205,7 +205,7 @@ struct NetworkService { let request = URLRequest(url: url) let task = URLSession.shared.dataTask(with: request) { data, response, error in if let response = response as? HTTPURLResponse { - let header = response.headers["x-debug-service"] + let header = response.getHeader(for: "x-debug-service") if header == nil { Debugger.printFailure("Domain profile page has changed response structure", critical: true) } @@ -247,7 +247,7 @@ struct NetworkService { Debugger.printInfo(topic: .Network, "--- REQUEST TO ENDPOINT") Debugger.printInfo(topic: .Network, "METHOD: \(method) | URL: \(url.absoluteString)") Debugger.printInfo(topic: .Network, "BODY: \(body)") - Debugger.printInfo(topic: .Network, "HEADERS: \(urlRequest.headers)") + Debugger.printInfo(topic: .Network, "HEADERS: \(urlRequest.allHTTPHeaderFields ?? ["":""])") return urlRequest } @@ -538,3 +538,14 @@ extension EthereumAddress { self.hex(eip55: true) } } + + +extension HTTPURLResponse { + func getAllHeaders() { + let headers = self.allHeaderFields as? [String: String] + } + + func getHeader(for key: String) -> String? { + self.value(forHTTPHeaderField: key) + } +} From 66bb2a231341b550b90e073cbe57b6c9e6d82d65 Mon Sep 17 00:00:00 2001 From: rommex Date: Tue, 5 Mar 2024 14:08:12 +0200 Subject: [PATCH 7/9] removed Zesame and a bunch of other shtuff --- .../project.pbxproj | 17 --------- .../xcshareddata/swiftpm/Package.resolved | 36 ------------------- 2 files changed, 53 deletions(-) diff --git a/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj b/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj index 39ca5734e..080329446 100644 --- a/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj +++ b/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.pbxproj @@ -86,7 +86,6 @@ 309FDFBC265E7C0C00AE53D3 /* StripePaymentHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 309FDFBB265E7C0C00AE53D3 /* StripePaymentHelper.swift */; }; 30A1895525AB483B0001178D /* PullUpView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 30A1895425AB483B0001178D /* PullUpView.xib */; }; 30A280372714217200FD3759 /* wallets-registry.json in Resources */ = {isa = PBXBuildFile; fileRef = 30A280362714217100FD3759 /* wallets-registry.json */; }; - 30AD0D792704634600F42ACC /* Zesame in Frameworks */ = {isa = PBXBuildFile; productRef = 30AD0D782704634600F42ACC /* Zesame */; }; 30AE84A92575862F003A0142 /* SF-Pro.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 30AE84A82575862F003A0142 /* SF-Pro.ttf */; }; 30AE8521257837B5003A0142 /* NetworkConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30AE8520257837B5003A0142 /* NetworkConfig.swift */; }; 30B3DC9728763294006FAA64 /* WCConnectionIntentStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30B3DC9628763294006FAA64 /* WCConnectionIntentStorage.swift */; }; @@ -3635,7 +3634,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 30AD0D792704634600F42ACC /* Zesame in Frameworks */, C61ECD862A25AB4200E97D70 /* SocketIO in Frameworks */, 290A604C2950AA1600882109 /* WalletConnectNetworking in Frameworks */, 307B1D5A2603C8E0007B14C3 /* BigInt in Frameworks */, @@ -7670,7 +7668,6 @@ 30CE604B26A9DED000E0D29B /* web3swift */, 30B6583826A9E75E004F707F /* Stripe */, 30D89F5A26A9EB5500251C2D /* Bugsnag */, - 30AD0D782704634600F42ACC /* Zesame */, C63402872886547C00AB5D38 /* SVGKit */, 290A60472950AA1600882109 /* WalletConnect */, 290A60492950AA1600882109 /* WalletConnectAuth */, @@ -7817,7 +7814,6 @@ 30CE604A26A9DED000E0D29B /* XCRemoteSwiftPackageReference "web3swift" */, 30B6583726A9E75E004F707F /* XCRemoteSwiftPackageReference "stripe-ios" */, 30D89F5926A9EB5500251C2D /* XCRemoteSwiftPackageReference "bugsnag-cocoa" */, - 30AD0D772704634600F42ACC /* XCRemoteSwiftPackageReference "Zesame" */, C63402862886547C00AB5D38 /* XCRemoteSwiftPackageReference "SVGKit-Light" */, 290A60462950AA1500882109 /* XCRemoteSwiftPackageReference "WalletConnectSwiftV2" */, C63812222993E009002590E7 /* XCRemoteSwiftPackageReference "Valet-ios" */, @@ -10980,14 +10976,6 @@ version = 5.3.0; }; }; - 30AD0D772704634600F42ACC /* XCRemoteSwiftPackageReference "Zesame" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/unstoppabledomains/Zesame"; - requirement = { - branch = master; - kind = branch; - }; - }; 30B6583726A9E75E004F707F /* XCRemoteSwiftPackageReference "stripe-ios" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/stripe/stripe-ios"; @@ -11134,11 +11122,6 @@ package = 307B1D582603C8E0007B14C3 /* XCRemoteSwiftPackageReference "BigInt" */; productName = BigInt; }; - 30AD0D782704634600F42ACC /* Zesame */ = { - isa = XCSwiftPackageProductDependency; - package = 30AD0D772704634600F42ACC /* XCRemoteSwiftPackageReference "Zesame" */; - productName = Zesame; - }; 30B6583826A9E75E004F707F /* Stripe */ = { isa = XCSwiftPackageProductDependency; package = 30B6583726A9E75E004F707F /* XCRemoteSwiftPackageReference "stripe-ios" */; diff --git a/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 3a8a9428f..4ae4e91c8 100644 --- a/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/unstoppable-ios-app/domains-manager-ios.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,14 +1,5 @@ { "pins" : [ - { - "identity" : "alamofire", - "kind" : "remoteSourceControl", - "location" : "https://github.com/Alamofire/Alamofire.git", - "state" : { - "revision" : "3dc6a42c7727c49bf26508e29b0a0b35f9c7e1ad", - "version" : "5.8.1" - } - }, { "identity" : "amplitude-ios", "kind" : "remoteSourceControl", @@ -72,15 +63,6 @@ "version" : "1.8.0" } }, - { - "identity" : "ellipticcurvekit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/Sajjon/EllipticCurveKit.git", - "state" : { - "revision" : "9ebdfefe73f97cd9a2b95cd94a093d4aad61d12e", - "version" : "1.0.2" - } - }, { "identity" : "generic-json-swift", "kind" : "remoteSourceControl", @@ -143,15 +125,6 @@ "version" : "14.3.1" } }, - { - "identity" : "rxswift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/ReactiveX/RxSwift.git", - "state" : { - "revision" : "7e01c05f25c025143073eaa3be3532f9375c614b", - "version" : "6.1.0" - } - }, { "identity" : "secp256k1.swift", "kind" : "remoteSourceControl", @@ -375,15 +348,6 @@ "branch" : "main", "revision" : "e08af6942841054ae02a6fe01d90d18e76d5f248" } - }, - { - "identity" : "zesame", - "kind" : "remoteSourceControl", - "location" : "https://github.com/unstoppabledomains/Zesame", - "state" : { - "branch" : "master", - "revision" : "5a3d17e30f7e480e8f3168a915ae3327643ee0d8" - } } ], "version" : 2 From f2d308289611c586f26a3328073e249886b7a087 Mon Sep 17 00:00:00 2001 From: rommex Date: Tue, 5 Mar 2024 14:10:49 +0200 Subject: [PATCH 8/9] removed --- .../Extensions/Extension-String+Common.swift | 4 ---- 1 file changed, 4 deletions(-) diff --git a/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Common.swift b/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Common.swift index 91bbc9229..17382e141 100644 --- a/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Common.swift +++ b/unstoppable-ios-app/domains-manager-ios/Extensions/Extension-String+Common.swift @@ -99,10 +99,6 @@ extension DomainName { return components.count > 2 } - - static func isZilByExtension(ext: String) -> Bool { - ext.lowercased() == "zil" - } } enum Seed: CustomStringConvertible, Equatable { From 8044dbed0f476f7d652a61bc4c1a1710ac0cdc62 Mon Sep 17 00:00:00 2001 From: rommex Date: Tue, 5 Mar 2024 16:10:29 +0200 Subject: [PATCH 9/9] removed zil icon --- .../Common/zilIcon.imageset/Contents.json | 15 --------------- .../Common/zilIcon.imageset/zilIcon.pdf | Bin 1634 -> 0 bytes 2 files changed, 15 deletions(-) delete mode 100644 unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/zilIcon.imageset/Contents.json delete mode 100644 unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/zilIcon.imageset/zilIcon.pdf diff --git a/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/zilIcon.imageset/Contents.json b/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/zilIcon.imageset/Contents.json deleted file mode 100644 index 645f412b1..000000000 --- a/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/zilIcon.imageset/Contents.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "images" : [ - { - "filename" : "zilIcon.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - }, - "properties" : { - "template-rendering-intent" : "template" - } -} diff --git a/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/zilIcon.imageset/zilIcon.pdf b/unstoppable-ios-app/domains-manager-ios/SupportingFiles/Assets.xcassets/Common/zilIcon.imageset/zilIcon.pdf deleted file mode 100644 index 665560d20ff961839d589968a461bf7ef0b7dfce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1634 zcmbtVO>Yx15WV|X%%xI$sMq7KwWX>OO(;TuC@Hs!!;-jdP_hfVTU7YuSL~79vzmSSS0<>q zGFEE?D7dmEI(G~e$z>_6Fhqq4M1fd>q5{3JawvMhHbjikdC^0c{2q}MFC&*>N0Li2 zNgg#)M^Qt~9iownxFtbJZ-dIBAR?AaZH3g}xgoH`oSfxGmYTYe5sA7>EThDO?p6#_ zMiY=@MA*@A#k-O_ue~lwb@XVc(b-)`@w~^FH^n0rjg}hsI=!RvAM+tO3T4n9Gaf_V zw9dz47zMF69*)!C#L>&TRgz}jk!Bf|;=PP*$0Pc|__1%DA)3J87~bpT7doNjBgLz_ zZu$=HzL2lbDn9@E9-z3X9>NHG2#aNP)jY%9&K=Td$QO3oNVCv2PwhN(5S?o_hMP2X zA8N`NZEFkOR4rj(Mkq742qn`i-YpkYDnte|*yfouPjnX#>hB22BH6u2kzkh+?ubvS zzFIX8`&XaaaL)vkY;ei=3)UEAfZ%b_*Rk0FdEU4b)frcUP`CpK1r@e`N|yd_NEy;{ zJk__=aur$@)q6XocAR$2I-J4ja&a~^rI7