Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
rommex committed Sep 3, 2024
2 parents 56dcb10 + b5c5d5f commit 0a608c7
Show file tree
Hide file tree
Showing 323 changed files with 2,563 additions and 5,572 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ final class AppContext: AppContextProtocol {
var walletTransactionsService: WalletTransactionsServiceProtocol
var mpcWalletsService: MPCWalletsServiceProtocol
var ipVerificationService: IPVerificationServiceProtocol = IPVerificationService()
var claimMPCWalletService: ClaimMPCWalletServiceProtocol = ClaimMPCWalletService()

func createStripeInstance(amount: Int, using secret: String) -> StripeServiceProtocol {
StripeService(paymentDetails: .init(amount: amount, paymentSecret: secret))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// PreviewClaimMPCWalletService.swift
// domains-manager-ios
//
// Created by Oleg Kuplin on 22.08.2024.
//

import Foundation

final class ClaimMPCWalletService {

}

// MARK: - ClaimMPCWalletServiceProtocol
extension ClaimMPCWalletService: ClaimMPCWalletServiceProtocol {
func validateEmailIsAvailable(email: String) async throws -> Bool {
true
}

func sendVerificationCodeTo(email: String) async throws {
await Task.sleep(seconds: 0.5)
}

func runTakeover(credentials: MPCTakeoverCredentials) async throws {
await Task.sleep(seconds: 5)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import UIKit


final class CoreAppCoordinator: CoreAppCoordinatorProtocol {
private var window: UIWindow?

func askToReconnectMPCWallet(_ reconnectData: MPCWalletReconnectData) async {

}
Expand All @@ -17,10 +19,10 @@ final class CoreAppCoordinator: CoreAppCoordinatorProtocol {



var topVC: UIViewController? { nil }
var topVC: UIViewController? { window?.rootViewController?.topVisibleViewController() }

func startWith(window: UIWindow) {

self.window = window
}

func showOnboarding(_ flow: OnboardingNavigationController.OnboardingFlow) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ final class MessagingService: MessagingServiceProtocol {
return .init(id: "1", wallet: wallet.address, serviceIdentifier: .xmtp)
}

func isCreatingProfileInProgressFor(wallet: WalletEntity) async -> Bool { true }

func isCommunitiesEnabled(for messagingProfile: MessagingChatUserProfileDisplayInfo) async -> Bool {
false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class UDFeatureFlagsService: UDFeatureFlagsServiceProtocol {
case .isBuyDomainEnabled, .isBuyCryptoEnabled:
return true
default:
return true
return true
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
//

import Foundation
import Combine

final class WCRequestsHandlingService: WCRequestsHandlingServiceProtocol, WalletConnectExternalWalletHandlerProtocol {
private(set) var eventsPublisher = PassthroughSubject<WalletConnectServiceEvent, Never>()

func handleWCRequest(_ request: WCRequest, target: UDWallet) async throws {

}
Expand All @@ -27,7 +30,7 @@ struct UnifiedConnectAppInfo: UnifiedConnectAppInfoProtocol {

var walletAddress: HexAddress
var appName: String
var displayName: String
var displayName: String { appName }

var appIconUrls: [String] = []
var appUrlString: String = ""
Expand All @@ -37,10 +40,14 @@ struct UnifiedConnectAppInfo: UnifiedConnectAppInfoProtocol {
var chainIds: [Int] = []

init(name: String = "Uniswap",
walletAddress: String = "") {
walletAddress: String = "") {
self.walletAddress = walletAddress
self.appName = name
self.displayName = name
}

init(from appV2: WCConnectedAppsStorageV2.ConnectedApp) {
self.walletAddress = appV2.walletAddress
self.appName = appV2.appName
}

}
18 changes: 18 additions & 0 deletions unstoppable-ios-app/domains-manager-ios-preview/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
setup()

return true
}

Expand All @@ -37,3 +39,19 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

}

// MARK: - Private methods
private extension AppDelegate {
func setup() {
configureNavBar()
setupAppearance()
}

func configureNavBar() {
UINavigationBar.appearance().scrollEdgeAppearance = UINavigationBarAppearance.udAppearanceWith(isTransparent: true)
UINavigationBar.appearance().standardAppearance = UINavigationBarAppearance.udAppearanceWith(isTransparent: false)
}

func setupAppearance() {
UITextField.appearance(whenContainedInInstancesOf: [UISearchBar.self]).backgroundColor = .backgroundSubtle
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ struct WCConnectedAppsStorageV2 {
}
}

struct ConnectedApp: Codable, Equatable, Hashable, CustomStringConvertible {

var walletAddress: HexAddress
var appName: String

var description: String {
"ConnectedApp:"
}

}
}

struct AppMetadata {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, SceneDelegateProtocol {
window.makeKeyAndVisible()
self.window = window

let view = HomeTabView(tabRouter: HomeTabRouter(profile: .wallet(MockEntitiesFabric.Wallet.mockEntities().first!)))
let vc = UIHostingController(rootView: view)

window.rootViewController = vc

// setHomeViewAsRoot(in: window)
setOnboardingAsRoot(in: window)

window.overrideUserInterfaceStyle = .dark
appContext.coreAppCoordinator.startWith(window: window)
// let vc = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController()!
// let nav = CNavigationController(rootViewController: vc)
// window.rootViewController = nav
Expand Down Expand Up @@ -92,7 +90,18 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, SceneDelegateProtocol {
false
}



}

// MARK: - Private methods
private extension SceneDelegate {
func setHomeViewAsRoot(in window: UIWindow) {
let view = HomeTabView(tabRouter: HomeTabRouter(profile: .wallet(MockEntitiesFabric.Wallet.mockEntities().first!)))
let vc = UIHostingController(rootView: view)
window.rootViewController = vc
}

func setOnboardingAsRoot(in window: UIWindow) {
let vc = OnboardingNavigationController.instantiate(flow: .newUser(subFlow: nil))
window.rootViewController = vc
}
}
Loading

0 comments on commit 0a608c7

Please sign in to comment.