Skip to content

Commit

Permalink
Merge pull request #507 from Outblock/develop
Browse files Browse the repository at this point in the history
Release 2.2.10
  • Loading branch information
lmcmz authored Nov 12, 2024
2 parents a2cd4ac + 6be11aa commit 7b0a3bf
Show file tree
Hide file tree
Showing 219 changed files with 12,458 additions and 6,335 deletions.
12 changes: 12 additions & 0 deletions FRW.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,8 @@
15DFD3332CD4576A004B0DB8 /* CGPoint+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15DFD3272CD4576A004B0DB8 /* CGPoint+Extensions.swift */; };
15DFD3342CD4576A004B0DB8 /* BlobLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15DFD3262CD4576A004B0DB8 /* BlobLayer.swift */; };
15DFD3352CD4576A004B0DB8 /* ResizableLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15DFD32A2CD4576A004B0DB8 /* ResizableLayer.swift */; };
15DFD34C2CE197F9004B0DB8 /* AppExternalLinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15DFD34B2CE197F9004B0DB8 /* AppExternalLinks.swift */; };
15DFD34D2CE197F9004B0DB8 /* AppExternalLinks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15DFD34B2CE197F9004B0DB8 /* AppExternalLinks.swift */; };
15ECAE3928C4FCE600B79453 /* WalletConnectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15CC8A6B28C4F817001D2696 /* WalletConnectView.swift */; };
15ECAE3A28C4FCE700B79453 /* WalletConnectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15CC8A6B28C4F817001D2696 /* WalletConnectView.swift */; };
15ECAE3B28C4FCEB00B79453 /* WalletConnectViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15CC8A6C28C4F836001D2696 /* WalletConnectViewModel.swift */; };
Expand Down Expand Up @@ -1138,6 +1140,8 @@
4E9532392CD3E4B300AAECD1 /* CustomTokenManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E9532372CD3E4B300AAECD1 /* CustomTokenManager.swift */; };
4E95323E2CD5501C00AAECD1 /* CustomTokenDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E95323D2CD5501C00AAECD1 /* CustomTokenDetailView.swift */; };
4E95323F2CD5501C00AAECD1 /* CustomTokenDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E95323D2CD5501C00AAECD1 /* CustomTokenDetailView.swift */; };
4E9532412CDA18FB00AAECD1 /* AddTokenSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E9532402CDA18FB00AAECD1 /* AddTokenSheetView.swift */; };
4E9532422CDA18FB00AAECD1 /* AddTokenSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E9532402CDA18FB00AAECD1 /* AddTokenSheetView.swift */; };
4E9621D52B984EF3006859AD /* CadenceManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E9621D42B984EF3006859AD /* CadenceManager.swift */; };
4E9621D62B984EF3006859AD /* CadenceManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E9621D42B984EF3006859AD /* CadenceManager.swift */; };
4E9621D82B9850CF006859AD /* FRWAPI+Cadence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E9621D72B9850CF006859AD /* FRWAPI+Cadence.swift */; };
Expand Down Expand Up @@ -2314,6 +2318,7 @@
15DFD3282CD4576A004B0DB8 /* FluidGradient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FluidGradient.swift; sourceTree = "<group>"; };
15DFD3292CD4576A004B0DB8 /* FluidGradientView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FluidGradientView.swift; sourceTree = "<group>"; };
15DFD32A2CD4576A004B0DB8 /* ResizableLayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResizableLayer.swift; sourceTree = "<group>"; };
15DFD34B2CE197F9004B0DB8 /* AppExternalLinks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppExternalLinks.swift; sourceTree = "<group>"; };
15EC9DF1274FD1FD00F70CD9 /* FRW_App.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FRW_App.swift; sourceTree = "<group>"; };
15EC9DF5274FD1FD00F70CD9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
15EC9DF8274FD1FD00F70CD9 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2437,6 +2442,7 @@
4E9532342CD2196400AAECD1 /* SectionItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SectionItem.swift; sourceTree = "<group>"; };
4E9532372CD3E4B300AAECD1 /* CustomTokenManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTokenManager.swift; sourceTree = "<group>"; };
4E95323D2CD5501C00AAECD1 /* CustomTokenDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTokenDetailView.swift; sourceTree = "<group>"; };
4E9532402CDA18FB00AAECD1 /* AddTokenSheetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddTokenSheetView.swift; sourceTree = "<group>"; };
4E9621D42B984EF3006859AD /* CadenceManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CadenceManager.swift; sourceTree = "<group>"; };
4E9621D72B9850CF006859AD /* FRWAPI+Cadence.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "FRWAPI+Cadence.swift"; sourceTree = "<group>"; };
4E9621DA2B985BAB006859AD /* cloudfunctions.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = cloudfunctions.json; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4951,6 +4957,7 @@
4E9532312CD2089C00AAECD1 /* AddCustomTokenViewModel.swift */,
4E95323D2CD5501C00AAECD1 /* CustomTokenDetailView.swift */,
4E9532372CD3E4B300AAECD1 /* CustomTokenManager.swift */,
4E9532402CDA18FB00AAECD1 /* AddTokenSheetView.swift */,
);
path = CustomToken;
sourceTree = "<group>";
Expand Down Expand Up @@ -5802,6 +5809,7 @@
6AAD4E6828BC6E9900AEAB1F /* TransactionModels.swift */,
6AC476E728F3C993008503E6 /* WebBookmark.swift */,
6A2C560A290BE46800306A6C /* Currency.swift */,
15DFD34B2CE197F9004B0DB8 /* AppExternalLinks.swift */,
);
path = Model;
sourceTree = "<group>";
Expand Down Expand Up @@ -6726,6 +6734,7 @@
6A164F742845F1CB0026B31E /* EnvironmentValues+IndexBarInsets.swift in Sources */,
15DC20CD27819C56000B187A /* VNavigationLink.swift in Sources */,
15ADAE2B28F51EBB0014B722 /* SymmetricEncryption.swift in Sources */,
15DFD34C2CE197F9004B0DB8 /* AppExternalLinks.swift in Sources */,
4E31380B2C658FB2003A73E5 /* CappedCollection.swift in Sources */,
15DFD3312CD4576A004B0DB8 /* FluidGradientView.swift in Sources */,
15DFD3322CD4576A004B0DB8 /* FluidGradient.swift in Sources */,
Expand Down Expand Up @@ -7050,6 +7059,7 @@
154866F428D0FE8900D012B8 /* ViewCondition.swift in Sources */,
6A46754B28F2D50500F705A8 /* DBManager.swift in Sources */,
4EFBE5DE2BCE61FF0012968A /* WalletConnectEVMHandler.swift in Sources */,
4E9532422CDA18FB00AAECD1 /* AddTokenSheetView.swift in Sources */,
15DC20DB27819C56000B187A /* VPrimaryButtonState.swift in Sources */,
4E5646622C06073900890E61 /* WalletAccount.swift in Sources */,
6A5D99AF2A4D5E7400C43D36 /* DAppsListViewModel.swift in Sources */,
Expand Down Expand Up @@ -7521,6 +7531,7 @@
15C58AB82868A4EE00BD4FC6 /* EnvironmentValues+IndexBarInsets.swift in Sources */,
15C58AB92868A4EE00BD4FC6 /* VNavigationLink.swift in Sources */,
15ADAE2A28F51EBB0014B722 /* SymmetricEncryption.swift in Sources */,
15DFD34D2CE197F9004B0DB8 /* AppExternalLinks.swift in Sources */,
4E31380A2C658FB2003A73E5 /* CappedCollection.swift in Sources */,
15DFD32C2CD4576A004B0DB8 /* FluidGradientView.swift in Sources */,
15DFD32D2CD4576A004B0DB8 /* FluidGradient.swift in Sources */,
Expand Down Expand Up @@ -7845,6 +7856,7 @@
6A46754A28F2D50500F705A8 /* DBManager.swift in Sources */,
1565FBB728B173960086A652 /* ExploreTabScreen.swift in Sources */,
4EFBE5DD2BCE61FF0012968A /* WalletConnectEVMHandler.swift in Sources */,
4E9532412CDA18FB00AAECD1 /* AddTokenSheetView.swift in Sources */,
6A5D99AE2A4D5E7400C43D36 /* DAppsListViewModel.swift in Sources */,
4E5646612C06073900890E61 /* WalletAccount.swift in Sources */,
15C58B572868A4EE00BD4FC6 /* ThemeManager.swift in Sources */,
Expand Down
23 changes: 3 additions & 20 deletions FRW/App/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,28 +103,11 @@ class AppDelegate: NSObject, UIApplicationDelegate {

func application(_: UIApplication, continue userActivity: NSUserActivity, restorationHandler _: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
if let url = userActivity.webpageURL {
if url.absoluteString.hasPrefix("https://fcw-link.lilico.app") {
var uri = url.absoluteString.deletingPrefix("https://fcw-link.lilico.app/wc?uri=")
uri = uri.deletingPrefix("fcw://")
WalletConnectManager.shared.onClientConnected = {
WalletConnectManager.shared.connect(link: uri)
}
WalletConnectManager.shared.connect(link: uri)
} else if url.absoluteString.hasPrefix("https://frw-link.lilico.app") {
var uri = url.absoluteString.deletingPrefix("https://frw-link.lilico.app/wc?uri=")
uri = uri.deletingPrefix("frw://")
WalletConnectManager.shared.onClientConnected = {
WalletConnectManager.shared.connect(link: uri)
}
WalletConnectManager.shared.connect(link: uri)
} else {
var uri = url.absoluteString.deletingPrefix("https://link.lilico.app/wc?uri=")
uri = uri.deletingPrefix("lilico://")
WalletConnectManager.shared.onClientConnected = {
WalletConnectManager.shared.connect(link: uri)
}
let uri = AppExternalLinks.exactWCLink(link: url.absoluteString)
WalletConnectManager.shared.onClientConnected = {
WalletConnectManager.shared.connect(link: uri)
}
WalletConnectManager.shared.connect(link: uri)
}
return true
}
Expand Down
2 changes: 1 addition & 1 deletion FRW/App/Env/Prod/InstabugConfig.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Instabug.swift
// InstabugConfig.swift
// FRW
//
// Created by cat on 2024/1/12.
Expand Down
17 changes: 13 additions & 4 deletions FRW/App/Env/ServiceConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,30 @@
import Foundation
import Instabug

// MARK: - ServiceConfig

class ServiceConfig {
static let shared = ServiceConfig()
private let dict: [String: String]
// MARK: Lifecycle

init() {
guard let filePath = Bundle.main.path(forResource: "ServiceConfig", ofType: "plist") else {
fatalError("fatalError ===> Can't find ServiceConfig.plist")
}
dict = NSDictionary(contentsOfFile: filePath) as? [String: String] ?? [:]
self.dict = NSDictionary(contentsOfFile: filePath) as? [String: String] ?? [:]
}

// MARK: Internal

static let shared = ServiceConfig()

static func configure() {
ServiceConfig.shared.setupInstabug()
ServiceConfig.shared.setupMixPanel()
}

// MARK: Private

private let dict: [String: String]
}

// MARK: instabug config
Expand All @@ -35,7 +44,7 @@ extension ServiceConfig {

InstabugConfig.start(token: token)
}

private func setupMixPanel() {
guard let token = dict["MixPanelToken"] else {
fatalError("fatalError ===> Can't find MixPanel Token at ServiceConfig.plist")
Expand Down
2 changes: 1 addition & 1 deletion FRW/Foundation/Define/AppPlaceholder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

struct AppPlaceholder {
enum AppPlaceholder {
static var image: String = "https://lilico.app/placeholder-2.0.png"
static var imageURL = URL(string: AppPlaceholder.image)!
}
10 changes: 6 additions & 4 deletions FRW/Foundation/Model/AddressBookInfoModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ extension Contact {
case flowns = 2
case meow = 3

// MARK: Internal

var domain: String {
switch self {
case .unknown:
Expand All @@ -38,10 +40,10 @@ extension Contact {
}
}

// MARK: - AddressBook
// MARK: - Contact

struct Contact: Codable, Identifiable {
enum WalletType: String,Codable {
enum WalletType: String, Codable {
case flow
case evm
case link
Expand All @@ -56,7 +58,7 @@ struct Contact: Codable, Identifiable {
var walletType: WalletType? = .flow

var needShowLocalAvatar: Bool {
return contactType == .domain
contactType == .domain
}

var localAvatar: String? {
Expand Down Expand Up @@ -99,6 +101,6 @@ struct Contact: Codable, Identifiable {
}

var uniqueId: String {
return "\(address ?? "")-\(domain?.domainType?.rawValue ?? 0)-\(name)-\(contactType?.rawValue ?? 0)"
"\(address ?? "")-\(domain?.domainType?.rawValue ?? 0)-\(name)-\(contactType?.rawValue ?? 0)"
}
}
42 changes: 42 additions & 0 deletions FRW/Foundation/Model/AppExternalLinks.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// AppExternalLinks.swift
// FRW
//
// Created by Hao Fu on 11/11/2024.
//

import Foundation

enum AppExternalLinks: String, CaseIterable {
case frw = "frw://"
case fcw = "fcw://"
case lilico = "lilico://"
case frwUL = "https://frw-link.lilico.app"
case fcwUL = "https://fcw-link.lilico.app"

// MARK: Internal

static var allLinks: [String] {
AppExternalLinks.allCases.map(\.rawValue)
}

var isUniversalLink: Bool {
switch self {
case .frwUL, .fcwUL:
return true
default:
return false
}
}

static func exactWCLink(link: String) -> String {
let newLink = link
.replacingOccurrences(of: "wc%2Fwc", with: "wc")
.replacingOccurrences(of: "wc/wc", with: "wc")

return newLink
.deletingPrefixes(allLinks.map { link in "\(link)/wc?uri=" })
.deletingPrefixes(allLinks.map { link in "\(link)wc?uri=" })
.deletingPrefixes(allLinks)
}
}
Loading

0 comments on commit 7b0a3bf

Please sign in to comment.