2021-07-29 15:38:35 -07:00
|
|
|
//
|
|
|
|
// secantApp.swift
|
|
|
|
// secant
|
|
|
|
//
|
|
|
|
// Created by Francisco Gindre on 7/29/21.
|
|
|
|
//
|
|
|
|
|
|
|
|
import SwiftUI
|
2022-04-04 05:04:01 -07:00
|
|
|
import ComposableArchitecture
|
2022-07-19 11:56:46 -07:00
|
|
|
import ZcashLightClientKit
|
2022-04-04 05:04:01 -07:00
|
|
|
|
|
|
|
final class AppDelegate: NSObject, UIApplicationDelegate {
|
2022-12-07 04:32:06 -08:00
|
|
|
var rootStore: RootStore = .placeholder
|
|
|
|
lazy var rootViewStore = ViewStore(
|
|
|
|
rootStore.stateless,
|
2022-04-04 05:04:01 -07:00
|
|
|
removeDuplicates: ==
|
|
|
|
)
|
|
|
|
|
|
|
|
func application(
|
|
|
|
_ application: UIApplication,
|
|
|
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
|
|
|
|
) -> Bool {
|
2023-03-01 10:34:28 -08:00
|
|
|
walletLogger = OSLogger(logLevel: .debug, category: LoggerConstants.walletLogs)
|
2022-05-27 08:19:21 -07:00
|
|
|
// set the default behavior for the NSDecimalNumber
|
|
|
|
NSDecimalNumber.defaultBehavior = Zatoshi.decimalHandler
|
2022-12-07 05:47:42 -08:00
|
|
|
rootViewStore.send(.initialization(.appDelegate(.didFinishLaunching)))
|
2022-04-04 05:04:01 -07:00
|
|
|
return true
|
|
|
|
}
|
2022-09-26 10:25:44 -07:00
|
|
|
|
|
|
|
func application(
|
|
|
|
_ application: UIApplication,
|
|
|
|
shouldAllowExtensionPointIdentifier extensionPointIdentifier: UIApplication.ExtensionPointIdentifier
|
|
|
|
) -> Bool {
|
|
|
|
return extensionPointIdentifier != UIApplication.ExtensionPointIdentifier.keyboard
|
|
|
|
}
|
2022-04-04 05:04:01 -07:00
|
|
|
}
|
2021-07-29 15:38:35 -07:00
|
|
|
|
|
|
|
@main
|
|
|
|
struct SecantApp: App {
|
2022-04-04 05:04:01 -07:00
|
|
|
@UIApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate
|
2021-12-13 17:23:50 -08:00
|
|
|
|
2021-07-29 15:38:35 -07:00
|
|
|
var body: some Scene {
|
|
|
|
WindowGroup {
|
2022-12-07 04:32:06 -08:00
|
|
|
RootView(store: appDelegate.rootStore)
|
2021-07-29 15:38:35 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-02-22 06:06:43 -08:00
|
|
|
|
|
|
|
// MARK: Zcash Network global type
|
|
|
|
|
|
|
|
/// Whenever the ZcashNetwork is required use this var to determine which is the
|
|
|
|
/// network type suitable for the present target.
|
|
|
|
|
|
|
|
enum TargetConstants {
|
|
|
|
static var zcashNetwork: ZcashNetwork {
|
|
|
|
#if SECANT_MAINNET
|
|
|
|
return ZcashNetworkBuilder.network(for: .mainnet)
|
|
|
|
#elseif SECANT_TESTNET
|
|
|
|
return ZcashNetworkBuilder.network(for: .testnet)
|
|
|
|
#else
|
|
|
|
fatalError("SECANT_MAINNET or SECANT_TESTNET flags not defined on Swift Compiler custom flags of your build target.")
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|