diff --git a/BankexWallet.xcodeproj/project.pbxproj b/BankexWallet.xcodeproj/project.pbxproj index 32fa5b03..57c3fcf5 100644 --- a/BankexWallet.xcodeproj/project.pbxproj +++ b/BankexWallet.xcodeproj/project.pbxproj @@ -501,6 +501,7 @@ 9296A28A21B7F4E500BB3E27 /* BackButtonView.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = BackButtonView.xcassets; sourceTree = ""; }; 92A9FCFC21AECA6C00F8BB33 /* AssetManagementEthViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssetManagementEthViewController.swift; sourceTree = ""; }; 92A9FCFE21AECAAD00F8BB33 /* AssetManagementEth.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = AssetManagementEth.storyboard; sourceTree = ""; }; + 92AA46C121D6766E00572208 /* BankexWallet 3.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "BankexWallet 3.xcdatamodel"; sourceTree = ""; }; 92BCEDE921D0D805002264FE /* TransactionDetailsService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionDetailsService.swift; sourceTree = ""; }; 92BCEDEB21D0E23D002264FE /* TransactionDetails.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionDetails.swift; sourceTree = ""; }; 92DF231421D3D65C00AF00A0 /* SFSafariViewController+AssetManagement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SFSafariViewController+AssetManagement.swift"; sourceTree = ""; }; @@ -2506,10 +2507,11 @@ 81942F0D201B36A300F0AE29 /* BankexWallet.xcdatamodeld */ = { isa = XCVersionGroup; children = ( + 92AA46C121D6766E00572208 /* BankexWallet 3.xcdatamodel */, 86F4CEC6216F6CD300B946FF /* BankexWallet 2.xcdatamodel */, 81942F0E201B36A300F0AE29 /* BankexWallet.xcdatamodel */, ); - currentVersion = 86F4CEC6216F6CD300B946FF /* BankexWallet 2.xcdatamodel */; + currentVersion = 92AA46C121D6766E00572208 /* BankexWallet 3.xcdatamodel */; path = BankexWallet.xcdatamodeld; sourceTree = ""; usesTabs = 0; diff --git a/BankexWallet/Model/BankexWallet.xcdatamodeld/.xccurrentversion b/BankexWallet/Model/BankexWallet.xcdatamodeld/.xccurrentversion index a2dcd718..f2eb323b 100644 --- a/BankexWallet/Model/BankexWallet.xcdatamodeld/.xccurrentversion +++ b/BankexWallet/Model/BankexWallet.xcdatamodeld/.xccurrentversion @@ -3,6 +3,6 @@ _XCCurrentVersionName - BankexWallet 2.xcdatamodel + BankexWallet 3.xcdatamodel diff --git a/BankexWallet/Model/BankexWallet.xcdatamodeld/BankexWallet 3.xcdatamodel/contents b/BankexWallet/Model/BankexWallet.xcdatamodeld/BankexWallet 3.xcdatamodel/contents new file mode 100644 index 00000000..db56424c --- /dev/null +++ b/BankexWallet/Model/BankexWallet.xcdatamodeld/BankexWallet 3.xcdatamodel/contents @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BankexWallet/Service/CustomERC20TokensService.swift b/BankexWallet/Service/CustomERC20TokensService.swift index e1b5283a..ceabc00f 100644 --- a/BankexWallet/Service/CustomERC20TokensService.swift +++ b/BankexWallet/Service/CustomERC20TokensService.swift @@ -92,7 +92,6 @@ class CustomERC20TokensServiceImplementation: CustomERC20TokensService { newToken.decimals = decimals.description newToken.isAdded = true newToken.isSelected = true - newToken.networkURL = self.networksService.preferredNetwork().fullNetworkUrl.absoluteString try context.insert(newToken) save() } @@ -383,8 +382,7 @@ class CustomERC20TokensServiceImplementation: CustomERC20TokensService { let networksService = NetworksServiceImplementation() func availableTokensList() -> [ERC20TokenModel]? { - let selectedNetworkURL = networksService.preferredNetwork().fullNetworkUrl.absoluteString - let networks = try! db.fetch(FetchRequest().filtered(with: NSPredicate(format:"networkURL == %@ && isAdded == %@", selectedNetworkURL, NSNumber(value: true)))) + let networks = try! db.fetch(FetchRequest().filtered(with: NSPredicate(format:"isAdded == %@", NSNumber(value: true)))) let listOfNetworks = [etherModel()] + networks.map { (token) -> ERC20TokenModel in return ERC20TokenModel(name: token.name ?? "", diff --git a/BankexWallet/Service/DefaultTokensService.swift b/BankexWallet/Service/DefaultTokensService.swift index 9ef1f592..a0f83006 100644 --- a/BankexWallet/Service/DefaultTokensService.swift +++ b/BankexWallet/Service/DefaultTokensService.swift @@ -57,7 +57,6 @@ class DefaultTokensServiceImplementation: DefaultTokensService { newToken.symbol = dict["symbol"] as? String newToken.name = newToken.symbol newToken.decimals = String((dict["decimal"] as? Int) ?? 0) - newToken.networkURL = self.networksService.preferredNetwork().fullNetworkUrl.absoluteString newToken.isSecurity = dict["isSecurity"] as? Bool ?? false try context.insert(newToken) save()