Merge pull request #5246 from oa-s/#5234-2

remove dependency from resources #5234
pull/5257/head
Crypto Pank 2 years ago committed by GitHub
commit 77f373b441
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 0
      API.swift
  2. 2894
      AlphaWallet.xcodeproj/project.pbxproj
  3. 1
      AlphaWallet/Accounts/Coordinators/AccountsCoordinator.swift
  4. 1
      AlphaWallet/Accounts/ViewControllers/AccountsViewController.swift
  5. 1
      AlphaWallet/Accounts/ViewModels/AccountViewModel.swift
  6. 1
      AlphaWallet/Accounts/ViewModels/AccountsViewModel.swift
  7. 1
      AlphaWallet/Accounts/ViewModels/WalletSummaryViewModel.swift
  8. 1
      AlphaWallet/Accounts/Views/AccountViewCell.swift
  9. 1
      AlphaWallet/ActiveWalletCoordinator.swift
  10. 1
      AlphaWallet/Activities/Coordinators/ActivitiesCoordinator.swift
  11. 1
      AlphaWallet/Activities/ViewControllers/ActivitiesViewController.swift
  12. 1
      AlphaWallet/Activities/ViewControllers/ActivityViewController.swift
  13. 1
      AlphaWallet/Activities/ViewModels/ActivitiesViewModel.swift
  14. 1
      AlphaWallet/Activities/ViewModels/ActivityCellViewModel.swift
  15. 1
      AlphaWallet/Activities/ViewModels/ActivityStateViewViewModel.swift
  16. 5
      AlphaWallet/Activities/ViewModels/ActivityViewModel.swift
  17. 1
      AlphaWallet/Activities/ViewModels/DefaultActivityCellViewModel.swift
  18. 1
      AlphaWallet/Activities/ViewModels/DefaultActivityViewModel.swift
  19. 1
      AlphaWallet/Activities/Views/ActivitiesView.swift
  20. 1
      AlphaWallet/Activities/Views/ActivityPageView.swift
  21. 1
      AlphaWallet/Activities/Views/ActivityViewCell.swift
  22. 1
      AlphaWallet/AddMultipleCustomRpc/AddMultipleCustomRpcModel.swift
  23. 1
      AlphaWallet/AddMultipleCustomRpc/AddMultipleCustomRpcViewController.swift
  24. 1
      AlphaWallet/Alerts/Coordinators/EditPriceAlertCoordinator.swift
  25. 1
      AlphaWallet/Alerts/ViewControllers/EditPriceAlertViewController.swift
  26. 1
      AlphaWallet/Alerts/ViewModels/EditPriceAlertViewModel.swift
  27. 1
      AlphaWallet/Alerts/ViewModels/PriceAlertsPageViewModel.swift
  28. 1
      AlphaWallet/Alerts/Views/PriceAlertsPageView.swift
  29. 1
      AlphaWallet/AlphaWalletHelp/Views/ContactUsBannerView.swift
  30. 10
      AlphaWallet/AppCoordinator.swift
  31. 1
      AlphaWallet/AppDelegate.swift
  32. 1
      AlphaWallet/Browser/Coordinators/DappBrowserCoordinator.swift
  33. 1
      AlphaWallet/Browser/Coordinators/DappRequestSwitchCustomChainCoordinator.swift
  34. 1
      AlphaWallet/Browser/Coordinators/DappRequestSwitchExistingChainCoordinator.swift
  35. 1
      AlphaWallet/Browser/Coordinators/QRCodeResolutionCoordinator.swift
  36. 1
      AlphaWallet/Browser/Coordinators/ScanQRCodeCoordinator.swift
  37. 1
      AlphaWallet/Browser/ViewControllers/BrowserHistoryViewController.swift
  38. 1
      AlphaWallet/Browser/ViewControllers/BrowserViewController.swift
  39. 1
      AlphaWallet/Browser/ViewControllers/DappsAutoCompletionViewController.swift
  40. 1
      AlphaWallet/Browser/ViewControllers/DappsHomeViewController.swift
  41. 1
      AlphaWallet/Browser/ViewControllers/DiscoverDappsViewController.swift
  42. 1
      AlphaWallet/Browser/ViewControllers/EditMyDappViewController.swift
  43. 1
      AlphaWallet/Browser/ViewControllers/MyDappsViewController.swift
  44. 1
      AlphaWallet/Browser/ViewControllers/SwitchChainRequestViewController.swift
  45. 1
      AlphaWallet/Browser/ViewModel/BrowserHistoryCellViewModel.swift
  46. 1
      AlphaWallet/Browser/ViewModel/DappViewCellViewModel.swift
  47. 1
      AlphaWallet/Browser/ViewModel/DappsAutoCompletionCellViewModel.swift
  48. 1
      AlphaWallet/Browser/ViewModel/DappsAutoCompletionViewControllerViewModel.swift
  49. 3
      AlphaWallet/Browser/ViewModel/DappsHomeViewControllerViewModel.swift
  50. 1
      AlphaWallet/Browser/ViewModel/DiscoverDappCellViewModel.swift
  51. 1
      AlphaWallet/Browser/ViewModel/DiscoverDappsViewControllerViewModel.swift
  52. 1
      AlphaWallet/Browser/ViewModel/EditMyDappViewControllerViewModel.swift
  53. 1
      AlphaWallet/Browser/ViewModel/HistoriesViewModel.swift
  54. 1
      AlphaWallet/Browser/ViewModel/MyDappCellViewModel.swift
  55. 1
      AlphaWallet/Browser/ViewModel/MyDappsViewControllerViewModel.swift
  56. 1
      AlphaWallet/Browser/ViewModel/SwitchChainRequestViewModel.swift
  57. 1
      AlphaWallet/Browser/Views/DappBrowserNavigationBar.swift
  58. 1
      AlphaWallet/Browser/Views/DappViewCell.swift
  59. 1
      AlphaWallet/Browser/Views/DiscoverDappCell.swift
  60. 1
      AlphaWallet/BuyCrypto/BuyCryptoUsingThirdPartyCoordinator.swift
  61. 1
      AlphaWallet/BuyCrypto/SelectServiceToBuyCryptoCoordinator.swift
  62. 1
      AlphaWallet/Common/Coordinators/AcceptProposalCoordinator.swift
  63. 1
      AlphaWallet/Common/Coordinators/CheckDeviceCoordinator.swift
  64. 1
      AlphaWallet/Common/Coordinators/ServerUnavailableCoordinator.swift
  65. 1
      AlphaWallet/Common/Coordinators/WalletApiCoordinator.swift
  66. 1
      AlphaWallet/Common/Services/DappRequestHandler.swift
  67. 7
      AlphaWallet/Common/Services/FirebaseReportService.swift
  68. 1
      AlphaWallet/Common/Services/KeyboardChecker.swift
  69. 1
      AlphaWallet/Common/Services/LocalNotificationService.swift
  70. 1
      AlphaWallet/Common/Services/PushNotificationsService.swift
  71. 1
      AlphaWallet/Common/Types/AppStyle.swift
  72. 1
      AlphaWallet/Common/Types/CanOpenContractWebPage.swift
  73. 0
      AlphaWallet/Common/Types/Configuration.swift
  74. 1
      AlphaWallet/Common/Types/SwitchCustomChainCallbackId.swift
  75. 1
      AlphaWallet/Common/ViewControllers/ModalViewController.swift
  76. 1
      AlphaWallet/Common/ViewModels/AcceptDeepLinkViewModel.swift
  77. 1
      AlphaWallet/Common/ViewModels/AcceptProposalViewModel.swift
  78. 1
      AlphaWallet/Common/ViewModels/AcceptWalletConnectSessionViewModel.swift
  79. 38
      AlphaWallet/Common/ViewModels/DappRequesterViewModel.swift
  80. 38
      AlphaWallet/Common/ViewModels/DeepLinkRequesterViewModel.swift
  81. 1
      AlphaWallet/Common/ViewModels/DropDownViewModel.swift
  82. 1
      AlphaWallet/Common/ViewModels/GasViewModel.swift
  83. 76
      AlphaWallet/Common/ViewModels/RequesterViewModel.swift
  84. 1
      AlphaWallet/Common/Views/AddressOrEnsNameLabel.swift
  85. 3
      AlphaWallet/Common/Views/AddressTextField.swift
  86. 1
      AlphaWallet/Common/Views/AmountTextField.swift
  87. 1
      AlphaWallet/Common/Views/AmountTextField_v2.swift
  88. 0
      AlphaWallet/Common/Views/BalloonMarker.swift
  89. 1
      AlphaWallet/Common/Views/BlockieImageView.swift
  90. 0
      AlphaWallet/Common/Views/BoxView.swift
  91. 0
      AlphaWallet/Common/Views/Button.swift
  92. 1
      AlphaWallet/Common/Views/ButtonsBar/ButtonsBar.swift
  93. 0
      AlphaWallet/Common/Views/ContainerTableViewCell.swift
  94. 0
      AlphaWallet/Common/Views/ContainerViewWithShadow.swift
  95. 0
      AlphaWallet/Common/Views/DateEntryField.swift
  96. 0
      AlphaWallet/Common/Views/EmptyView.swift
  97. 0
      AlphaWallet/Common/Views/ErrorView.swift
  98. 0
      AlphaWallet/Common/Views/LoadingView.swift
  99. 1
      AlphaWallet/Common/Views/NavigationController.swift
  100. 0
      AlphaWallet/Common/Views/NumberStepper.swift
  101. Some files were not shown because too many files have changed in this diff Show More

