Skip to content

Commit

Permalink
Merge pull request #5246 from oa-s/#5234-2
Browse files Browse the repository at this point in the history
remove dependency from resources #5234
  • Loading branch information
oa-s authored Sep 2, 2022
2 parents 34aff72 + 963272d commit 77f373b
Show file tree
Hide file tree
Showing 1,603 changed files with 6,119 additions and 6,962 deletions.
File renamed without changes.
2,894 changes: 128 additions & 2,766 deletions AlphaWallet.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import Foundation
import UIKit
import Combine
import AlphaWalletFoundation

protocol AccountsCoordinatorDelegate: AnyObject {
func didCancel(in coordinator: AccountsCoordinator)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import UIKit
import Combine
import AlphaWalletFoundation

protocol AccountsViewControllerDelegate: AnyObject {
func didSelectAccount(account: Wallet, in viewController: AccountsViewController)
Expand Down
1 change: 1 addition & 0 deletions AlphaWallet/Accounts/ViewModels/AccountViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import UIKit
import Combine
import AlphaWalletFoundation

class AccountViewModel {
private let getWalletName: GetWalletName
Expand Down
1 change: 1 addition & 0 deletions AlphaWallet/Accounts/ViewModels/AccountsViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import Foundation
import Combine
import UIKit
import AlphaWalletFoundation

struct AccountsViewModelInput {
let appear: AnyPublisher<Void, Never>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import UIKit
import Combine
import AlphaWalletFoundation

struct WalletSummaryViewModel {
private let alignment: NSTextAlignment
Expand Down
1 change: 1 addition & 0 deletions AlphaWallet/Accounts/Views/AccountViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import UIKit
import Combine
import AlphaWalletFoundation

class AccountViewCell: UITableViewCell {
private let addressOrEnsName = UILabel()
Expand Down
1 change: 1 addition & 0 deletions AlphaWallet/ActiveWalletCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import PromiseKit
import RealmSwift
import Result
import Combine
import AlphaWalletFoundation

// swiftlint:disable file_length
protocol ActiveWalletCoordinatorDelegate: AnyObject {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import UIKit
import Combine
import AlphaWalletFoundation

protocol ActivitiesCoordinatorDelegate: AnyObject {
func didPressTransaction(transaction: TransactionInstance, in viewController: ActivitiesViewController)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import UIKit
import BigInt
import StatefulViewController
import AlphaWalletFoundation

protocol ActivitiesViewControllerDelegate: AnyObject {
func didPressActivity(activity: Activity, in viewController: ActivitiesViewController)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import UIKit
import Combine
import AlphaWalletFoundation

protocol ActivityViewControllerDelegate: AnyObject {
func reinject(viewController: ActivityViewController)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import UIKit
import AlphaWalletFoundation

struct ActivitiesViewModel {
var collection: ActivityCollection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import Foundation
import BigInt
import AlphaWalletFoundation

struct ActivityCellViewModel {
private var server: RPCServer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import UIKit
import AlphaWalletFoundation

struct ActivityStateViewViewModel {
var stateImage: UIImage? {
Expand Down
5 changes: 3 additions & 2 deletions AlphaWallet/Activities/ViewModels/ActivityViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import Foundation
import BigInt
import AlphaWalletFoundation

struct ActivityViewModel {
let activity: Activity
Expand Down Expand Up @@ -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)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import UIKit
import BigInt
import AlphaWalletFoundation

struct DefaultActivityCellViewModel {
private var server: RPCServer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import UIKit
import BigInt
import AlphaWalletFoundation

struct DefaultActivityViewModel {
private var server: RPCServer {
Expand Down
1 change: 1 addition & 0 deletions AlphaWallet/Activities/Views/ActivitiesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import UIKit
import BigInt
import StatefulViewController
import AlphaWalletFoundation

protocol ActivitiesViewDelegate: class {
func didPressActivity(activity: Activity, in view: ActivitiesView)
Expand Down
1 change: 1 addition & 0 deletions AlphaWallet/Activities/Views/ActivityPageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import UIKit
import StatefulViewController
import AlphaWalletFoundation

struct ActivityPageViewModel {
var title: String {
Expand Down
1 change: 1 addition & 0 deletions AlphaWallet/Activities/Views/ActivityViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import UIKit
import BigInt
import AlphaWalletFoundation

class ActivityViewCell: UITableViewCell {
private let background = UIView()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import Foundation
import AlphaWalletFoundation

class AddMultipleCustomRpcModel: NSObject {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import UIKit
import PromiseKit
import AlphaWalletFoundation

@objc protocol AddMultipleCustomRpcViewControllerResponse: AnyObject {
@objc func addMultipleCustomRpcCompleted()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import UIKit
import AlphaWalletFoundation

protocol EditPriceAlertCoordinatorDelegate: class {
func didClose(in coordinator: EditPriceAlertCoordinator)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import UIKit
import Combine
import AlphaWalletFoundation

protocol EditPriceAlertViewControllerDelegate: class {
func didUpdateAlert(in viewController: EditPriceAlertViewController)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import UIKit
import AlphaWalletFoundation

enum EdiPricetAlertViewModelConfiguration {
case create
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import UIKit
import AlphaWalletFoundation

struct PriceAlertsPageViewModel {
var title: String { return R.string.localizable.priceAlertNavigationTitle() }
Expand Down
1 change: 1 addition & 0 deletions AlphaWallet/Alerts/Views/PriceAlertsPageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import UIKit
import AlphaWalletFoundation

protocol PriceAlertsPageViewDelegate: class {
func editAlertSelected(in view: PriceAlertsPageView, alert: PriceAlert)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import UIKit
import MessageUI
import AlphaWalletFoundation

protocol ContactUsBannerViewDelegate: AnyObject {
func present(_ viewController: UIViewController, for view: ContactUsBannerView)
Expand Down
10 changes: 9 additions & 1 deletion AlphaWallet/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions AlphaWallet/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import AWSCore
import PromiseKit
import UserNotifications
import AlphaWalletAddress
import AlphaWalletFoundation

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import UIKit
import PromiseKit
import AlphaWalletFoundation

protocol DappRequestSwitchCustomChainCoordinatorDelegate: AnyObject {
func notifySuccessful(withCallbackId callbackId: SwitchCustomChainCallbackId, inCoordinator coordinator: DappRequestSwitchCustomChainCoordinator)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import UIKit
import PromiseKit
import AlphaWalletFoundation

protocol DappRequestSwitchExistingChainCoordinatorDelegate: AnyObject {
func notifySuccessful(withCallbackId callbackId: SwitchCustomChainCallbackId, inCoordinator coordinator: DappRequestSwitchExistingChainCoordinator)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Foundation
import QRCodeReaderViewController
import BigInt
import PromiseKit
import AlphaWalletFoundation

protocol ScanQRCodeCoordinatorDelegate: AnyObject {
func didCancel(in coordinator: ScanQRCodeCoordinator)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import Foundation
import UIKit
import StatefulViewController
import AlphaWalletFoundation

protocol BrowserHistoryViewControllerDelegate: AnyObject {
func didSelect(history: History, inViewController controller: BrowserHistoryViewController)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import Foundation
import UIKit
import AlphaWalletFoundation

protocol DappsAutoCompletionViewControllerDelegate: AnyObject {
func didTap(dapp: Dapp, inViewController viewController: DappsAutoCompletionViewController)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import Foundation
import UIKit
import AlphaWalletFoundation

protocol DappsHomeViewControllerDelegate: AnyObject {
func didTapShowMyDappsViewController(inViewController viewController: DappsHomeViewController)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import Foundation
import UIKit
import AlphaWalletFoundation

protocol DiscoverDappsViewControllerDelegate: AnyObject {
func didTap(dapp: Dapp, inViewController viewController: DiscoverDappsViewController)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import Foundation
import UIKit
import StatefulViewController
import AlphaWalletFoundation

protocol MyDappsViewControllerDelegate: AnyObject {
func didTapToEdit(dapp: Bookmark, inViewController viewController: MyDappsViewController)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import UIKit
import PromiseKit
import AlphaWalletFoundation

protocol SwitchChainRequestViewControllerDelegate: class {
func didClose(in viewController: SwitchChainRequestViewController)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import Foundation
import UIKit
import AlphaWalletFoundation

struct BrowserHistoryCellViewModel {
let history: History
Expand Down
1 change: 1 addition & 0 deletions AlphaWallet/Browser/ViewModel/DappViewCellViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import Foundation
import UIKit
import AlphaWalletFoundation

class DappViewCellViewModel {
let dapp: Bookmark
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import Foundation
import UIKit
import AlphaWalletFoundation

struct DappsAutoCompletionCellViewModel {
let dapp: Dapp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright © 2018 Stormbird PTE. LTD.

import Foundation
import AlphaWalletFoundation

struct DappsAutoCompletionViewControllerViewModel {
var dappSuggestions = [Dapp]()
Expand Down
Loading

0 comments on commit 77f373b

Please sign in to comment.