File diff suppressed because it is too large Load Diff

@ -3,6 +3,7 @@
import Foundation
import UIKit
import Combine
import AlphaWalletFoundation
protocol AccountsCoordinatorDelegate: AnyObject {
func didCancel(in coordinator: AccountsCoordinator)

@ -2,6 +2,7 @@
import UIKit
import Combine
import AlphaWalletFoundation
protocol AccountsViewControllerDelegate: AnyObject {
func didSelectAccount(account: Wallet, in viewController: AccountsViewController)

@ -2,6 +2,7 @@
import UIKit
import Combine
import AlphaWalletFoundation
class AccountViewModel {
private let getWalletName: GetWalletName

@ -3,6 +3,7 @@
import Foundation
import Combine
import UIKit
import AlphaWalletFoundation
struct AccountsViewModelInput {
let appear: AnyPublisher<Void, Never>

@ -7,6 +7,7 @@
import UIKit
import Combine
import AlphaWalletFoundation
struct WalletSummaryViewModel {
private let alignment: NSTextAlignment

@ -2,6 +2,7 @@
import UIKit
import Combine
import AlphaWalletFoundation
class AccountViewCell: UITableViewCell {
private let addressOrEnsName = UILabel()

@ -4,6 +4,7 @@ import PromiseKit
import RealmSwift
import Result
import Combine
import AlphaWalletFoundation
// swiftlint:disable file_length
protocol ActiveWalletCoordinatorDelegate: AnyObject {

@ -2,6 +2,7 @@
import UIKit
import Combine
import AlphaWalletFoundation
protocol ActivitiesCoordinatorDelegate: AnyObject {
func didPressTransaction(transaction: TransactionInstance, in viewController: ActivitiesViewController)

@ -3,6 +3,7 @@
import UIKit
import BigInt
import StatefulViewController
import AlphaWalletFoundation
protocol ActivitiesViewControllerDelegate: AnyObject {
func didPressActivity(activity: Activity, in viewController: ActivitiesViewController)

@ -2,6 +2,7 @@
import UIKit
import Combine
import AlphaWalletFoundation
protocol ActivityViewControllerDelegate: AnyObject {
func reinject(viewController: ActivityViewController)

@ -6,6 +6,7 @@
//
import UIKit
import AlphaWalletFoundation
struct ActivitiesViewModel {
var collection: ActivityCollection

@ -2,6 +2,7 @@
import Foundation
import BigInt
import AlphaWalletFoundation
struct ActivityCellViewModel {
private var server: RPCServer {

@ -6,6 +6,7 @@
//
import UIKit
import AlphaWalletFoundation
struct ActivityStateViewViewModel {
var stateImage: UIImage? {

@ -2,6 +2,7 @@
import Foundation
import BigInt
import AlphaWalletFoundation
struct ActivityViewModel {
let activity: Activity
@ -159,10 +160,10 @@ struct ActivityViewModel {
extension HasTokenImage {
func icon(withSize size: GoogleContentSize) -> Subscribable<TokenImage> {
public func icon(withSize size: GoogleContentSize) -> Subscribable<TokenImage> {
let name = symbol.nilIfEmpty ?? name
let colors = [R.color.radical()!, R.color.cerulean()!, R.color.emerald()!, R.color.indigo()!, R.color.azure()!, R.color.pumpkin()!]
let blockChainNameColor = server.blockChainNameColor
return TokenImageFetcher.instance.image(contractAddress: contractAddress, server: server, name: name, type: type, balance: firstNftAsset, size: size, contractDefinedImage: contractAddress.tokenImage, colors: colors, staticOverlayIcon: server.staticOverlayIcon, blockChainNameColor: blockChainNameColor)
return TokenImageFetcher.instance.image(contractAddress: contractAddress, server: server, name: name, type: type, balance: firstNftAsset, size: size, contractDefinedImage: contractAddress.tokenImage, colors: colors, staticOverlayIcon: server.staticOverlayIcon, blockChainNameColor: blockChainNameColor, serverIconImage: server.iconImage)
}
}

@ -2,6 +2,7 @@
import UIKit
import BigInt
import AlphaWalletFoundation
struct DefaultActivityCellViewModel {
private var server: RPCServer {

@ -2,6 +2,7 @@
import UIKit
import BigInt
import AlphaWalletFoundation
struct DefaultActivityViewModel {
private var server: RPCServer {

@ -8,6 +8,7 @@
import UIKit
import BigInt
import StatefulViewController
import AlphaWalletFoundation
protocol ActivitiesViewDelegate: class {
func didPressActivity(activity: Activity, in view: ActivitiesView)

@ -7,6 +7,7 @@
import UIKit
import StatefulViewController
import AlphaWalletFoundation
struct ActivityPageViewModel {
var title: String {

@ -2,6 +2,7 @@
import UIKit
import BigInt
import AlphaWalletFoundation
class ActivityViewCell: UITableViewCell {
private let background = UIView()

@ -6,6 +6,7 @@
//
import Foundation
import AlphaWalletFoundation
class AddMultipleCustomRpcModel: NSObject {

@ -7,6 +7,7 @@
import UIKit
import PromiseKit
import AlphaWalletFoundation
@objc protocol AddMultipleCustomRpcViewControllerResponse: AnyObject {
@objc func addMultipleCustomRpcCompleted()

@ -6,6 +6,7 @@
//
import UIKit
import AlphaWalletFoundation
protocol EditPriceAlertCoordinatorDelegate: class {
func didClose(in coordinator: EditPriceAlertCoordinator)

@ -7,6 +7,7 @@
import UIKit
import Combine
import AlphaWalletFoundation
protocol EditPriceAlertViewControllerDelegate: class {
func didUpdateAlert(in viewController: EditPriceAlertViewController)

@ -6,6 +6,7 @@
//
import UIKit
import AlphaWalletFoundation
enum EdiPricetAlertViewModelConfiguration {
case create

@ -6,6 +6,7 @@
//
import UIKit
import AlphaWalletFoundation
struct PriceAlertsPageViewModel {
var title: String { return R.string.localizable.priceAlertNavigationTitle() }

@ -6,6 +6,7 @@
//
import UIKit
import AlphaWalletFoundation
protocol PriceAlertsPageViewDelegate: class {
func editAlertSelected(in view: PriceAlertsPageView, alert: PriceAlert)

@ -2,6 +2,7 @@
import UIKit
import MessageUI
import AlphaWalletFoundation
protocol ContactUsBannerViewDelegate: AnyObject {
func present(_ viewController: UIViewController, for view: ContactUsBannerView)

@ -4,13 +4,21 @@ import Combine
import UIKit
import PromiseKit
import AlphaWalletCore
import AlphaWalletFoundation
extension TokenScript {
static let baseTokenScriptFiles: [TokenType: String] = [
.erc20: (try! String(contentsOf: R.file.erc20TokenScriptTsml()!)),
.erc721: (try! String(contentsOf: R.file.erc721TokenScriptTsml()!)),
]
}
class AppCoordinator: NSObject, Coordinator {
private let config = Config()
private let legacyFileBasedKeystore: LegacyFileBasedKeystore
private let lock = Lock()
private var keystore: Keystore
private let assetDefinitionStore = AssetDefinitionStore()
private let assetDefinitionStore = AssetDefinitionStore(baseTokenScriptFiles: TokenScript.baseTokenScriptFiles)
private let window: UIWindow
private var appTracker = AppTracker()
//TODO rename and replace type? Not Initializer but similar as of writing

@ -5,6 +5,7 @@ import AWSCore
import PromiseKit
import UserNotifications
import AlphaWalletAddress
import AlphaWalletFoundation
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate {

@ -8,6 +8,7 @@ import JSONRPCKit
import PromiseKit
import RealmSwift
import Result
import AlphaWalletFoundation
protocol DappBrowserCoordinatorDelegate: CanOpenURL, RequestAddCustomChainProvider, RequestSwitchChainProvider, BuyCryptoDelegate {
func didSentTransaction(transaction: SentTransaction, inCoordinator coordinator: DappBrowserCoordinator)

@ -2,6 +2,7 @@
import UIKit
import PromiseKit
import AlphaWalletFoundation
protocol DappRequestSwitchCustomChainCoordinatorDelegate: AnyObject {
func notifySuccessful(withCallbackId callbackId: SwitchCustomChainCallbackId, inCoordinator coordinator: DappRequestSwitchCustomChainCoordinator)

@ -2,6 +2,7 @@
import UIKit
import PromiseKit
import AlphaWalletFoundation
protocol DappRequestSwitchExistingChainCoordinatorDelegate: AnyObject {
func notifySuccessful(withCallbackId callbackId: SwitchCustomChainCallbackId, inCoordinator coordinator: DappRequestSwitchExistingChainCoordinator)

@ -8,6 +8,7 @@
import Foundation
import BigInt
import PromiseKit
import AlphaWalletFoundation
protocol QRCodeResolutionCoordinatorDelegate: AnyObject {
func coordinator(_ coordinator: QRCodeResolutionCoordinator, didResolveAddress address: AlphaWallet.Address, action: ScanQRCodeAction)

@ -4,6 +4,7 @@ import Foundation
import QRCodeReaderViewController
import BigInt
import PromiseKit
import AlphaWalletFoundation
protocol ScanQRCodeCoordinatorDelegate: AnyObject {
func didCancel(in coordinator: ScanQRCodeCoordinator)

@ -5,6 +5,7 @@
import Foundation
import UIKit
import StatefulViewController
import AlphaWalletFoundation
protocol BrowserHistoryViewControllerDelegate: AnyObject {
func didSelect(history: History, inViewController controller: BrowserHistoryViewController)

@ -5,6 +5,7 @@ import UIKit
import WebKit
import JavaScriptCore
import Result
import AlphaWalletFoundation
protocol BrowserViewControllerDelegate: AnyObject {
func didCall(action: DappAction, callbackID: Int, inBrowserViewController viewController: BrowserViewController)

@ -2,6 +2,7 @@
import Foundation
import UIKit
import AlphaWalletFoundation
protocol DappsAutoCompletionViewControllerDelegate: AnyObject {
func didTap(dapp: Dapp, inViewController viewController: DappsAutoCompletionViewController)

@ -4,6 +4,7 @@
import Foundation
import UIKit
import AlphaWalletFoundation
protocol DappsHomeViewControllerDelegate: AnyObject {
func didTapShowMyDappsViewController(inViewController viewController: DappsHomeViewController)

@ -4,6 +4,7 @@
import Foundation
import UIKit
import AlphaWalletFoundation
protocol DiscoverDappsViewControllerDelegate: AnyObject {
func didTap(dapp: Dapp, inViewController viewController: DiscoverDappsViewController)

@ -2,6 +2,7 @@
import Foundation
import UIKit
import AlphaWalletFoundation
protocol EditMyDappViewControllerDelegate: AnyObject {
func didTapSave(dapp: Bookmark, withTitle title: String, url: String, inViewController viewController: EditMyDappViewController)

@ -5,6 +5,7 @@
import Foundation
import UIKit
import StatefulViewController
import AlphaWalletFoundation
protocol MyDappsViewControllerDelegate: AnyObject {
func didTapToEdit(dapp: Bookmark, inViewController viewController: MyDappsViewController)

@ -7,6 +7,7 @@
import UIKit
import PromiseKit
import AlphaWalletFoundation
protocol SwitchChainRequestViewControllerDelegate: class {
func didClose(in viewController: SwitchChainRequestViewController)

@ -2,6 +2,7 @@
import Foundation
import UIKit
import AlphaWalletFoundation
struct BrowserHistoryCellViewModel {
let history: History

@ -2,6 +2,7 @@
import Foundation
import UIKit
import AlphaWalletFoundation
class DappViewCellViewModel {
let dapp: Bookmark

@ -2,6 +2,7 @@
import Foundation
import UIKit
import AlphaWalletFoundation
struct DappsAutoCompletionCellViewModel {
let dapp: Dapp

@ -1,6 +1,7 @@
// Copyright © 2018 Stormbird PTE. LTD.
import Foundation
import AlphaWalletFoundation
struct DappsAutoCompletionViewControllerViewModel {
var dappSuggestions = [Dapp]()

@ -2,6 +2,7 @@
import Foundation
import UIKit
import AlphaWalletFoundation
struct DappsHomeViewControllerViewModel {
var bookmarksStore: BookmarksStore
@ -17,4 +18,4 @@ struct DappsHomeViewControllerViewModel {
var backgroundColor: UIColor {
return Colors.appWhite
}
}
}

@ -2,6 +2,7 @@
import Foundation
import UIKit
import AlphaWalletFoundation
struct DiscoverDappCellViewModel {
let bookmarksStore: BookmarksStore

@ -2,6 +2,7 @@
import Foundation
import UIKit
import AlphaWalletFoundation
struct DiscoverDappsViewControllerViewModel {

@ -2,6 +2,7 @@
import Foundation
import UIKit
import AlphaWalletFoundation
struct EditMyDappViewControllerViewModel {
let dapp: Bookmark

@ -1,6 +1,7 @@
// Copyright DApps Platform Inc. All rights reserved.
import Foundation
import AlphaWalletFoundation
struct HistoriesViewModel {
private let store: HistoryStore

@ -2,6 +2,7 @@
import Foundation
import UIKit
import AlphaWalletFoundation
struct MyDappCellViewModel {
let dapp: Bookmark

@ -1,6 +1,7 @@
// Copyright © 2018 Stormbird PTE. LTD.
import Foundation
import AlphaWalletFoundation
struct MyDappsViewControllerViewModel {
var bookmarksStore: BookmarksStore

@ -6,6 +6,7 @@
//
import Foundation
import AlphaWalletFoundation
struct SwitchChainRequestViewModel {
let title: String = R.string.localizable.switchChainRequestTitle()

@ -1,6 +1,7 @@
// Copyright © 2018 Stormbird PTE. LTD.
import UIKit
import AlphaWalletFoundation
protocol DappBrowserNavigationBarDelegate: AnyObject {
func didTyped(text: String, inNavigationBar navigationBar: DappBrowserNavigationBar)

@ -2,6 +2,7 @@
import Foundation
import UIKit
import AlphaWalletFoundation
protocol DappViewCellDelegate: AnyObject {
func didTapDelete(dapp: Bookmark, inCell cell: DappViewCell)

@ -2,6 +2,7 @@
import Foundation
import UIKit
import AlphaWalletFoundation
protocol DiscoverDappCellDelegate: AnyObject {
func onAdd(dapp: Dapp, inCell cell: DiscoverDappCell)

@ -6,6 +6,7 @@
//
import UIKit
import AlphaWalletFoundation
protocol BuyCryptoUsingThirdPartyCoordinatorDelegate: AnyObject, CanOpenURL {
}

@ -6,6 +6,7 @@
//
import UIKit
import AlphaWalletFoundation
protocol SelectServiceToBuyCryptoCoordinatorDelegate: AnyObject, CanOpenURL {
func selectBuyService(_ result: Result<Void, BuyCryptoError>, in coordinator: SelectServiceToBuyCryptoCoordinator)

@ -7,6 +7,7 @@
import UIKit
import PromiseKit
import AlphaWalletFoundation
protocol AcceptProposalCoordinatorDelegate: AnyObject {
func coordinator(_ coordinator: AcceptProposalCoordinator, didComplete result: ProposalResult)

@ -2,6 +2,7 @@
import Foundation
import UIKit
import AlphaWalletFoundation
class CheckDeviceCoordinator: Coordinator {
private let navigationController: UINavigationController

@ -7,6 +7,7 @@
import UIKit
import PromiseKit
import AlphaWalletFoundation
protocol ServerUnavailableCoordinatorDelegate: AnyObject {
func didDismiss(in coordinator: ServerUnavailableCoordinator)

@ -8,6 +8,7 @@
import UIKit
import Combine
import PromiseKit
import AlphaWalletFoundation
protocol WalletApiCoordinatorDelegate: AnyObject {
func didOpenUrl(in service: WalletApiCoordinator, redirectUrl: URL)

@ -6,6 +6,7 @@
//
import Foundation
import AlphaWalletFoundation
protocol DappRequestHandlerDelegate: class {
func processRestartQueueAndRestartUI()

@ -6,6 +6,7 @@
//
import Firebase
import AlphaWalletFoundation
extension AlphaWallet {
final class FirebaseReportService: ReportService {
@ -126,3 +127,9 @@ extension AlphaWallet {
}
}
}
extension Constants {
public static let googleServiceInfoPlistContent: String? = {
R.file.googleServiceInfoPlist()?.path
}()
}

@ -6,6 +6,7 @@
//
import UIKit
import AlphaWalletFoundation
class KeyboardChecker: NSObject {

@ -7,6 +7,7 @@
import Foundation
import UserNotifications
import AlphaWalletFoundation
class LocalNotificationService: ScheduledNotificationService {

@ -3,6 +3,7 @@
import Foundation
import UIKit
import UserNotifications
import AlphaWalletFoundation
final class UNUserNotificationsService: NSObject, PushNotificationsService {
private var notificationCenter: UNUserNotificationCenter {

@ -2,6 +2,7 @@
import Foundation
import UIKit
import AlphaWalletFoundation
func applyStyle() {
UIBarButtonItem.appearance(whenContainedInInstancesOf: [UIDocumentBrowserViewController.self]).tintColor = Configuration.Color.Semantic.navigationbarButtonItemTint

@ -1,6 +1,7 @@
//Copyright © 2018 Stormbird PTE. LTD.
import UIKit
import AlphaWalletFoundation
protocol CanOpenURL {
func didPressViewContractWebPage(forContract contract: AlphaWallet.Address, server: RPCServer, in viewController: UIViewController)

@ -6,6 +6,7 @@
//
import Foundation
import AlphaWalletFoundation
enum SwitchCustomChainCallbackId {
case dapp(requestId: Int)

@ -6,6 +6,7 @@
//
import UIKit
import AlphaWalletFoundation
protocol ModalViewControllerDelegate: class {
func didDismiss(_ controller: ModalViewController)

@ -7,6 +7,7 @@
import Foundation
import AlphaWalletAddress
import AlphaWalletFoundation
final class AcceptDeepLinkViewModel: SectionProtocol {

@ -6,6 +6,7 @@
//
import UIKit
import AlphaWalletFoundation
enum ProposalType {
case walletConnect(AcceptWalletConnectSessionViewModel)

@ -6,6 +6,7 @@
//
import Foundation
import AlphaWalletFoundation
final class AcceptWalletConnectSessionViewModel: SectionProtocol {
private let config: Config

@ -0,0 +1,38 @@
//
// DappRequesterViewModel.swift
// AlphaWallet
//
// Created by Vladyslav Shepitko on 31.08.2022.
//
import Foundation
import AlphaWalletFoundation
struct DappRequesterViewModel: RequesterViewModel {
let requester: Requester
var viewModels: [Any] {
var viewModels: [SignatureConfirmationViewModel.ViewType] = []
var dappNameHeader: String { R.string.localizable.walletConnectDappName() }
viewModels += [
.header(.init(title: .normal(requester.shortName), headerName: dappNameHeader, configuration: .init(section: 0)))
]
if let dappUrl = requester.url {
var dappWebsiteHeader: String { R.string.localizable.walletConnectDappWebsite() }
viewModels += [
.header(.init(title: .normal(dappUrl.absoluteString), headerName: dappWebsiteHeader, configuration: .init(section: 0))),
]
}
if let server = requester.server {
var dappServerHeader: String { R.string.localizable.settingsNetworkButtonTitle() }
viewModels += [
.header(.init(title: .normal(server.name), headerName: dappServerHeader, configuration: .init(section: 0)))
]
}
return viewModels
}
}

@ -0,0 +1,38 @@
//
// DeepLinkRequesterViewModel.swift
// AlphaWallet
//
// Created by Vladyslav Shepitko on 31.08.2022.
//
import Foundation
import AlphaWalletFoundation
struct DeepLinkRequesterViewModel: RequesterViewModel {
let requester: Requester
var viewModels: [Any] {
var viewModels: [SignatureConfirmationViewModel.ViewType] = []
var dappNameHeader: String { R.string.localizable.walletConnectDappName() }
viewModels += [
.header(.init(title: .normal(requester.shortName), headerName: dappNameHeader, configuration: .init(section: 0)))
]
if let dappUrl = requester.url {
var dappWebsiteHeader: String { R.string.localizable.requesterFieldUrl() }
viewModels += [
.header(.init(title: .normal(dappUrl.absoluteString), headerName: dappWebsiteHeader, configuration: .init(section: 0))),
]
}
if let server = requester.server {
var dappServerHeader: String { R.string.localizable.settingsNetworkButtonTitle() }
viewModels += [
.header(.init(title: .normal(server.name), headerName: dappServerHeader, configuration: .init(section: 0)))
]
}
return viewModels
}
}

@ -6,6 +6,7 @@
//
import Foundation
import AlphaWalletFoundation
protocol DropDownItemType: Equatable {
var title: String { get }

@ -2,6 +2,7 @@
import Foundation
import BigInt
import AlphaWalletFoundation
struct GasViewModel {
private let fee: BigInt

@ -1,76 +0,0 @@
//
// RequesterViewModel.swift
// AlphaWallet
//
// Created by Vladyslav Shepitko on 16.06.2022.
//
import Foundation
protocol RequesterViewModel {
var requester: Requester { get }
var viewModels: [SignatureConfirmationViewModel.ViewType] { get }
}
extension RequesterViewModel {
var iconUrl: URL? { return requester.iconUrl }
}
struct DeepLinkRequesterViewModel: RequesterViewModel {
let requester: Requester
var viewModels: [SignatureConfirmationViewModel.ViewType] {
var viewModels: [SignatureConfirmationViewModel.ViewType] = []
var dappNameHeader: String { R.string.localizable.walletConnectDappName() }
viewModels += [
.header(.init(title: .normal(requester.shortName), headerName: dappNameHeader, configuration: .init(section: 0)))
]
if let dappUrl = requester.url {
var dappWebsiteHeader: String { R.string.localizable.requesterFieldUrl() }
viewModels += [
.header(.init(title: .normal(dappUrl.absoluteString), headerName: dappWebsiteHeader, configuration: .init(section: 0))),
]
}
if let server = requester.server {
var dappServerHeader: String { R.string.localizable.settingsNetworkButtonTitle() }
viewModels += [
.header(.init(title: .normal(server.name), headerName: dappServerHeader, configuration: .init(section: 0)))
]
}
return viewModels
}
}
struct DappRequesterViewModel: RequesterViewModel {
let requester: Requester
var viewModels: [SignatureConfirmationViewModel.ViewType] {
var viewModels: [SignatureConfirmationViewModel.ViewType] = []
var dappNameHeader: String { R.string.localizable.walletConnectDappName() }
viewModels += [
.header(.init(title: .normal(requester.shortName), headerName: dappNameHeader, configuration: .init(section: 0)))
]
if let dappUrl = requester.url {
var dappWebsiteHeader: String { R.string.localizable.walletConnectDappWebsite() }
viewModels += [
.header(.init(title: .normal(dappUrl.absoluteString), headerName: dappWebsiteHeader, configuration: .init(section: 0))),
]
}
if let server = requester.server {
var dappServerHeader: String { R.string.localizable.settingsNetworkButtonTitle() }
viewModels += [
.header(.init(title: .normal(server.name), headerName: dappServerHeader, configuration: .init(section: 0)))
]
}
return viewModels
}
}

@ -9,6 +9,7 @@ import UIKit
import PromiseKit
import CryptoSwift
import Combine
import AlphaWalletFoundation
class AddressOrEnsNameLabel: UILabel {

@ -1,6 +1,7 @@
// Copyright © 2018 Stormbird PTE. LTD.
import UIKit
import AlphaWalletFoundation
protocol AddressTextFieldDelegate: AnyObject {
func displayError(error: Error, for textField: AddressTextField)
@ -416,7 +417,7 @@ extension String {
}
extension SendInputErrors {
var errorDescription: String? {
public var errorDescription: String? {
switch self {
case .emptyClipBoard:
return R.string.localizable.sendErrorEmptyClipBoard()

@ -1,6 +1,7 @@
// Copyright © 2018 Stormbird PTE. LTD.
import UIKit
import AlphaWalletFoundation
protocol AmountTextFieldDelegate: AnyObject {
func changeAmount(in textField: AmountTextField)

@ -2,6 +2,7 @@
import UIKit
import Combine
import AlphaWalletFoundation
protocol AmountTextField_v2Delegate: AnyObject {
func changeAmount(in textField: AmountTextField_v2)

@ -6,6 +6,7 @@
//
import UIKit
import AlphaWalletFoundation
class BlockieImageView: UIView {
private lazy var imageView: WebImageView = {

@ -2,6 +2,7 @@
import Foundation
import UIKit
import AlphaWalletFoundation
enum HorizontalButtonsBarConfiguration {
case empty

@ -6,6 +6,7 @@
//
import UIKit
import AlphaWalletFoundation
protocol PushNotifiable {
func didPushViewController(animated: Bool)

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save