diff --git a/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj b/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj index 62d92f9928..629603607e 100644 --- a/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj +++ b/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj @@ -22,7 +22,7 @@ 11B3503093D40D5FA0675FA7 /* KeychainKitDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B3555A19D9E41785D88A5E /* KeychainKitDelegate.swift */; }; 11B350340029D15D3BC15C3B /* RestoreViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B3518EEF5AFC1C55FD07BA /* RestoreViewModel.swift */; }; 11B3503456D10F362D8CC855 /* RestoreSettingsModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35336293A4473DD9F5C8B /* RestoreSettingsModule.swift */; }; - 11B350354CCA9BDDC05A9CBA /* WalletConnectV2SessionStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B355C1E3C922BAE804AAF9 /* WalletConnectV2SessionStorage.swift */; }; + 11B350354CCA9BDDC05A9CBA /* WalletConnectSessionStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B355C1E3C922BAE804AAF9 /* WalletConnectSessionStorage.swift */; }; 11B350388CD7F33B10BD3F4B /* AdapterFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B3583932F270503C1DF3F0 /* AdapterFactory.swift */; }; 11B3503BF015EA47E1061122 /* AccountRecordStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B358556C8FC5368E14D81E /* AccountRecordStorage.swift */; }; 11B3503C1335F0860B6DF7B8 /* CoinTreasuriesService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B3580ECB328146E94D4359 /* CoinTreasuriesService.swift */; }; @@ -30,7 +30,6 @@ 11B3504029EB87A32DB63666 /* MarketTopService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35770F0C72E1CD3F99985 /* MarketTopService.swift */; }; 11B35040917F10257C949596 /* NftCollectionRecord.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B350E6966203DF2855369A /* NftCollectionRecord.swift */; }; 11B35041FF23044B3CCDDA55 /* CoinInvestment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35264F7CE80AD5D9A540A /* CoinInvestment.swift */; }; - 11B35043A45A13D49CF7AE29 /* WalletConnectSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35CC3319F0D16C6E6E5C0 /* WalletConnectSession.swift */; }; 11B3504619330D3DB0E0ECD1 /* PublicKeysModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35111F25CE7D0C8E0B29B /* PublicKeysModule.swift */; }; 11B350462257FD424088A52E /* DonutChartView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35FC207C703EBF63FD56A /* DonutChartView.swift */; }; 11B3504F9DECABF08D8C82BC /* RestoreSettingsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B357F15913DDAE69C9B0E0 /* RestoreSettingsManager.swift */; }; @@ -84,7 +83,6 @@ 11B350E923A4E51AAF9D2828 /* BarsProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35A686DD5BA335FEB6BEB /* BarsProgressView.swift */; }; 11B350ECEE8748562D27249F /* CexWithdrawNetworkSelectViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B351C522855F29C6B038D3 /* CexWithdrawNetworkSelectViewController.swift */; }; 11B350EDDD1C8A1506043C4D /* BaseCurrencySettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B352034B036C9CB7A52724 /* BaseCurrencySettingsViewController.swift */; }; - 11B350EF484B6A02FA41EC27 /* WalletConnectSessionStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B3582303D9BC904086E159 /* WalletConnectSessionStorage.swift */; }; 11B350F12C3CA54080C16031 /* ManageWalletsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35C4D645B4468F84EADB7 /* ManageWalletsViewController.swift */; }; 11B350F36947CF278CDB436B /* MarketListMarketFieldDecorator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B353B060BDF272932D3522 /* MarketListMarketFieldDecorator.swift */; }; 11B350F58D6907C9A9A79F6B /* NftViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35419084A6CB11230E3C6 /* NftViewController.swift */; }; @@ -175,7 +173,6 @@ 11B351FF1C61A672DB318DC0 /* ReceiveViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B359D1A38D53951CEE6F84 /* ReceiveViewController.swift */; }; 11B351FF652F0F7BCEB682A9 /* InputCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35977188C93500A2CC6B0 /* InputCell.swift */; }; 11B352006084CC499F31CD70 /* WalletService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35A5B004015DEA52AD5C9 /* WalletService.swift */; }; - 11B35201583EC6E1EB476ADB /* WalletConnectSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35CC3319F0D16C6E6E5C0 /* WalletConnectSession.swift */; }; 11B35205EDD1A11067E1AC91 /* CoinManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B359C5AF7EE92A5756CCFF /* CoinManager.swift */; }; 11B35208D0EACC4FEAB69B73 /* CexDepositViewItemFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35B0A0EC524FBC663BEA5 /* CexDepositViewItemFactory.swift */; }; 11B352095498FB15A2A6E210 /* AccountRecord_v_0_20.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B3506CB3D780A00F4BBBBE /* AccountRecord_v_0_20.swift */; }; @@ -205,7 +202,7 @@ 11B35258C072691B5BD7C41E /* ExtendedKeyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35A774105F0F012935845 /* ExtendedKeyViewController.swift */; }; 11B3525DD29BC2286526669F /* PoolGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B357F4747A6B256C31EC7C /* PoolGroup.swift */; }; 11B35262A6D3AB8C41E2E245 /* AccountStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35E87C15A3AE82F471007 /* AccountStorage.swift */; }; - 11B35262B98EA59CDA12DF97 /* WalletConnectV2SessionStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B355C1E3C922BAE804AAF9 /* WalletConnectV2SessionStorage.swift */; }; + 11B35262B98EA59CDA12DF97 /* WalletConnectSessionStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B355C1E3C922BAE804AAF9 /* WalletConnectSessionStorage.swift */; }; 11B3526AA8E758606BC0CE38 /* CexWithdrawService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B3548F0E1223B08D3B7F0C /* CexWithdrawService.swift */; }; 11B3526D1747C11291F2D998 /* CoinTreasuriesService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B3580ECB328146E94D4359 /* CoinTreasuriesService.swift */; }; 11B352712EC6F2C7F6965443 /* MarketWatchlistViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B3566FE007887C3528583C /* MarketWatchlistViewModel.swift */; }; @@ -266,7 +263,6 @@ 11B35321C9FCFD1DFA4401A3 /* SendEvmService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B3540BDD94203AFD41C6C7 /* SendEvmService.swift */; }; 11B353260AE7B998C07955E6 /* MarketCategoryService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B357229D5E717F2051F0AC /* MarketCategoryService.swift */; }; 11B35328067C30C80DF244DF /* BackupVerifyWordsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B3576FCFC9394BA37975FC /* BackupVerifyWordsViewModel.swift */; }; - 11B35328A1DEC617A657A305 /* WalletConnectService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35B8762A9A899A170E7AA /* WalletConnectService.swift */; }; 11B35328EA42C49649B1E3F6 /* SyncMode_v_0_24.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35CB98A27269A510F40EE /* SyncMode_v_0_24.swift */; }; 11B3532D03B0893AB8E46CD9 /* BalanceViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B3591AD106DAC0D18FEDD7 /* BalanceViewItem.swift */; }; 11B3532D56D7D1F8286B39AC /* FavoriteCoinRecordStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35C7B8BA65E9AA3BB7AFB /* FavoriteCoinRecordStorage.swift */; }; @@ -349,7 +345,6 @@ 11B3542D112D915738AB1045 /* SimpleActivateModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35178643181B9CE1D6C8B /* SimpleActivateModule.swift */; }; 11B35434C09F1E3818DC857B /* ReceiveDerivationViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B357EEC98939F9C7AA3271 /* ReceiveDerivationViewModel.swift */; }; 11B3543A420A23064B056925 /* ReceiveAddressViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B3532A1DC90E3D0E3403F8 /* ReceiveAddressViewModel.swift */; }; - 11B3543FCB1C67619A0DAA27 /* WalletConnectService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35B8762A9A899A170E7AA /* WalletConnectService.swift */; }; 11B35440714FF3AAF24542D4 /* WalletCexElementService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35C7CCC41913AA8D36CBC /* WalletCexElementService.swift */; }; 11B35444DADD43277D30DFE6 /* AmountData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35B617A9CE668EEF4978B /* AmountData.swift */; }; 11B354460024FA6EDB8B27DC /* BackupVerifyWordsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35FA70D9570CB2708E1CA /* BackupVerifyWordsService.swift */; }; @@ -709,7 +704,6 @@ 11B35920CB7EA5E3322F6D7F /* InputStackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B353BA87FDCB1BCBA92E61 /* InputStackView.swift */; }; 11B359257D417D73971FF400 /* MarketOverviewNftCollectionsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B351CEB402BC8F806365D9 /* MarketOverviewNftCollectionsService.swift */; }; 11B359264A7E2CFD0925A778 /* CoinMajorHoldersService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35C6498078B1AFF406256 /* CoinMajorHoldersService.swift */; }; - 11B35927181B6E08C7001FBC /* WalletConnectSessionStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B3582303D9BC904086E159 /* WalletConnectSessionStorage.swift */; }; 11B35929AD3C9F27463392C6 /* TopPlatformViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35BB370AE2C896BB9F877 /* TopPlatformViewController.swift */; }; 11B3592EC9C229FD531ED6B5 /* BalanceButtonsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B3585EF1DA625D906AF9B5 /* BalanceButtonsView.swift */; }; 11B3593134900A8FC7C075B6 /* NftService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B355129D9F61172FCAB8C0 /* NftService.swift */; }; @@ -829,7 +823,6 @@ 11B35A82532EC55909EFBAD8 /* LaunchScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B3595BAA550B6BEC8C3F72 /* LaunchScreen.swift */; }; 11B35A8395C75C6FA6515F3C /* CexWithdrawViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35ABC3E6C990E3BFA0A7B /* CexWithdrawViewController.swift */; }; 11B35A8456750E9838BBEA93 /* WalletConnectRequestViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B355DBB08BD360380F7EAF /* WalletConnectRequestViewController.swift */; }; - 11B35A866A95D72FF5360F12 /* WalletConnectSessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B353AEAF26CD0805C2AE7D /* WalletConnectSessionManager.swift */; }; 11B35A89B3F0D81C42DC5C40 /* CoinRankHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B351664970D7EA1F7B50C7 /* CoinRankHeaderView.swift */; }; 11B35A8BB87C68ACF4594C99 /* MarketTopModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35F9DA79410E7B9C1B0F8 /* MarketTopModule.swift */; }; 11B35A8D8CA77B42650F4C03 /* Publisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B351958604DF0B0AB3346C /* Publisher.swift */; }; @@ -1253,7 +1246,6 @@ 11B35FC5D80CC1D4854DBC94 /* BottomSheetTitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B354C3C105D13E1B382178 /* BottomSheetTitleView.swift */; }; 11B35FC689D745FFBB3684C4 /* TokenType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B3519AE11DC423E0D078E2 /* TokenType.swift */; }; 11B35FC6DE83EE46FB361756 /* CexWithdrawModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35507A989EA73EE5E8EA8 /* CexWithdrawModule.swift */; }; - 11B35FCBBA5007F4CA25BA0A /* WalletConnectSessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B353AEAF26CD0805C2AE7D /* WalletConnectSessionManager.swift */; }; 11B35FD18C255E2C6D75F38A /* RestoreMnemonicHintView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35CB288AF5A54B99A51E4 /* RestoreMnemonicHintView.swift */; }; 11B35FD73BCF3DD557FD9783 /* RecipientAddressInputCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B35DBDADDA8D4F9D88C7AA /* RecipientAddressInputCell.swift */; }; 11B35FE7DA00590FF95854FF /* WatchPublicKeyViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11B350D2A21FC1BE1F457B41 /* WatchPublicKeyViewModel.swift */; }; @@ -1926,15 +1918,14 @@ ABC9A005F31836B4EBAB1C97 /* DonateDescriptionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AD0848221B0EC25C37F3 /* DonateDescriptionCell.swift */; }; ABC9A0073333D3DEC2797D15 /* BackupCloudPassphraseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A8E4CDD143171A1F9C46 /* BackupCloudPassphraseViewController.swift */; }; ABC9A00CF4BC7368D8EFEFB1 /* WalletTokenModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A4B75DFB58AC56FEF798 /* WalletTokenModule.swift */; }; - ABC9A01AE17801DE7100B10B /* WalletConnectSessionKiller.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A1667330B8DBC1A8FE52 /* WalletConnectSessionKiller.swift */; }; ABC9A0248195A85CA00D6A13 /* ImageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A7FC41B9F98871246E0E /* ImageCell.swift */; }; ABC9A029AFF2F178AF5AD11B /* RestoreTypeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A939DD222D4A2BD3D71C /* RestoreTypeViewController.swift */; }; ABC9A02C18AACAA8CC930665 /* WalletTokenListDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A3FBE68E228E3BE66F7B /* WalletTokenListDataSource.swift */; }; - ABC9A040EA0B56AF76D01855 /* WalletConnectV2PendingRequestsModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A2F6EDC8BB83ED7B75BA /* WalletConnectV2PendingRequestsModule.swift */; }; + ABC9A0337DAB77500E7A631D /* WalletConnectPairingService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A56ED1DB109A2E1F6EC1 /* WalletConnectPairingService.swift */; }; + ABC9A040EA0B56AF76D01855 /* WalletConnectPendingRequestsModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A2F6EDC8BB83ED7B75BA /* WalletConnectPendingRequestsModule.swift */; }; ABC9A043F82D9F5945C5FAFA /* PseudoAccessoryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AEC034DE5784F55BD5F3 /* PseudoAccessoryView.swift */; }; ABC9A04655D81FE5198B786F /* SendEip1155ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A23CB332521C0607CC6B /* SendEip1155ViewModel.swift */; }; ABC9A05D9F96BE464CFC90CC /* ContactBookModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A5518367F0DDDB94D320 /* ContactBookModule.swift */; }; - ABC9A06616429B8BA46D262C /* WalletConnectV1MainService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A857395F2521BA0A2602 /* WalletConnectV1MainService.swift */; }; ABC9A06BB934A43890376A70 /* NftCollectionCellFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A8CF40E995105E7F38AC /* NftCollectionCellFactory.swift */; }; ABC9A06BE632BD33E5CA4106 /* Contact.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AEAD18F73D4FBE05783D /* Contact.swift */; }; ABC9A074995C051E714FAFAB /* BackupContact.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AC50307ABA3DF7034E1D /* BackupContact.swift */; }; @@ -1943,24 +1934,22 @@ ABC9A07A1D93791D09BEA9AF /* PredefinedBlockchainService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A1057AD189DA1CE31BF5 /* PredefinedBlockchainService.swift */; }; ABC9A08340695A0AFCE9C2F2 /* SendBitcoinViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A7D6C9D12C1F1F3A1218 /* SendBitcoinViewController.swift */; }; ABC9A0866C672D2D560DA23C /* CoinDetailAdviceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A10A83A43DCAFA709472 /* CoinDetailAdviceViewController.swift */; }; - ABC9A08E14B61C478C342548 /* WalletConnectEvmChainParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AAF99E1669B374FF256E /* WalletConnectEvmChainParser.swift */; }; ABC9A092DC0DEEF9838DB47A /* CellElement.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A776346AF62265896CA1 /* CellElement.swift */; }; ABC9A096B05E5491A40A327C /* DonateDescriptionDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9ABFE62D22F9FB0B3409A /* DonateDescriptionDataSource.swift */; }; ABC9A097A0BDD99777D5374D /* DonateDescriptionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AD0848221B0EC25C37F3 /* DonateDescriptionCell.swift */; }; ABC9A0A3A52AD41643D67D3D /* SingleLineFormTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A03401172C4C65D66764 /* SingleLineFormTextView.swift */; }; ABC9A0AADAE0A5C370946B8D /* RestoreCloudPassphraseViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA99463E646706E8E36D /* RestoreCloudPassphraseViewModel.swift */; }; + ABC9A0B37693470DAD0FFE20 /* WalletConnectMainService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AD18F3E73F96DD6C4FA9 /* WalletConnectMainService.swift */; }; ABC9A0B58626A1E0C4248162 /* SendEip1155Service.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AC6A0B950C0AABD5A93E /* SendEip1155Service.swift */; }; ABC9A0B5A5577704AC99F47B /* ChartIndicatorsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A3AF18834CE9E569C89E /* ChartIndicatorsViewModel.swift */; }; ABC9A0BAB439DEB0BC7495C3 /* ContactBookAddressViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A12529DC8DE5D46D9776 /* ContactBookAddressViewModel.swift */; }; ABC9A0C6E37779D3F3602EEC /* SendEip1155AvailableBalanceViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AB612DE3C8AA3A1EEAC7 /* SendEip1155AvailableBalanceViewModel.swift */; }; ABC9A0CEBC41CCE5AB205B3C /* NftAssetOverviewModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A90781302D793E0773CB /* NftAssetOverviewModule.swift */; }; - ABC9A0D8D596A7122B2DDD97 /* WalletConnectV2ListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A8DC6C2EEBD4FD453342 /* WalletConnectV2ListViewModel.swift */; }; ABC9A0E6EE31D5675542EE0B /* SessionRequestFilterManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA77C414AC06C41F9319 /* SessionRequestFilterManager.swift */; }; ABC9A0E743DDE8F4ADA483EB /* SwapPriceCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA459E123B7053EC73F0 /* SwapPriceCell.swift */; }; ABC9A0EE5E5B31405569BF3F /* IndicatorAdviceCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AACC40370E1E0CFC7639 /* IndicatorAdviceCell.swift */; }; ABC9A0F42A6687705CAD1340 /* NftAssetViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AF9C0D0174A5B6A91F13 /* NftAssetViewController.swift */; }; - ABC9A1117A41AB8CE00FDEDB /* WalletConnectV2AppShowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A845B2969166028BA5F0 /* WalletConnectV2AppShowView.swift */; }; - ABC9A12E32EC45F56B612B06 /* WalletConnectV2PairingService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AFB38C3D5494BBD2D56E /* WalletConnectV2PairingService.swift */; }; + ABC9A1117A41AB8CE00FDEDB /* WalletConnectAppShowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A845B2969166028BA5F0 /* WalletConnectAppShowView.swift */; }; ABC9A133A6BF0FC9A87FA14A /* ContactBookSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A99184EE1D5D052C52E9 /* ContactBookSettingsViewController.swift */; }; ABC9A13DB3ADB580D59F66E4 /* SendEip1155ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A23CB332521C0607CC6B /* SendEip1155ViewModel.swift */; }; ABC9A13F4C814FFB31FF13CA /* SendEip721ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A7315E119F0B1581B70C /* SendEip721ViewController.swift */; }; @@ -1969,8 +1958,7 @@ ABC9A1636549E626FB32F71A /* WalletTokenBalanceCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AB2DC4C4412EFE6BEFF7 /* WalletTokenBalanceCell.swift */; }; ABC9A191F1E62A20D2D38262 /* BackupCloudPassphraseViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A5544C221860C10BF131 /* BackupCloudPassphraseViewModel.swift */; }; ABC9A19695087B66FD79ED99 /* Array.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A06A64AB5B2A12C38D91 /* Array.swift */; }; - ABC9A1994630FAD8B42DDF67 /* WalletConnectV2AppShowService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA3B8927F9F138ABCFB8 /* WalletConnectV2AppShowService.swift */; }; - ABC9A19A110AA6F55FADB3EE /* WalletConnectV2PairingViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AFD222C4514B22C3E43F /* WalletConnectV2PairingViewModel.swift */; }; + ABC9A1994630FAD8B42DDF67 /* WalletConnectAppShowService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA3B8927F9F138ABCFB8 /* WalletConnectAppShowService.swift */; }; ABC9A1B8D2BCB6660A12AAE2 /* ChartIndicatorsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A3AF18834CE9E569C89E /* ChartIndicatorsViewModel.swift */; }; ABC9A1D021B4E9ACCE3DE0BA /* WalletConnectMainViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AEA1D717D8CED8462AB0 /* WalletConnectMainViewModel.swift */; }; ABC9A1D42EED3235129D810B /* BaseSendViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9ABE97578DC667CBDC11A /* BaseSendViewController.swift */; }; @@ -1983,15 +1971,15 @@ ABC9A20F6F7D5EA2A1A55A9E /* ContactLabelService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AB89F64056FFB98928E7 /* ContactLabelService.swift */; }; ABC9A227648FF076E9518703 /* ContactBookHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AE12A5E8B9FB24FFE42F /* ContactBookHelper.swift */; }; ABC9A2462F3F928644435B86 /* NftAssetModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AD35D41AEEBD38AA08B5 /* NftAssetModule.swift */; }; - ABC9A251119A2486465B315E /* WalletConnectV2Service.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A1136889E6976E17B347 /* WalletConnectV2Service.swift */; }; + ABC9A251119A2486465B315E /* WalletConnectService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A1136889E6976E17B347 /* WalletConnectService.swift */; }; ABC9A2542EA47C2ED85C06B9 /* WalletConnectListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AE5FD79ECC4AC85B86FA /* WalletConnectListViewController.swift */; }; ABC9A2545322919129F163D5 /* SwapInputCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AC2EF759D639F6CEA256 /* SwapInputCardView.swift */; }; + ABC9A2559D001CA67E8F10C7 /* WalletConnectMainService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AD18F3E73F96DD6C4FA9 /* WalletConnectMainService.swift */; }; ABC9A25C4149CC1DC03B853E /* SendViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AAF2ADD900F32D87C7BE /* SendViewModel.swift */; }; ABC9A266809A701B69765151 /* IntegerAmountInputCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA527E63E18179CB689A /* IntegerAmountInputCell.swift */; }; ABC9A2692A01293B1229EF50 /* WalletTokenBalanceService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A352F3EAA38107897CEF /* WalletTokenBalanceService.swift */; }; ABC9A2746046C136F98F970A /* BackupContact.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AC50307ABA3DF7034E1D /* BackupContact.swift */; }; ABC9A2876CBE0C74849C9AC4 /* SwapInputModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AAD55B8932EE75E3C037 /* SwapInputModule.swift */; }; - ABC9A293A1192758CE3F6B83 /* WalletConnectV2PairingModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA6A9EA3FAE9031A34C8 /* WalletConnectV2PairingModule.swift */; }; ABC9A295A99F39EFAAF8FCDA /* Integer.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AF26FDCB363793BF66E1 /* Integer.swift */; }; ABC9A29A23C043A3FD65AF1C /* SendBinanceFeeWarningViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A2C2D1331E91D666AB3E /* SendBinanceFeeWarningViewModel.swift */; }; ABC9A2A249A94B271F56EBD0 /* BackupCryptoHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AD5CB1911A698718213F /* BackupCryptoHelper.swift */; }; @@ -2005,9 +1993,8 @@ ABC9A2D0ACEDCFA5FDB04D89 /* IndicatorDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A12E4155640075755699 /* IndicatorDataSource.swift */; }; ABC9A2E71264B12B7FFC3736 /* WalletConnectListService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A3BEB33F6DBE2395FD11 /* WalletConnectListService.swift */; }; ABC9A2E921AE00E0AF5067DE /* CoinProChartModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A021D71EDD24DFB6BA62 /* CoinProChartModule.swift */; }; - ABC9A2EEC77205793C21F9A1 /* WalletConnectV2MainPendingRequestViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A8D8072033A5AC7E4897 /* WalletConnectV2MainPendingRequestViewModel.swift */; }; - ABC9A2FF431ACFA812F58AD1 /* WalletConnectV2RequestMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA31438063F7AB7BDDC8 /* WalletConnectV2RequestMapper.swift */; }; - ABC9A30459A3D9922CCF2E26 /* WalletConnectV1ListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA2DC16F947607B1794E /* WalletConnectV1ListView.swift */; }; + ABC9A2EEC77205793C21F9A1 /* WalletConnectMainPendingRequestViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A8D8072033A5AC7E4897 /* WalletConnectMainPendingRequestViewModel.swift */; }; + ABC9A2FF431ACFA812F58AD1 /* WalletConnectRequestMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA31438063F7AB7BDDC8 /* WalletConnectRequestMapper.swift */; }; ABC9A305CBB28F2B19EB00D2 /* CoinDetailAdviceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A10A83A43DCAFA709472 /* CoinDetailAdviceViewController.swift */; }; ABC9A30629619D5BD6CEB952 /* ContactBookContactViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A8A353E491AAD3EDA120 /* ContactBookContactViewController.swift */; }; ABC9A307AAD83C3ED0D591C7 /* ContactBookContactModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AB2ED4E48D4FCEDBE769 /* ContactBookContactModule.swift */; }; @@ -2024,7 +2011,7 @@ ABC9A359DB8C1A89269236CC /* ContactBookSettingsModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A24CBB826A2D2F88EC61 /* ContactBookSettingsModule.swift */; }; ABC9A3613C5477C07F37F48C /* WalletConnectListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AE5FD79ECC4AC85B86FA /* WalletConnectListViewController.swift */; }; ABC9A36297D869E49C152CAB /* SwapRevokeConfirmationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A1360FE305343B1049CF /* SwapRevokeConfirmationViewController.swift */; }; - ABC9A395A96C1F7C30F21940 /* WalletConnectV2PendingRequestsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AD3F677671FB57CCD886 /* WalletConnectV2PendingRequestsService.swift */; }; + ABC9A395A96C1F7C30F21940 /* WalletConnectPendingRequestsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AD3F677671FB57CCD886 /* WalletConnectPendingRequestsService.swift */; }; ABC9A3B155B3F6E7E0F2CB07 /* HudHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A381CB4C09FF7CB62A94 /* HudHelper.swift */; }; ABC9A3BC9A18F74818EF5C17 /* MetadataMonitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA2491ADC4E5E089CD42 /* MetadataMonitor.swift */; }; ABC9A3C13073DDFABF8C0679 /* RestoreCloudViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A5FE0EDA53E4D9B85DE1 /* RestoreCloudViewModel.swift */; }; @@ -2032,12 +2019,10 @@ ABC9A3CC73251E7F83A94181 /* UniswapV3TradeService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9ACF418357FF7AFC64B3F /* UniswapV3TradeService.swift */; }; ABC9A3D46AA7356763213BA6 /* FeePriceScale.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AF8E8DE67732371A00E0 /* FeePriceScale.swift */; }; ABC9A3D48A3E0E1733F70686 /* SendBinanceService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A3F41BDCD5F4146E6E06 /* SendBinanceService.swift */; }; - ABC9A3D6BA1A316A385B0A53 /* WalletConnectV2MainService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AF574F7957C169129905 /* WalletConnectV2MainService.swift */; }; - ABC9A3DCC68C65EFF44509B7 /* WalletConnectV1ListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA2DC16F947607B1794E /* WalletConnectV1ListView.swift */; }; - ABC9A3DD58A1F5566B9D6182 /* WalletConnectV1ListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A7809A4A33BEBCFA3194 /* WalletConnectV1ListViewModel.swift */; }; + ABC9A3FCFC46EC73A7E57EA3 /* WalletConnectPairingModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A4BA46EDEEAB6CD9B25C /* WalletConnectPairingModule.swift */; }; ABC9A3FEF48388A60B8BACB5 /* DataSourceChain.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A22311B6AA64B7D93CB4 /* DataSourceChain.swift */; }; ABC9A4045F498EE345B998D8 /* IntegerFormAmountInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AB9077A6A0ABE4909B76 /* IntegerFormAmountInputView.swift */; }; - ABC9A40EB6EC886116806130 /* WalletConnectV2SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AC0B5943DF3B61B20BF6 /* WalletConnectV2SessionManager.swift */; }; + ABC9A40EB6EC886116806130 /* WalletConnectSessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AC0B5943DF3B61B20BF6 /* WalletConnectSessionManager.swift */; }; ABC9A427B3166B8A0630EC8A /* WalletTokenBalanceViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A52822CE6B8830CF5EF4 /* WalletTokenBalanceViewModel.swift */; }; ABC9A4387AF9D012498DF42B /* NftAssetOverviewViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AB8907B0E779CA4DF8F1 /* NftAssetOverviewViewModel.swift */; }; ABC9A446EF71E1DB4FA7D353 /* RestoreCloudPassphraseService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A6F1FB00B33D1896FC6B /* RestoreCloudPassphraseService.swift */; }; @@ -2058,9 +2043,8 @@ ABC9A4E323FF7AAD86FA8E75 /* MarketCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A37521CD6E2CC5BA4E68 /* MarketCardView.swift */; }; ABC9A4F4B7F17169DC240A98 /* WalletConnectUriHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A1C31F5343EB2BEA4540 /* WalletConnectUriHandler.swift */; }; ABC9A4FF1E1964FB77700C4E /* ChartIndicatorFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A6DE5C760A5D0C90B70E /* ChartIndicatorFactory.swift */; }; - ABC9A506478A295F78F2A63B /* WalletConnectV1MainRequestView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A413A1015882E90F7675 /* WalletConnectV1MainRequestView.swift */; }; ABC9A51979D2047BEF45A2AE /* TokenSelectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A791A47F4F1E71B51B3B /* TokenSelectView.swift */; }; - ABC9A51E36466E414AF24C67 /* WalletConnectV2MainPendingRequestViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A8D8072033A5AC7E4897 /* WalletConnectV2MainPendingRequestViewModel.swift */; }; + ABC9A51E36466E414AF24C67 /* WalletConnectMainPendingRequestViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A8D8072033A5AC7E4897 /* WalletConnectMainPendingRequestViewModel.swift */; }; ABC9A51F2E7EB0B477EBE708 /* SendZcashService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AE6D2CD14194802E7976 /* SendZcashService.swift */; }; ABC9A52E08E5C57665C07DBC /* PseudoAccessoryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AEC034DE5784F55BD5F3 /* PseudoAccessoryView.swift */; }; ABC9A543EB59D153FAD103F6 /* KdfParams.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A6663522498A53CF4174 /* KdfParams.swift */; }; @@ -2074,14 +2058,12 @@ ABC9A57EB423CAD56190F36B /* ChartIndicatorSettingsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9ACE2CCBDF21572F5600C /* ChartIndicatorSettingsViewModel.swift */; }; ABC9A59B465A9C59F93DFB96 /* ChartCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A9F6635146BEBFB432D1 /* ChartCell.swift */; }; ABC9A5A0C65184DF54C48C5A /* TechnicalIndicatorService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A3EE670713BA4B6110F4 /* TechnicalIndicatorService.swift */; }; - ABC9A5A0E47C6A90F30382E2 /* WalletConnectV1MainService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A857395F2521BA0A2602 /* WalletConnectV1MainService.swift */; }; ABC9A5BBFC1960B1DD8F62B7 /* SendBinanceService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A3F41BDCD5F4146E6E06 /* SendBinanceService.swift */; }; ABC9A5C2E2976341520D2F6D /* WalletConnectListModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AC09A586D88BAB3B9C67 /* WalletConnectListModule.swift */; }; ABC9A5CB5C5D56F50FE5F64C /* SendTimeLockErrorService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9ADF114FCFABEA148AF04 /* SendTimeLockErrorService.swift */; }; - ABC9A5CFD2FF8B73B7AC9B8E /* WalletConnectV2PendingRequestsModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A2F6EDC8BB83ED7B75BA /* WalletConnectV2PendingRequestsModule.swift */; }; - ABC9A5D74CE790A6DEF71777 /* WalletConnectV2PendingRequestsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AAD79FD756DA69A52578 /* WalletConnectV2PendingRequestsViewController.swift */; }; + ABC9A5CFD2FF8B73B7AC9B8E /* WalletConnectPendingRequestsModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A2F6EDC8BB83ED7B75BA /* WalletConnectPendingRequestsModule.swift */; }; + ABC9A5D74CE790A6DEF71777 /* WalletConnectPendingRequestsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AAD79FD756DA69A52578 /* WalletConnectPendingRequestsViewController.swift */; }; ABC9A5DB0B5E6D82560A41D8 /* WalletConnectMainModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AE8A193F58021C411311 /* WalletConnectMainModule.swift */; }; - ABC9A5F17C3512899E18F43A /* WalletConnectV2ListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A8DC6C2EEBD4FD453342 /* WalletConnectV2ListViewModel.swift */; }; ABC9A60350DF10E0E2534216 /* SwapPriceCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA459E123B7053EC73F0 /* SwapPriceCell.swift */; }; ABC9A60BA5DF119C7FC8A859 /* KdfParams.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A6663522498A53CF4174 /* KdfParams.swift */; }; ABC9A618B77A70D94E269D6B /* SwapInputCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AC2EF759D639F6CEA256 /* SwapInputCardView.swift */; }; @@ -2099,23 +2081,23 @@ ABC9A69BADD39C6E9239A2A1 /* SendViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AAF2ADD900F32D87C7BE /* SendViewModel.swift */; }; ABC9A69C4D41D6E8B5DFBA97 /* UniswapV3DataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AE97D361FBF43F46F016 /* UniswapV3DataSource.swift */; }; ABC9A69FA41A9BC474DD1915 /* DiffLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A916C64B5EA9D96B8FDA /* DiffLabel.swift */; }; - ABC9A6A484F9B3F7F1054379 /* WalletConnectV2MainPendingRequestService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AFF8093DEB7AFD7DBBCC /* WalletConnectV2MainPendingRequestService.swift */; }; + ABC9A6A484F9B3F7F1054379 /* WalletConnectMainPendingRequestService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AFF8093DEB7AFD7DBBCC /* WalletConnectMainPendingRequestService.swift */; }; ABC9A6A792282ACC8DAB62BC /* IntegerFormAmountInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AB9077A6A0ABE4909B76 /* IntegerFormAmountInputView.swift */; }; ABC9A6BC79804B3D3AAFA8F1 /* SendZcashService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AE6D2CD14194802E7976 /* SendZcashService.swift */; }; ABC9A6C0A45A33C83B632D58 /* SendFeeService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9ADB77831DCB474B24C8A /* SendFeeService.swift */; }; ABC9A6C1B2F55F1FFA8910CA /* ContactBookSettingsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A06A4A02C5E889265463 /* ContactBookSettingsViewModel.swift */; }; ABC9A6C65416E7F4F3830962 /* RestoreCloudPassphraseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AF12879C62002DFE946A /* RestoreCloudPassphraseViewController.swift */; }; ABC9A6D1C4EF73D4A8D6F3BD /* CoinProChartModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A021D71EDD24DFB6BA62 /* CoinProChartModule.swift */; }; + ABC9A6D1CDF470FB73EF4816 /* WalletConnectPairingService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A56ED1DB109A2E1F6EC1 /* WalletConnectPairingService.swift */; }; ABC9A6E939BDC0269313A66D /* SendModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AD1F2311CC6425CF9D90 /* SendModule.swift */; }; ABC9A6F88E51293F2605CACD /* ContactBookContactModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AB2ED4E48D4FCEDBE769 /* ContactBookContactModule.swift */; }; ABC9A70AE588307EA1D3A414 /* SendConfirmationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A2FD4A59DB53631435BA /* SendConfirmationService.swift */; }; ABC9A712F6389F5C2B0D63E3 /* RestoreCloudService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A06866150862CEDEB5DE /* RestoreCloudService.swift */; }; - ABC9A7219A4F94D981558DC2 /* WalletConnectV2ListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AFE16BDDA2ECBE8729CA /* WalletConnectV2ListView.swift */; }; ABC9A727EC8A3C74C9C1A31A /* WalletConnectMainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A3A694467493C6F4AACE /* WalletConnectMainViewController.swift */; }; ABC9A728EEF4A054C7B8722B /* DonateAddressModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A0B7E7360DC0357B2D0F /* DonateAddressModule.swift */; }; ABC9A7297650FD2D9F8F595F /* MacdIndicatorDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA8F31619609907AD67E /* MacdIndicatorDataSource.swift */; }; ABC9A733703BD9E28B90BECD /* MaIndicatorDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AD2E1F25A5CED10DB81F /* MaIndicatorDataSource.swift */; }; - ABC9A736DDFBF98473C065F7 /* WalletConnectV2RequestMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA31438063F7AB7BDDC8 /* WalletConnectV2RequestMapper.swift */; }; + ABC9A736DDFBF98473C065F7 /* WalletConnectRequestMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA31438063F7AB7BDDC8 /* WalletConnectRequestMapper.swift */; }; ABC9A739B2E6FC4DFBD3ABC9 /* UniswapV3Module.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A6363DB5DAE5B58AFDC0 /* UniswapV3Module.swift */; }; ABC9A74F192AB94CFD1D1649 /* IndicatorAdviceCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AACC40370E1E0CFC7639 /* IndicatorAdviceCell.swift */; }; ABC9A75740E0048A695C36E8 /* WalletTokenService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A38082BD2EBE1BC8E11E /* WalletTokenService.swift */; }; @@ -2126,8 +2108,7 @@ ABC9A78CFF8B232D330EC7B5 /* DiffLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A916C64B5EA9D96B8FDA /* DiffLabel.swift */; }; ABC9A78D3A4267CAC0F5D0E8 /* SendConfirmationModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AFF7119B9AC0E32B2060 /* SendConfirmationModule.swift */; }; ABC9A794E47FC07ABFC32BBD /* FeePriceScale.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AF8E8DE67732371A00E0 /* FeePriceScale.swift */; }; - ABC9A79835648674C5943A6F /* WalletConnectV2ListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AFE16BDDA2ECBE8729CA /* WalletConnectV2ListView.swift */; }; - ABC9A7A9053C6ECF618D0E4A /* WalletConnectV2Session.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A4544AB5CA22ADE16417 /* WalletConnectV2Session.swift */; }; + ABC9A7A9053C6ECF618D0E4A /* WalletConnectSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A4544AB5CA22ADE16417 /* WalletConnectSession.swift */; }; ABC9A7A9E27CC5F93BE5018B /* WalletConnectListService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A3BEB33F6DBE2395FD11 /* WalletConnectListService.swift */; }; ABC9A7AF4EE29CDE045ADEF7 /* MarketCategoryMarketCapFetcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9ADC1A3B17225B6CC0869 /* MarketCategoryMarketCapFetcher.swift */; }; ABC9A7CBFDC0DF741E29EA44 /* Integer.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AF26FDCB363793BF66E1 /* Integer.swift */; }; @@ -2139,13 +2120,12 @@ ABC9A806CB34CB9A5E27A0A3 /* RestoreCloudPassphraseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AF12879C62002DFE946A /* RestoreCloudPassphraseViewController.swift */; }; ABC9A80BCDA72347C6619E6C /* SendTimeLockErrorService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9ADF114FCFABEA148AF04 /* SendTimeLockErrorService.swift */; }; ABC9A819DDAEE683FCCA02EF /* NftAssetCellFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A30A8F78E9C9AEE861F1 /* NftAssetCellFactory.swift */; }; - ABC9A824BB54B9EB36425663 /* WalletConnectV2PairingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A11FA28631EE6EB4CA06 /* WalletConnectV2PairingViewController.swift */; }; - ABC9A82D771D920162551294 /* WalletConnectV2PendingRequestsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AE15C187118DE6F0CE7B /* WalletConnectV2PendingRequestsViewModel.swift */; }; - ABC9A83233DA4C83AF83E483 /* WalletConnectV2PendingRequestsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AD3F677671FB57CCD886 /* WalletConnectV2PendingRequestsService.swift */; }; + ABC9A82D771D920162551294 /* WalletConnectPendingRequestsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AE15C187118DE6F0CE7B /* WalletConnectPendingRequestsViewModel.swift */; }; + ABC9A83233DA4C83AF83E483 /* WalletConnectPendingRequestsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AD3F677671FB57CCD886 /* WalletConnectPendingRequestsService.swift */; }; ABC9A8451CEF02EA0A94CEAA /* ProFeaturesAuthorizationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A9628A708749A31EEA70 /* ProFeaturesAuthorizationManager.swift */; }; - ABC9A85215E0CCEFE2CB83C7 /* WalletConnectV2MainService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AF574F7957C169129905 /* WalletConnectV2MainService.swift */; }; ABC9A852D667D38030B7EF39 /* SendConfirmationModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AFF7119B9AC0E32B2060 /* SendConfirmationModule.swift */; }; ABC9A853E576B02141F75E1C /* SendMemoInputViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A099941AA53B68270D55 /* SendMemoInputViewModel.swift */; }; + ABC9A8541A21123726AC8E7B /* WalletConnectPairingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9ACE88105815BFC477D71 /* WalletConnectPairingViewController.swift */; }; ABC9A8551E1F8220D62552BC /* MaIndicatorDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AD2E1F25A5CED10DB81F /* MaIndicatorDataSource.swift */; }; ABC9A85BF47CEA922CB06B9D /* RsiIndicatorDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AF2B063727B7EABFD9A3 /* RsiIndicatorDataSource.swift */; }; ABC9A85CCDCE367D1873AB5D /* RsiIndicatorDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AF2B063727B7EABFD9A3 /* RsiIndicatorDataSource.swift */; }; @@ -2164,21 +2144,21 @@ ABC9A8FAB37E2049DC58FF14 /* RestoreTypeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A13DB598B22516E5AD76 /* RestoreTypeViewModel.swift */; }; ABC9A90978E16ABC5F67CCF7 /* BalanceButtonsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A53F8E3F9572FFEE4275 /* BalanceButtonsCell.swift */; }; ABC9A90BDA552DFBCB19B226 /* NftAssetOverviewService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9ABE473B354836327B3AC /* NftAssetOverviewService.swift */; }; - ABC9A91D03FB46F6AD21EEF4 /* WalletConnectV2SocketConnectionService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A0483AEAEB88DFBDD873 /* WalletConnectV2SocketConnectionService.swift */; }; - ABC9A9221E4FF0734089BCAB /* WalletConnectV2MainPendingRequestService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AFF8093DEB7AFD7DBBCC /* WalletConnectV2MainPendingRequestService.swift */; }; + ABC9A91D03FB46F6AD21EEF4 /* WalletConnectSocketConnectionService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A0483AEAEB88DFBDD873 /* WalletConnectSocketConnectionService.swift */; }; + ABC9A9221E4FF0734089BCAB /* WalletConnectMainPendingRequestService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AFF8093DEB7AFD7DBBCC /* WalletConnectMainPendingRequestService.swift */; }; + ABC9A92D7F9ADCE00CBCED09 /* WalletConnectPairingViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AE62C0399849EFB5C158 /* WalletConnectPairingViewModel.swift */; }; ABC9A933C2603486BA181B19 /* SendFeeService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9ADB77831DCB474B24C8A /* SendFeeService.swift */; }; ABC9A9493F250B81E1152012 /* SendBitcoinService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A696DCBBE4761E77311C /* SendBitcoinService.swift */; }; ABC9A9562DD283B6FCACBCF9 /* MarketCardTitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AC7983E4A81E421AB639 /* MarketCardTitleView.swift */; }; - ABC9A9568395FB2EB273571B /* WalletConnectV2PairingModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA6A9EA3FAE9031A34C8 /* WalletConnectV2PairingModule.swift */; }; ABC9A95E667DD7BD26602D8E /* SendEip721Service.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9ACE7CB7CC9C118C72559 /* SendEip721Service.swift */; }; ABC9A96132AD85DD613EC773 /* ProFeaturesStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AB785128005F6C2C9F9A /* ProFeaturesStorage.swift */; }; ABC9A994D6AC5771ED49EFD1 /* DonateAddressViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A72B62F6152709348A6D /* DonateAddressViewModel.swift */; }; ABC9A99724D817AF0E6C5EC3 /* FileStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AB0A37663BC3F17C7A81 /* FileStorage.swift */; }; ABC9A998ECDE5438D94FBAE7 /* MarketDiscoveryCategoryService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9ADFD9DA59BD2FB21C51B /* MarketDiscoveryCategoryService.swift */; }; ABC9A9A9FE5A83A6F0C3BFE9 /* SendEip721ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A7C3BC5FC664BBF14C4F /* SendEip721ViewModel.swift */; }; - ABC9A9AC7890BE4AAE7DDC84 /* WalletConnectV2SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AC0B5943DF3B61B20BF6 /* WalletConnectV2SessionManager.swift */; }; + ABC9A9AC7890BE4AAE7DDC84 /* WalletConnectSessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AC0B5943DF3B61B20BF6 /* WalletConnectSessionManager.swift */; }; + ABC9A9CDDC14BA6259450ECA /* WalletConnectPairingModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A4BA46EDEEAB6CD9B25C /* WalletConnectPairingModule.swift */; }; ABC9A9CF9BC0D1D10C291FDD /* UIViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AB69D8053840476C26FA /* UIViewController.swift */; }; - ABC9A9D2A3567747CC105B0E /* WalletConnectV2PairingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A11FA28631EE6EB4CA06 /* WalletConnectV2PairingViewController.swift */; }; ABC9A9E3191338CD0D1DE8AE /* WalletConnectModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A0F966294A4E629CCB65 /* WalletConnectModule.swift */; }; ABC9A9EBBC60A709836DE237 /* NftAssetViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AF9C0D0174A5B6A91F13 /* NftAssetViewController.swift */; }; ABC9A9FA3285B39D25801C2A /* AccountRestoreWarningManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A7D665A025E95697C757 /* AccountRestoreWarningManager.swift */; }; @@ -2193,8 +2173,7 @@ ABC9AA86292CD59848A130F9 /* MacdIndicatorDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA8F31619609907AD67E /* MacdIndicatorDataSource.swift */; }; ABC9AA8B7C29398895204651 /* ChartCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A9F6635146BEBFB432D1 /* ChartCell.swift */; }; ABC9AAA26F0215D41AE50C57 /* SwapInputCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A90E8831B7B909124AB2 /* SwapInputCell.swift */; }; - ABC9AAB720B0187F782E18AB /* WalletConnectV2SocketConnectionService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A0483AEAEB88DFBDD873 /* WalletConnectV2SocketConnectionService.swift */; }; - ABC9AAB941B036B4CA08334B /* WalletConnectV2PairingViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AFD222C4514B22C3E43F /* WalletConnectV2PairingViewModel.swift */; }; + ABC9AAB720B0187F782E18AB /* WalletConnectSocketConnectionService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A0483AEAEB88DFBDD873 /* WalletConnectSocketConnectionService.swift */; }; ABC9AADE6C4251FCC9222125 /* ManageBarButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A6CFDF38D413679D2088 /* ManageBarButtonView.swift */; }; ABC9AAE6886B6AB060FD9E99 /* DonateAddressViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A72B62F6152709348A6D /* DonateAddressViewModel.swift */; }; ABC9AAEE109F50E3500DD6D4 /* SendBitcoinFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A3DC5DA5B7BFDBF72B5D /* SendBitcoinFactory.swift */; }; @@ -2207,16 +2186,14 @@ ABC9AB401FD98F99EF6B07C6 /* RestoreTypeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A939DD222D4A2BD3D71C /* RestoreTypeViewController.swift */; }; ABC9AB4DF4CCEA2C51DD4AB6 /* SingleLineFormTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A03401172C4C65D66764 /* SingleLineFormTextView.swift */; }; ABC9AB6EB596E2F8B15D00E4 /* CipherParams.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A89726499CDB4F697EDD /* CipherParams.swift */; }; - ABC9AB71563E5F2C9F2EA9E4 /* WalletConnectV2AppShowViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A3FB680357E569B6DB5F /* WalletConnectV2AppShowViewModel.swift */; }; + ABC9AB71563E5F2C9F2EA9E4 /* WalletConnectAppShowViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A3FB680357E569B6DB5F /* WalletConnectAppShowViewModel.swift */; }; ABC9AB83EE3F909BD80E0539 /* BackupCryptoHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AD5CB1911A698718213F /* BackupCryptoHelper.swift */; }; ABC9AB86218564E4873F6428 /* WalletConnectUriHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A1C31F5343EB2BEA4540 /* WalletConnectUriHandler.swift */; }; - ABC9AB8A9028DC1488166ABC /* WalletConnectV2PendingRequestsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AAD79FD756DA69A52578 /* WalletConnectV2PendingRequestsViewController.swift */; }; - ABC9AB90B6DF671F213642B0 /* WalletConnectV2PairingService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AFB38C3D5494BBD2D56E /* WalletConnectV2PairingService.swift */; }; + ABC9AB8A9028DC1488166ABC /* WalletConnectPendingRequestsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AAD79FD756DA69A52578 /* WalletConnectPendingRequestsViewController.swift */; }; ABC9AB9DCC782F2EC14A7031 /* TechnicalIndicatorService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A3EE670713BA4B6110F4 /* TechnicalIndicatorService.swift */; }; ABC9ABA70CEF664E8E01FA7A /* SendNftModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A82A1E9AE6CC0E24756B /* SendNftModule.swift */; }; - ABC9ABAE470C553AE5E80A9F /* WalletConnectSessionKiller.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A1667330B8DBC1A8FE52 /* WalletConnectSessionKiller.swift */; }; ABC9ABC085B0733DD4EF1FCD /* RestoreCloudPassphraseViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA99463E646706E8E36D /* RestoreCloudPassphraseViewModel.swift */; }; - ABC9ABC09321233E1727A8DD /* WalletConnectV2Session.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A4544AB5CA22ADE16417 /* WalletConnectV2Session.swift */; }; + ABC9ABC09321233E1727A8DD /* WalletConnectSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A4544AB5CA22ADE16417 /* WalletConnectSession.swift */; }; ABC9ABC375B65451761D4766 /* SendFeeViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9ACF1ACFDFD53E2502C30 /* SendFeeViewModel.swift */; }; ABC9ABD7C7746ABF50DD646F /* ChartIndicatorFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A6DE5C760A5D0C90B70E /* ChartIndicatorFactory.swift */; }; ABC9ABD7DA0C144C545EE228 /* WalletTokenBalanceCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AB2DC4C4412EFE6BEFF7 /* WalletTokenBalanceCell.swift */; }; @@ -2225,6 +2202,7 @@ ABC9ABE3189E497EC732B331 /* BackupCloudPassphraseViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A5544C221860C10BF131 /* BackupCloudPassphraseViewModel.swift */; }; ABC9ABF97B8725530463FBCF /* NftAssetOverviewViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AB8907B0E779CA4DF8F1 /* NftAssetOverviewViewModel.swift */; }; ABC9ABF99296DEA24FC5BFF0 /* SendAmountCautionService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A580220B9FD291A6496A /* SendAmountCautionService.swift */; }; + ABC9ABFA7299ADDDFEE918F7 /* WalletConnectPairingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9ACE88105815BFC477D71 /* WalletConnectPairingViewController.swift */; }; ABC9AC011EA9D58866999D88 /* UniswapV3DataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AE97D361FBF43F46F016 /* UniswapV3DataSource.swift */; }; ABC9AC10D815702B812CFFB7 /* NftAssetOverviewService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9ABE473B354836327B3AC /* NftAssetOverviewService.swift */; }; ABC9AC1B69C1E03F4035A8FB /* RestoreCloudPassphraseModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A9E0190FAD212E2E007F /* RestoreCloudPassphraseModule.swift */; }; @@ -2236,13 +2214,13 @@ ABC9AC5C8EE0A8C7F10B8A50 /* ContactBookSettingsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A309A58148C40912B964 /* ContactBookSettingsService.swift */; }; ABC9AC692F695C5F81E0453D /* DonateAddressViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A525C1E9A53F37EC3918 /* DonateAddressViewController.swift */; }; ABC9AC73C488F8B1F54929B5 /* NftAssetCellFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A30A8F78E9C9AEE861F1 /* NftAssetCellFactory.swift */; }; - ABC9AC78B2D374511F751997 /* WalletConnectV2AppShowViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A3FB680357E569B6DB5F /* WalletConnectV2AppShowViewModel.swift */; }; + ABC9AC78B2D374511F751997 /* WalletConnectAppShowViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A3FB680357E569B6DB5F /* WalletConnectAppShowViewModel.swift */; }; ABC9AC79493AB0EC96904164 /* SessionRequestFilterManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA77C414AC06C41F9319 /* SessionRequestFilterManager.swift */; }; ABC9AC79ACCB69BF97A01B53 /* ContactBookSettingsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A06A4A02C5E889265463 /* ContactBookSettingsViewModel.swift */; }; ABC9AC7B5E1E2EE48117EFC4 /* BalanceButtonsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A53F8E3F9572FFEE4275 /* BalanceButtonsCell.swift */; }; ABC9AC839A67BDEABD24CD7A /* SendMemoInputCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A3C103C1DE359184D944 /* SendMemoInputCell.swift */; }; ABC9AC84790F5BEAA514C731 /* TransactionsContactLabelService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AE89A5925C2026AB6B69 /* TransactionsContactLabelService.swift */; }; - ABC9AC850D83253B2B6FBD0A /* WalletConnectV2AppShowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A845B2969166028BA5F0 /* WalletConnectV2AppShowView.swift */; }; + ABC9AC850D83253B2B6FBD0A /* WalletConnectAppShowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A845B2969166028BA5F0 /* WalletConnectAppShowView.swift */; }; ABC9AC87FA11BA3478A8E801 /* TransactionsContactLabelService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AE89A5925C2026AB6B69 /* TransactionsContactLabelService.swift */; }; ABC9AC8ACB374C9B96F05B3C /* WalletTokenBalanceModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A1833D302B63028A3966 /* WalletTokenBalanceModule.swift */; }; ABC9AC900545DC0DD2201DEE /* UniswapV3TradeService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9ACF418357FF7AFC64B3F /* UniswapV3TradeService.swift */; }; @@ -2273,17 +2251,18 @@ ABC9AD6C3EE6EDD0FB3D623A /* ContactBookViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A3C708CD81CFE4C5BC5C /* ContactBookViewModel.swift */; }; ABC9AD841550A5A686BE72C3 /* WalletTokenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A8D48B40400D645C5496 /* WalletTokenViewModel.swift */; }; ABC9AD85EF6798DF4302FD0E /* WalletTokenListDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A3FBE68E228E3BE66F7B /* WalletTokenListDataSource.swift */; }; + ABC9ADAAB5CC80BBE7E1D9FE /* WalletConnectPairingViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AE62C0399849EFB5C158 /* WalletConnectPairingViewModel.swift */; }; ABC9ADCAB9BB8D2144F8D3CC /* SendConfirmationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA7F2ECF212EF8B70470 /* SendConfirmationViewController.swift */; }; ABC9ADCDC949C4C63D1260DE /* WalletConnectListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A52AC277ED7563F2707F /* WalletConnectListViewModel.swift */; }; ABC9ADD1A3E8C0B54E0B5014 /* IntegerAmountInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A88E126AB21F856522A7 /* IntegerAmountInputView.swift */; }; ABC9ADD2EA3745F828763EB4 /* ContactBookService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AC4A19838CA08603E17B /* ContactBookService.swift */; }; - ABC9ADD2F99F8C6A6C346FCC /* WalletConnectV2AppShowService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA3B8927F9F138ABCFB8 /* WalletConnectV2AppShowService.swift */; }; + ABC9ADD2F99F8C6A6C346FCC /* WalletConnectAppShowService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AA3B8927F9F138ABCFB8 /* WalletConnectAppShowService.swift */; }; ABC9ADDC1F55F835C68DB4C7 /* UniswapV3Provider.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A253877D9FB972EFB8D7 /* UniswapV3Provider.swift */; }; - ABC9ADDF8BF51151BDB4D513 /* WalletConnectV2PendingRequestsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AE15C187118DE6F0CE7B /* WalletConnectV2PendingRequestsViewModel.swift */; }; + ABC9ADDF8BF51151BDB4D513 /* WalletConnectPendingRequestsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AE15C187118DE6F0CE7B /* WalletConnectPendingRequestsViewModel.swift */; }; ABC9ADE1C8B18509F080FD11 /* ProFeaturesStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AB785128005F6C2C9F9A /* ProFeaturesStorage.swift */; }; ABC9ADE7C30F3F992FD9E1CC /* Array.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A06A64AB5B2A12C38D91 /* Array.swift */; }; ABC9ADF1896A4AA4FAF0275A /* ContactBookSettingsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A309A58148C40912B964 /* ContactBookSettingsService.swift */; }; - ABC9ADF2CFB90B882B5DE3F9 /* WalletConnectV2Service.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A1136889E6976E17B347 /* WalletConnectV2Service.swift */; }; + ABC9ADF2CFB90B882B5DE3F9 /* WalletConnectService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A1136889E6976E17B347 /* WalletConnectService.swift */; }; ABC9ADFC39CA9A563ED2774E /* ProFeaturesAuthorizationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A9628A708749A31EEA70 /* ProFeaturesAuthorizationManager.swift */; }; ABC9AE014EA06F26956138FA /* SendBinanceFeeWarningViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A2C2D1331E91D666AB3E /* SendBinanceFeeWarningViewModel.swift */; }; ABC9AE03528F37BF2C3B75DF /* IntegerAmountInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A88E126AB21F856522A7 /* IntegerAmountInputView.swift */; }; @@ -2296,11 +2275,8 @@ ABC9AE3F4B99ABE949945A3A /* ChartIndicatorsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A0C131342CC764890C2B /* ChartIndicatorsViewController.swift */; }; ABC9AE44EF7D6B6419955B9B /* SendEip721Service.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9ACE7CB7CC9C118C72559 /* SendEip721Service.swift */; }; ABC9AE472D9105F6FDAECD42 /* BackupCloudPassphraseService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AF6AA02DA39787C053F0 /* BackupCloudPassphraseService.swift */; }; - ABC9AE4FBE95C870F2198D68 /* WalletConnectEvmChainParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AAF99E1669B374FF256E /* WalletConnectEvmChainParser.swift */; }; ABC9AE4FD599490B0A23003D /* PredefinedBlockchainService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A1057AD189DA1CE31BF5 /* PredefinedBlockchainService.swift */; }; - ABC9AE50CB44A21D0274384F /* WalletConnectV1MainRequestView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A413A1015882E90F7675 /* WalletConnectV1MainRequestView.swift */; }; ABC9AE553D422A163A09E5F8 /* MarketCardValueView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A4FCDC5085002DF35C17 /* MarketCardValueView.swift */; }; - ABC9AE66F6D18A152EC7FD15 /* WalletConnectV1MainRequestViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A6CFF0208D48FE778028 /* WalletConnectV1MainRequestViewModel.swift */; }; ABC9AE6D877341985A6F651F /* SendBitcoinAmountInputService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9ACF1F55164BDFD049793 /* SendBitcoinAmountInputService.swift */; }; ABC9AE832E74D8DCADB83803 /* ImageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A7FC41B9F98871246E0E /* ImageCell.swift */; }; ABC9AE863B44E921F58DF3EA /* WalletConnectMainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A3A694467493C6F4AACE /* WalletConnectMainViewController.swift */; }; @@ -2324,7 +2300,6 @@ ABC9AF4D82ACDFBFBDC2D23C /* MarketCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A37521CD6E2CC5BA4E68 /* MarketCardView.swift */; }; ABC9AF5B0B1D5FE002288AE1 /* FileStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AB0A37663BC3F17C7A81 /* FileStorage.swift */; }; ABC9AF5FD825D35D55428207 /* InputIntegerSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A21A8154277AF08399A8 /* InputIntegerSection.swift */; }; - ABC9AF64794A2AFC6106DCF3 /* WalletConnectV1ListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A7809A4A33BEBCFA3194 /* WalletConnectV1ListViewModel.swift */; }; ABC9AF6C4612BAFF25DF3560 /* WalletTokenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A8D48B40400D645C5496 /* WalletTokenViewModel.swift */; }; ABC9AF6EEA62130037D23942 /* UniswapV3ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A1C2F1CC07FD4CDFC591 /* UniswapV3ViewModel.swift */; }; ABC9AF77EF53B4A7B0C0E55A /* SendAmountCautionViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A07A33870908ED1BA338 /* SendAmountCautionViewModel.swift */; }; @@ -2337,7 +2312,6 @@ ABC9AFA5222E61F7999E2A88 /* RestoreCloudService.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A06866150862CEDEB5DE /* RestoreCloudService.swift */; }; ABC9AFA89983A9BCB78E4575 /* Contact.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9AEAD18F73D4FBE05783D /* Contact.swift */; }; ABC9AFAB3BB4A1D2BFD4283B /* DataSourceChain.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A22311B6AA64B7D93CB4 /* DataSourceChain.swift */; }; - ABC9AFC2E1155B5C87DC9F0E /* WalletConnectV1MainRequestViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A6CFF0208D48FE778028 /* WalletConnectV1MainRequestViewModel.swift */; }; ABC9AFE47A405844612EB01A /* IndicatorAdviceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A044BFF4E76CD17835CA /* IndicatorAdviceView.swift */; }; ABC9AFF2B9B16116FE1EB549 /* InputIntegerSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A21A8154277AF08399A8 /* InputIntegerSection.swift */; }; ABC9AFFD730AC3274811DA61 /* ContactBookContactViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC9A8A353E491AAD3EDA120 /* ContactBookContactViewController.swift */; }; @@ -2842,7 +2816,6 @@ 11B353A0B705D8EABC5B6827 /* EnabledWallet_v_0_10.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EnabledWallet_v_0_10.swift; sourceTree = ""; }; 11B353A1CC274EDBF8A67DEA /* MarketAdvancedSearchResultViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MarketAdvancedSearchResultViewController.swift; sourceTree = ""; }; 11B353A64E88BD68714D4D07 /* RestoreViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RestoreViewController.swift; sourceTree = ""; }; - 11B353AEAF26CD0805C2AE7D /* WalletConnectSessionManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectSessionManager.swift; sourceTree = ""; }; 11B353B060BDF272932D3522 /* MarketListMarketFieldDecorator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MarketListMarketFieldDecorator.swift; sourceTree = ""; }; 11B353B4C04282FDBB1B6563 /* Guide.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Guide.swift; sourceTree = ""; }; 11B353BA87FDCB1BCBA92E61 /* InputStackView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InputStackView.swift; sourceTree = ""; }; @@ -2912,7 +2885,7 @@ 11B355B6EFCAB40DC5ACEA3D /* MultiSelectorViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MultiSelectorViewController.swift; sourceTree = ""; }; 11B355B70AB1BC7B6F8B5241 /* WatchViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WatchViewController.swift; sourceTree = ""; }; 11B355BEB95969D89B3F8876 /* MarketListViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MarketListViewModel.swift; sourceTree = ""; }; - 11B355C1E3C922BAE804AAF9 /* WalletConnectV2SessionStorage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV2SessionStorage.swift; sourceTree = ""; }; + 11B355C1E3C922BAE804AAF9 /* WalletConnectSessionStorage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectSessionStorage.swift; sourceTree = ""; }; 11B355D5EFD2B74DE15F0C2A /* FaqModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FaqModule.swift; sourceTree = ""; }; 11B355DBB08BD360380F7EAF /* WalletConnectRequestViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectRequestViewController.swift; sourceTree = ""; }; 11B355DF40EB498107EDAA4A /* BrandFooterCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BrandFooterCell.swift; sourceTree = ""; }; @@ -3006,7 +2979,6 @@ 11B358145A0D9F93ACBC0301 /* CreateAccountModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CreateAccountModule.swift; sourceTree = ""; }; 11B3582259AD3A0C55CF6D2C /* MarketOverviewTopPlatformsService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MarketOverviewTopPlatformsService.swift; sourceTree = ""; }; 11B35822E26E7298100CD69D /* LogRecordStorage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LogRecordStorage.swift; sourceTree = ""; }; - 11B3582303D9BC904086E159 /* WalletConnectSessionStorage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectSessionStorage.swift; sourceTree = ""; }; 11B35828C8D50D0A5B915B2A /* TransactionsModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionsModule.swift; sourceTree = ""; }; 11B3583528958D290AD3CE0C /* BackupMnemonicWordsCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BackupMnemonicWordsCell.swift; sourceTree = ""; }; 11B3583932F270503C1DF3F0 /* AdapterFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AdapterFactory.swift; sourceTree = ""; }; @@ -3156,7 +3128,6 @@ 11B35B6D6FCA3745DE0750BD /* MainService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainService.swift; sourceTree = ""; }; 11B35B70808A7D2484859EFD /* FaqViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FaqViewController.swift; sourceTree = ""; }; 11B35B7D66631DD5D91D0773 /* CoinMarketsModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoinMarketsModule.swift; sourceTree = ""; }; - 11B35B8762A9A899A170E7AA /* WalletConnectService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectService.swift; sourceTree = ""; }; 11B35B968B299A67FC7FEAE3 /* WalletConnectManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectManager.swift; sourceTree = ""; }; 11B35B96D2BC5994AC8EC794 /* MainModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainModule.swift; sourceTree = ""; }; 11B35BAA4EA85B4A3A173498 /* RowButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RowButton.swift; sourceTree = ""; }; @@ -3206,7 +3177,6 @@ 11B35CB288AF5A54B99A51E4 /* RestoreMnemonicHintView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RestoreMnemonicHintView.swift; sourceTree = ""; }; 11B35CB98A27269A510F40EE /* SyncMode_v_0_24.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SyncMode_v_0_24.swift; sourceTree = ""; }; 11B35CBBFEC11CAE6FDBCFFA /* ManageWalletsModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ManageWalletsModule.swift; sourceTree = ""; }; - 11B35CC3319F0D16C6E6E5C0 /* WalletConnectSession.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectSession.swift; sourceTree = ""; }; 11B35CC832C2C96FA9E7B60B /* ReservoirNftProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReservoirNftProvider.swift; sourceTree = ""; }; 11B35CD5EBBB403D46BDEF0B /* WalletConnectRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectRequest.swift; sourceTree = ""; }; 11B35CE95BA53CC4B1E372FB /* NftAssetImageCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NftAssetImageCell.swift; sourceTree = ""; }; @@ -3674,7 +3644,7 @@ ABC9A021D71EDD24DFB6BA62 /* CoinProChartModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoinProChartModule.swift; sourceTree = ""; }; ABC9A03401172C4C65D66764 /* SingleLineFormTextView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SingleLineFormTextView.swift; sourceTree = ""; }; ABC9A044BFF4E76CD17835CA /* IndicatorAdviceView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IndicatorAdviceView.swift; sourceTree = ""; }; - ABC9A0483AEAEB88DFBDD873 /* WalletConnectV2SocketConnectionService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV2SocketConnectionService.swift; sourceTree = ""; }; + ABC9A0483AEAEB88DFBDD873 /* WalletConnectSocketConnectionService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectSocketConnectionService.swift; sourceTree = ""; }; ABC9A06866150862CEDEB5DE /* RestoreCloudService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RestoreCloudService.swift; sourceTree = ""; }; ABC9A06A4A02C5E889265463 /* ContactBookSettingsViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContactBookSettingsViewModel.swift; sourceTree = ""; }; ABC9A06A64AB5B2A12C38D91 /* Array.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Array.swift; sourceTree = ""; }; @@ -3686,14 +3656,12 @@ ABC9A0F966294A4E629CCB65 /* WalletConnectModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectModule.swift; sourceTree = ""; }; ABC9A1057AD189DA1CE31BF5 /* PredefinedBlockchainService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PredefinedBlockchainService.swift; sourceTree = ""; }; ABC9A10A83A43DCAFA709472 /* CoinDetailAdviceViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoinDetailAdviceViewController.swift; sourceTree = ""; }; - ABC9A1136889E6976E17B347 /* WalletConnectV2Service.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV2Service.swift; sourceTree = ""; }; - ABC9A11FA28631EE6EB4CA06 /* WalletConnectV2PairingViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV2PairingViewController.swift; sourceTree = ""; }; + ABC9A1136889E6976E17B347 /* WalletConnectService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectService.swift; sourceTree = ""; }; ABC9A12529DC8DE5D46D9776 /* ContactBookAddressViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContactBookAddressViewModel.swift; sourceTree = ""; }; ABC9A12E4155640075755699 /* IndicatorDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IndicatorDataSource.swift; sourceTree = ""; }; ABC9A1360FE305343B1049CF /* SwapRevokeConfirmationViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwapRevokeConfirmationViewController.swift; sourceTree = ""; }; ABC9A13DB598B22516E5AD76 /* RestoreTypeViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RestoreTypeViewModel.swift; sourceTree = ""; }; ABC9A141E4C255C3E450863E /* NoAccountWalletTokenListService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NoAccountWalletTokenListService.swift; sourceTree = ""; }; - ABC9A1667330B8DBC1A8FE52 /* WalletConnectSessionKiller.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectSessionKiller.swift; sourceTree = ""; }; ABC9A1833D302B63028A3966 /* WalletTokenBalanceModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletTokenBalanceModule.swift; sourceTree = ""; }; ABC9A1BD3B1B53C72DDF923A /* SendBitcoinAdapterService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendBitcoinAdapterService.swift; sourceTree = ""; }; ABC9A1C2F1CC07FD4CDFC591 /* UniswapV3ViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UniswapV3ViewModel.swift; sourceTree = ""; }; @@ -3707,7 +3675,7 @@ ABC9A2C2D1331E91D666AB3E /* SendBinanceFeeWarningViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendBinanceFeeWarningViewModel.swift; sourceTree = ""; }; ABC9A2D87362E00FD9FB5688 /* ContactBookViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContactBookViewController.swift; sourceTree = ""; }; ABC9A2F3E5147E0E92258FBB /* ChartIndicatorsService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChartIndicatorsService.swift; sourceTree = ""; }; - ABC9A2F6EDC8BB83ED7B75BA /* WalletConnectV2PendingRequestsModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV2PendingRequestsModule.swift; sourceTree = ""; }; + ABC9A2F6EDC8BB83ED7B75BA /* WalletConnectPendingRequestsModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectPendingRequestsModule.swift; sourceTree = ""; }; ABC9A2FD4A59DB53631435BA /* SendConfirmationService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendConfirmationService.swift; sourceTree = ""; }; ABC9A309A58148C40912B964 /* ContactBookSettingsService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContactBookSettingsService.swift; sourceTree = ""; }; ABC9A30A8F78E9C9AEE861F1 /* NftAssetCellFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NftAssetCellFactory.swift; sourceTree = ""; }; @@ -3726,14 +3694,14 @@ ABC9A3DC5DA5B7BFDBF72B5D /* SendBitcoinFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendBitcoinFactory.swift; sourceTree = ""; }; ABC9A3EE670713BA4B6110F4 /* TechnicalIndicatorService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TechnicalIndicatorService.swift; sourceTree = ""; }; ABC9A3F41BDCD5F4146E6E06 /* SendBinanceService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendBinanceService.swift; sourceTree = ""; }; - ABC9A3FB680357E569B6DB5F /* WalletConnectV2AppShowViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV2AppShowViewModel.swift; sourceTree = ""; }; + ABC9A3FB680357E569B6DB5F /* WalletConnectAppShowViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectAppShowViewModel.swift; sourceTree = ""; }; ABC9A3FBE68E228E3BE66F7B /* WalletTokenListDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletTokenListDataSource.swift; sourceTree = ""; }; - ABC9A413A1015882E90F7675 /* WalletConnectV1MainRequestView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV1MainRequestView.swift; sourceTree = ""; }; - ABC9A4544AB5CA22ADE16417 /* WalletConnectV2Session.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV2Session.swift; sourceTree = ""; }; + ABC9A4544AB5CA22ADE16417 /* WalletConnectSession.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectSession.swift; sourceTree = ""; }; ABC9A45E29D1773EF27A0074 /* RestoreCloudModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RestoreCloudModule.swift; sourceTree = ""; }; ABC9A4674CCDED7C12EB5C09 /* ContactBookAddressModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContactBookAddressModule.swift; sourceTree = ""; }; ABC9A48552CF0C90E22686A9 /* SendBaseService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendBaseService.swift; sourceTree = ""; }; ABC9A4B75DFB58AC56FEF798 /* WalletTokenModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletTokenModule.swift; sourceTree = ""; }; + ABC9A4BA46EDEEAB6CD9B25C /* WalletConnectPairingModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectPairingModule.swift; sourceTree = ""; }; ABC9A4C563432A34A634B82A /* ECashAdapter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ECashAdapter.swift; sourceTree = ""; }; ABC9A4FCDC5085002DF35C17 /* MarketCardValueView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MarketCardValueView.swift; sourceTree = ""; }; ABC9A525C1E9A53F37EC3918 /* DonateAddressViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DonateAddressViewController.swift; sourceTree = ""; }; @@ -3744,6 +3712,7 @@ ABC9A5544C221860C10BF131 /* BackupCloudPassphraseViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BackupCloudPassphraseViewModel.swift; sourceTree = ""; }; ABC9A55B0E99C1DD25839EDB /* ContactBookAddressViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContactBookAddressViewController.swift; sourceTree = ""; }; ABC9A56611CF5E7B3F25CD5C /* SwapInputAccessoryView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwapInputAccessoryView.swift; sourceTree = ""; }; + ABC9A56ED1DB109A2E1F6EC1 /* WalletConnectPairingService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectPairingService.swift; sourceTree = ""; }; ABC9A580220B9FD291A6496A /* SendAmountCautionService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendAmountCautionService.swift; sourceTree = ""; }; ABC9A5E6F7C6887DD5DFF6E4 /* ContactBookContactService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContactBookContactService.swift; sourceTree = ""; }; ABC9A5FE0EDA53E4D9B85DE1 /* RestoreCloudViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RestoreCloudViewModel.swift; sourceTree = ""; }; @@ -3753,7 +3722,6 @@ ABC9A696DCBBE4761E77311C /* SendBitcoinService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendBitcoinService.swift; sourceTree = ""; }; ABC9A6B2EF46FF7EDA4728D3 /* CheckboxView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckboxView.swift; sourceTree = ""; }; ABC9A6CFDF38D413679D2088 /* ManageBarButtonView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ManageBarButtonView.swift; sourceTree = ""; }; - ABC9A6CFF0208D48FE778028 /* WalletConnectV1MainRequestViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV1MainRequestViewModel.swift; sourceTree = ""; }; ABC9A6D56EBB7FFAD68CFD66 /* IntegerAmountInputViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IntegerAmountInputViewModel.swift; sourceTree = ""; }; ABC9A6DE5C760A5D0C90B70E /* ChartIndicatorFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChartIndicatorFactory.swift; sourceTree = ""; }; ABC9A6F1FB00B33D1896FC6B /* RestoreCloudPassphraseService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RestoreCloudPassphraseService.swift; sourceTree = ""; }; @@ -3762,7 +3730,6 @@ ABC9A7315E119F0B1581B70C /* SendEip721ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendEip721ViewController.swift; sourceTree = ""; }; ABC9A76776AD840DBFAA1804 /* CoinIndicatorViewItemFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoinIndicatorViewItemFactory.swift; sourceTree = ""; }; ABC9A776346AF62265896CA1 /* CellElement.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CellElement.swift; sourceTree = ""; }; - ABC9A7809A4A33BEBCFA3194 /* WalletConnectV1ListViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV1ListViewModel.swift; sourceTree = ""; }; ABC9A791A47F4F1E71B51B3B /* TokenSelectView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokenSelectView.swift; sourceTree = ""; }; ABC9A7C3BC5FC664BBF14C4F /* SendEip721ViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendEip721ViewModel.swift; sourceTree = ""; }; ABC9A7D665A025E95697C757 /* AccountRestoreWarningManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccountRestoreWarningManager.swift; sourceTree = ""; }; @@ -3772,8 +3739,7 @@ ABC9A806FD17A129212E3F7C /* NftAssetOverviewViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NftAssetOverviewViewController.swift; sourceTree = ""; }; ABC9A8080797194017F736AB /* ContactBookContactViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContactBookContactViewModel.swift; sourceTree = ""; }; ABC9A82A1E9AE6CC0E24756B /* SendNftModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendNftModule.swift; sourceTree = ""; }; - ABC9A845B2969166028BA5F0 /* WalletConnectV2AppShowView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV2AppShowView.swift; sourceTree = ""; }; - ABC9A857395F2521BA0A2602 /* WalletConnectV1MainService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV1MainService.swift; sourceTree = ""; }; + ABC9A845B2969166028BA5F0 /* WalletConnectAppShowView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectAppShowView.swift; sourceTree = ""; }; ABC9A86EA911DA12C7A6AC20 /* WalletTokenBalanceViewItemFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletTokenBalanceViewItemFactory.swift; sourceTree = ""; }; ABC9A88E126AB21F856522A7 /* IntegerAmountInputView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IntegerAmountInputView.swift; sourceTree = ""; }; ABC9A896A83640B618328FE1 /* EnsAddressParserItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EnsAddressParserItem.swift; sourceTree = ""; }; @@ -3785,8 +3751,7 @@ ABC9A8CF40E995105E7F38AC /* NftCollectionCellFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NftCollectionCellFactory.swift; sourceTree = ""; }; ABC9A8D3446ABE98F4D1C0CC /* ProFeaturesAuthorizationAdapter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProFeaturesAuthorizationAdapter.swift; sourceTree = ""; }; ABC9A8D48B40400D645C5496 /* WalletTokenViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletTokenViewModel.swift; sourceTree = ""; }; - ABC9A8D8072033A5AC7E4897 /* WalletConnectV2MainPendingRequestViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV2MainPendingRequestViewModel.swift; sourceTree = ""; }; - ABC9A8DC6C2EEBD4FD453342 /* WalletConnectV2ListViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV2ListViewModel.swift; sourceTree = ""; }; + ABC9A8D8072033A5AC7E4897 /* WalletConnectMainPendingRequestViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectMainPendingRequestViewModel.swift; sourceTree = ""; }; ABC9A8E4CDD143171A1F9C46 /* BackupCloudPassphraseViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BackupCloudPassphraseViewController.swift; sourceTree = ""; }; ABC9A90781302D793E0773CB /* NftAssetOverviewModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NftAssetOverviewModule.swift; sourceTree = ""; }; ABC9A90E8831B7B909124AB2 /* SwapInputCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwapInputCell.swift; sourceTree = ""; }; @@ -3798,12 +3763,10 @@ ABC9A9E0190FAD212E2E007F /* RestoreCloudPassphraseModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RestoreCloudPassphraseModule.swift; sourceTree = ""; }; ABC9A9F6635146BEBFB432D1 /* ChartCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChartCell.swift; sourceTree = ""; }; ABC9AA2491ADC4E5E089CD42 /* MetadataMonitor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MetadataMonitor.swift; sourceTree = ""; }; - ABC9AA2DC16F947607B1794E /* WalletConnectV1ListView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV1ListView.swift; sourceTree = ""; }; - ABC9AA31438063F7AB7BDDC8 /* WalletConnectV2RequestMapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV2RequestMapper.swift; sourceTree = ""; }; - ABC9AA3B8927F9F138ABCFB8 /* WalletConnectV2AppShowService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV2AppShowService.swift; sourceTree = ""; }; + ABC9AA31438063F7AB7BDDC8 /* WalletConnectRequestMapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectRequestMapper.swift; sourceTree = ""; }; + ABC9AA3B8927F9F138ABCFB8 /* WalletConnectAppShowService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectAppShowService.swift; sourceTree = ""; }; ABC9AA459E123B7053EC73F0 /* SwapPriceCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwapPriceCell.swift; sourceTree = ""; }; ABC9AA527E63E18179CB689A /* IntegerAmountInputCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IntegerAmountInputCell.swift; sourceTree = ""; }; - ABC9AA6A9EA3FAE9031A34C8 /* WalletConnectV2PairingModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV2PairingModule.swift; sourceTree = ""; }; ABC9AA751C8B09F90F716231 /* RestoreCloudViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RestoreCloudViewController.swift; sourceTree = ""; }; ABC9AA77C414AC06C41F9319 /* SessionRequestFilterManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SessionRequestFilterManager.swift; sourceTree = ""; }; ABC9AA7F2ECF212EF8B70470 /* SendConfirmationViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendConfirmationViewController.swift; sourceTree = ""; }; @@ -3813,10 +3776,9 @@ ABC9AAC741F9A54293CD21B1 /* RestoreTypeModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RestoreTypeModule.swift; sourceTree = ""; }; ABC9AACC40370E1E0CFC7639 /* IndicatorAdviceCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IndicatorAdviceCell.swift; sourceTree = ""; }; ABC9AAD55B8932EE75E3C037 /* SwapInputModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwapInputModule.swift; sourceTree = ""; }; - ABC9AAD79FD756DA69A52578 /* WalletConnectV2PendingRequestsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV2PendingRequestsViewController.swift; sourceTree = ""; }; + ABC9AAD79FD756DA69A52578 /* WalletConnectPendingRequestsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectPendingRequestsViewController.swift; sourceTree = ""; }; ABC9AAEA86EF9D14503A4791 /* WalletBackupCrypto.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletBackupCrypto.swift; sourceTree = ""; }; ABC9AAF2ADD900F32D87C7BE /* SendViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendViewModel.swift; sourceTree = ""; }; - ABC9AAF99E1669B374FF256E /* WalletConnectEvmChainParser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectEvmChainParser.swift; sourceTree = ""; }; ABC9AB0A37663BC3F17C7A81 /* FileStorage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FileStorage.swift; sourceTree = ""; }; ABC9AB2DC4C4412EFE6BEFF7 /* WalletTokenBalanceCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletTokenBalanceCell.swift; sourceTree = ""; }; ABC9AB2ED4E48D4FCEDBE769 /* ContactBookContactModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContactBookContactModule.swift; sourceTree = ""; }; @@ -3832,7 +3794,7 @@ ABC9ABE97578DC667CBDC11A /* BaseSendViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseSendViewController.swift; sourceTree = ""; }; ABC9ABFE62D22F9FB0B3409A /* DonateDescriptionDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DonateDescriptionDataSource.swift; sourceTree = ""; }; ABC9AC09A586D88BAB3B9C67 /* WalletConnectListModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectListModule.swift; sourceTree = ""; }; - ABC9AC0B5943DF3B61B20BF6 /* WalletConnectV2SessionManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV2SessionManager.swift; sourceTree = ""; }; + ABC9AC0B5943DF3B61B20BF6 /* WalletConnectSessionManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectSessionManager.swift; sourceTree = ""; }; ABC9AC2EF759D639F6CEA256 /* SwapInputCardView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwapInputCardView.swift; sourceTree = ""; }; ABC9AC4A19838CA08603E17B /* ContactBookService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContactBookService.swift; sourceTree = ""; }; ABC9AC50307ABA3DF7034E1D /* BackupContact.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BackupContact.swift; sourceTree = ""; }; @@ -3841,15 +3803,17 @@ ABC9AC8CCF3B57FDFC817356 /* ContactBookAddressService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContactBookAddressService.swift; sourceTree = ""; }; ABC9ACE2CCBDF21572F5600C /* ChartIndicatorSettingsViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChartIndicatorSettingsViewModel.swift; sourceTree = ""; }; ABC9ACE7CB7CC9C118C72559 /* SendEip721Service.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendEip721Service.swift; sourceTree = ""; }; + ABC9ACE88105815BFC477D71 /* WalletConnectPairingViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectPairingViewController.swift; sourceTree = ""; }; ABC9ACF1ACFDFD53E2502C30 /* SendFeeViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendFeeViewModel.swift; sourceTree = ""; }; ABC9ACF1F55164BDFD049793 /* SendBitcoinAmountInputService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendBitcoinAmountInputService.swift; sourceTree = ""; }; ABC9ACF418357FF7AFC64B3F /* UniswapV3TradeService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UniswapV3TradeService.swift; sourceTree = ""; }; ABC9AD0848221B0EC25C37F3 /* DonateDescriptionCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DonateDescriptionCell.swift; sourceTree = ""; }; ABC9AD0DD32AB4B9BAB79F11 /* SendBinanceFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendBinanceFactory.swift; sourceTree = ""; }; + ABC9AD18F3E73F96DD6C4FA9 /* WalletConnectMainService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectMainService.swift; sourceTree = ""; }; ABC9AD1F2311CC6425CF9D90 /* SendModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendModule.swift; sourceTree = ""; }; ABC9AD2E1F25A5CED10DB81F /* MaIndicatorDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaIndicatorDataSource.swift; sourceTree = ""; }; ABC9AD35D41AEEBD38AA08B5 /* NftAssetModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NftAssetModule.swift; sourceTree = ""; }; - ABC9AD3F677671FB57CCD886 /* WalletConnectV2PendingRequestsService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV2PendingRequestsService.swift; sourceTree = ""; }; + ABC9AD3F677671FB57CCD886 /* WalletConnectPendingRequestsService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectPendingRequestsService.swift; sourceTree = ""; }; ABC9AD448DC071D8800C6B12 /* WalletTokenBalanceCustomAmountCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletTokenBalanceCustomAmountCell.swift; sourceTree = ""; }; ABC9AD5CB1911A698718213F /* BackupCryptoHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BackupCryptoHelper.swift; sourceTree = ""; }; ABC9ADB77831DCB474B24C8A /* SendFeeService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendFeeService.swift; sourceTree = ""; }; @@ -3858,8 +3822,9 @@ ABC9ADF114FCFABEA148AF04 /* SendTimeLockErrorService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendTimeLockErrorService.swift; sourceTree = ""; }; ABC9ADFD9DA59BD2FB21C51B /* MarketDiscoveryCategoryService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MarketDiscoveryCategoryService.swift; sourceTree = ""; }; ABC9AE12A5E8B9FB24FFE42F /* ContactBookHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContactBookHelper.swift; sourceTree = ""; }; - ABC9AE15C187118DE6F0CE7B /* WalletConnectV2PendingRequestsViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV2PendingRequestsViewModel.swift; sourceTree = ""; }; + ABC9AE15C187118DE6F0CE7B /* WalletConnectPendingRequestsViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectPendingRequestsViewModel.swift; sourceTree = ""; }; ABC9AE5FD79ECC4AC85B86FA /* WalletConnectListViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectListViewController.swift; sourceTree = ""; }; + ABC9AE62C0399849EFB5C158 /* WalletConnectPairingViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectPairingViewModel.swift; sourceTree = ""; }; ABC9AE6D2CD14194802E7976 /* SendZcashService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendZcashService.swift; sourceTree = ""; }; ABC9AE89A5925C2026AB6B69 /* TransactionsContactLabelService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionsContactLabelService.swift; sourceTree = ""; }; ABC9AE8A193F58021C411311 /* WalletConnectMainModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectMainModule.swift; sourceTree = ""; }; @@ -3872,15 +3837,11 @@ ABC9AF15BD67548E6D755CA0 /* SendBinanceViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendBinanceViewController.swift; sourceTree = ""; }; ABC9AF26FDCB363793BF66E1 /* Integer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Integer.swift; sourceTree = ""; }; ABC9AF2B063727B7EABFD9A3 /* RsiIndicatorDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RsiIndicatorDataSource.swift; sourceTree = ""; }; - ABC9AF574F7957C169129905 /* WalletConnectV2MainService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV2MainService.swift; sourceTree = ""; }; ABC9AF6AA02DA39787C053F0 /* BackupCloudPassphraseService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BackupCloudPassphraseService.swift; sourceTree = ""; }; ABC9AF8E8DE67732371A00E0 /* FeePriceScale.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeePriceScale.swift; sourceTree = ""; }; ABC9AF9C0D0174A5B6A91F13 /* NftAssetViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NftAssetViewController.swift; sourceTree = ""; }; - ABC9AFB38C3D5494BBD2D56E /* WalletConnectV2PairingService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV2PairingService.swift; sourceTree = ""; }; - ABC9AFD222C4514B22C3E43F /* WalletConnectV2PairingViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV2PairingViewModel.swift; sourceTree = ""; }; - ABC9AFE16BDDA2ECBE8729CA /* WalletConnectV2ListView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV2ListView.swift; sourceTree = ""; }; ABC9AFF7119B9AC0E32B2060 /* SendConfirmationModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendConfirmationModule.swift; sourceTree = ""; }; - ABC9AFF8093DEB7AFD7DBBCC /* WalletConnectV2MainPendingRequestService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectV2MainPendingRequestService.swift; sourceTree = ""; }; + ABC9AFF8093DEB7AFD7DBBCC /* WalletConnectMainPendingRequestService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WalletConnectMainPendingRequestService.swift; sourceTree = ""; }; D00267B82A57E6CE00D6B2D5 /* ResendPastInputCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResendPastInputCell.swift; sourceTree = ""; }; D00267BB2A57E72700D6B2D5 /* ResendPasteInputView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResendPasteInputView.swift; sourceTree = ""; }; D003297526CD2C67002EC21D /* TransactionLockInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionLockInfo.swift; sourceTree = ""; }; @@ -4239,20 +4200,17 @@ children = ( 11B35F8F04804673FF91D3F0 /* Request */, 1A564CE43A1CD390D196FD83 /* Views */, - 11B35B8762A9A899A170E7AA /* WalletConnectService.swift */, 11B35A9F154EC84CEFA909B9 /* WalletConnectInteractor.swift */, 11B35B968B299A67FC7FEAE3 /* WalletConnectManager.swift */, - 11B353AEAF26CD0805C2AE7D /* WalletConnectSessionManager.swift */, 11B35CD5EBBB403D46BDEF0B /* WalletConnectRequest.swift */, ABC9AA3A1DE80490A419F658 /* List */, ABC9A63273CF7429742F1CD7 /* ScanQr */, ABC9A25DA779297B95A9BFD0 /* PendingRequests */, ABC9A6073E7A8B2997B27997 /* Main */, - ABC9A1136889E6976E17B347 /* WalletConnectV2Service.swift */, + ABC9A1136889E6976E17B347 /* WalletConnectService.swift */, ABC9A1C31F5343EB2BEA4540 /* WalletConnectUriHandler.swift */, - ABC9A1667330B8DBC1A8FE52 /* WalletConnectSessionKiller.swift */, ABC9A0F966294A4E629CCB65 /* WalletConnectModule.swift */, - ABC9A0483AEAEB88DFBDD873 /* WalletConnectV2SocketConnectionService.swift */, + ABC9A0483AEAEB88DFBDD873 /* WalletConnectSocketConnectionService.swift */, ABC9AF0B88F3140CBD4406B8 /* Pairings */, ABC9A71A64E11AD3709A1174 /* Workers */, ABC9AA77C414AC06C41F9319 /* SessionRequestFilterManager.swift */, @@ -4610,7 +4568,7 @@ 11B35A4E49ED2D2BF8E60863 /* AdapterManager.swift */, 11B35BEEC0AB0B09C7E4209A /* LaunchScreenManager.swift */, 11B35A296048CDD27A26FE9E /* EvmAccountManager.swift */, - ABC9AC0B5943DF3B61B20BF6 /* WalletConnectV2SessionManager.swift */, + ABC9AC0B5943DF3B61B20BF6 /* WalletConnectSessionManager.swift */, 11B356D15E318829D9C7F5F1 /* EvmBlockchainManager.swift */, 11B35F13BAFE57D363B9684F /* EvmLabelManager.swift */, 11B3566DC3A97A5CC3E2C729 /* BalancePrimaryValueManager.swift */, @@ -4944,7 +4902,6 @@ 11B35B176A5FDEBBE94D307E /* BitcoinCashCoinType.swift */, 11B352D393EDFE4F015B0DEA /* Address.swift */, 179E7048A730489634E27043 /* FavoriteCoinRecord.swift */, - 11B35CC3319F0D16C6E6E5C0 /* WalletConnectSession.swift */, 11B35F98E89F83A30870F404 /* ActiveAccount.swift */, 11B3546480B733000550BEB6 /* RestoreSettingRecord.swift */, 11B3502637A858E6DDF9471B /* EvmSyncSource.swift */, @@ -4957,7 +4914,7 @@ 11B35B451378835F7F060012 /* NftPriceRecord.swift */, 11B359852B313E849499BC19 /* NftAssetRecord.swift */, 11B350E6966203DF2855369A /* NftCollectionRecord.swift */, - ABC9A4544AB5CA22ADE16417 /* WalletConnectV2Session.swift */, + ABC9A4544AB5CA22ADE16417 /* WalletConnectSession.swift */, 11B35E3F01D5A5CFE5A4E94B /* EvmMethodLabel.swift */, 11B353282C7000D3BDFC7FD0 /* EvmAddressLabel.swift */, 11B35E5C80435645132BCDD2 /* EvmUpdateStatus.swift */, @@ -5090,8 +5047,7 @@ 11B358556C8FC5368E14D81E /* AccountRecordStorage.swift */, 11B35822E26E7298100CD69D /* LogRecordStorage.swift */, 11B35C7B8BA65E9AA3BB7AFB /* FavoriteCoinRecordStorage.swift */, - 11B3582303D9BC904086E159 /* WalletConnectSessionStorage.swift */, - 11B355C1E3C922BAE804AAF9 /* WalletConnectV2SessionStorage.swift */, + 11B355C1E3C922BAE804AAF9 /* WalletConnectSessionStorage.swift */, 11B354C4B46DF1A50103F026 /* ActiveAccountStorage.swift */, 11B350DD8FFDB14904D23AE0 /* RestoreSettingsStorage.swift */, 11B35888BDB55DCFD0ECF655 /* AppVersionRecordStorage.swift */, @@ -5782,7 +5738,7 @@ 1A5647792BF6E777F087999A /* Sign */, 11B356C2E5AF8ED41E2B545D /* WalletConnectRequestModule.swift */, 11B355DBB08BD360380F7EAF /* WalletConnectRequestViewController.swift */, - ABC9AA31438063F7AB7BDDC8 /* WalletConnectV2RequestMapper.swift */, + ABC9AA31438063F7AB7BDDC8 /* WalletConnectRequestMapper.swift */, ); path = Request; sourceTree = ""; @@ -6758,16 +6714,6 @@ path = Indicators; sourceTree = ""; }; - ABC9A057D947B84E4D4E6A27 /* V1 */ = { - isa = PBXGroup; - children = ( - ABC9A6CFF0208D48FE778028 /* WalletConnectV1MainRequestViewModel.swift */, - ABC9A857395F2521BA0A2602 /* WalletConnectV1MainService.swift */, - ABC9A413A1015882E90F7675 /* WalletConnectV1MainRequestView.swift */, - ); - path = V1; - sourceTree = ""; - }; ABC9A0C84F2BFCCECF03B045 /* Main */ = { isa = PBXGroup; children = ( @@ -6935,14 +6881,13 @@ path = ContactBookList; sourceTree = ""; }; - ABC9A4B2FB3E02FF5B5B62A5 /* V2 */ = { + ABC9A4B2FB3E02FF5B5B62A5 /* PendingRequest */ = { isa = PBXGroup; children = ( - ABC9AF574F7957C169129905 /* WalletConnectV2MainService.swift */, - ABC9A8D8072033A5AC7E4897 /* WalletConnectV2MainPendingRequestViewModel.swift */, - ABC9AFF8093DEB7AFD7DBBCC /* WalletConnectV2MainPendingRequestService.swift */, + ABC9A8D8072033A5AC7E4897 /* WalletConnectMainPendingRequestViewModel.swift */, + ABC9AFF8093DEB7AFD7DBBCC /* WalletConnectMainPendingRequestService.swift */, ); - path = V2; + path = PendingRequest; sourceTree = ""; }; ABC9A4C18F27446916AD53E0 /* KeyboardTracker */ = { @@ -6967,16 +6912,6 @@ path = Send; sourceTree = ""; }; - ABC9A5D89330A9391B470BE5 /* V2 */ = { - isa = PBXGroup; - children = ( - ABC9AAF99E1669B374FF256E /* WalletConnectEvmChainParser.swift */, - ABC9A8DC6C2EEBD4FD453342 /* WalletConnectV2ListViewModel.swift */, - ABC9AFE16BDDA2ECBE8729CA /* WalletConnectV2ListView.swift */, - ); - path = V2; - sourceTree = ""; - }; ABC9A5F2A0999FCFDDEF1BA3 /* AmountCaution */ = { isa = PBXGroup; children = ( @@ -6991,9 +6926,9 @@ children = ( ABC9AE8A193F58021C411311 /* WalletConnectMainModule.swift */, ABC9A3A694467493C6F4AACE /* WalletConnectMainViewController.swift */, - ABC9A057D947B84E4D4E6A27 /* V1 */, ABC9AEA1D717D8CED8462AB0 /* WalletConnectMainViewModel.swift */, - ABC9A4B2FB3E02FF5B5B62A5 /* V2 */, + ABC9A4B2FB3E02FF5B5B62A5 /* PendingRequest */, + ABC9AD18F3E73F96DD6C4FA9 /* WalletConnectMainService.swift */, ); path = Main; sourceTree = ""; @@ -7049,14 +6984,14 @@ path = Crypto; sourceTree = ""; }; - ABC9A6B0734FA399147D5BBB /* WalletConnectV2AppShowWorker */ = { + ABC9A6B0734FA399147D5BBB /* WalletConnectAppShowWorker */ = { isa = PBXGroup; children = ( - ABC9A845B2969166028BA5F0 /* WalletConnectV2AppShowView.swift */, - ABC9AA3B8927F9F138ABCFB8 /* WalletConnectV2AppShowService.swift */, - ABC9A3FB680357E569B6DB5F /* WalletConnectV2AppShowViewModel.swift */, + ABC9A845B2969166028BA5F0 /* WalletConnectAppShowView.swift */, + ABC9AA3B8927F9F138ABCFB8 /* WalletConnectAppShowService.swift */, + ABC9A3FB680357E569B6DB5F /* WalletConnectAppShowViewModel.swift */, ); - path = WalletConnectV2AppShowWorker; + path = WalletConnectAppShowWorker; sourceTree = ""; }; ABC9A6E3A891AD336A1A5326 /* Zcash */ = { @@ -7072,7 +7007,7 @@ ABC9A71A64E11AD3709A1174 /* Workers */ = { isa = PBXGroup; children = ( - ABC9A6B0734FA399147D5BBB /* WalletConnectV2AppShowWorker */, + ABC9A6B0734FA399147D5BBB /* WalletConnectAppShowWorker */, ); path = Workers; sourceTree = ""; @@ -7101,10 +7036,10 @@ ABC9A99F726DF775B1321923 /* V2 */ = { isa = PBXGroup; children = ( - ABC9AAD79FD756DA69A52578 /* WalletConnectV2PendingRequestsViewController.swift */, - ABC9A2F6EDC8BB83ED7B75BA /* WalletConnectV2PendingRequestsModule.swift */, - ABC9AD3F677671FB57CCD886 /* WalletConnectV2PendingRequestsService.swift */, - ABC9AE15C187118DE6F0CE7B /* WalletConnectV2PendingRequestsViewModel.swift */, + ABC9AAD79FD756DA69A52578 /* WalletConnectPendingRequestsViewController.swift */, + ABC9A2F6EDC8BB83ED7B75BA /* WalletConnectPendingRequestsModule.swift */, + ABC9AD3F677671FB57CCD886 /* WalletConnectPendingRequestsService.swift */, + ABC9AE15C187118DE6F0CE7B /* WalletConnectPendingRequestsViewModel.swift */, ); path = V2; sourceTree = ""; @@ -7124,8 +7059,6 @@ ABC9A3BEB33F6DBE2395FD11 /* WalletConnectListService.swift */, ABC9AC09A586D88BAB3B9C67 /* WalletConnectListModule.swift */, ABC9A52AC277ED7563F2707F /* WalletConnectListViewModel.swift */, - ABC9AE408481275F22245AC1 /* V1 */, - ABC9A5D89330A9391B470BE5 /* V2 */, ); path = List; sourceTree = ""; @@ -7206,17 +7139,6 @@ path = Confirmation; sourceTree = ""; }; - ABC9AD1DF3675B6EA2EEB2E3 /* V2 */ = { - isa = PBXGroup; - children = ( - ABC9AFB38C3D5494BBD2D56E /* WalletConnectV2PairingService.swift */, - ABC9AA6A9EA3FAE9031A34C8 /* WalletConnectV2PairingModule.swift */, - ABC9AFD222C4514B22C3E43F /* WalletConnectV2PairingViewModel.swift */, - ABC9A11FA28631EE6EB4CA06 /* WalletConnectV2PairingViewController.swift */, - ); - path = V2; - sourceTree = ""; - }; ABC9AD43BE81A12A368EDF16 /* Platforms */ = { isa = PBXGroup; children = ( @@ -7264,15 +7186,6 @@ path = Overview; sourceTree = ""; }; - ABC9AE408481275F22245AC1 /* V1 */ = { - isa = PBXGroup; - children = ( - ABC9A7809A4A33BEBCFA3194 /* WalletConnectV1ListViewModel.swift */, - ABC9AA2DC16F947607B1794E /* WalletConnectV1ListView.swift */, - ); - path = V1; - sourceTree = ""; - }; ABC9AE67921B3AE4F6C6A5E2 /* PriceView */ = { isa = PBXGroup; children = ( @@ -7296,7 +7209,10 @@ ABC9AF0B88F3140CBD4406B8 /* Pairings */ = { isa = PBXGroup; children = ( - ABC9AD1DF3675B6EA2EEB2E3 /* V2 */, + ABC9A4BA46EDEEAB6CD9B25C /* WalletConnectPairingModule.swift */, + ABC9ACE88105815BFC477D71 /* WalletConnectPairingViewController.swift */, + ABC9A56ED1DB109A2E1F6EC1 /* WalletConnectPairingService.swift */, + ABC9AE62C0399849EFB5C158 /* WalletConnectPairingViewModel.swift */, ); path = Pairings; sourceTree = ""; @@ -8132,11 +8048,9 @@ 58AAAFDBA357FC699C07C334 /* AdditionalDataWithErrorView.swift in Sources */, 58AAA9053CD38F13CD944E2A /* SwapApproveAmountView.swift in Sources */, 58AAAFE644C1B236B9714B47 /* CoinSelectViewModel.swift in Sources */, - 11B35328A1DEC617A657A305 /* WalletConnectService.swift in Sources */, 50701ACF25B041E600EDE51B /* JailbreakTestManager.swift in Sources */, 11B3582D3298B7C072FBAD86 /* WalletConnectRequestViewController.swift in Sources */, 11B35D6C064BE981FDA401D6 /* WalletConnectInteractor.swift in Sources */, - 11B35A866A95D72FF5360F12 /* WalletConnectSessionManager.swift in Sources */, D36DE0C4272FD864000BC916 /* UniswapModule.swift in Sources */, D05E968E2A25D6C6002CCD71 /* Trc20Adapter.swift in Sources */, 11B355F32686B8689B4EC105 /* WalletConnectRequest.swift in Sources */, @@ -8208,7 +8122,6 @@ 58AAAA8975F5B63340672D00 /* MarketWatchlistService.swift in Sources */, 11B35B970E8949F968960796 /* MarketListViewController.swift in Sources */, 11B35B501A30615698B04C96 /* AddEvmTokenBlockchainService.swift in Sources */, - 11B35043A45A13D49CF7AE29 /* WalletConnectSession.swift in Sources */, 11B35E57C6406D2249A23E6F /* SendEvmTransactionService.swift in Sources */, 11B352AB213E0F3C147EAEE9 /* SendEvmTransactionViewController.swift in Sources */, D02A67CF272A7460009B2C1C /* Tweet.swift in Sources */, @@ -8572,39 +8485,29 @@ 1A564DBDAA43925DC8E39164 /* TraitsCell.swift in Sources */, 1A56441AD76BA80CB74902CB /* TraitCell.swift in Sources */, ABC9A9CF9BC0D1D10C291FDD /* UIViewController.swift in Sources */, - ABC9A40EB6EC886116806130 /* WalletConnectV2SessionManager.swift in Sources */, + ABC9A40EB6EC886116806130 /* WalletConnectSessionManager.swift in Sources */, 2FA5DC4BBDF469873662BDEE /* Eip1559EvmFeeViewModel.swift in Sources */, 2FA5D3C3D3AB41202B592640 /* Eip1559EvmFeeDataSource.swift in Sources */, - ABC9ABC09321233E1727A8DD /* WalletConnectV2Session.swift in Sources */, + ABC9ABC09321233E1727A8DD /* WalletConnectSession.swift in Sources */, 11B359C05619611CBCFC89AC /* EvmBlockchainManager.swift in Sources */, ABC9A2542EA47C2ED85C06B9 /* WalletConnectListViewController.swift in Sources */, ABC9A7A9E27CC5F93BE5018B /* WalletConnectListService.swift in Sources */, ABC9A5C2E2976341520D2F6D /* WalletConnectListModule.swift in Sources */, ABC9ADCDC949C4C63D1260DE /* WalletConnectListViewModel.swift in Sources */, - ABC9AF64794A2AFC6106DCF3 /* WalletConnectV1ListViewModel.swift in Sources */, - ABC9A30459A3D9922CCF2E26 /* WalletConnectV1ListView.swift in Sources */, - ABC9A08E14B61C478C342548 /* WalletConnectEvmChainParser.swift in Sources */, - ABC9A5F17C3512899E18F43A /* WalletConnectV2ListViewModel.swift in Sources */, - ABC9A7219A4F94D981558DC2 /* WalletConnectV2ListView.swift in Sources */, ABC9A85FAA53B6FB01F94171 /* WalletConnectScanQrViewModel.swift in Sources */, - ABC9AB8A9028DC1488166ABC /* WalletConnectV2PendingRequestsViewController.swift in Sources */, - ABC9A040EA0B56AF76D01855 /* WalletConnectV2PendingRequestsModule.swift in Sources */, - ABC9A83233DA4C83AF83E483 /* WalletConnectV2PendingRequestsService.swift in Sources */, - ABC9A82D771D920162551294 /* WalletConnectV2PendingRequestsViewModel.swift in Sources */, + ABC9AB8A9028DC1488166ABC /* WalletConnectPendingRequestsViewController.swift in Sources */, + ABC9A040EA0B56AF76D01855 /* WalletConnectPendingRequestsModule.swift in Sources */, + ABC9A83233DA4C83AF83E483 /* WalletConnectPendingRequestsService.swift in Sources */, + ABC9A82D771D920162551294 /* WalletConnectPendingRequestsViewModel.swift in Sources */, ABC9AEA5C042362B5B5BE81C /* WalletConnectMainModule.swift in Sources */, ABC9AE863B44E921F58DF3EA /* WalletConnectMainViewController.swift in Sources */, - ABC9AE66F6D18A152EC7FD15 /* WalletConnectV1MainRequestViewModel.swift in Sources */, D087628129815E8400E6FFD4 /* ChooseCoinService.swift in Sources */, - ABC9A5A0E47C6A90F30382E2 /* WalletConnectV1MainService.swift in Sources */, - ABC9A506478A295F78F2A63B /* WalletConnectV1MainRequestView.swift in Sources */, ABC9A4801E4964F6AED1E667 /* WalletConnectMainViewModel.swift in Sources */, - ABC9A85215E0CCEFE2CB83C7 /* WalletConnectV2MainService.swift in Sources */, - ABC9A251119A2486465B315E /* WalletConnectV2Service.swift in Sources */, + ABC9A251119A2486465B315E /* WalletConnectService.swift in Sources */, ABC9AB86218564E4873F6428 /* WalletConnectUriHandler.swift in Sources */, - ABC9ABAE470C553AE5E80A9F /* WalletConnectSessionKiller.swift in Sources */, ABC9A9E3191338CD0D1DE8AE /* WalletConnectModule.swift in Sources */, D09D76922A2E0753004311E6 /* SendTronConfirmationViewModel.swift in Sources */, - ABC9A2FF431ACFA812F58AD1 /* WalletConnectV2RequestMapper.swift in Sources */, + ABC9A2FF431ACFA812F58AD1 /* WalletConnectRequestMapper.swift in Sources */, ABC9A4566EA1995007490C0D /* SendFeeViewModel.swift in Sources */, ABC9A6C0A45A33C83B632D58 /* SendFeeService.swift in Sources */, ABC9AE6D877341985A6F651F /* SendBitcoinAmountInputService.swift in Sources */, @@ -8628,8 +8531,7 @@ 11B3503BF015EA47E1061122 /* AccountRecordStorage.swift in Sources */, 11B356A4B22FA16BE27AFAB1 /* LogRecordStorage.swift in Sources */, 11B35968A3A43727ED6FB0B7 /* FavoriteCoinRecordStorage.swift in Sources */, - 11B35927181B6E08C7001FBC /* WalletConnectSessionStorage.swift in Sources */, - 11B350354CCA9BDDC05A9CBA /* WalletConnectV2SessionStorage.swift in Sources */, + 11B350354CCA9BDDC05A9CBA /* WalletConnectSessionStorage.swift in Sources */, 11B35890939A3326B352A0FB /* ActiveAccountStorage.swift in Sources */, 11B35AC33360F772120B9562 /* RestoreSettingsStorage.swift in Sources */, 11B35729848FDBC47F038553 /* AppVersionRecordStorage.swift in Sources */, @@ -8750,7 +8652,7 @@ 1A5648C0787EBA8CDCB6F761 /* ReachabilityService.swift in Sources */, 1A564406716193E4A2D9075F /* ReachabilityViewModel.swift in Sources */, 1A5644FE2885F71299CC66EA /* PlaceholderViewModule.swift in Sources */, - ABC9AAB720B0187F782E18AB /* WalletConnectV2SocketConnectionService.swift in Sources */, + ABC9AAB720B0187F782E18AB /* WalletConnectSocketConnectionService.swift in Sources */, 11B355A721E0D46706485A6C /* TransactionsModule.swift in Sources */, 11B35516B09BF11EDC33482F /* TransactionsService.swift in Sources */, 11B3556B3FAAA6B1FA63C8B1 /* TransactionsViewModel.swift in Sources */, @@ -8863,15 +8765,11 @@ 11B35C1823E7C3F02864133C /* WatchPublicKeyViewModel.swift in Sources */, 2FA5D47663BD8C2F6E4DE912 /* PassphraseValidator.swift in Sources */, ABC9A1FFFB4F9EC58BF78661 /* AccountRestoreWarningManager.swift in Sources */, - ABC9AB90B6DF671F213642B0 /* WalletConnectV2PairingService.swift in Sources */, - ABC9A9568395FB2EB273571B /* WalletConnectV2PairingModule.swift in Sources */, - ABC9A19A110AA6F55FADB3EE /* WalletConnectV2PairingViewModel.swift in Sources */, - ABC9A9D2A3567747CC105B0E /* WalletConnectV2PairingViewController.swift in Sources */, - ABC9A51E36466E414AF24C67 /* WalletConnectV2MainPendingRequestViewModel.swift in Sources */, - ABC9A6A484F9B3F7F1054379 /* WalletConnectV2MainPendingRequestService.swift in Sources */, - ABC9A1117A41AB8CE00FDEDB /* WalletConnectV2AppShowView.swift in Sources */, - ABC9ADD2F99F8C6A6C346FCC /* WalletConnectV2AppShowService.swift in Sources */, - ABC9AC78B2D374511F751997 /* WalletConnectV2AppShowViewModel.swift in Sources */, + ABC9A51E36466E414AF24C67 /* WalletConnectMainPendingRequestViewModel.swift in Sources */, + ABC9A6A484F9B3F7F1054379 /* WalletConnectMainPendingRequestService.swift in Sources */, + ABC9A1117A41AB8CE00FDEDB /* WalletConnectAppShowView.swift in Sources */, + ABC9ADD2F99F8C6A6C346FCC /* WalletConnectAppShowService.swift in Sources */, + ABC9AC78B2D374511F751997 /* WalletConnectAppShowViewModel.swift in Sources */, 2FA5D342449885CF8D58B704 /* HdWalletExtensions.swift in Sources */, ABC9A2545322919129F163D5 /* SwapInputCardView.swift in Sources */, ABC9AA78419B8BFEC23E8E02 /* TokenSelectView.swift in Sources */, @@ -9179,6 +9077,11 @@ 11B35FA70EB07440E1576A56 /* RowButton.swift in Sources */, 11B35CA92AA402BE72B4F5D6 /* Image.swift in Sources */, ABC9AD2688A8DF327A3F92FC /* NoAccountWalletTokenListService.swift in Sources */, + ABC9A3FCFC46EC73A7E57EA3 /* WalletConnectPairingModule.swift in Sources */, + ABC9ABFA7299ADDDFEE918F7 /* WalletConnectPairingViewController.swift in Sources */, + ABC9A0337DAB77500E7A631D /* WalletConnectPairingService.swift in Sources */, + ABC9ADAAB5CC80BBE7E1D9FE /* WalletConnectPairingViewModel.swift in Sources */, + ABC9A0B37693470DAD0FFE20 /* WalletConnectMainService.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -9419,12 +9322,10 @@ 58AAAAC61D3D8AD1AC4BEEAE /* AdditionalDataWithErrorView.swift in Sources */, 58AAACD7A57AA93736CDB54D /* SwapApproveAmountView.swift in Sources */, 58AAA29F80AC65D37BD1D289 /* CoinSelectViewModel.swift in Sources */, - 11B3543FCB1C67619A0DAA27 /* WalletConnectService.swift in Sources */, 50701ACE25B041E600EDE51B /* JailbreakTestManager.swift in Sources */, 11B35A8456750E9838BBEA93 /* WalletConnectRequestViewController.swift in Sources */, D36DE0F6272FD92F000BC916 /* SwapSelectProviderViewController.swift in Sources */, 11B357CD9544E312865CE36F /* WalletConnectInteractor.swift in Sources */, - 11B35FCBBA5007F4CA25BA0A /* WalletConnectSessionManager.swift in Sources */, D05E968D2A25D6C6002CCD71 /* Trc20Adapter.swift in Sources */, 11B350D6CBB602F510882F1E /* WalletConnectRequest.swift in Sources */, 11B359E8FA2FD4E7CF6A40AD /* WalletConnectRequestModule.swift in Sources */, @@ -9495,7 +9396,6 @@ 58AAA8D67EB6C19719BD760B /* MarketWatchlistService.swift in Sources */, 11B35C8E09922F59B200E347 /* MarketListViewController.swift in Sources */, 11B3556FCACE2ECE022138DF /* AddEvmTokenBlockchainService.swift in Sources */, - 11B35201583EC6E1EB476ADB /* WalletConnectSession.swift in Sources */, 11B355FAD0E7823AF5F8EC83 /* SendEvmTransactionService.swift in Sources */, 11B355967997A7C65B008BC7 /* SendEvmTransactionViewController.swift in Sources */, D06669022A31B559004B048D /* TronRecipientAddressViewModel.swift in Sources */, @@ -9861,39 +9761,29 @@ 1A564D02348C91416FD011FC /* TraitsCell.swift in Sources */, 1A5649CEE6EFCC06A10F69CF /* TraitCell.swift in Sources */, ABC9A3C3FC55AB33A9896382 /* UIViewController.swift in Sources */, - ABC9A9AC7890BE4AAE7DDC84 /* WalletConnectV2SessionManager.swift in Sources */, + ABC9A9AC7890BE4AAE7DDC84 /* WalletConnectSessionManager.swift in Sources */, 2FA5D18A57B386FD3A4384BA /* Eip1559EvmFeeViewModel.swift in Sources */, 2FA5DA30F665BF2C170210C8 /* Eip1559EvmFeeDataSource.swift in Sources */, 2FA5DB3D429B482B2B209977 /* Eip1559GasPriceService.swift in Sources */, - ABC9A7A9053C6ECF618D0E4A /* WalletConnectV2Session.swift in Sources */, + ABC9A7A9053C6ECF618D0E4A /* WalletConnectSession.swift in Sources */, 11B35349D234724EE34956A0 /* EvmBlockchainManager.swift in Sources */, ABC9A3613C5477C07F37F48C /* WalletConnectListViewController.swift in Sources */, ABC9A2E71264B12B7FFC3736 /* WalletConnectListService.swift in Sources */, ABC9A3114AEA853305A33586 /* WalletConnectListModule.swift in Sources */, ABC9A32176DC914BBB4E9BFF /* WalletConnectListViewModel.swift in Sources */, - ABC9A3DD58A1F5566B9D6182 /* WalletConnectV1ListViewModel.swift in Sources */, - ABC9A3DCC68C65EFF44509B7 /* WalletConnectV1ListView.swift in Sources */, - ABC9AE4FBE95C870F2198D68 /* WalletConnectEvmChainParser.swift in Sources */, - ABC9A0D8D596A7122B2DDD97 /* WalletConnectV2ListViewModel.swift in Sources */, - ABC9A79835648674C5943A6F /* WalletConnectV2ListView.swift in Sources */, ABC9AB0F8FE5808DB889C081 /* WalletConnectScanQrViewModel.swift in Sources */, - ABC9A5D74CE790A6DEF71777 /* WalletConnectV2PendingRequestsViewController.swift in Sources */, - ABC9A5CFD2FF8B73B7AC9B8E /* WalletConnectV2PendingRequestsModule.swift in Sources */, - ABC9A395A96C1F7C30F21940 /* WalletConnectV2PendingRequestsService.swift in Sources */, - ABC9ADDF8BF51151BDB4D513 /* WalletConnectV2PendingRequestsViewModel.swift in Sources */, + ABC9A5D74CE790A6DEF71777 /* WalletConnectPendingRequestsViewController.swift in Sources */, + ABC9A5CFD2FF8B73B7AC9B8E /* WalletConnectPendingRequestsModule.swift in Sources */, + ABC9A395A96C1F7C30F21940 /* WalletConnectPendingRequestsService.swift in Sources */, + ABC9ADDF8BF51151BDB4D513 /* WalletConnectPendingRequestsViewModel.swift in Sources */, ABC9A5DB0B5E6D82560A41D8 /* WalletConnectMainModule.swift in Sources */, ABC9A727EC8A3C74C9C1A31A /* WalletConnectMainViewController.swift in Sources */, - ABC9AFC2E1155B5C87DC9F0E /* WalletConnectV1MainRequestViewModel.swift in Sources */, - ABC9A06616429B8BA46D262C /* WalletConnectV1MainService.swift in Sources */, D087628029815E8400E6FFD4 /* ChooseCoinService.swift in Sources */, - ABC9AE50CB44A21D0274384F /* WalletConnectV1MainRequestView.swift in Sources */, ABC9A1D021B4E9ACCE3DE0BA /* WalletConnectMainViewModel.swift in Sources */, - ABC9A3D6BA1A316A385B0A53 /* WalletConnectV2MainService.swift in Sources */, - ABC9ADF2CFB90B882B5DE3F9 /* WalletConnectV2Service.swift in Sources */, + ABC9ADF2CFB90B882B5DE3F9 /* WalletConnectService.swift in Sources */, ABC9A4F4B7F17169DC240A98 /* WalletConnectUriHandler.swift in Sources */, - ABC9A01AE17801DE7100B10B /* WalletConnectSessionKiller.swift in Sources */, ABC9AA27A709AC5F85176A53 /* WalletConnectModule.swift in Sources */, - ABC9A736DDFBF98473C065F7 /* WalletConnectV2RequestMapper.swift in Sources */, + ABC9A736DDFBF98473C065F7 /* WalletConnectRequestMapper.swift in Sources */, ABC9ABC375B65451761D4766 /* SendFeeViewModel.swift in Sources */, ABC9A933C2603486BA181B19 /* SendFeeService.swift in Sources */, ABC9A4B643D98FB95F431401 /* SendBitcoinAmountInputService.swift in Sources */, @@ -9917,8 +9807,7 @@ 11B356C081AC552CBDA9147B /* AccountRecordStorage.swift in Sources */, 11B35727A4950C1E066F2244 /* LogRecordStorage.swift in Sources */, 11B3532D56D7D1F8286B39AC /* FavoriteCoinRecordStorage.swift in Sources */, - 11B350EF484B6A02FA41EC27 /* WalletConnectSessionStorage.swift in Sources */, - 11B35262B98EA59CDA12DF97 /* WalletConnectV2SessionStorage.swift in Sources */, + 11B35262B98EA59CDA12DF97 /* WalletConnectSessionStorage.swift in Sources */, 11B350ACC851B0F8C911AC3E /* ActiveAccountStorage.swift in Sources */, 11B35A2DC1B9521150F81EA6 /* RestoreSettingsStorage.swift in Sources */, 11B35D5B873123BC2D3909EF /* AppVersionRecordStorage.swift in Sources */, @@ -10038,7 +9927,7 @@ 1A56483DCD5E1942AFAC0A1C /* ReachabilityService.swift in Sources */, 1A564B1C354CEC471841AEB9 /* ReachabilityViewModel.swift in Sources */, 1A564E69BA99DF8CD4562902 /* PlaceholderViewModule.swift in Sources */, - ABC9A91D03FB46F6AD21EEF4 /* WalletConnectV2SocketConnectionService.swift in Sources */, + ABC9A91D03FB46F6AD21EEF4 /* WalletConnectSocketConnectionService.swift in Sources */, 11B3564FBC180A0E6D30BCFA /* TransactionsModule.swift in Sources */, 11B3501BA3EA411F93E9C694 /* TransactionsService.swift in Sources */, 11B3540DFB757438B38C793F /* TransactionsViewModel.swift in Sources */, @@ -10151,15 +10040,11 @@ 11B35FE7DA00590FF95854FF /* WatchPublicKeyViewModel.swift in Sources */, 2FA5D9E03826EE05AA6A83C3 /* PassphraseValidator.swift in Sources */, ABC9A9FA3285B39D25801C2A /* AccountRestoreWarningManager.swift in Sources */, - ABC9A12E32EC45F56B612B06 /* WalletConnectV2PairingService.swift in Sources */, - ABC9A293A1192758CE3F6B83 /* WalletConnectV2PairingModule.swift in Sources */, - ABC9AAB941B036B4CA08334B /* WalletConnectV2PairingViewModel.swift in Sources */, - ABC9A824BB54B9EB36425663 /* WalletConnectV2PairingViewController.swift in Sources */, - ABC9A2EEC77205793C21F9A1 /* WalletConnectV2MainPendingRequestViewModel.swift in Sources */, - ABC9A9221E4FF0734089BCAB /* WalletConnectV2MainPendingRequestService.swift in Sources */, - ABC9AC850D83253B2B6FBD0A /* WalletConnectV2AppShowView.swift in Sources */, - ABC9A1994630FAD8B42DDF67 /* WalletConnectV2AppShowService.swift in Sources */, - ABC9AB71563E5F2C9F2EA9E4 /* WalletConnectV2AppShowViewModel.swift in Sources */, + ABC9A2EEC77205793C21F9A1 /* WalletConnectMainPendingRequestViewModel.swift in Sources */, + ABC9A9221E4FF0734089BCAB /* WalletConnectMainPendingRequestService.swift in Sources */, + ABC9AC850D83253B2B6FBD0A /* WalletConnectAppShowView.swift in Sources */, + ABC9A1994630FAD8B42DDF67 /* WalletConnectAppShowService.swift in Sources */, + ABC9AB71563E5F2C9F2EA9E4 /* WalletConnectAppShowViewModel.swift in Sources */, 2FA5DAFBFC02E2E70EA0D971 /* HdWalletExtensions.swift in Sources */, ABC9A618B77A70D94E269D6B /* SwapInputCardView.swift in Sources */, ABC9A51979D2047BEF45A2AE /* TokenSelectView.swift in Sources */, @@ -10465,6 +10350,11 @@ 11B35631BD5C6570C9359BEC /* RowButton.swift in Sources */, 11B3541ED37746BAFF1832BA /* Image.swift in Sources */, ABC9AC5671A5EA9BF5ACBC5D /* NoAccountWalletTokenListService.swift in Sources */, + ABC9A9CDDC14BA6259450ECA /* WalletConnectPairingModule.swift in Sources */, + ABC9A8541A21123726AC8E7B /* WalletConnectPairingViewController.swift in Sources */, + ABC9A6D1CDF470FB73EF4816 /* WalletConnectPairingService.swift in Sources */, + ABC9A92D7F9ADCE00CBCED09 /* WalletConnectPairingViewModel.swift in Sources */, + ABC9A2559D001CA67E8F10C7 /* WalletConnectMainService.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/UnstoppableWallet/UnstoppableWallet/Core/App.swift b/UnstoppableWallet/UnstoppableWallet/Core/App.swift index c9208505dd..19a7a091e0 100644 --- a/UnstoppableWallet/UnstoppableWallet/Core/App.swift +++ b/UnstoppableWallet/UnstoppableWallet/Core/App.swift @@ -86,9 +86,8 @@ class App { let guidesManager: GuidesManager let termsManager: TermsManager + let walletConnectSocketConnectionService: WalletConnectSocketConnectionService let walletConnectSessionManager: WalletConnectSessionManager - let walletConnectV2SocketConnectionService: WalletConnectV2SocketConnectionService - let walletConnectV2SessionManager: WalletConnectV2SessionManager let walletConnectManager: WalletConnectManager let deepLinkManager: DeepLinkManager @@ -269,8 +268,6 @@ class App { guidesManager = GuidesManager(networkManager: networkManager) termsManager = TermsManager(storage: StorageKit.LocalStorage.default) - let walletConnectSessionStorage = WalletConnectSessionStorage(dbPool: dbPool) - walletConnectSessionManager = WalletConnectSessionManager(storage: walletConnectSessionStorage, accountManager: accountManager, evmBlockchainManager: evmBlockchainManager) walletConnectManager = WalletConnectManager(accountManager: accountManager, evmBlockchainManager: evmBlockchainManager) let walletClientInfo = WalletConnectClientInfo( @@ -282,15 +279,15 @@ class App { icons: ["https://raw.githubusercontent.com/horizontalsystems/HS-Design/master/PressKit/UW-AppIcon-on-light.png"] ) - walletConnectV2SocketConnectionService = WalletConnectV2SocketConnectionService(reachabilityManager: reachabilityManager, logger: logger) - let walletConnectV2Service = WalletConnectV2Service( - connectionService: walletConnectV2SocketConnectionService, + walletConnectSocketConnectionService = WalletConnectSocketConnectionService(reachabilityManager: reachabilityManager, logger: logger) + let walletConnectService = WalletConnectService( + connectionService: walletConnectSocketConnectionService, sessionRequestFilterManager: SessionRequestFilterManager(), info: walletClientInfo, logger: logger ) - let walletConnectV2SessionStorage = WalletConnectV2SessionStorage(dbPool: dbPool) - walletConnectV2SessionManager = WalletConnectV2SessionManager(service: walletConnectV2Service, storage: walletConnectV2SessionStorage, accountManager: accountManager, evmBlockchainManager: evmBlockchainManager, currentDateProvider: CurrentDateProvider()) + let walletConnectSessionStorage = WalletConnectSessionStorage(dbPool: dbPool) + walletConnectSessionManager = WalletConnectSessionManager(service: walletConnectService, storage: walletConnectSessionStorage, accountManager: accountManager, evmBlockchainManager: evmBlockchainManager, currentDateProvider: CurrentDateProvider()) deepLinkManager = DeepLinkManager() launchScreenManager = LaunchScreenManager(storage: StorageKit.LocalStorage.default) @@ -321,7 +318,7 @@ class App { deepLinkManager: deepLinkManager, evmLabelManager: evmLabelManager, balanceHiddenManager: balanceHiddenManager, - walletConnectV2SocketConnectionService: walletConnectV2SocketConnectionService, + walletConnectSocketConnectionService: walletConnectSocketConnectionService, nftMetadataSyncer: nftMetadataSyncer ) } diff --git a/UnstoppableWallet/UnstoppableWallet/Core/Managers/AppManager.swift b/UnstoppableWallet/UnstoppableWallet/Core/Managers/AppManager.swift index f01c1c6251..e433dc178b 100644 --- a/UnstoppableWallet/UnstoppableWallet/Core/Managers/AppManager.swift +++ b/UnstoppableWallet/UnstoppableWallet/Core/Managers/AppManager.swift @@ -18,7 +18,7 @@ class AppManager { private let deepLinkManager: DeepLinkManager private let evmLabelManager: EvmLabelManager private let balanceHiddenManager: BalanceHiddenManager - private let walletConnectV2SocketConnectionService: WalletConnectV2SocketConnectionService + private let walletConnectSocketConnectionService: WalletConnectSocketConnectionService private let nftMetadataSyncer: NftMetadataSyncer private let didBecomeActiveSubject = PublishSubject<()>() @@ -30,7 +30,7 @@ class AppManager { appVersionManager: AppVersionManager, rateAppManager: RateAppManager, logRecordManager: LogRecordManager, deepLinkManager: DeepLinkManager, evmLabelManager: EvmLabelManager, balanceHiddenManager: BalanceHiddenManager, - walletConnectV2SocketConnectionService: WalletConnectV2SocketConnectionService, nftMetadataSyncer: NftMetadataSyncer + walletConnectSocketConnectionService: WalletConnectSocketConnectionService, nftMetadataSyncer: NftMetadataSyncer ) { self.accountManager = accountManager self.walletManager = walletManager @@ -46,7 +46,7 @@ class AppManager { self.deepLinkManager = deepLinkManager self.evmLabelManager = evmLabelManager self.balanceHiddenManager = balanceHiddenManager - self.walletConnectV2SocketConnectionService = walletConnectV2SocketConnectionService + self.walletConnectSocketConnectionService = walletConnectSocketConnectionService self.nftMetadataSyncer = nftMetadataSyncer } @@ -85,7 +85,7 @@ extension AppManager { debugBackgroundLogger?.logEnterBackground() pinKit.didEnterBackground() - walletConnectV2SocketConnectionService.didEnterBackground() + walletConnectSocketConnectionService.didEnterBackground() balanceHiddenManager.didEnterBackground() } @@ -99,7 +99,7 @@ extension AppManager { keychainKit.handleForeground() pinKit.willEnterForeground() adapterManager.refresh() - walletConnectV2SocketConnectionService.willEnterForeground() + walletConnectSocketConnectionService.willEnterForeground() nftMetadataSyncer.sync() } diff --git a/UnstoppableWallet/UnstoppableWallet/Core/Managers/WalletConnectV2SessionManager.swift b/UnstoppableWallet/UnstoppableWallet/Core/Managers/WalletConnectSessionManager.swift similarity index 85% rename from UnstoppableWallet/UnstoppableWallet/Core/Managers/WalletConnectV2SessionManager.swift rename to UnstoppableWallet/UnstoppableWallet/Core/Managers/WalletConnectSessionManager.swift index 51ec09f2ed..6803a6f459 100644 --- a/UnstoppableWallet/UnstoppableWallet/Core/Managers/WalletConnectV2SessionManager.swift +++ b/UnstoppableWallet/UnstoppableWallet/Core/Managers/WalletConnectSessionManager.swift @@ -5,11 +5,11 @@ import WalletConnectSign import WalletConnectPairing import MarketKit -class WalletConnectV2SessionManager { +class WalletConnectSessionManager { private let disposeBag = DisposeBag() - let service: WalletConnectV2Service - private let storage: WalletConnectV2SessionStorage + let service: WalletConnectService + private let storage: WalletConnectSessionStorage private let accountManager: AccountManager private let currentDateProvider: CurrentDateProvider private let evmBlockchainManager: EvmBlockchainManager @@ -19,7 +19,7 @@ class WalletConnectV2SessionManager { private let pairingsRelay = BehaviorRelay<[WalletConnectPairing.Pairing]>(value: []) private let sessionRequestReceivedRelay = PublishRelay() - init(service: WalletConnectV2Service, storage: WalletConnectV2SessionStorage, accountManager: AccountManager, evmBlockchainManager: EvmBlockchainManager, currentDateProvider: CurrentDateProvider) { + init(service: WalletConnectService, storage: WalletConnectSessionStorage, accountManager: AccountManager, evmBlockchainManager: EvmBlockchainManager, currentDateProvider: CurrentDateProvider) { self.service = service self.storage = storage self.accountManager = accountManager @@ -50,7 +50,7 @@ class WalletConnectV2SessionManager { } private func handleDeleted(account: Account) { - storage.deleteSessionsV2(accountId: account.id) + storage.deleteSessions(accountId: account.id) syncSessions() syncPendingRequest() } @@ -66,7 +66,7 @@ class WalletConnectV2SessionManager { } let currentSessions = allSessions - let allDbSessions = storage.sessionsV2(accountId: nil) + let allDbSessions = storage.sessions(accountId: nil) let dbTopics = allDbSessions.map { $0.topic } @@ -81,9 +81,9 @@ class WalletConnectV2SessionManager { } storage.save(sessions: newSessions.map { - WalletConnectV2Session(accountId: accountId, topic: $0.topic) + WalletConnectSession(accountId: accountId, topic: $0.topic) }) - storage.deleteSessionV2(topics: deletedTopics) + storage.deleteSession(topics: deletedTopics) sessionsRelay.accept(sessions(accountId: accountId, sessions: currentSessions)) activePendingRequestsRelay.accept(activePendingRequests) @@ -93,7 +93,7 @@ class WalletConnectV2SessionManager { guard let account = accountManager.activeAccount else { return } - let activeSessions = storage.sessionsV2(accountId: account.id) + let activeSessions = storage.sessions(accountId: account.id) guard let chainId = Int(request.chainId.reference), let blockchain = evmBlockchainManager.blockchain(chainId: chainId), @@ -107,7 +107,7 @@ class WalletConnectV2SessionManager { let chain = WalletConnectRequest.Chain(id: chainId, chainName: blockchain.name, address: address.eip55) guard activeSessions.first(where: { session in session.topic == request.topic }) != nil, let session = allSessions.first(where: { session in session.topic == request.topic }), - let request = try? WalletConnectV2RequestMapper.map(dAppName: session.peer.name, chain: chain, request: request) else { + let request = try? WalletConnectRequestMapper.map(dAppName: session.peer.name, chain: chain, request: request) else { return } @@ -116,7 +116,7 @@ class WalletConnectV2SessionManager { private func sessions(accountId: String, sessions: [WalletConnectSign.Session]?) -> [WalletConnectSign.Session] { let sessions = sessions ?? allSessions - let dbSessions = storage.sessionsV2(accountId: accountId) + let dbSessions = storage.sessions(accountId: accountId) let accountSessions = sessions.filter { session in dbSessions.contains { @@ -147,7 +147,7 @@ class WalletConnectV2SessionManager { private func requests(accountId: String? = nil) -> [WalletConnectSign.Request] { let allRequests = service.pendingRequests - let dbSessions = storage.sessionsV2(accountId: accountId) + let dbSessions = storage.sessions(accountId: accountId) return allRequests.filter { request in dbSessions.contains { session in @@ -158,7 +158,7 @@ class WalletConnectV2SessionManager { } -extension WalletConnectV2SessionManager { +extension WalletConnectSessionManager { public var sessions: [WalletConnectSign.Session] { guard let accountId = accountManager.activeAccount?.id else { @@ -179,7 +179,7 @@ extension WalletConnectV2SessionManager { } public func deleteSession(topic: String) { - service.disconnect(topic: topic, reason: WalletConnectV2MainService.RejectionReason(code: 1, message: "Session Killed by User")) + service.disconnect(topic: topic, reason: WalletConnectMainService.RejectionReason(code: 1, message: "Session Killed by User")) } public var activePendingRequests: [WalletConnectSign.Request] { diff --git a/UnstoppableWallet/UnstoppableWallet/Core/Storage/StorageMigrator.swift b/UnstoppableWallet/UnstoppableWallet/Core/Storage/StorageMigrator.swift index 469f20b49c..521395a3c1 100644 --- a/UnstoppableWallet/UnstoppableWallet/Core/Storage/StorageMigrator.swift +++ b/UnstoppableWallet/UnstoppableWallet/Core/Storage/StorageMigrator.swift @@ -327,18 +327,6 @@ class StorageMigrator { } } - migrator.registerMigration("createWalletConnectSessions") { db in - try db.create(table: WalletConnectSession.databaseTableName) { t in - t.column(WalletConnectSession.Columns.chainId.name, .integer).notNull() - t.column(WalletConnectSession.Columns.accountId.name, .text).notNull() - t.column(WalletConnectSession.Columns.session.name, .text).notNull() - t.column(WalletConnectSession.Columns.peerId.name, .text).notNull() - t.column(WalletConnectSession.Columns.peerMeta.name, .text).notNull() - - t.primaryKey([WalletConnectSession.Columns.chainId.name, WalletConnectSession.Columns.accountId.name, WalletConnectSession.Columns.peerId.name], onConflict: .replace) - } - } - migrator.registerMigration("extractCoinsAndChangeCoinIds") { db in // apply changes in database try db.drop(table: CoinRecord_v19.databaseTableName) @@ -532,11 +520,11 @@ class StorageMigrator { } migrator.registerMigration("createWalletConnectV2Sessions") { db in - try db.create(table: WalletConnectV2Session.databaseTableName) { t in - t.column(WalletConnectV2Session.Columns.accountId.name, .text).notNull() - t.column(WalletConnectV2Session.Columns.topic.name, .text).notNull() + try db.create(table: WalletConnectSession.databaseTableName) { t in + t.column(WalletConnectSession.Columns.accountId.name, .text).notNull() + t.column(WalletConnectSession.Columns.topic.name, .text).notNull() - t.primaryKey([WalletConnectV2Session.Columns.accountId.name, WalletConnectV2Session.Columns.topic.name], onConflict: .replace) + t.primaryKey([WalletConnectSession.Columns.accountId.name, WalletConnectSession.Columns.topic.name], onConflict: .replace) } } diff --git a/UnstoppableWallet/UnstoppableWallet/Core/Storage/WalletConnectSessionStorage.swift b/UnstoppableWallet/UnstoppableWallet/Core/Storage/WalletConnectSessionStorage.swift index 9dc5c46edb..8c41e1f696 100644 --- a/UnstoppableWallet/UnstoppableWallet/Core/Storage/WalletConnectSessionStorage.swift +++ b/UnstoppableWallet/UnstoppableWallet/Core/Storage/WalletConnectSessionStorage.swift @@ -11,27 +11,29 @@ class WalletConnectSessionStorage { extension WalletConnectSessionStorage { - func sessions(accountId: String) -> [WalletConnectSession] { + func sessions(accountId: String?) -> [WalletConnectSession] { try! dbPool.read { db in - try WalletConnectSession.filter(WalletConnectSession.Columns.accountId == accountId).fetchAll(db) + var request = WalletConnectSession.all() + if let accountId = accountId { + request = request.filter(WalletConnectSession.Columns.accountId == accountId) + } + return try request.fetchAll(db) } } - func session(peerId: String, accountId: String) -> WalletConnectSession? { - try! dbPool.read { db in - try WalletConnectSession.filter(WalletConnectSession.Columns.peerId == peerId && WalletConnectSession.Columns.accountId == accountId).fetchOne(db) - } - } - - func save(session: WalletConnectSession) { + func save(sessions: [WalletConnectSession]) { _ = try! dbPool.write { db in - try session.insert(db) + for session in sessions { + try session.insert(db) + } } } - func deleteSession(peerId: String) { + func deleteSession(topics: [String]) { _ = try! dbPool.write { db in - try WalletConnectSession.filter(WalletConnectSession.Columns.peerId == peerId).deleteAll(db) + for topic in topics { + try WalletConnectSession.filter(WalletConnectSession.Columns.topic == topic).deleteAll(db) + } } } diff --git a/UnstoppableWallet/UnstoppableWallet/Core/Storage/WalletConnectV2SessionStorage.swift b/UnstoppableWallet/UnstoppableWallet/Core/Storage/WalletConnectV2SessionStorage.swift deleted file mode 100644 index 22d81a9f07..0000000000 --- a/UnstoppableWallet/UnstoppableWallet/Core/Storage/WalletConnectV2SessionStorage.swift +++ /dev/null @@ -1,46 +0,0 @@ -import GRDB - -class WalletConnectV2SessionStorage { - private let dbPool: DatabasePool - - init(dbPool: DatabasePool) { - self.dbPool = dbPool - } - -} - -extension WalletConnectV2SessionStorage { - - func sessionsV2(accountId: String?) -> [WalletConnectV2Session] { - try! dbPool.read { db in - var request = WalletConnectV2Session.all() - if let accountId = accountId { - request = request.filter(WalletConnectV2Session.Columns.accountId == accountId) - } - return try request.fetchAll(db) - } - } - - func save(sessions: [WalletConnectV2Session]) { - _ = try! dbPool.write { db in - for session in sessions { - try session.insert(db) - } - } - } - - func deleteSessionV2(topics: [String]) { - _ = try! dbPool.write { db in - for topic in topics { - try WalletConnectV2Session.filter(WalletConnectV2Session.Columns.topic == topic).deleteAll(db) - } - } - } - - func deleteSessionsV2(accountId: String) { - _ = try! dbPool.write { db in - try WalletConnectV2Session.filter(WalletConnectV2Session.Columns.accountId == accountId).deleteAll(db) - } - } - -} diff --git a/UnstoppableWallet/UnstoppableWallet/Models/WalletConnectSession.swift b/UnstoppableWallet/UnstoppableWallet/Models/WalletConnectSession.swift index ce876b6bfa..c74986c4e8 100644 --- a/UnstoppableWallet/UnstoppableWallet/Models/WalletConnectSession.swift +++ b/UnstoppableWallet/UnstoppableWallet/Models/WalletConnectSession.swift @@ -1,31 +1,21 @@ import GRDB -import WalletConnectV1 class WalletConnectSession: Codable, FetchableRecord, PersistableRecord, TableRecord { - let chainId: Int let accountId: String - let session: WCSession - let peerId: String - let peerMeta: WCPeerMeta + let topic: String - init(chainId: Int, accountId: String, session: WCSession, peerId: String, peerMeta: WCPeerMeta) { - self.chainId = chainId + init(accountId: String, topic: String) { self.accountId = accountId - self.session = session - self.peerId = peerId - self.peerMeta = peerMeta + self.topic = topic } class var databaseTableName: String { - "wallet_connect_sessions" + "wallet_connect_sessions_v2" } enum Columns { - static let chainId = Column(CodingKeys.chainId) static let accountId = Column(CodingKeys.accountId) - static let session = Column(CodingKeys.session) - static let peerId = Column(CodingKeys.peerId) - static let peerMeta = Column(CodingKeys.peerMeta) + static let topic = Column(CodingKeys.topic) } } diff --git a/UnstoppableWallet/UnstoppableWallet/Models/WalletConnectV2Session.swift b/UnstoppableWallet/UnstoppableWallet/Models/WalletConnectV2Session.swift deleted file mode 100644 index a3c3c9c78c..0000000000 --- a/UnstoppableWallet/UnstoppableWallet/Models/WalletConnectV2Session.swift +++ /dev/null @@ -1,21 +0,0 @@ -import GRDB - -class WalletConnectV2Session: Codable, FetchableRecord, PersistableRecord, TableRecord { - let accountId: String - let topic: String - - init(accountId: String, topic: String) { - self.accountId = accountId - self.topic = topic - } - - class var databaseTableName: String { - "wallet_connect_sessions_v2" - } - - enum Columns { - static let accountId = Column(CodingKeys.accountId) - static let topic = Column(CodingKeys.topic) - } - -} diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/Main/MainBadgeService.swift b/UnstoppableWallet/UnstoppableWallet/Modules/Main/MainBadgeService.swift index 501799cf19..c52c0a0fd9 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/Main/MainBadgeService.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/Main/MainBadgeService.swift @@ -12,17 +12,17 @@ class MainBadgeService { private let pinKit: PinKit.Kit private let termsManager: TermsManager - private let walletConnectV2SessionManager: WalletConnectV2SessionManager + private let walletConnectSessionManager: WalletConnectSessionManager private let contactBookManager: ContactBookManager private let settingsBadgeRelay = BehaviorRelay<(Bool, Int)>(value: (false, 0)) - init(backupManager: BackupManager, accountRestoreWarningManager: AccountRestoreWarningManager, pinKit: PinKit.Kit, termsManager: TermsManager, walletConnectV2SessionManager: WalletConnectV2SessionManager, contactBookManager: ContactBookManager) { + init(backupManager: BackupManager, accountRestoreWarningManager: AccountRestoreWarningManager, pinKit: PinKit.Kit, termsManager: TermsManager, walletConnectSessionManager: WalletConnectSessionManager, contactBookManager: ContactBookManager) { self.backupManager = backupManager self.accountRestoreWarningManager = accountRestoreWarningManager self.pinKit = pinKit self.termsManager = termsManager - self.walletConnectV2SessionManager = walletConnectV2SessionManager + self.walletConnectSessionManager = walletConnectSessionManager self.contactBookManager = contactBookManager accountRestoreWarningManager.hasNonStandardObservable @@ -55,7 +55,7 @@ class MainBadgeService { }) .disposed(by: disposeBag) - walletConnectV2SessionManager.activePendingRequestsObservable + walletConnectSessionManager.activePendingRequestsObservable .subscribeOn(ConcurrentDispatchQueueScheduler(qos: .background)) .observeOn(ConcurrentDispatchQueueScheduler(qos: .background)) .subscribe(onNext: { [weak self] _ in @@ -80,7 +80,7 @@ class MainBadgeService { } private func syncSettingsBadge() { - let count = walletConnectV2SessionManager.activePendingRequests.count + let count = walletConnectSessionManager.activePendingRequests.count let cloudError = contactBookManager.iCloudError != nil && contactBookManager.remoteSync let visible = accountRestoreWarningManager.hasNonStandard || !backupManager.allBackedUp || !pinKit.isPinSet || !termsManager.termsAccepted || cloudError || count != 0 settingsBadgeRelay.accept((visible, count)) diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/Main/MainModule.swift b/UnstoppableWallet/UnstoppableWallet/Modules/Main/MainModule.swift index 5e1c9f5622..944e233c23 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/Main/MainModule.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/Main/MainModule.swift @@ -24,7 +24,7 @@ struct MainModule { accountRestoreWarningManager: App.shared.accountRestoreWarningManager, pinKit: App.shared.pinKit, termsManager: App.shared.termsManager, - walletConnectV2SessionManager: App.shared.walletConnectV2SessionManager, + walletConnectSessionManager: App.shared.walletConnectSessionManager, contactBookManager: App.shared.contactManager ) let releaseNotesService = ReleaseNotesService( @@ -39,13 +39,13 @@ struct MainModule { let viewModel = MainViewModel(service: service, badgeService: badgeService, releaseNotesService: releaseNotesService, jailbreakService: jailbreakService, deepLinkService: deepLinkService) let viewController = MainViewController(viewModel: viewModel) - let walletConnectWorkerService = WalletConnectV2AppShowService( - walletConnectV2Manager: App.shared.walletConnectV2SessionManager, + let walletConnectWorkerService = WalletConnectAppShowService( + walletConnectManager: App.shared.walletConnectSessionManager, cloudAccountBackupManager: App.shared.cloudAccountBackupManager, accountManager: App.shared.accountManager, pinKit: App.shared.pinKit) - let walletConnectWorkerViewModel = WalletConnectV2AppShowViewModel(service: walletConnectWorkerService) - let walletConnectWorkerView = WalletConnectV2AppShowView( + let walletConnectWorkerViewModel = WalletConnectAppShowViewModel(service: walletConnectWorkerService) + let walletConnectWorkerView = WalletConnectAppShowView( viewModel: walletConnectWorkerViewModel, parentViewController: viewController) diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsModule.swift b/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsModule.swift index 2018bdf259..942996a0d3 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsModule.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsModule.swift @@ -14,7 +14,6 @@ struct MainSettingsModule { systemInfoManager: App.shared.systemInfoManager, currencyKit: App.shared.currencyKit, walletConnectSessionManager: App.shared.walletConnectSessionManager, - walletConnectV2SessionManager: App.shared.walletConnectV2SessionManager, subscriptionManager: App.shared.subscriptionManager ) diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsService.swift b/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsService.swift index 23ab2593fb..e75eae927f 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsService.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsService.swift @@ -21,15 +21,13 @@ class MainSettingsService { private let systemInfoManager: SystemInfoManager private let currencyKit: CurrencyKit.Kit private let walletConnectSessionManager: WalletConnectSessionManager - private let walletConnectV2SessionManager: WalletConnectV2SessionManager private let subscriptionManager: SubscriptionManager private let iCloudAvailableErrorRelay = BehaviorRelay(value: false) private let noWalletRequiredActionsRelay = BehaviorRelay(value: false) init(backupManager: BackupManager, cloudAccountBackupManager: CloudAccountBackupManager, accountRestoreWarningManager: AccountRestoreWarningManager, accountManager: AccountManager, contactBookManager: ContactBookManager, pinKit: PinKit.Kit, termsManager: TermsManager, - systemInfoManager: SystemInfoManager, currencyKit: CurrencyKit.Kit, - walletConnectSessionManager: WalletConnectSessionManager, walletConnectV2SessionManager: WalletConnectV2SessionManager, subscriptionManager: SubscriptionManager) { + systemInfoManager: SystemInfoManager, currencyKit: CurrencyKit.Kit, walletConnectSessionManager: WalletConnectSessionManager, subscriptionManager: SubscriptionManager) { self.cloudAccountBackupManager = cloudAccountBackupManager self.backupManager = backupManager self.accountRestoreWarningManager = accountRestoreWarningManager @@ -40,7 +38,6 @@ class MainSettingsService { self.systemInfoManager = systemInfoManager self.currencyKit = currencyKit self.walletConnectSessionManager = walletConnectSessionManager - self.walletConnectV2SessionManager = walletConnectV2SessionManager self.subscriptionManager = subscriptionManager subscribe(disposeBag, contactBookManager.iCloudErrorObservable) { [weak self] error in @@ -98,21 +95,19 @@ extension MainSettingsService { } var walletConnectSessionCount: Int { - walletConnectSessionManager.sessions.count + walletConnectV2SessionManager.sessions.count + walletConnectSessionManager.sessions.count } var walletConnectSessionCountObservable: Observable { - Observable.combineLatest(walletConnectSessionManager.sessionsObservable, walletConnectV2SessionManager.sessionsObservable).map { - $0.count + $1.count - } + walletConnectSessionManager.sessionsObservable.map { $0.count } } var walletConnectPendingRequestCount: Int { - walletConnectV2SessionManager.activePendingRequests.count + walletConnectSessionManager.activePendingRequests.count } var walletConnectPendingRequestCountObservable: Observable { - walletConnectV2SessionManager.activePendingRequestsObservable.map { $0.count } + walletConnectSessionManager.activePendingRequestsObservable.map { $0.count } } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsViewController.swift b/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsViewController.swift index dd331d238d..6a4719e47c 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsViewController.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsViewController.swift @@ -372,7 +372,7 @@ class MainSettingsViewController: ThemeViewController { private func openWalletConnect(mode: MainSettingsViewModel.WalletConnectOpenMode) { switch mode { case .errorDialog(let error): - WalletConnectV2AppShowView.showWalletConnectError(error: error, sourceViewController: self) + WalletConnectAppShowView.showWalletConnectError(error: error, sourceViewController: self) case .list: navigationController?.pushViewController(WalletConnectListModule.viewController(), animated: true) } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsViewModel.swift b/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsViewModel.swift index 72fe605ea7..aa03bd9565 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsViewModel.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/Settings/Main/MainSettingsViewModel.swift @@ -155,7 +155,7 @@ extension MainSettingsViewModel { enum WalletConnectOpenMode { case list - case errorDialog(error: WalletConnectV2AppShowView.WalletConnectOpenError) + case errorDialog(error: WalletConnectAppShowView.WalletConnectOpenError) } } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/V1/WalletConnectV1ListView.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/V1/WalletConnectV1ListView.swift deleted file mode 100644 index b0f5bf91c9..0000000000 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/V1/WalletConnectV1ListView.swift +++ /dev/null @@ -1,119 +0,0 @@ -import UIKit -import ThemeKit -import SectionsTableView -import ComponentKit -import RxSwift -import RxCocoa - -class WalletConnectV1ListView { - private let disposeBag = DisposeBag() - private let viewModel: WalletConnectV1ListViewModel - weak var sourceViewController: WalletConnectListViewController? - - private(set) var viewItems = [WalletConnectV1ListViewModel.ViewItem]() - - private let reloadTableRelay = PublishRelay<()>() - - init(viewModel: WalletConnectV1ListViewModel) { - self.viewModel = viewModel - } - - func viewDidLoad() { - subscribe(disposeBag, viewModel.viewItemsDriver) { [weak self] in self?.sync(viewItems: $0) } - subscribe(disposeBag, viewModel.showLoadingSignal) { HudHelper.instance.show(banner: .disconnectingWalletConnect) } - subscribe(disposeBag, viewModel.showSuccessSignal) { HudHelper.instance.show(banner: .disconnectedWalletConnect) } - subscribe(disposeBag, viewModel.showWalletConnectSessionSignal) { [weak self] in self?.show(session: $0) } - } - - private func sync(viewItems: [WalletConnectV1ListViewModel.ViewItem]) { - self.viewItems = viewItems - - reloadTableRelay.accept(()) - } - - private func show(session: WalletConnectSession) { - guard let viewController = WalletConnectMainModule.viewController(session: session, sourceViewController: sourceViewController) else { - return - } - - sourceViewController?.navigationController?.present(viewController, animated: true) - } - - private func deleteRowAction(id: Int) -> RowAction { - RowAction(pattern: .icon( - image: UIImage(named: "circle_minus_shifted_24"), - background: UIColor(red: 0, green: 0, blue: 0, alpha: 0) - ), action: { [weak self] cell in - self?.viewModel.kill(id: id) - }) - } - - private func section(tableView: SectionsTableView, viewItems: [WalletConnectV1ListViewModel.ViewItem]) -> SectionProtocol { - Section( - id: "section_1", - headerState: tableView.sectionHeader(text: "wallet_connect.list.version_text".localized("1.0")), - footerState: tableView.sectionFooter(text: "wallet_connect.list.v1_bottom_text".localized), - rows: viewItems.enumerated().map { index, viewItem in - let isFirst = index == 0 - let isLast = index == viewItems.count - 1 - let rowAction = deleteRowAction(id: viewItem.id) - - return CellBuilderNew.row( - rootElement: .hStack([ - .image32 { component in - component.imageView.cornerRadius = .cornerRadius8 - component.imageView.layer.cornerCurve = .continuous - component.setImage(urlString: viewItem.imageUrl, placeholder: UIImage(named: "placeholder_rectangle_32")) - }, - .vStackCentered([ - .text { component in - component.font = .body - component.textColor = .themeLeah - component.text = viewItem.title - }, - .margin(1), - .text { component in - component.font = .subhead2 - component.textColor = .themeGray - component.text = viewItem.description - } - ]), - .image20 { component in - component.imageView.image = UIImage(named: "arrow_big_forward_20")?.withTintColor(.themeGray) - } - ]), - tableView: tableView, - id: viewItem.id.description, - height: .heightDoubleLineCell, - autoDeselect: true, - rowActionProvider: { [rowAction] }, - bind: { cell in - cell.set(backgroundStyle: .lawrence, isFirst: isFirst, isLast: isLast) - }, - action: { [weak self] in - self?.viewModel.showSession(id: viewItem.id) - } - ) - } - ) - } - -} - -extension WalletConnectV1ListView { - - func sections(tableView: SectionsTableView) -> [SectionProtocol] { - guard !viewItems.isEmpty else { - return [] - } - - return [ - section(tableView: tableView, viewItems: viewItems) - ] - } - - var reloadTableSignal: Signal<()> { - reloadTableRelay.asSignal() - } - -} diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/V1/WalletConnectV1ListViewModel.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/V1/WalletConnectV1ListViewModel.swift deleted file mode 100644 index 396168ab2e..0000000000 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/V1/WalletConnectV1ListViewModel.swift +++ /dev/null @@ -1,87 +0,0 @@ -import Foundation -import RxSwift -import RxCocoa - -class WalletConnectV1ListViewModel { - private let service: WalletConnectListService - private let disposeBag = DisposeBag() - - private let showWalletConnectSessionRelay = PublishRelay() - - private let viewItemsRelay = BehaviorRelay<[ViewItem]>(value: []) - private let showLoadingRelay = PublishRelay<()>() - private let showSuccessRelay = PublishRelay<()>() - - init(service: WalletConnectListService) { - self.service = service - - subscribe(disposeBag, service.itemsV1Observable) { [weak self] in self?.sync(items: $0) } - subscribe(disposeBag, service.sessionKillingObservable) { [weak self] in self?.sync(sessionKillingState: $0) } - subscribe(disposeBag, service.showSessionV1Observable) { [weak self] in self?.show(session: $0) } - - sync(items: service.itemsV1) - } - - private func sync(items: [WalletConnectListService.Item]) { - let viewItems = items.map { - ViewItem( - id: $0.id, - title: $0.appName, - description: $0.blockchains.map { $0.shortName }.joined(separator: ", "), - imageUrl: $0.appIcons.last - ) - } - - viewItemsRelay.accept(viewItems) - } - - private func sync(sessionKillingState: WalletConnectListService.SessionKillingState) { - switch sessionKillingState { - case .processing: showLoadingRelay.accept(()) - case .completed: showSuccessRelay.accept(()) // don't needed different text - case .removedOnly: showSuccessRelay.accept(()) // app just remove peerId from database - } - } - - private func show(session: WalletConnectSession) { - showWalletConnectSessionRelay.accept(session) - } - -} - -extension WalletConnectV1ListViewModel { - - //Connections section - - var showWalletConnectSessionSignal: Signal { - showWalletConnectSessionRelay.asSignal() - } - - var viewItemsDriver: Driver<[ViewItem]> { - viewItemsRelay.asDriver() - } - - var showLoadingSignal: Signal<()> { - showLoadingRelay.asSignal() - } - - var showSuccessSignal: Signal<()> { - showSuccessRelay.asSignal() - } - - // Manage connections - func showSession(id: Int) { - service.showSession(id: id) - } - - func kill(id: Int) { - service.kill(id: id) - } - -} - -extension WalletConnectV1ListViewModel { - - class ViewItem: WalletConnectListViewModel.ViewItem {} - -} diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/V2/WalletConnectEvmChainParser.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/V2/WalletConnectEvmChainParser.swift deleted file mode 100644 index 0faf00e6ce..0000000000 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/V2/WalletConnectEvmChainParser.swift +++ /dev/null @@ -1,32 +0,0 @@ -import Foundation -import EvmKit - -class WalletConnectEvmChainParser { - - func parse(string: String) -> AccountData? { - // todo: parse blockchain and return evm-chainId if it's possible - - let chunks = string.split(separator: ":") - guard chunks.count >= 2 else { - return nil - } - let chainId = Int(chunks[1]) - var address: String? = nil - if chunks.count >= 3 { - address = String(chunks[2]) - } - - return chainId.map { AccountData(eip: String(chunks[0]), chainId: $0, address: address) } - } - -} - -extension WalletConnectEvmChainParser { - - struct AccountData { - let eip: String - let chainId: Int - let address: String? - } - -} \ No newline at end of file diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/V2/WalletConnectV2ListView.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/V2/WalletConnectV2ListView.swift deleted file mode 100644 index 1ef73ab1d0..0000000000 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/V2/WalletConnectV2ListView.swift +++ /dev/null @@ -1,177 +0,0 @@ -import UIKit -import ThemeKit -import SectionsTableView -import ComponentKit -import RxSwift -import RxCocoa -import WalletConnectSign - -class WalletConnectV2ListView { - private let disposeBag = DisposeBag() - private let viewModel: WalletConnectV2ListViewModel - weak var sourceViewController: WalletConnectListViewController? - - private var viewItems = [WalletConnectListViewModel.ViewItem]() - private var pairingCount: Int = 0 - - private let reloadTableRelay = PublishRelay<()>() - - init(viewModel: WalletConnectV2ListViewModel) { - self.viewModel = viewModel - } - - func viewDidLoad() { - subscribe(disposeBag, viewModel.viewItemsDriver) { [weak self] in self?.sync(viewItems: $0) } - subscribe(disposeBag, viewModel.pairingCountDriver) { [weak self] in self?.sync(pairingCount: $0) } - subscribe(disposeBag, viewModel.showLoadingSignal) { HudHelper.instance.showSpinner(title: "wallet_connect_list.disconnecting".localized, userInteractionEnabled: false) } - subscribe(disposeBag, viewModel.showSuccessSignal) { _ in HudHelper.instance.show(banner: .done) } - subscribe(disposeBag, viewModel.showWalletConnectSessionSignal) { [weak self] in self?.show(session: $0) } - } - - private func sync(viewItems: [WalletConnectListViewModel.ViewItem]) { - self.viewItems = viewItems - - reloadTableRelay.accept(()) - } - - private func sync(pairingCount: Int) { - self.pairingCount = pairingCount - - reloadTableRelay.accept(()) - } - - private func show(session: WalletConnectSign.Session) { - guard let viewController = WalletConnectMainModule.viewController(session: session, sourceViewController: sourceViewController) else { - return - } - - sourceViewController?.navigationController?.present(viewController, animated: true) - } - - private func showPairings() { - let viewController = WalletConnectV2PairingModule.viewController() - - sourceViewController?.navigationController?.pushViewController(viewController, animated: true) - } - - private func deleteRowAction(id: Int) -> RowAction { - RowAction(pattern: .icon( - image: UIImage(named: "circle_minus_shifted_24"), - background: UIColor(red: 0, green: 0, blue: 0, alpha: 0) - ), action: { [weak self] cell in - self?.viewModel.kill(id: id) - }) - } - - private func cell(tableView: UITableView, viewItem: WalletConnectListViewModel.ViewItem, isFirst: Bool, isLast: Bool, action: @escaping () -> ()) -> RowProtocol? { - let rowAction = deleteRowAction(id: viewItem.id) - - let elements: [CellBuilderNew.CellElement] = [ - .image32 { component in - component.imageView.cornerRadius = .cornerRadius8 - component.imageView.layer.cornerCurve = .continuous - component.imageView.contentMode = .scaleAspectFit - component.setImage(urlString: viewItem.imageUrl, placeholder: UIImage(named: "placeholder_rectangle_32")) - }, - .vStackCentered([ - .text { component in - component.font = .body - component.textColor = .themeLeah - component.text = viewItem.title - }, - .margin(1), - .text { component in - component.font = .subhead2 - component.textColor = .themeGray - component.text = viewItem.description - } - ]), - .badge { component in - if let badge = viewItem.badge { - component.isHidden = false - component.badgeView.set(style: .medium) - component.badgeView.text = badge - } else { - component.isHidden = true - } - }, - .image20 { component in - component.imageView.image = UIImage(named: "arrow_big_forward_20") - } - ] - - return CellBuilderNew.row( - rootElement: .hStack(elements), - tableView: tableView, - id: viewItem.title, - height: .heightDoubleLineCell, - autoDeselect: true, - rowActionProvider: { [rowAction] }, - bind: { cell in cell.set(backgroundStyle: .lawrence, isFirst: isFirst, isLast: isLast) }, - action: action - ) - } - - private func pairingCountCell(tableView: SectionsTableView, pairingCount: Int) -> RowProtocol { - tableView.universalRow48(id: "session-pairing", - title: .body("wallet_connect.list.pairings".localized), - value: .subhead1("\(pairingCount)", color: .themeGray), - accessoryType: .disclosure, - autoDeselect: true, - isFirst: true, - isLast: true, - action: { [weak self] in self?.showPairings() } - ) - } - - private func pairingSection(tableView: SectionsTableView, showHeader: Bool) -> SectionProtocol? { - guard pairingCount != 0 else { - return nil - } - - let cell = pairingCountCell(tableView: tableView, pairingCount: pairingCount) - return Section( - id: "section_pairing", - headerState: showHeader ? tableView.sectionHeader(text: "wallet_connect.list.version_text".localized("2.0")) : .margin(height: 0), - footerState: .margin(height: .margin24), - rows: [cell] - ) - } - - private func section(tableView: SectionsTableView, viewItems: [WalletConnectListViewModel.ViewItem]) -> SectionProtocol? { - guard !viewItems.isEmpty else { - return nil - } - - return Section( - id: "section_2", - headerState: tableView.sectionHeader(text: "wallet_connect.list.version_text".localized("2.0")), - footerState: .margin(height: .margin24), - rows: viewItems.enumerated().compactMap { index, viewItem in - let isFirst = index == 0 - let isLast = index == viewItems.count - 1 - - return cell(tableView: tableView, viewItem: viewItem, isFirst: isFirst, isLast: isLast) { [weak self] in - self?.viewModel.showSession(id: viewItem.id) - } - } - ) - } - -} - -extension WalletConnectV2ListView { - - func sections(tableView: SectionsTableView) -> [SectionProtocol] { - guard !viewItems.isEmpty || pairingCount != 0 else { - return [] - } - - return [section(tableView: tableView, viewItems: viewItems), pairingSection(tableView: tableView, showHeader: viewItems.isEmpty)].compactMap { $0 } - } - - var reloadTableSignal: Signal<()> { - reloadTableRelay.asSignal() - } - -} diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/V2/WalletConnectV2ListViewModel.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/V2/WalletConnectV2ListViewModel.swift deleted file mode 100644 index 98952ed9cd..0000000000 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/V2/WalletConnectV2ListViewModel.swift +++ /dev/null @@ -1,99 +0,0 @@ -import Foundation -import RxSwift -import RxCocoa -import WalletConnectSign -import WalletConnectPairing - -class WalletConnectV2ListViewModel { - private let service: WalletConnectListService - private let disposeBag = DisposeBag() - - private let showWalletConnectSessionRelay = PublishRelay() - - private let viewItemsRelay = BehaviorRelay<[WalletConnectListViewModel.ViewItem]>(value: []) - private let pairingCountRelay = BehaviorRelay(value: 0) - private let showLoadingRelay = PublishRelay<()>() - private let showSuccessRelay = PublishRelay() - - init(service: WalletConnectListService) { - self.service = service - - subscribe(disposeBag, service.itemsV2Observable) { [weak self] in self?.sync(items: $0) } - subscribe(disposeBag, service.pendingRequestsV2Observable) { [weak self] in self?.sync(pendingRequests: $0) } - subscribe(disposeBag, service.pairingsObservable) { [weak self] in self?.sync(pairings: $0) } - subscribe(disposeBag, service.showSessionV2Observable) { [weak self] in self?.show(session: $0) } - - sync(items: service.itemsV2) - sync(pendingRequests: service.pendingRequestsV2) - sync(pairings: service.pairings) - } - - private func sync(items: [WalletConnectListService.Item]) { - let viewItems = items.map { - let description = $0.blockchains.map { $0.shortName }.joined(separator: ", ") - - var badge: String? - if let item = $0 as? WalletConnectListService.ItemV2, item.requestCount != 0 { - badge = "\(item.requestCount)" - } - - return WalletConnectListViewModel.ViewItem( - id: $0.id, - title: ($0.appName != "") ? $0.appName : "Unnamed", - description: description, - badge: badge, - imageUrl: $0.appIcons.last - ) - } - - viewItemsRelay.accept(viewItems) - } - - private func sync(pairings: [WalletConnectPairing.Pairing]) { - pairingCountRelay.accept(pairings.count) - } - - private func sync(pendingRequests: [WalletConnectSign.Request]) { - sync(items: service.itemsV2) - } - - private func show(session: WalletConnectSign.Session) { - showWalletConnectSessionRelay.accept(session) - } - -} - -extension WalletConnectV2ListViewModel { - - //Connections section - - var showWalletConnectSessionSignal: Signal { - showWalletConnectSessionRelay.asSignal() - } - - var viewItemsDriver: Driver<[WalletConnectListViewModel.ViewItem]> { - viewItemsRelay.asDriver() - } - - var pairingCountDriver: Driver { - pairingCountRelay.asDriver() - } - - var showLoadingSignal: Signal<()> { - showLoadingRelay.asSignal() - } - - var showSuccessSignal: Signal { - showSuccessRelay.asSignal() - } - - // Manage connections - func showSession(id: Int) { - service.showSession(id: id) - } - - func kill(id: Int) { - service.kill(id: id) - } - -} diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/WalletConnectListModule.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/WalletConnectListModule.swift index 11007e2a6e..fce385f5f4 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/WalletConnectListModule.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/WalletConnectListModule.swift @@ -1,25 +1,15 @@ import UIKit - class WalletConnectListModule { static func viewController() -> UIViewController { let service = WalletConnectListService( sessionManager: App.shared.walletConnectSessionManager, - sessionManagerV2: App.shared.walletConnectV2SessionManager, - evmBlockchainManager: App.shared.evmBlockchainManager, - evmChainParser: WalletConnectEvmChainParser() + evmBlockchainManager: App.shared.evmBlockchainManager ) - let listViewModelV1 = WalletConnectV1ListViewModel(service: service) - let listViewV1 = WalletConnectV1ListView(viewModel: listViewModelV1) - - let listViewModelV2 = WalletConnectV2ListViewModel(service: service) - let listViewV2 = WalletConnectV2ListView(viewModel: listViewModelV2) let viewModel = WalletConnectListViewModel(service: service) - let viewController = WalletConnectListViewController(listViewV1: listViewV1, listViewV2: listViewV2, viewModel: viewModel) - listViewV1.sourceViewController = viewController - listViewV2.sourceViewController = viewController + let viewController = WalletConnectListViewController(viewModel: viewModel) return viewController } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/WalletConnectListService.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/WalletConnectListService.swift index 3661a77e5e..01c8805aec 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/WalletConnectListService.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/WalletConnectListService.swift @@ -14,73 +14,31 @@ class WalletConnectListService { private var waitingForSessionDisposeBag = DisposeBag() private(set) var isWaitingForSession = false - private let createServiceV1Relay = PublishRelay() - private let validateV2ResultRelay = PublishRelay>() - private let pairingV2ResultRelay = PublishRelay>() - private let proposalV2ReceivedRelay = PublishRelay<()>() - private let proposalV2timeOutRelay = PublishRelay<()>() + private let validateResultRelay = PublishRelay>() + private let pairingResultRelay = PublishRelay>() + private let proposalReceivedRelay = PublishRelay<()>() + private let proposalTimeOutRelay = PublishRelay<()>() private let connectionErrorRelay = PublishRelay() private let sessionManager: WalletConnectSessionManager - private let sessionManagerV2: WalletConnectV2SessionManager private let evmBlockchainManager: EvmBlockchainManager - private let evmChainParser: WalletConnectEvmChainParser - private var sessionKiller: WalletConnectSessionKiller? - private let showSessionV1Relay = PublishRelay() - private let showSessionV2Relay = PublishRelay() + private let showSessionRelay = PublishRelay() private let sessionKillingRelay = PublishRelay() - init(sessionManager: WalletConnectSessionManager, sessionManagerV2: WalletConnectV2SessionManager, evmBlockchainManager: EvmBlockchainManager, evmChainParser: WalletConnectEvmChainParser) { + init(sessionManager: WalletConnectSessionManager, evmBlockchainManager: EvmBlockchainManager) { self.sessionManager = sessionManager - self.sessionManagerV2 = sessionManagerV2 self.evmBlockchainManager = evmBlockchainManager - self.evmChainParser = evmChainParser - } - - private func onUpdateSessionKiller(state: WalletConnectSessionKiller.State) { - switch state { - case .killed: finishSessionKill() - case .failed: finishSessionKill(successful: false) - default: () - } - } - - private func finishSessionKill(successful: Bool = true) { - if let killer = sessionKiller { - sessionManager.deleteSession(peerId: killer.peerId) - } - - sessionKiller = nil //deinit session killer and clean disposeBag - disposeBag = DisposeBag() - - sessionKillingRelay.accept(successful ? .completed : .removedOnly) - } - - private func items(sessions: [WalletConnectSession]) -> [Item] { - sessions.compactMap { - guard let blockchain = evmBlockchainManager.blockchain(chainId: $0.chainId) else { - return nil - } - return Item( - id: $0.id, - blockchains: [blockchain], - appName: $0.peerMeta.name, - appUrl: $0.peerMeta.url, - appDescription: $0.peerMeta.description, - appIcons: $0.peerMeta.icons - ) - } } private func items(sessions: [WalletConnectSign.Session]) -> [Item] { - let pendingRequests = pendingRequestsV2 + let pendingRequests = pendingRequests return sessions.map { session in let blockchains = session.chainIds.compactMap { evmBlockchainManager.blockchain(chainId: $0) } let requestCount = pendingRequests.filter { $0.topic == session.topic }.count - return ItemV2( + return Item( id: session.id, blockchains: blockchains, appName: session.peer.name, @@ -93,13 +51,13 @@ class WalletConnectListService { } private func waitingForSession() { - pairingV2ResultRelay.accept(.success(())) + pairingResultRelay.accept(.success(())) isWaitingForSession = true - subscribe(waitingForSessionDisposeBag, sessionManagerV2.service.receiveProposalObservable) { [weak self] _ in + subscribe(waitingForSessionDisposeBag, sessionManager.service.receiveProposalObservable) { [weak self] _ in self?.waitingForSessionDisposeBag = DisposeBag() self?.isWaitingForSession = false - self?.proposalV2ReceivedRelay.accept(()) + self?.proposalReceivedRelay.accept(()) } let timeOutTimer = Observable.just(()).delay(.seconds(Self.timeOutInterval), scheduler: ConcurrentDispatchQueueScheduler(qos: .userInitiated)) @@ -107,7 +65,7 @@ class WalletConnectListService { subscribe(waitingForSessionDisposeBag, timeOutTimer) { [weak self] in self?.waitingForSessionDisposeBag = DisposeBag() self?.isWaitingForSession = false - self?.proposalV2timeOutRelay.accept(()) + self?.proposalTimeOutRelay.accept(()) } } @@ -116,55 +74,41 @@ class WalletConnectListService { extension WalletConnectListService { var emptySessionList: Bool { - (sessionManager.sessions.count + sessionManagerV2.sessions.count) == 0 + sessionManager.sessions.isEmpty } var emptyPairingList: Bool { - sessionManagerV2.pairings.count == 0 + sessionManager.pairings.isEmpty } - var itemsV1: [Item] { + var items: [Item] { items(sessions: sessionManager.sessions) } - var itemsV2: [Item] { - items(sessions: sessionManagerV2.sessions) - } - - var itemsV1Observable: Observable<[Item]> { + var itemsObservable: Observable<[Item]> { sessionManager.sessionsObservable.map { [weak self] in self?.items(sessions: $0) ?? [] } } - var itemsV2Observable: Observable<[Item]> { - sessionManagerV2.sessionsObservable.map { [weak self] in - self?.items(sessions: $0) ?? [] - } + var pendingRequests: [WalletConnectSign.Request] { + sessionManager.pendingRequests() } - var pendingRequestsV2: [WalletConnectSign.Request] { - sessionManagerV2.pendingRequests() - } - - var pendingRequestsV2Observable: Observable<[WalletConnectSign.Request]> { - sessionManagerV2.activePendingRequestsObservable + var pendingRequestsObservable: Observable<[WalletConnectSign.Request]> { + sessionManager.activePendingRequestsObservable } var pairings: [WalletConnectPairing.Pairing] { - sessionManagerV2.pairings + sessionManager.pairings } var pairingsObservable: Observable<[WalletConnectPairing.Pairing]> { - sessionManagerV2.pairingsObservable - } - - var showSessionV1Observable: Observable { - showSessionV1Relay.asObservable() + sessionManager.pairingsObservable } - var showSessionV2Observable: Observable { - showSessionV2Relay.asObservable() + var showSessionObservable: Observable { + showSessionRelay.asObservable() } var sessionKillingObservable: Observable { @@ -174,48 +118,28 @@ extension WalletConnectListService { func kill(id: Int) { if let session = sessionManager.sessions.first(where: { $0.id == id }) { sessionKillingRelay.accept(.processing) - - let sessionKiller = WalletConnectSessionKiller(session: session) - let forceTimer = Observable.just(()).delay(.seconds(Self.timeOutInterval), scheduler: ConcurrentDispatchQueueScheduler(qos: .userInitiated)) - - subscribe(disposeBag, forceTimer) { [weak self] in - self?.finishSessionKill(successful: false) - } - subscribe(disposeBag, sessionKiller.stateObservable) { [weak self] in - self?.onUpdateSessionKiller(state: $0) - } - - sessionKiller.kill() - self.sessionKiller = sessionKiller - } - if let session = sessionManagerV2.sessions.first(where: { $0.id == id }) { - sessionKillingRelay.accept(.processing) let killTimer = Observable.just(()).delay(.milliseconds(600), scheduler: ConcurrentDispatchQueueScheduler(qos: .userInitiated)) subscribe(disposeBag, killTimer) { [weak self] in - self?.sessionManagerV2.deleteSession(topic: session.topic) + self?.sessionManager.deleteSession(topic: session.topic) self?.sessionKillingRelay.accept(.completed) } } } - var createServiceV1Observable: Observable { - createServiceV1Relay.asObservable() + var validateResultObservable: Observable> { + validateResultRelay.asObservable() } - var validateV2ResultObservable: Observable> { - validateV2ResultRelay.asObservable() + var pairingResultObservable: Observable> { + pairingResultRelay.asObservable() } - var pairingV2ResultObservable: Observable> { - pairingV2ResultRelay.asObservable() + var proposalReceivedObservable: Observable<()> { + proposalReceivedRelay.asObservable() } - var proposalV2ReceivedObservable: Observable<()> { - proposalV2ReceivedRelay.asObservable() - } - - var proposalV2timeOutObservable: Observable<()> { - proposalV2timeOutRelay.asObservable() + var proposalTimeOutObservable: Observable<()> { + proposalTimeOutRelay.asObservable() } var connectionErrorObservable: Observable { @@ -224,46 +148,33 @@ extension WalletConnectListService { func connect(uri: String) { switch WalletConnectUriHandler.uriVersion(uri: uri) { - case 1: - WalletConnectUriHandler.createServiceV1(uri: uri) - .subscribeOn(ConcurrentDispatchQueueScheduler(qos: .userInitiated)) - .observeOn(ConcurrentDispatchQueueScheduler(qos: .userInitiated)) - .subscribe(onSuccess: { [weak self] service in - self?.createServiceV1Relay.accept(service) - }, onError: { [weak self] error in - self?.connectionErrorRelay.accept(error) - }) - .disposed(by: disposeBag) case 2: do { try WalletConnectUriHandler.validate(uri: uri) - validateV2ResultRelay.accept(.success(uri)) + validateResultRelay.accept(.success(uri)) } catch { - validateV2ResultRelay.accept(.failure(error)) + validateResultRelay.accept(.failure(error)) } default: connectionErrorRelay.accept(WalletConnectUriHandler.ConnectionError.wrongUri) } } - func pairV2(validUri: String) { - WalletConnectUriHandler.pairV2(uri: validUri) + func pair(validUri: String) { + WalletConnectUriHandler.pair(uri: validUri) .subscribeOn(ConcurrentDispatchQueueScheduler(qos: .userInitiated)) .observeOn(ConcurrentDispatchQueueScheduler(qos: .userInitiated)) .subscribe(onSuccess: { [weak self] service in self?.waitingForSession() }, onError: { [weak self] error in - self?.pairingV2ResultRelay.accept(.failure(error)) + self?.pairingResultRelay.accept(.failure(error)) }) .disposed(by: disposeBag) } func showSession(id: Int) { - if let sessionV1 = sessionManager.sessions.first(where: { $0.id == id }) { - showSessionV1Relay.accept(sessionV1) - } - if let sessionV2 = sessionManagerV2.sessions.first(where: { $0.id == id }) { - showSessionV2Relay.accept(sessionV2) + if let session = sessionManager.sessions.first(where: { $0.id == id }) { + showSessionRelay.accept(session) } } @@ -286,44 +197,21 @@ extension WalletConnectListService { let appDescription: String let appIcons: [String] - init(id: Int, blockchains: [MarketKit.Blockchain], appName: String, appUrl: String, appDescription: String, appIcons: [String]) { + let requestCount: Int + + init(id: Int, blockchains: [MarketKit.Blockchain], appName: String, appUrl: String, appDescription: String, appIcons: [String], requestCount: Int) { self.id = id self.blockchains = blockchains self.appName = appName self.appUrl = appUrl self.appDescription = appDescription self.appIcons = appIcons - } - } - - class ItemV2: Item { - let requestCount: Int - - init(id: Int, blockchains: [MarketKit.Blockchain], appName: String, appUrl: String, appDescription: String, appIcons: [String], requestCount: Int) { self.requestCount = requestCount - super.init(id: id, blockchains: blockchains, appName: appName, appUrl: appUrl, appDescription: appDescription, appIcons: appIcons) } } } -extension WalletConnectSession: Hashable { - - public var id: Int { - hashValue - } - - public func hash(into hasher: inout Hasher) { - hasher.combine(accountId) - hasher.combine(peerId) - } - - public static func ==(lhs: WalletConnectSession, rhs: WalletConnectSession) -> Bool { - lhs.accountId == rhs.accountId && lhs.peerId == rhs.peerId - } - -} - extension WalletConnectSign.Session { var chainIds: [Int] { diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/WalletConnectListViewController.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/WalletConnectListViewController.swift index 0a0edd4a3b..2672ba8cd5 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/WalletConnectListViewController.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/WalletConnectListViewController.swift @@ -1,16 +1,15 @@ import UIKit -import ThemeKit -import SectionsTableView import RxSwift import RxCocoa +import WalletConnectSign import ComponentKit +import SectionsTableView +import ThemeKit class WalletConnectListViewController: ThemeViewController { private let disposeBag = DisposeBag() private let viewModel: WalletConnectListViewModel - private let listViewV1: WalletConnectV1ListView - private let listViewV2: WalletConnectV2ListView private let emptyView = PlaceholderView() private let bottomButtonHolder = BottomGradientHolder() @@ -18,9 +17,10 @@ class WalletConnectListViewController: ThemeViewController { private let tableView = SectionsTableView(style: .grouped) - init(listViewV1: WalletConnectV1ListView, listViewV2: WalletConnectV2ListView, viewModel: WalletConnectListViewModel) { - self.listViewV1 = listViewV1 - self.listViewV2 = listViewV2 + private var viewItems = [WalletConnectListViewModel.ViewItem]() + private var pairingCount: Int = 0 + + init(viewModel: WalletConnectListViewModel) { self.viewModel = viewModel super.init() @@ -71,24 +71,32 @@ class WalletConnectListViewController: ThemeViewController { bottomButton.setTitle("wallet_connect_list.new_connection".localized, for: .normal) bottomButton.addTarget(self, action: #selector(startNewConnection), for: .touchUpInside) - subscribe(disposeBag, viewModel.showWalletConnectMainModuleSignal) { [weak self] in self?.show(walletConnectMainModule: $0) } - subscribe(disposeBag, viewModel.showWalletConnectV2ValidatedSignal) { [weak self] in self?.showV2ValidatedSuccessful(uri: $0) } + subscribe(disposeBag, viewModel.showWalletConnectValidatedSignal) { [weak self] in self?.showValidatedSuccessful(uri: $0) } subscribe(disposeBag, viewModel.showWaitingForSessionSignal) { [weak self] in self?.showWaitingForSession(true) } subscribe(disposeBag, viewModel.hideWaitingForSessionSignal) { [weak self] in self?.showWaitingForSession(false) } subscribe(disposeBag, viewModel.disableNewConnectionSignal) { [weak self] in self?.disableNewConnection($0) } subscribe(disposeBag, viewModel.showErrorSignal) { [weak self] in self?.showError(text: $0) } subscribe(disposeBag, viewModel.newConnectionErrorSignal) { [weak self] in self?.show(newConnectionError: $0) } - subscribe(disposeBag, listViewV1.reloadTableSignal) { [weak self] in self?.syncItems() } - subscribe(disposeBag, listViewV2.reloadTableSignal) { [weak self] in self?.syncItems() } - - listViewV1.viewDidLoad() - listViewV2.viewDidLoad() + subscribe(disposeBag, viewModel.viewItemsDriver) { [weak self] in self?.sync(viewItems: $0) } + subscribe(disposeBag, viewModel.pairingCountDriver) { [weak self] in self?.sync(pairingCount: $0) } + subscribe(disposeBag, viewModel.showDisconnectingSignal) { HudHelper.instance.showSpinner(title: "wallet_connect_list.disconnecting".localized, userInteractionEnabled: false) } + subscribe(disposeBag, viewModel.showSuccessSignal) { HudHelper.instance.show(banner: .done) } + subscribe(disposeBag, viewModel.showWalletConnectSessionSignal) { [weak self] in self?.show(session: $0) } if viewModel.emptyList { startNewConnection() } } + private func sync(viewItems: [WalletConnectListViewModel.ViewItem]? = nil, pairingCount: Int? = nil) { + if let viewItems { self.viewItems = viewItems } + if let pairingCount { self.pairingCount = pairingCount } + + emptyView.isHidden = !viewModel.emptyList + + tableView.reload() + } + @objc private func onTapInfo() { guard let url = FaqUrlHelper.walletConnectUrl else { return @@ -98,28 +106,14 @@ class WalletConnectListViewController: ThemeViewController { present(ThemeNavigationController(rootViewController: module), animated: true) } - private func syncItems() { - emptyView.isHidden = !viewModel.emptyList - - tableView.reload() - } - @objc private func startNewConnection() { let scanQrViewController = ScanQrViewController(reportAfterDismiss: true, pasteEnabled: true) scanQrViewController.delegate = self present(scanQrViewController, animated: true) } - private func show(walletConnectMainModule: WalletConnectV1MainService) { - guard let viewController = WalletConnectMainModule.viewController(service: walletConnectMainModule, sourceViewController: self) else { - return - } - - present(viewController, animated: true) - } - - private func showV2ValidatedSuccessful(uri: String) { - viewModel.pairV2(validUri: uri) + private func showValidatedSuccessful(uri: String) { + viewModel.pair(validUri: uri) } private func showWaitingForSession(_ isShow: Bool) { @@ -133,6 +127,20 @@ class WalletConnectListViewController: ThemeViewController { } } + private func show(session: WalletConnectSign.Session) { + guard let viewController = WalletConnectMainModule.viewController(session: session, sourceViewController: self) else { + return + } + + navigationController?.present(viewController, animated: true) + } + + private func showPairings() { + let viewController = WalletConnectPairingModule.viewController() + + navigationController?.pushViewController(viewController, animated: true) + } + private func disableNewConnection(_ isDisabled: Bool) { bottomButton.isEnabled = !isDisabled navigationItem.rightBarButtonItem?.isEnabled = !isDisabled @@ -158,13 +166,123 @@ class WalletConnectListViewController: ThemeViewController { present(viewController, animated: true) } + private func deleteRowAction(id: Int) -> RowAction { + RowAction(pattern: .icon( + image: UIImage(named: "circle_minus_shifted_24"), + background: UIColor(red: 0, green: 0, blue: 0, alpha: 0) + ), action: { [weak self] cell in + self?.viewModel.kill(id: id) + }) + } + + private func cell(tableView: UITableView, viewItem: WalletConnectListViewModel.ViewItem, isFirst: Bool, isLast: Bool, action: @escaping () -> ()) -> RowProtocol? { + let rowAction = deleteRowAction(id: viewItem.id) + + let elements: [CellBuilderNew.CellElement] = [ + .image32 { component in + component.imageView.cornerRadius = .cornerRadius8 + component.imageView.layer.cornerCurve = .continuous + component.imageView.contentMode = .scaleAspectFit + component.setImage(urlString: viewItem.imageUrl, placeholder: UIImage(named: "placeholder_rectangle_32")) + }, + .vStackCentered([ + .text { component in + component.font = .body + component.textColor = .themeLeah + component.text = viewItem.title + }, + .margin(1), + .text { component in + component.font = .subhead2 + component.textColor = .themeGray + component.text = viewItem.description + } + ]), + .badge { component in + if let badge = viewItem.badge { + component.isHidden = false + component.badgeView.set(style: .medium) + component.badgeView.text = badge + } else { + component.isHidden = true + } + }, + .image20 { component in + component.imageView.image = UIImage(named: "arrow_big_forward_20") + } + ] + + return CellBuilderNew.row( + rootElement: .hStack(elements), + tableView: tableView, + id: viewItem.title, + height: .heightDoubleLineCell, + autoDeselect: true, + rowActionProvider: { [rowAction] }, + bind: { cell in cell.set(backgroundStyle: .lawrence, isFirst: isFirst, isLast: isLast) }, + action: action + ) + } + + private func pairingCountCell(tableView: SectionsTableView, pairingCount: Int) -> RowProtocol { + tableView.universalRow48(id: "session-pairing", + title: .body("wallet_connect.list.pairings".localized), + value: .subhead1("\(pairingCount)", color: .themeGray), + accessoryType: .disclosure, + autoDeselect: true, + isFirst: true, + isLast: true, + action: { [weak self] in self?.showPairings() } + ) + } + + private func pairingSection(tableView: SectionsTableView, showHeader: Bool) -> SectionProtocol? { + guard pairingCount != 0 else { + return nil + } + + let cell = pairingCountCell(tableView: tableView, pairingCount: pairingCount) + return Section( + id: "section_pairing", + headerState: showHeader ? tableView.sectionHeader(text: "wallet_connect.list.version_text".localized("2.0")) : .margin(height: 0), + footerState: .margin(height: .margin24), + rows: [cell] + ) + } + + private func section(tableView: SectionsTableView, viewItems: [WalletConnectListViewModel.ViewItem]) -> SectionProtocol? { + guard !viewItems.isEmpty else { + return nil + } + + return Section( + id: "section_2", + headerState: tableView.sectionHeader(text: "wallet_connect.list.version_text".localized("2.0")), + footerState: .margin(height: .margin24), + rows: viewItems.enumerated().compactMap { index, viewItem in + let isFirst = index == 0 + let isLast = index == viewItems.count - 1 + + return cell(tableView: tableView, viewItem: viewItem, isFirst: isFirst, isLast: isLast) { [weak self] in + self?.viewModel.showSession(id: viewItem.id) + } + } + ) + } + } extension WalletConnectListViewController: SectionsDataSource { func buildSections() -> [SectionProtocol] { - [Section(id: "top-margin", headerState: .margin(height: .margin12))] + - (listViewV2.sections(tableView: tableView) + listViewV1.sections(tableView: tableView)).compactMap { $0 } + var sections: [SectionProtocol] = [Section(id: "top-margin", headerState: .margin(height: .margin12))] + + sections.append(contentsOf: [ + section(tableView: tableView, viewItems: viewItems), + pairingSection(tableView: tableView, showHeader: viewItems.isEmpty) + ].compactMap { $0 }) + + return sections } } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/WalletConnectListViewModel.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/WalletConnectListViewModel.swift index 93b0be7c10..12ead9e362 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/WalletConnectListViewModel.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/List/WalletConnectListViewModel.swift @@ -2,43 +2,96 @@ import Foundation import RxSwift import RxRelay import RxCocoa +import WalletConnectSign +import WalletConnectPairing class WalletConnectListViewModel { private let service: WalletConnectListService private let disposeBag = DisposeBag() private let newConnectionErrorRelay = PublishRelay() - private let showWalletConnectV1MainServiceRelay = PublishRelay() - private let showWalletConnectV2ValidatedRelay = PublishRelay() + + private let showWalletConnectSessionRelay = PublishRelay() + private let showWalletConnectValidatedRelay = PublishRelay() private let showWaitingForSessionRelay = PublishRelay<()>() private let hideWaitingForSessionRelay = PublishRelay<()>() private let showAttentionRelay = PublishRelay() private let disableNewConnectionRelay = PublishRelay() - private let showWalletConnectV1SessionRelay = PublishRelay() + + private let viewItemsRelay = BehaviorRelay<[WalletConnectListViewModel.ViewItem]>(value: []) + private let pairingCountRelay = BehaviorRelay(value: 0) + private let showDisconnectingRelay = PublishRelay<()>() + private let showSuccessRelay = PublishRelay<()>() init(service: WalletConnectListService) { self.service = service - subscribe(disposeBag, service.createServiceV1Observable) { [weak self] in self?.show(service: $0) } - subscribe(disposeBag, service.validateV2ResultObservable) { [weak self] in self?.validateV2(result: $0) } - subscribe(disposeBag, service.pairingV2ResultObservable) { [weak self] in self?.pairingV2(result: $0) } - subscribe(disposeBag, service.proposalV2ReceivedObservable) { [weak self] in self?.proposalReceived() } - subscribe(disposeBag, service.proposalV2timeOutObservable) { [weak self] in self?.proposalWaitingTimeOut() } + subscribe(disposeBag, service.validateResultObservable) { [weak self] in self?.validate(result: $0) } + subscribe(disposeBag, service.pairingResultObservable) { [weak self] in self?.pairing(result: $0) } + subscribe(disposeBag, service.proposalReceivedObservable) { [weak self] in self?.proposalReceived() } + subscribe(disposeBag, service.proposalTimeOutObservable) { [weak self] in self?.proposalWaitingTimeOut() } subscribe(disposeBag, service.connectionErrorObservable) { [weak self] in self?.show(connectionError: $0) } + + subscribe(disposeBag, service.itemsObservable) { [weak self] in self?.sync(items: $0) } + subscribe(disposeBag, service.pendingRequestsObservable) { [weak self] in self?.sync(pendingRequests: $0) } + subscribe(disposeBag, service.pairingsObservable) { [weak self] in self?.sync(pairings: $0) } + subscribe(disposeBag, service.showSessionObservable) { [weak self] in self?.show(session: $0) } + subscribe(disposeBag, service.sessionKillingObservable) { [weak self] in self?.sync(sessionKillingState: $0) } + + sync(items: service.items) + sync(pendingRequests: service.pendingRequests) + sync(pairings: service.pairings) + } + + private func sync(items: [WalletConnectListService.Item]) { + let viewItems = items.map { + let description = $0.blockchains.map { $0.shortName }.joined(separator: ", ") + + var badge: String? + if $0.requestCount != 0 { + badge = "\($0.requestCount)" + } + + return WalletConnectListViewModel.ViewItem( + id: $0.id, + title: ($0.appName != "") ? $0.appName : "Unnamed", + description: description, + badge: badge, + imageUrl: $0.appIcons.last + ) + } + + viewItemsRelay.accept(viewItems) + } + + private func sync(pairings: [WalletConnectPairing.Pairing]) { + pairingCountRelay.accept(pairings.count) } - private func show(service: WalletConnectV1MainService) { - showWalletConnectV1MainServiceRelay.accept(service) + private func sync(pendingRequests: [WalletConnectSign.Request]) { + sync(items: service.items) } - private func validateV2(result: Result) { + private func sync(sessionKillingState: WalletConnectListService.SessionKillingState) { + switch sessionKillingState { + case .processing: showDisconnectingRelay.accept(()) + case .completed: showSuccessRelay.accept(()) // don't needed different text + case .removedOnly: showSuccessRelay.accept(()) // app just remove peerId from database + } + } + + private func show(session: WalletConnectSign.Session) { + showWalletConnectSessionRelay.accept(session) + } + + private func validate(result: Result) { switch result { - case .success(let uri): showWalletConnectV2ValidatedRelay.accept(uri) + case .success(let uri): showWalletConnectValidatedRelay.accept(uri) case .failure(let error): newConnectionErrorRelay.accept(error.smartDescription) } } - private func pairingV2(result: Result<(), Error>) { + private func pairing(result: Result<(), Error>) { switch result { case .success: showWaitingForSessionRelay.accept(()) @@ -69,17 +122,33 @@ extension WalletConnectListViewModel { service.isWaitingForSession } + var showWalletConnectSessionSignal: Signal { + showWalletConnectSessionRelay.asSignal() + } + + var viewItemsDriver: Driver<[WalletConnectListViewModel.ViewItem]> { + viewItemsRelay.asDriver() + } + + var pairingCountDriver: Driver { + pairingCountRelay.asDriver() + } + + var showDisconnectingSignal: Signal<()> { + showDisconnectingRelay.asSignal() + } + + var showSuccessSignal: Signal<()> { + showSuccessRelay.asSignal() + } + // NewConnection section var emptyList: Bool { service.emptySessionList && service.emptyPairingList } - var showWalletConnectMainModuleSignal: Signal { - showWalletConnectV1MainServiceRelay.asSignal() - } - - var showWalletConnectV2ValidatedSignal: Signal { - showWalletConnectV2ValidatedRelay.asSignal() + var showWalletConnectValidatedSignal: Signal { + showWalletConnectValidatedRelay.asSignal() } var showWaitingForSessionSignal: Signal<()> { @@ -106,8 +175,17 @@ extension WalletConnectListViewModel { service.connect(uri: string) } - func pairV2(validUri: String) { - service.pairV2(validUri: validUri) + func pair(validUri: String) { + service.pair(validUri: validUri) + } + + // Manage connections + func showSession(id: Int) { + service.showSession(id: id) + } + + func kill(id: Int) { + service.kill(id: id) } } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/V2/WalletConnectV2MainPendingRequestService.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/PendingRequest/WalletConnectMainPendingRequestService.swift similarity index 87% rename from UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/V2/WalletConnectV2MainPendingRequestService.swift rename to UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/PendingRequest/WalletConnectMainPendingRequestService.swift index c817b3f057..87592a0f53 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/V2/WalletConnectV2MainPendingRequestService.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/PendingRequest/WalletConnectMainPendingRequestService.swift @@ -3,11 +3,11 @@ import RxSwift import RxRelay import WalletConnectSign -class WalletConnectV2MainPendingRequestService { +class WalletConnectMainPendingRequestService { private let disposeBag = DisposeBag() private let accountManager: AccountManager - private let sessionManager: WalletConnectV2SessionManager + private let sessionManager: WalletConnectSessionManager private let evmBlockchainManager: EvmBlockchainManager private let signService: IWalletConnectSignService private var session: WalletConnectSign.Session? @@ -21,7 +21,7 @@ class WalletConnectV2MainPendingRequestService { private let showPendingRequestRelay = PublishRelay() - init(service: WalletConnectV2MainService, accountManager: AccountManager, sessionManager: WalletConnectV2SessionManager, evmBlockchainManager: EvmBlockchainManager, signService: IWalletConnectSignService) { + init(service: WalletConnectMainService, accountManager: AccountManager, sessionManager: WalletConnectSessionManager, evmBlockchainManager: EvmBlockchainManager, signService: IWalletConnectSignService) { self.accountManager = accountManager self.sessionManager = sessionManager self.evmBlockchainManager = evmBlockchainManager @@ -61,7 +61,7 @@ class WalletConnectV2MainPendingRequestService { } -extension WalletConnectV2MainPendingRequestService { +extension WalletConnectMainPendingRequestService { var itemsObservable: Observable<[Item]> { itemsRelay.asObservable() @@ -99,7 +99,7 @@ extension WalletConnectV2MainPendingRequestService { let chain = WalletConnectRequest.Chain(id: chainId, chainName: blockchain.name, address: address.eip55) - guard let wcRequest = try? WalletConnectV2RequestMapper.map(dAppName: session?.peer.name, chain: chain, request: request) else { + guard let wcRequest = try? WalletConnectRequestMapper.map(dAppName: session?.peer.name, chain: chain, request: request) else { return } @@ -112,7 +112,7 @@ extension WalletConnectV2MainPendingRequestService { } -extension WalletConnectV2MainPendingRequestService { +extension WalletConnectMainPendingRequestService { struct Item { let id: Int diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/V2/WalletConnectV2MainPendingRequestViewModel.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/PendingRequest/WalletConnectMainPendingRequestViewModel.swift similarity index 81% rename from UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/V2/WalletConnectV2MainPendingRequestViewModel.swift rename to UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/PendingRequest/WalletConnectMainPendingRequestViewModel.swift index a1ba01941c..80725dcbb0 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/V2/WalletConnectV2MainPendingRequestViewModel.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/PendingRequest/WalletConnectMainPendingRequestViewModel.swift @@ -2,14 +2,14 @@ import RxSwift import RxRelay import RxCocoa -class WalletConnectV2MainPendingRequestViewModel { - private let service: WalletConnectV2MainPendingRequestService +class WalletConnectMainPendingRequestViewModel { + private let service: WalletConnectMainPendingRequestService private let disposeBag = DisposeBag() private let viewItemsRelay = BehaviorRelay<[ViewItem]>(value: []) private let showPendingRequestRelay = PublishRelay() - init(service: WalletConnectV2MainPendingRequestService) { + init(service: WalletConnectMainPendingRequestService) { self.service = service subscribe(disposeBag, service.itemsObservable) { [weak self] in @@ -22,7 +22,7 @@ class WalletConnectV2MainPendingRequestViewModel { sync(items: service.items) } - private func sync(items: [WalletConnectV2MainPendingRequestService.Item]) { + private func sync(items: [WalletConnectMainPendingRequestService.Item]) { let viewItems = items.map { request in ViewItem( id: request.id, @@ -38,7 +38,7 @@ class WalletConnectV2MainPendingRequestViewModel { } -extension WalletConnectV2MainPendingRequestViewModel { +extension WalletConnectMainPendingRequestViewModel { var viewItemsDriver: Driver<[ViewItem]> { viewItemsRelay.asDriver() @@ -58,7 +58,7 @@ extension WalletConnectV2MainPendingRequestViewModel { } -extension WalletConnectV2MainPendingRequestViewModel { +extension WalletConnectMainPendingRequestViewModel { struct ViewItem { let id: Int @@ -70,7 +70,7 @@ extension WalletConnectV2MainPendingRequestViewModel { } -extension WalletConnectV2MainPendingRequestService.RequestMethod { +extension WalletConnectMainPendingRequestService.RequestMethod { var title: String { switch self { diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/V1/WalletConnectV1MainRequestView.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/V1/WalletConnectV1MainRequestView.swift deleted file mode 100644 index 5cc75df55b..0000000000 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/V1/WalletConnectV1MainRequestView.swift +++ /dev/null @@ -1,36 +0,0 @@ -import UIKit -import ThemeKit -import RxSwift - -class WalletConnectV1MainRequestView { - private let disposeBag = DisposeBag() - private let viewModel: WalletConnectV1MainRequestViewModel - weak var sourceViewController: UIViewController? - - init(viewModel: WalletConnectV1MainRequestViewModel) { - self.viewModel = viewModel - - subscribe(disposeBag, viewModel.openRequestSignal) { [weak self] in self?.open(request: $0) } - } - - private func open(request: WalletConnectRequest) { - var viewController: UIViewController? - - switch request { - case let request as WalletConnectSendEthereumTransactionRequest: - viewController = WalletConnectSendEthereumTransactionRequestModule.viewController(signService: viewModel.service, requestId: request.id) - case let request as WalletConnectSignMessageRequest: - viewController = WalletConnectSignMessageRequestModule.viewController(signService: viewModel.service, requestId: request.id) - default: () - } - - if let viewController = viewController { - sourceViewController?.present(ThemeNavigationController(rootViewController: viewController), animated: true) - } - } - -} - -extension WalletConnectV1MainRequestView: IWalletConnectMainRequestView { - -} \ No newline at end of file diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/V1/WalletConnectV1MainRequestViewModel.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/V1/WalletConnectV1MainRequestViewModel.swift deleted file mode 100644 index b32e5e4dd3..0000000000 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/V1/WalletConnectV1MainRequestViewModel.swift +++ /dev/null @@ -1,26 +0,0 @@ -import RxSwift -import RxRelay -import RxCocoa -import WalletConnectV1 - -class WalletConnectV1MainRequestViewModel { - private let disposeBag = DisposeBag() - let service: WalletConnectV1MainService - - private let openRequestRelay = PublishRelay() - - init(service: WalletConnectV1MainService) { - self.service = service - - subscribe(disposeBag, service.requestObservable) { [weak self] in self?.openRequestRelay.accept($0) } - } - -} - -extension WalletConnectV1MainRequestViewModel { - - var openRequestSignal: Signal { - openRequestRelay.asSignal() - } - -} \ No newline at end of file diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/V1/WalletConnectV1MainService.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/V1/WalletConnectV1MainService.swift deleted file mode 100644 index 611283422e..0000000000 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/V1/WalletConnectV1MainService.swift +++ /dev/null @@ -1,425 +0,0 @@ -import Foundation -import EvmKit -import WalletConnectV1 -import RxSwift -import RxRelay -import CurrencyKit -import BigInt -import HsToolKit - -class WalletConnectV1MainService { - private let disposeBag = DisposeBag() - private var waitingForSessionDisposeBag = DisposeBag() - - private let manager: WalletConnectManager - private let sessionManager: WalletConnectSessionManager - private let reachabilityManager: IReachabilityManager - private let accountManager: AccountManager - private let evmBlockchainManager: EvmBlockchainManager - - private var interactor: WalletConnectInteractor? - private var sessionData: SessionData? - - private let allowedBlockchainsRelay = PublishRelay<[WalletConnectMainModule.BlockchainItem]>() - private var blockchainItems = [WalletConnectMainModule.BlockchainItem]() { - didSet { - allowedBlockchainsRelay.accept(blockchainItems) - } - } - - private var stateRelay = PublishRelay() - private var connectionStateRelay = PublishRelay() - private var requestRelay = PublishRelay() - private let proposalTimeOutAttentionRelay = PublishRelay<()>() - private var errorRelay = PublishRelay() - - private var pendingRequests = [Int: WalletConnectRequest]() - private var requestIsProcessing = false - - private let queue = DispatchQueue(label: "\(AppConfig.label).wallet-connect-service", qos: .userInitiated) - - private(set) var state: WalletConnectMainModule.State = .idle { - didSet { - if oldValue != state { - stateRelay.accept(state) - } - } - } - - var connectionState: WalletConnectMainModule.ConnectionState { - guard let interactor = interactor else { - return .disconnected - } - return connectionState(state: interactor.state) - } - - init(session: WalletConnectSession? = nil, uri: String? = nil, manager: WalletConnectManager, sessionManager: WalletConnectSessionManager, reachabilityManager: IReachabilityManager, accountManager: AccountManager, evmBlockchainManager: EvmBlockchainManager) throws { - self.manager = manager - self.sessionManager = sessionManager - self.reachabilityManager = reachabilityManager - self.accountManager = accountManager - self.evmBlockchainManager = evmBlockchainManager - - if let session = session { - restore(session: session) - } - if let uri = uri { - try connect(uri: uri) - - state = .idle - } - - reachabilityManager.reachabilityObservable - .subscribeOn(ConcurrentDispatchQueueScheduler(qos: .background)) - .subscribe(onNext: { [weak self] reachable in - if reachable { - self?.interactor?.connect() - } - }) - .disposed(by: disposeBag) - } - - private func restore(session: WalletConnectSession) { - do { - try initSession(peerId: session.peerId, peerMeta: session.peerMeta, chainId: session.chainId) - - interactor = WalletConnectInteractor(session: session.session, remotePeerId: session.peerId) - interactor?.delegate = self - interactor?.connect() - - state = .ready - } catch { - state = .invalid(error: error) - } - } - - private func syncSession(peerId: String, peerMeta: WCPeerMeta, chainId: Int) throws { - guard let account = manager.activeAccount else { - throw WalletConnectMainModule.SessionError.noSuitableAccount - } - - guard let currentBlockchain = evmBlockchainManager.blockchain(chainId: chainId), - let evmKitWrapper = manager.evmKitWrapper(chainId: chainId, account: account) else { - throw WalletConnectMainModule.SessionError.noAnySupportedChainId - } - - let address = evmKitWrapper.evmKit.address.eip55 - - blockchainItems = evmBlockchainManager.allBlockchains - .sorted(by: { $0.type.order < $1.type.order }) - .map { blockchain in - WalletConnectMainModule.BlockchainItem( - namespace: "eip155", - chainId: evmBlockchainManager.chain(blockchainType: blockchain.type).id, - blockchain: blockchain, - address: address, - selected: blockchain == currentBlockchain - ) - } - - sessionData = SessionData(peerId: peerId, chainId: chainId, peerMeta: peerMeta, account: account, evmKitWrapper: evmKitWrapper) - } - - private func initSession(peerId: String, peerMeta: WCPeerMeta, chainId: Int) throws { - try syncSession(peerId: peerId, peerMeta: peerMeta, chainId: chainId) - } - - private func handleRequest(id: Int, requestResolver: () throws -> WalletConnectRequest) { - do { - let request = try requestResolver() - pendingRequests[id] = request - processNextRequest() - } catch { - interactor?.rejectRequest(id: id, message: error.smartDescription) - } - } - - private func processNextRequest() { - guard !requestIsProcessing else { - return - } - - guard let nextRequest = pendingRequests.values.first else { - return - } - - requestRelay.accept(nextRequest) - requestIsProcessing = true - } - - private func connectionState(state: WalletConnectInteractor.State) -> WalletConnectMainModule.ConnectionState { - switch state { - case .connected: return .connected - case .connecting: return .connecting - case .disconnected: return .disconnected - } - } - -} - -extension WalletConnectV1MainService: IWalletConnectMainService { - - var stateObservable: Observable { - stateRelay.asObservable() - } - - var allowedBlockchains: [WalletConnectMainModule.BlockchainItem] { - blockchainItems - } - - var allowedBlockchainsObservable: Observable<[WalletConnectMainModule.BlockchainItem]> { - allowedBlockchainsRelay.asObservable() - } - - var connectionStateObservable: Observable { - connectionStateRelay.asObservable() - } - - var requestObservable: Observable { - requestRelay.asObservable() - } - - var proposalTimeOutAttentionObservable: Observable<()> { - proposalTimeOutAttentionRelay.asObservable() - } - - var errorObservable: Observable { - errorRelay.asObservable() - } - - var activeAccountName: String? { - accountManager.activeAccount?.name - } - - var appMetaItem: WalletConnectMainModule.AppMetaItem? { - (sessionData?.peerMeta).map { - WalletConnectMainModule.AppMetaItem( - multiChain: false, - name: $0.name, - url: $0.url, - description: $0.description, - icons: $0.icons - ) - } - } - - var hint: String? { - switch connectionState { - case .disconnected: - if state == .waitingForApproveSession || state == .ready { - return "wallet_connect.no_connection".localized - } - case .connecting: return nil - case .connected: () - } - - switch state { - case .invalid(let error): - return error.smartDescription - case .waitingForApproveSession: - return "wallet_connect.connect_description".localized - case .ready: - return "wallet_connect.usage_description".localized - default: - return nil - } - } - - func select(chainId: Int) { - guard let sessionData = sessionData else { - return - } - - do { - try syncSession(peerId: sessionData.peerId, peerMeta: sessionData.peerMeta, chainId: chainId) - } catch { - print(error) - } - } - - func toggle(chainId: Int) { - // can't handle toggle, because it's only 1 chainId. - } - - func pendingRequest(requestId: Int) -> WalletConnectRequest? { - pendingRequests[requestId] - } - - func connect(uri: String) throws { - interactor = try WalletConnectInteractor(uri: uri) - interactor?.delegate = self - interactor?.connect() - - let timeOutTimer = Observable.just(()).delay(.seconds(WalletConnectListService.timeOutInterval), scheduler: ConcurrentDispatchQueueScheduler(qos: .userInitiated)) - - subscribe(waitingForSessionDisposeBag, timeOutTimer) { [weak self] in - self?.waitingForSessionDisposeBag = DisposeBag() - self?.proposalTimeOutAttentionRelay.accept(()) - } - } - - func reconnect() { - guard reachabilityManager.isReachable else { - errorRelay.accept(AppError.noConnection) - return - } - - interactor?.delegate = self - interactor?.connect() - } - - func approveSession() { - guard reachabilityManager.isReachable else { - errorRelay.accept(AppError.noConnection) - return - } - - guard let interactor = interactor, let sessionData = sessionData else { - return - } - - interactor.approveSession(address: sessionData.evmKitWrapper.evmKit.address.eip55, chainId: sessionData.evmKitWrapper.evmKit.chain.id) - - let session = WalletConnectSession( - chainId: sessionData.evmKitWrapper.evmKit.chain.id, - accountId: sessionData.account.id, - session: interactor.session, - peerId: sessionData.peerId, - peerMeta: sessionData.peerMeta - ) - - sessionManager.save(session: session) - - state = .ready - } - - func rejectSession() { - guard reachabilityManager.isReachable else { - errorRelay.accept(AppError.noConnection) - return - } - - guard let interactor = interactor else { - return - } - - interactor.rejectSession(message: "Session Rejected by User") - - state = .killed(reason: .rejectProposal) - } - - func approveRequest(id: Int, anyResult: Any) { - guard reachabilityManager.isReachable else { - errorRelay.accept(AppError.noConnection) - return - } - - queue.async { - if let request = self.pendingRequests.removeValue(forKey: id), let convertedResult = request.convert(result: anyResult) { - self.interactor?.approveRequest(id: id, result: convertedResult) - } - - self.requestIsProcessing = false - self.processNextRequest() - } - } - - func rejectRequest(id: Int) { - guard reachabilityManager.isReachable else { - errorRelay.accept(AppError.noConnection) - return - } - - queue.async { - self.pendingRequests.removeValue(forKey: id) - - self.interactor?.rejectRequest(id: id, message: "Rejected by user") - - self.requestIsProcessing = false - self.processNextRequest() - } - } - - func killSession() { - guard let interactor = interactor else { - return - } - - interactor.killSession() - } - -} - -extension WalletConnectV1MainService: IWalletConnectInteractorDelegate { - - func didUpdate(state: WalletConnectInteractor.State) { - connectionStateRelay.accept(connectionState(state: state)) - } - - func didRequestSession(peerId: String, peerMeta: WCPeerMeta, chainId: Int?) { - waitingForSessionDisposeBag = DisposeBag() - do { - let chainId = chainId ?? 1 // fallback to chainId = 1 (Ethereum MainNet) - - try initSession(peerId: peerId, peerMeta: peerMeta, chainId: chainId) - - state = .waitingForApproveSession - } catch { - interactor?.rejectSession(message: "Session Rejected: \(error)") - state = .invalid(error: error) - } - } - - func didKillSession() { - if let sessionData = sessionData { - sessionManager.deleteSession(peerId: sessionData.peerId) - } - - state = .killed(reason: .killSession) - } - - func didRequestSendEthereumTransaction(id: Int, transaction: WCEthereumTransaction) { - let chainId = sessionData?.chainId - let peerName = sessionData?.peerMeta.name - queue.async { - self.handleRequest(id: id) { - try WalletConnectSendEthereumTransactionRequest(id: id, chain: .init(id: chainId ?? 1), dAppName: peerName, transaction: transaction) - } - } - } - - func didRequestSignEthereumTransaction(id: Int, transaction: WCEthereumTransaction) { - print("didRequestSignEthereumTransaction") - } - - func didRequestSign(id: Int, payload: WCEthereumSignPayload) { - let chainId = sessionData?.chainId - let peerName = sessionData?.peerMeta.name - queue.async { - self.handleRequest(id: id) { - WalletConnectSignMessageRequest(id: id, chain: .init(id: chainId ?? 1), dAppName: peerName, payload: payload) - } - } - } - -} - -extension WalletConnectV1MainService { - - struct SessionData { - let peerId: String - let chainId: Int - let peerMeta: WCPeerMeta - let account: Account - let evmKitWrapper: EvmKitWrapper - } - -} - -extension WalletConnectV1MainService: IWalletConnectSignService { - - func approveRequest(id: Int, result: Data) { - approveRequest(id: id, anyResult: result) - } - -} diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/WalletConnectMainModule.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/WalletConnectMainModule.swift index f5ecf5707c..0f1c0c2b05 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/WalletConnectMainModule.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/WalletConnectMainModule.swift @@ -5,85 +5,36 @@ import WalletConnectSign import WalletConnectUtils import MarketKit -protocol IWalletConnectMainService { - var activeAccountName: String? { get } - var appMetaItem: WalletConnectMainModule.AppMetaItem? { get } - var allowedBlockchains: [WalletConnectMainModule.BlockchainItem] { get } - var allowedBlockchainsObservable: Observable<[WalletConnectMainModule.BlockchainItem]> { get } - var hint: String? { get } - var state: WalletConnectMainModule.State { get } - var connectionState: WalletConnectMainModule.ConnectionState { get } - - var stateObservable: Observable { get } - var connectionStateObservable: Observable { get } - var proposalTimeOutAttentionObservable: Observable<()> { get } - var errorObservable: Observable { get } - - func select(chainId: Int) - func toggle(chainId: Int) - func reconnect() - func approveSession() - func rejectSession() - func killSession() -} - -protocol IWalletConnectMainRequestView { - -} - struct WalletConnectMainModule { - static func viewController(session: WalletConnectSession, sourceViewController: UIViewController?) -> UIViewController? { - let service = try? WalletConnectV1MainService( - session: session, - manager: App.shared.walletConnectManager, - sessionManager: App.shared.walletConnectSessionManager, - reachabilityManager: App.shared.reachabilityManager, - accountManager: App.shared.accountManager, - evmBlockchainManager: App.shared.evmBlockchainManager - ) - - return service.flatMap { viewController(service: $0, sourceViewController: sourceViewController) } - } - static func viewController(session: WalletConnectSign.Session? = nil, proposal: WalletConnectSign.Session.Proposal? = nil, sourceViewController: UIViewController?) -> UIViewController? { - let service = App.shared.walletConnectV2SessionManager.service + let service = App.shared.walletConnectSessionManager.service - let mainService = WalletConnectV2MainService( + let mainService = WalletConnectMainService( session: session, proposal: proposal, service: service, manager: App.shared.walletConnectManager, reachabilityManager: App.shared.reachabilityManager, accountManager: App.shared.accountManager, - evmBlockchainManager: App.shared.evmBlockchainManager, - evmChainParser: WalletConnectEvmChainParser() + evmBlockchainManager: App.shared.evmBlockchainManager ) return viewController(service: mainService, sourceViewController: sourceViewController) } - static func viewController(service: IWalletConnectMainService, sourceViewController: UIViewController?) -> UIViewController? { + static func viewController(service: WalletConnectMainService, sourceViewController: UIViewController?) -> UIViewController? { let viewModel = WalletConnectMainViewModel(service: service) let viewController = WalletConnectMainViewController(viewModel: viewModel, sourceViewController: sourceViewController) - switch service { - case let service as WalletConnectV1MainService: - let requestViewModel = WalletConnectV1MainRequestViewModel(service: service) - let requestView = WalletConnectV1MainRequestView(viewModel: requestViewModel) - requestView.sourceViewController = viewController - - viewController.requestView = requestView - case let service as WalletConnectV2MainService: - let pendingRequestService = WalletConnectV2MainPendingRequestService( - service: service, - accountManager: App.shared.accountManager, - sessionManager: App.shared.walletConnectV2SessionManager, - evmBlockchainManager: App.shared.evmBlockchainManager, - signService: App.shared.walletConnectV2SessionManager.service) - let pendingRequestViewModel = WalletConnectV2MainPendingRequestViewModel(service: pendingRequestService) - viewController.pendingRequestViewModel = pendingRequestViewModel - default: return nil - } + + let pendingRequestService = WalletConnectMainPendingRequestService( + service: service, + accountManager: App.shared.accountManager, + sessionManager: App.shared.walletConnectSessionManager, + evmBlockchainManager: App.shared.evmBlockchainManager, + signService: App.shared.walletConnectSessionManager.service) + let pendingRequestViewModel = WalletConnectMainPendingRequestViewModel(service: pendingRequestService) + viewController.pendingRequestViewModel = pendingRequestViewModel return ThemeNavigationController(rootViewController: viewController) } @@ -93,7 +44,6 @@ struct WalletConnectMainModule { extension WalletConnectMainModule { struct AppMetaItem { - let multiChain: Bool let name: String let url: String let description: String diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/V2/WalletConnectV2MainService.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/WalletConnectMainService.swift similarity index 95% rename from UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/V2/WalletConnectV2MainService.swift rename to UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/WalletConnectMainService.swift index 165de4a9cc..97678be359 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/V2/WalletConnectV2MainService.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/WalletConnectMainService.swift @@ -5,15 +5,14 @@ import WalletConnectSign import HsToolKit import EvmKit -class WalletConnectV2MainService { +class WalletConnectMainService { private let disposeBag = DisposeBag() - private let service: WalletConnectV2Service + private let service: WalletConnectService private let manager: WalletConnectManager private let reachabilityManager: IReachabilityManager private let accountManager: AccountManager private let evmBlockchainManager: EvmBlockchainManager - private let evmChainParser: WalletConnectEvmChainParser private var proposal: WalletConnectSign.Session.Proposal? private(set) var session: WalletConnectSign.Session? { @@ -40,7 +39,7 @@ class WalletConnectV2MainService { } } - init(session: WalletConnectSign.Session? = nil, proposal: WalletConnectSign.Session.Proposal? = nil, service: WalletConnectV2Service, manager: WalletConnectManager, reachabilityManager: IReachabilityManager, accountManager: AccountManager, evmBlockchainManager: EvmBlockchainManager, evmChainParser: WalletConnectEvmChainParser) { + init(session: WalletConnectSign.Session? = nil, proposal: WalletConnectSign.Session.Proposal? = nil, service: WalletConnectService, manager: WalletConnectManager, reachabilityManager: IReachabilityManager, accountManager: AccountManager, evmBlockchainManager: EvmBlockchainManager) { self.session = session self.proposal = proposal self.service = service @@ -48,7 +47,6 @@ class WalletConnectV2MainService { self.reachabilityManager = reachabilityManager self.accountManager = accountManager self.evmBlockchainManager = evmBlockchainManager - self.evmChainParser = evmChainParser subscribe(disposeBag, service.receiveProposalObservable) { [weak self] in self?.proposal = $0 @@ -193,7 +191,7 @@ class WalletConnectV2MainService { } -extension WalletConnectV2MainService: IWalletConnectMainService { +extension WalletConnectMainService { var activeAccountName: String? { accountManager.activeAccount?.name @@ -202,7 +200,6 @@ extension WalletConnectV2MainService: IWalletConnectMainService { var appMetaItem: WalletConnectMainModule.AppMetaItem? { if let session = session { return WalletConnectMainModule.AppMetaItem( - multiChain: true, name: session.peer.name, url: session.peer.url, description: session.peer.description, @@ -211,7 +208,6 @@ extension WalletConnectV2MainService: IWalletConnectMainService { } if let proposal = proposal { return WalletConnectMainModule.AppMetaItem( - multiChain: true, name: proposal.proposer.name, url: proposal.proposer.url, description: proposal.proposer.description, @@ -277,7 +273,7 @@ extension WalletConnectV2MainService: IWalletConnectMainService { } func select(chainId: Int) { - // not required for V2 + // not required for V2 // todo: Refactor and remove } func toggle(chainId: Int) { @@ -389,7 +385,7 @@ extension WalletConnectV2MainService: IWalletConnectMainService { } -extension WalletConnectV2MainService { +extension WalletConnectMainService { struct RejectionReason: Reason { let code: Int diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/WalletConnectMainViewController.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/WalletConnectMainViewController.swift index 2a40a6c470..69bcc45a9d 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/WalletConnectMainViewController.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/WalletConnectMainViewController.swift @@ -15,9 +15,7 @@ class WalletConnectMainViewController: ThemeViewController { private weak var sourceViewController: UIViewController? - var requestView: IWalletConnectMainRequestView? - - var pendingRequestViewModel: WalletConnectV2MainPendingRequestViewModel? { + var pendingRequestViewModel: WalletConnectMainPendingRequestViewModel? { didSet { pendingRequestDisposeBag = DisposeBag() if let viewModel = pendingRequestViewModel { @@ -30,7 +28,7 @@ class WalletConnectMainViewController: ThemeViewController { } } } - private var pendingRequestViewItems = [WalletConnectV2MainPendingRequestViewModel.ViewItem]() + private var pendingRequestViewItems = [WalletConnectMainPendingRequestViewModel.ViewItem]() private let spinner = HUDActivityView.create(with: .large48) private let buttonsHolder = BottomGradientHolder() @@ -222,9 +220,9 @@ class WalletConnectMainViewController: ThemeViewController { } } - // V2 pending requests section + // pending requests section - private func sync(pendingRequestViewItems: [WalletConnectV2MainPendingRequestViewModel.ViewItem]) { + private func sync(pendingRequestViewItems: [WalletConnectMainPendingRequestViewModel.ViewItem]) { self.pendingRequestViewItems = pendingRequestViewItems tableView.reload() @@ -234,12 +232,12 @@ class WalletConnectMainViewController: ThemeViewController { pendingRequestViewModel?.onSelect(requestId: requestId) } - private func onTapReject(pendingRequestViewItem: WalletConnectV2MainPendingRequestViewModel.ViewItem) { + private func onTapReject(pendingRequestViewItem: WalletConnectMainPendingRequestViewModel.ViewItem) { pendingRequestViewModel?.onReject(id: pendingRequestViewItem.id) } private func showPending(request: WalletConnectRequest) { - guard let viewController = WalletConnectRequestModule.viewController(signService: App.shared.walletConnectV2SessionManager.service, request: request) else { + guard let viewController = WalletConnectRequestModule.viewController(signService: App.shared.walletConnectSessionManager.service, request: request) else { return } @@ -251,7 +249,7 @@ class WalletConnectMainViewController: ThemeViewController { extension WalletConnectMainViewController: SectionsDataSource { - private func pendingRequestCell(viewItem: WalletConnectV2MainPendingRequestViewModel.ViewItem, isFirst: Bool, isLast: Bool) -> RowProtocol { + private func pendingRequestCell(viewItem: WalletConnectMainPendingRequestViewModel.ViewItem, isFirst: Bool, isLast: Bool) -> RowProtocol { var elements: [CellBuilderNew.CellElement] = [ .vStackCentered([ .text { component in diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/WalletConnectMainViewModel.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/WalletConnectMainViewModel.swift index bc2908348e..30580818f1 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/WalletConnectMainViewModel.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Main/WalletConnectMainViewModel.swift @@ -8,7 +8,7 @@ import EvmKit class WalletConnectMainViewModel { private let scheduler = SerialDispatchQueueScheduler(qos: .userInitiated, internalSerialQueueName: "\(AppConfig.label).wallet_connect_main") - private let service: IWalletConnectMainService + private let service: WalletConnectMainService private let disposeBag = DisposeBag() private let showErrorRelay = PublishRelay() @@ -24,7 +24,7 @@ class WalletConnectMainViewModel { private let viewItemRelay = BehaviorRelay(value: nil) private let finishRelay = PublishRelay() - init(service: IWalletConnectMainService) { + init(service: WalletConnectMainService) { self.service = service subscribe(scheduler, disposeBag, service.errorObservable) { [weak self] in @@ -82,27 +82,15 @@ class WalletConnectMainViewModel { var networkEditable = false var blockchains: [BlockchainViewItem]? - let multiChain = service.appMetaItem?.multiChain ?? false - - if multiChain { - // v2 - blockchains = allowedBlockchains - .map { item in - BlockchainViewItem( - chainId: item.chainId, - chainTitle: item.blockchain.name, - address: item.address.shortened, - selected: item.selected - ) - } - } else { - // v1 - if let blockchainItem = allowedBlockchains.first(where: { $0.selected }) { - address = blockchainItem.address.shortened - network = blockchainItem.blockchain.name - networkEditable = state == .waitingForApproveSession - } - } + blockchains = allowedBlockchains + .map { item in + BlockchainViewItem( + chainId: item.chainId, + chainTitle: item.blockchain.name, + address: item.address.shortened, + selected: item.selected + ) + } let viewItem = ViewItem( dAppMeta: service.appMetaItem.map { dAppMetaViewItem(appMetaItem: $0) }, diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/V2/WalletConnectV2PairingModule.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/V2/WalletConnectV2PairingModule.swift deleted file mode 100644 index 9d3579c2ca..0000000000 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/V2/WalletConnectV2PairingModule.swift +++ /dev/null @@ -1,13 +0,0 @@ -import UIKit -import ThemeKit - -struct WalletConnectV2PairingModule { - - static func viewController() -> UIViewController { - let service = WalletConnectV2PairingService(sessionManager: App.shared.walletConnectV2SessionManager) - - let viewModel = WalletConnectV2PairingViewModel(service: service) - return WalletConnectV2PairingViewController(viewModel: viewModel) - } - -} diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/WalletConnectPairingModule.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/WalletConnectPairingModule.swift new file mode 100644 index 0000000000..4997250696 --- /dev/null +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/WalletConnectPairingModule.swift @@ -0,0 +1,13 @@ +import UIKit +import ThemeKit + +struct WalletConnectPairingModule { + + static func viewController() -> UIViewController { + let service = WalletConnectPairingService(sessionManager: App.shared.walletConnectSessionManager) + + let viewModel = WalletConnectPairingViewModel(service: service) + return WalletConnectPairingViewController(viewModel: viewModel) + } + +} diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/V2/WalletConnectV2PairingService.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/WalletConnectPairingService.swift similarity index 91% rename from UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/V2/WalletConnectV2PairingService.swift rename to UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/WalletConnectPairingService.swift index 2b4e0a65fd..0e8fb716e9 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/V2/WalletConnectV2PairingService.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/WalletConnectPairingService.swift @@ -2,10 +2,10 @@ import RxSwift import RxRelay import WalletConnectPairing -class WalletConnectV2PairingService { +class WalletConnectPairingService { private var disposeBag = DisposeBag() - private let sessionManager: WalletConnectV2SessionManager + private let sessionManager: WalletConnectSessionManager private let itemsRelay = PublishRelay<[Item]>() private(set) var items = [Item]() { @@ -16,7 +16,7 @@ class WalletConnectV2PairingService { private let pairingKillingRelay = PublishRelay() - init(sessionManager: WalletConnectV2SessionManager) { + init(sessionManager: WalletConnectSessionManager) { self.sessionManager = sessionManager subscribe(disposeBag, sessionManager.pairingsObservable) { [weak self] _ in self?.syncPairings() } @@ -37,7 +37,7 @@ class WalletConnectV2PairingService { } -extension WalletConnectV2PairingService { +extension WalletConnectPairingService { var itemsObservable: Observable<[Item]> { itemsRelay.asObservable() @@ -82,7 +82,7 @@ extension WalletConnectV2PairingService { } -extension WalletConnectV2PairingService { +extension WalletConnectPairingService { enum PairingKillingState { case processing diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/V2/WalletConnectV2PairingViewController.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/WalletConnectPairingViewController.swift similarity index 89% rename from UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/V2/WalletConnectV2PairingViewController.swift rename to UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/WalletConnectPairingViewController.swift index 6f493f4867..bc78a4a523 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/V2/WalletConnectV2PairingViewController.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/WalletConnectPairingViewController.swift @@ -4,16 +4,16 @@ import ThemeKit import RxSwift import ComponentKit -class WalletConnectV2PairingViewController: ThemeViewController { - private let viewModel: WalletConnectV2PairingViewModel +class WalletConnectPairingViewController: ThemeViewController { + private let viewModel: WalletConnectPairingViewModel private let disposeBag = DisposeBag() private let tableView = SectionsTableView(style: .grouped) private var isLoaded = false - private var viewItems = [WalletConnectV2PairingViewModel.ViewItem]() + private var viewItems = [WalletConnectPairingViewModel.ViewItem]() - init(viewModel: WalletConnectV2PairingViewModel) { + init(viewModel: WalletConnectPairingViewModel) { self.viewModel = viewModel super.init() @@ -55,7 +55,7 @@ class WalletConnectV2PairingViewController: ThemeViewController { isLoaded = true } - private func sync(items: [WalletConnectV2PairingViewModel.ViewItem]) { + private func sync(items: [WalletConnectPairingViewModel.ViewItem]) { viewItems = items guard !viewItems.isEmpty else { navigationController?.popViewController(animated: true) @@ -74,7 +74,7 @@ class WalletConnectV2PairingViewController: ThemeViewController { tableView.reload() } - private func cell(tableView: UITableView, viewItem: WalletConnectV2PairingViewModel.ViewItem, isFirst: Bool, isLast: Bool, action: (() -> ())? = nil) -> RowProtocol { + private func cell(tableView: UITableView, viewItem: WalletConnectPairingViewModel.ViewItem, isFirst: Bool, isLast: Bool, action: (() -> ())? = nil) -> RowProtocol { let elements: [CellBuilderNew.CellElement] = [ .image32 { component in component.imageView.layer.cornerCurve = .continuous @@ -117,7 +117,7 @@ class WalletConnectV2PairingViewController: ThemeViewController { ) } - private func section(viewItems: [WalletConnectV2PairingViewModel.ViewItem]) -> SectionProtocol { + private func section(viewItems: [WalletConnectPairingViewModel.ViewItem]) -> SectionProtocol { Section( id: "section-list", headerState: .margin(height: .margin12), @@ -162,7 +162,7 @@ class WalletConnectV2PairingViewController: ThemeViewController { } -extension WalletConnectV2PairingViewController: SectionsDataSource { +extension WalletConnectPairingViewController: SectionsDataSource { func buildSections() -> [SectionProtocol] { var sections = [section(viewItems: viewItems)] diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/V2/WalletConnectV2PairingViewModel.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/WalletConnectPairingViewModel.swift similarity index 80% rename from UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/V2/WalletConnectV2PairingViewModel.swift rename to UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/WalletConnectPairingViewModel.swift index 7e1beed874..74c5ab1687 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/V2/WalletConnectV2PairingViewModel.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Pairings/WalletConnectPairingViewModel.swift @@ -2,15 +2,15 @@ import RxSwift import RxRelay import RxCocoa -class WalletConnectV2PairingViewModel { - private let service: WalletConnectV2PairingService +class WalletConnectPairingViewModel { + private let service: WalletConnectPairingService private let disposeBag = DisposeBag() private let viewItemRelay = BehaviorRelay<[ViewItem]>(value: []) private let showDisconnectingRelay = PublishRelay<()>() private let showDisconnectedRelay = PublishRelay() - init(service: WalletConnectV2PairingService) { + init(service: WalletConnectPairingService) { self.service = service subscribe(disposeBag, service.itemsObservable) { [weak self] in self?.sync(items: $0) } @@ -19,7 +19,7 @@ class WalletConnectV2PairingViewModel { sync(items: service.items) } - private func sync(items: [WalletConnectV2PairingService.Item]) { + private func sync(items: [WalletConnectPairingService.Item]) { let viewItems = items.map { item in ViewItem(topic: item.topic, title: item.appName, description: item.appUrl, imageUrl: item.appIcons.first) } @@ -27,7 +27,7 @@ class WalletConnectV2PairingViewModel { viewItemRelay.accept(viewItems) } - private func sync(pairingKillingState: WalletConnectV2PairingService.PairingKillingState) { + private func sync(pairingKillingState: WalletConnectPairingService.PairingKillingState) { switch pairingKillingState { case .processing: showDisconnectingRelay.accept(()) case .completed: showDisconnectedRelay.accept(true) @@ -37,7 +37,7 @@ class WalletConnectV2PairingViewModel { } -extension WalletConnectV2PairingViewModel { +extension WalletConnectPairingViewModel { var viewItemsDriver: Driver<[ViewItem]> { viewItemRelay.asDriver() @@ -62,7 +62,7 @@ extension WalletConnectV2PairingViewModel { } -extension WalletConnectV2PairingViewModel { +extension WalletConnectPairingViewModel { struct ViewItem { let topic: String diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectPendingRequestsModule.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectPendingRequestsModule.swift new file mode 100644 index 0000000000..0180345ad4 --- /dev/null +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectPendingRequestsModule.swift @@ -0,0 +1,18 @@ +import UIKit +import ThemeKit + +struct WalletConnectPendingRequestsModule { + + static func viewController() -> UIViewController { + let service = WalletConnectPendingRequestsService( + sessionManager: App.shared.walletConnectSessionManager, + accountManager: App.shared.accountManager, + evmBlockchainManager: App.shared.evmBlockchainManager, + signService: App.shared.walletConnectSessionManager.service + ) + + let viewModel = WalletConnectPendingRequestsViewModel(service: service) + return WalletConnectPendingRequestsViewController(viewModel: viewModel) + } + +} diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectV2PendingRequestsService.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectPendingRequestsService.swift similarity index 91% rename from UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectV2PendingRequestsService.swift rename to UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectPendingRequestsService.swift index 418b526e1d..3597715365 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectV2PendingRequestsService.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectPendingRequestsService.swift @@ -1,10 +1,10 @@ import RxSwift import RxRelay -class WalletConnectV2PendingRequestsService { +class WalletConnectPendingRequestsService { private let disposeBag = DisposeBag() - private let sessionManager: WalletConnectV2SessionManager + private let sessionManager: WalletConnectSessionManager private let accountManager: AccountManager private let evmBlockchainManager: EvmBlockchainManager private let signService: IWalletConnectSignService @@ -20,7 +20,7 @@ class WalletConnectV2PendingRequestsService { private let showPendingRequestRelay = PublishRelay() - init(sessionManager: WalletConnectV2SessionManager, accountManager: AccountManager, evmBlockchainManager: EvmBlockchainManager, signService: IWalletConnectSignService) { + init(sessionManager: WalletConnectSessionManager, accountManager: AccountManager, evmBlockchainManager: EvmBlockchainManager, signService: IWalletConnectSignService) { self.sessionManager = sessionManager self.accountManager = accountManager self.evmBlockchainManager = evmBlockchainManager @@ -82,7 +82,7 @@ class WalletConnectV2PendingRequestsService { } -extension WalletConnectV2PendingRequestsService { +extension WalletConnectPendingRequestsService { func blockchain(chainId: String?) -> String? { guard let chainId = chainId, @@ -120,7 +120,7 @@ extension WalletConnectV2PendingRequestsService { let chain = WalletConnectRequest.Chain(id: chainId, chainName: blockchain.name, address: address.eip55) - guard let wcRequest = try? WalletConnectV2RequestMapper.map(dAppName: session?.peer.name, chain: chain, request: request) else { + guard let wcRequest = try? WalletConnectRequestMapper.map(dAppName: session?.peer.name, chain: chain, request: request) else { return } @@ -137,7 +137,7 @@ extension WalletConnectV2PendingRequestsService { } -extension WalletConnectV2PendingRequestsService { +extension WalletConnectPendingRequestsService { struct RequestItem { let id: Int diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectV2PendingRequestsViewController.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectPendingRequestsViewController.swift similarity index 90% rename from UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectV2PendingRequestsViewController.swift rename to UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectPendingRequestsViewController.swift index ae267e3e36..1683a30e4a 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectV2PendingRequestsViewController.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectPendingRequestsViewController.swift @@ -4,16 +4,16 @@ import ThemeKit import RxSwift import ComponentKit -class WalletConnectV2PendingRequestsViewController: ThemeViewController { - private let viewModel: WalletConnectV2PendingRequestsViewModel +class WalletConnectPendingRequestsViewController: ThemeViewController { + private let viewModel: WalletConnectPendingRequestsViewModel private let disposeBag = DisposeBag() private let tableView = SectionsTableView(style: .grouped) private var isLoaded = false - private var viewItems = [WalletConnectV2PendingRequestsViewModel.SectionViewItem]() + private var viewItems = [WalletConnectPendingRequestsViewModel.SectionViewItem]() - init(viewModel: WalletConnectV2PendingRequestsViewModel) { + init(viewModel: WalletConnectPendingRequestsViewModel) { self.viewModel = viewModel super.init() @@ -48,7 +48,7 @@ class WalletConnectV2PendingRequestsViewController: ThemeViewController { isLoaded = true } - private func sync(items: [WalletConnectV2PendingRequestsViewModel.SectionViewItem]) { + private func sync(items: [WalletConnectPendingRequestsViewModel.SectionViewItem]) { viewItems = items guard !viewItems.isEmpty else { navigationController?.popViewController(animated: true) @@ -76,7 +76,7 @@ class WalletConnectV2PendingRequestsViewController: ThemeViewController { } private func showPending(request: WalletConnectRequest) { - guard let viewController = WalletConnectRequestModule.viewController(signService: App.shared.walletConnectV2SessionManager.service, request: request) else { + guard let viewController = WalletConnectRequestModule.viewController(signService: App.shared.walletConnectSessionManager.service, request: request) else { return } @@ -114,7 +114,7 @@ class WalletConnectV2PendingRequestsViewController: ThemeViewController { ) } - private func section(sectionViewItem: WalletConnectV2PendingRequestsViewModel.SectionViewItem) -> SectionProtocol { + private func section(sectionViewItem: WalletConnectPendingRequestsViewModel.SectionViewItem) -> SectionProtocol { Section(id: "section-\(sectionViewItem.title)", headerState: .margin(height: .margin12), footerState: sectionViewItem.selected ? .margin(height: .margin32) : tableView.sectionFooter(text: "wallet_connect.pending_requests.nonactive_footer".localized), @@ -182,13 +182,13 @@ class WalletConnectV2PendingRequestsViewController: ThemeViewController { ) } - private func onTapReject(viewItem: WalletConnectV2PendingRequestsViewModel.ViewItem) { + private func onTapReject(viewItem: WalletConnectPendingRequestsViewModel.ViewItem) { viewModel.onReject(id: viewItem.id) } } -extension WalletConnectV2PendingRequestsViewController: SectionsDataSource { +extension WalletConnectPendingRequestsViewController: SectionsDataSource { func buildSections() -> [SectionProtocol] { viewItems.map { section(sectionViewItem: $0) } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectV2PendingRequestsViewModel.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectPendingRequestsViewModel.swift similarity index 85% rename from UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectV2PendingRequestsViewModel.swift rename to UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectPendingRequestsViewModel.swift index e1b906eaa6..9516f20836 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectV2PendingRequestsViewModel.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectPendingRequestsViewModel.swift @@ -2,14 +2,14 @@ import RxSwift import RxRelay import RxCocoa -class WalletConnectV2PendingRequestsViewModel { - private let service: WalletConnectV2PendingRequestsService +class WalletConnectPendingRequestsViewModel { + private let service: WalletConnectPendingRequestsService private let disposeBag = DisposeBag() private let sectionViewItemsRelay = BehaviorRelay<[SectionViewItem]>(value: []) private let showPendingRequestRelay = PublishRelay() - init(service: WalletConnectV2PendingRequestsService) { + init(service: WalletConnectPendingRequestsService) { self.service = service subscribe(disposeBag, service.itemsObservable) { [weak self] in @@ -22,7 +22,7 @@ class WalletConnectV2PendingRequestsViewModel { sync(items: service.items) } - private func sync(items: [WalletConnectV2PendingRequestsService.Item]) { + private func sync(items: [WalletConnectPendingRequestsService.Item]) { let viewItems = items.map { item in SectionViewItem( id: item.accountId, @@ -45,7 +45,7 @@ class WalletConnectV2PendingRequestsViewModel { } -extension WalletConnectV2PendingRequestsViewModel { +extension WalletConnectPendingRequestsViewModel { var sectionViewItemsDriver: Driver<[SectionViewItem]> { sectionViewItemsRelay.asDriver() @@ -69,7 +69,7 @@ extension WalletConnectV2PendingRequestsViewModel { } -extension WalletConnectV2PendingRequestsViewModel { +extension WalletConnectPendingRequestsViewModel { struct ViewItem { let id: Int @@ -88,7 +88,7 @@ extension WalletConnectV2PendingRequestsViewModel { } -extension WalletConnectV2PendingRequestsService.RequestMethod { +extension WalletConnectPendingRequestsService.RequestMethod { var title: String { switch self { diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectV2PendingRequestsModule.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectV2PendingRequestsModule.swift deleted file mode 100644 index 9576a9d912..0000000000 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/PendingRequests/V2/WalletConnectV2PendingRequestsModule.swift +++ /dev/null @@ -1,18 +0,0 @@ -import UIKit -import ThemeKit - -struct WalletConnectV2PendingRequestsModule { - - static func viewController() -> UIViewController { - let service = WalletConnectV2PendingRequestsService( - sessionManager: App.shared.walletConnectV2SessionManager, - accountManager: App.shared.accountManager, - evmBlockchainManager: App.shared.evmBlockchainManager, - signService: App.shared.walletConnectV2SessionManager.service - ) - - let viewModel = WalletConnectV2PendingRequestsViewModel(service: service) - return WalletConnectV2PendingRequestsViewController(viewModel: viewModel) - } - -} diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Request/SendEthereumTransaction/WalletConnectSendEthereumTransactionRequestModule.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Request/SendEthereumTransaction/WalletConnectSendEthereumTransactionRequestModule.swift index c90d91e3e9..34634aa5b7 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Request/SendEthereumTransaction/WalletConnectSendEthereumTransactionRequestModule.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Request/SendEthereumTransaction/WalletConnectSendEthereumTransactionRequestModule.swift @@ -4,14 +4,6 @@ import MarketKit struct WalletConnectSendEthereumTransactionRequestModule { - static func viewController(signService: WalletConnectV1MainService, requestId: Int) -> UIViewController? { - guard let request = signService.pendingRequest(requestId: requestId) as? WalletConnectSendEthereumTransactionRequest else { - return nil - } - - return viewController(signService: signService, request: request) - } - static func viewController(signService: IWalletConnectSignService, request: WalletConnectSendEthereumTransactionRequest) -> UIViewController? { guard let account = App.shared.accountManager.activeAccount, let evmKitWrapper = App.shared.walletConnectManager.evmKitWrapper(chainId: request.chain.id, account: account) else { diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Request/Sign/WalletConnectSignMessageRequestModule.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Request/Sign/WalletConnectSignMessageRequestModule.swift index b49661fa12..7a1d63e2d6 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Request/Sign/WalletConnectSignMessageRequestModule.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Request/Sign/WalletConnectSignMessageRequestModule.swift @@ -3,14 +3,6 @@ import EvmKit struct WalletConnectSignMessageRequestModule { - static func viewController(signService: WalletConnectV1MainService, requestId: Int) -> UIViewController? { - guard let request = signService.pendingRequest(requestId: requestId) as? WalletConnectSignMessageRequest else { - return nil - } - - return viewController(signService: signService, request: request) - } - static func viewController(signService: IWalletConnectSignService, request: WalletConnectSignMessageRequest) -> UIViewController? { guard let account = App.shared.accountManager.activeAccount, let evmWrapper = App.shared.walletConnectManager.evmKitWrapper(chainId: request.chain.id, account: account), diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Request/WalletConnectV2RequestMapper.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Request/WalletConnectRequestMapper.swift similarity index 98% rename from UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Request/WalletConnectV2RequestMapper.swift rename to UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Request/WalletConnectRequestMapper.swift index d2179b864f..8a5db0ba06 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Request/WalletConnectV2RequestMapper.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Request/WalletConnectRequestMapper.swift @@ -3,7 +3,7 @@ import WalletConnectSign import WalletConnectV1 import HsExtensions -struct WalletConnectV2RequestMapper { +struct WalletConnectRequestMapper { static func map(dAppName: String?, chain: WalletConnectRequest.Chain, request: WalletConnectSign.Request) throws -> WalletConnectRequest? { let id = request.id.intValue diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Request/WalletConnectRequestModule.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Request/WalletConnectRequestModule.swift index fe10d33c18..b4d854dd35 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Request/WalletConnectRequestModule.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Request/WalletConnectRequestModule.swift @@ -22,10 +22,10 @@ struct WalletConnectRequestModule { static func viewController(signService: IWalletConnectSignService, request: WalletConnectRequest) -> UIViewController? { switch request { case let request as WalletConnectSignMessageRequest: - let service = App.shared.walletConnectV2SessionManager.service + let service = App.shared.walletConnectSessionManager.service return WalletConnectSignMessageRequestModule.viewController(signService: service, request: request) case let request as WalletConnectSendEthereumTransactionRequest: - let service = App.shared.walletConnectV2SessionManager.service + let service = App.shared.walletConnectSessionManager.service return WalletConnectSendEthereumTransactionRequestModule.viewController(signService: service, request: request) default: return nil } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectService.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectService.swift index b1421aad2a..74caa6028e 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectService.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectService.swift @@ -1,338 +1,384 @@ import Foundation -import EvmKit -import WalletConnectV1 +import CryptoSwift import RxSwift import RxRelay -import CurrencyKit -import BigInt +import Combine +import Starscream +import WalletConnectKMS +import WalletConnectSign +import WalletConnectRelay +import WalletConnectUtils +import WalletConnectNetworking +import WalletConnectPairing import HsToolKit -class WalletConnectService { - private let manager: WalletConnectManager - private let sessionManager: WalletConnectSessionManager - private let reachabilityManager: IReachabilityManager - private let disposeBag = DisposeBag() +extension Starscream.WebSocket: WebSocketConnecting { } - private var interactor: WalletConnectInteractor? - private var sessionData: SessionData? +struct SocketFactory: WebSocketFactory { + func create(with url: URL) -> WebSocketConnecting { + Starscream.WebSocket(url: url) + } +} - private var stateRelay = PublishRelay() - private var connectionStateRelay = PublishRelay() - private var requestRelay = PublishRelay() - private var errorRelay = PublishRelay() +class WalletConnectService { + private let logger: Logger? + private let connectionService: WalletConnectSocketConnectionService + private let sessionRequestFilterManager: SessionRequestFilterManager - private var pendingRequests = [Int: WalletConnectRequest]() - private var requestIsProcessing = false + private let receiveProposalSubject = PublishSubject() + private let receiveSessionRelay = PublishRelay() + private let deleteSessionRelay = PublishRelay<(String, WalletConnectSign.Reason)>() - private let queue = DispatchQueue(label: "\(AppConfig.label).wallet-connect-service", qos: .userInitiated) + private let sessionsItemUpdatedRelay = PublishRelay<()>() + private let pendingRequestsUpdatedRelay = PublishRelay<()>() + private let pairingUpdatedRelay = PublishRelay<()>() + private let sessionRequestReceivedRelay = PublishRelay() - private(set) var state: State = .idle { + private let socketConnectionStatusRelay = PublishRelay() + private(set) var socketConnectionStatus: WalletConnectMainModule.ConnectionState = .disconnected { didSet { - stateRelay.accept(state) + socketConnectionStatusRelay.accept(socketConnectionStatus) } } - var connectionState: WalletConnectInteractor.State { - interactor?.state ?? .disconnected - } - - init(session: WalletConnectSession?, uri: String?, manager: WalletConnectManager, sessionManager: WalletConnectSessionManager, reachabilityManager: IReachabilityManager) { - self.manager = manager - self.sessionManager = sessionManager - self.reachabilityManager = reachabilityManager + private var publishers = [AnyCancellable]() + + init(connectionService: WalletConnectSocketConnectionService, sessionRequestFilterManager: SessionRequestFilterManager, info: WalletConnectClientInfo, logger: Logger? = nil) { + self.connectionService = connectionService + self.sessionRequestFilterManager = sessionRequestFilterManager + self.logger = logger + let metadata = WalletConnectSign.AppMetadata( + name: info.name, + description: info.description, + url: info.url, + icons: info.icons + ) - if let session = session { - restore(session: session) - } - if let uri = uri { - do { - try connect(uri: uri) + Networking.configure(projectId: info.projectId, socketFactory: SocketFactory(), socketConnectionType: .manual) + Pair.configure(metadata: metadata) + setUpAuthSubscribing() - state = .ready - } catch { - state = .invalid(error: error) - } - } + connectionService.relayClient = Relay.instance - reachabilityManager.reachabilityObservable - .subscribeOn(ConcurrentDispatchQueueScheduler(qos: .background)) - .subscribe(onNext: { [weak self] reachable in - if reachable { - self?.interactor?.connect() - } - }) - .disposed(by: disposeBag) + updateSessions() + updatePairings() } - private func restore(session: WalletConnectSession) { - do { - try initSession(peerId: session.peerId, peerMeta: session.peerMeta, chainId: session.chainId) + func setUpAuthSubscribing() { + Sign.instance.socketConnectionStatusPublisher + .receive(on: DispatchQueue.main) + .sink { [weak self] status in + self?.didChangeSocketConnectionStatus(status) + }.store(in: &publishers) + + Sign.instance.sessionProposalPublisher + .receive(on: DispatchQueue.main) + .sink { [weak self] sessionProposal in + self?.didReceive(sessionProposal: sessionProposal.proposal) + }.store(in: &publishers) + + Sign.instance.sessionSettlePublisher + .receive(on: DispatchQueue.main) + .sink { [weak self] session in + self?.didSettle(session: session) + }.store(in: &publishers) + + Sign.instance.sessionUpdatePublisher + .receive(on: DispatchQueue.main) + .sink { [weak self] pair in + self?.didUpdate(sessionTopic: pair.sessionTopic, namespaces: pair.namespaces) + }.store(in: &publishers) + + Sign.instance.sessionRequestPublisher + .receive(on: DispatchQueue.main) + .sink { [weak self] sessionRequest in + self?.didReceive(sessionRequest: sessionRequest.request) + }.store(in: &publishers) + + Sign.instance.sessionDeletePublisher + .receive(on: DispatchQueue.main) + .sink { [weak self] tuple in + self?.didDelete(sessionTopic: tuple.0, reason: tuple.1) + }.store(in: &publishers) + } - interactor = WalletConnectInteractor(session: session.session, remotePeerId: session.peerId) - interactor?.delegate = self - interactor?.connect() - state = .ready - } catch { - state = .invalid(error: error) - } + private func updateSessions() { + sessionsItemUpdatedRelay.accept(()) } - private func initSession(peerId: String, peerMeta: WCPeerMeta, chainId: Int) throws { - guard let account = manager.activeAccount else { - throw SessionError.noSuitableAccount - } + private func updatePairings() { + pairingUpdatedRelay.accept(()) + } - guard let evmKitWrapper = manager.evmKitWrapper(chainId: chainId, account: account) else { - throw SessionError.unsupportedChainId - } +} - sessionData = SessionData(peerId: peerId, chainId: chainId, peerMeta: peerMeta, account: account, evmKitWrapper: evmKitWrapper) - } +extension WalletConnectService { - private func handleRequest(id: Int, requestResolver: () throws -> WalletConnectRequest) { - do { - let request = try requestResolver() - pendingRequests[id] = request - processNextRequest() - } catch { - interactor?.rejectRequest(id: id, message: error.smartDescription) - } + public func didReceive(sessionProposal: Session.Proposal) { + logger?.debug("WC v2 SignClient did receive session proposal: \(sessionProposal.id) : proposer: \(sessionProposal.proposer.name)") + receiveProposalSubject.onNext(sessionProposal) } - private func processNextRequest() { - guard !requestIsProcessing else { - return - } + public func didReceive(sessionRequest: Request) { + logger?.debug("WC v2 SignClient did receive session request: \(sessionRequest.method) : session: \(sessionRequest.topic)") - guard let nextRequest = pendingRequests.values.first else { + if sessionRequestFilterManager.handle(request: sessionRequest) { return } - requestRelay.accept(nextRequest) - requestIsProcessing = true + sessionRequestReceivedRelay.accept(sessionRequest) + pendingRequestsUpdatedRelay.accept(()) } -} + public func didReceive(sessionResponse: Response) { + logger?.debug("WC v2 SignClient did receive session response: \(sessionResponse.topic) : chainId: \(sessionResponse.chainId ?? "")") + } -extension WalletConnectService { + public func didReceive(event: Session.Event, sessionTopic: String, chainId: WalletConnectSign.Blockchain?) { + logger?.debug("WC v2 SignClient did receive session event: \(event.name) : session: \(sessionTopic)") + } - var stateObservable: Observable { - stateRelay.asObservable() + public func didDelete(sessionTopic: String, reason: Reason) { + logger?.debug("WC v2 SignClient did delete session: \(sessionTopic)") + deleteSessionRelay.accept((sessionTopic, reason)) + updateSessions() } - var connectionStateObservable: Observable { - connectionStateRelay.asObservable() + public func didUpdate(sessionTopic: String, namespaces: [String: SessionNamespace]) { + logger?.debug("WC v2 SignClient did update session: \(sessionTopic)") } - var requestObservable: Observable { - requestRelay.asObservable() + public func didSettle(session: Session) { + logger?.debug("WC v2 SignClient did settle session: \(session.topic)") + receiveSessionRelay.accept(session) + updateSessions() } - var errorObservable: Observable { - errorRelay.asObservable() + public func didChangeSocketConnectionStatus(_ status: WalletConnectSign.SocketConnectionStatus) { + logger?.debug("WC v2 SignClient change socketStatus: \(status)") + socketConnectionStatus = status.connectionState } - var remotePeerMeta: WCPeerMeta? { - sessionData?.peerMeta +} + +extension WalletConnectService { + + // helpers + public func ping(topic: String, completion: @escaping (Result) -> ()) { + Task(priority: .userInitiated) { @MainActor in + do { + try await Sign.instance.ping(topic: topic) + completion(.success(())) + } catch { + completion(.failure(error)) + } + } } - var evmKitWrapper: EvmKitWrapper? { - sessionData?.evmKitWrapper + // works with sessions + public var activeSessions: [WalletConnectSign.Session] { + Sign.instance.getSessions() } - func pendingRequest(requestId: Int) -> WalletConnectRequest? { - pendingRequests[requestId] + public var sessionsUpdatedObservable: Observable<()> { + sessionsItemUpdatedRelay.asObservable() } - func connect(uri: String) throws { - interactor = try WalletConnectInteractor(uri: uri) - interactor?.delegate = self - interactor?.connect() + // works with pending requests + public var pendingRequests: [WalletConnectSign.Request] { + Sign.instance.getPendingRequests() } - func reconnect() { - guard reachabilityManager.isReachable else { - errorRelay.accept(AppError.noConnection) - return - } + public var pendingRequestsUpdatedObservable: Observable<()> { + pendingRequestsUpdatedRelay.asObservable() + } - interactor?.delegate = self - interactor?.connect() + // works with pairings + public var pairings: [WalletConnectPairing.Pairing] { + Pair.instance.getPairings() } - func approveSession() { - guard reachabilityManager.isReachable else { - errorRelay.accept(AppError.noConnection) - return - } + public var pairingUpdatedObservable: Observable<()> { + pairingUpdatedRelay.asObservable() + } - guard let interactor = interactor, let sessionData = sessionData else { - return + public func disconnectPairing(topic: String) -> Single<()> { + Single.create { observer in + Task { [weak self] in + do { + try await Pair.instance.disconnect(topic: topic) + self?.updatePairings() + observer(.success(())) + } catch { + self?.updatePairings() + observer(.error(error)) + } + } + return Disposables.create() } + } - interactor.approveSession(address: sessionData.evmKitWrapper.evmKit.address.eip55, chainId: sessionData.chainId) - - let session = WalletConnectSession( - chainId: sessionData.chainId, - accountId: sessionData.account.id, - session: interactor.session, - peerId: sessionData.peerId, - peerMeta: sessionData.peerMeta - ) + // connect/disconnect session + public var receiveProposalObservable: Observable { + receiveProposalSubject.asObservable() + } - sessionManager.save(session: session) + public var receiveSessionObservable: Observable { + receiveSessionRelay.asObservable() + } - state = .ready + public var deleteSessionObservable: Observable<(String, WalletConnectSign.Reason)> { + deleteSessionRelay.asObservable() } - func rejectSession() { - guard reachabilityManager.isReachable else { - errorRelay.accept(AppError.noConnection) - return - } + public var socketConnectionStatusObservable: Observable { + socketConnectionStatusRelay.asObservable() + } - guard let interactor = interactor else { - return + // works with dApp + public func validate(uri: String) throws -> WalletConnectUtils.WalletConnectURI { + guard let uri = WalletConnectUtils.WalletConnectURI(string: uri) else { + throw WalletConnectUriHandler.ConnectionError.wrongUri } - - interactor.rejectSession(message: "Session Rejected by User") - - state = .killed + return uri } - func approveRequest(id: Int, result: Any) { - guard reachabilityManager.isReachable else { - errorRelay.accept(AppError.noConnection) - return + public func pair(uri: WalletConnectUtils.WalletConnectURI) async throws { + Task.init { [weak self] in + do { + try await Pair.instance.pair(uri: uri) + self?.updatePairings() + } catch { + //can't pair with dApp, duplicate pairing or can't parse uri + throw error + } } + } - queue.async { - if let request = self.pendingRequests.removeValue(forKey: id), let convertedResult = request.convert(result: result) { - self.interactor?.approveRequest(id: id, result: convertedResult) + public func approve(proposal: WalletConnectSign.Session.Proposal, accounts: Set, methods: Set, events: Set) async throws { + logger?.debug("[WALLET] Approve Session: \(proposal.id)") + Task { [logger] in + do { + let eip155 = WalletConnectSign.SessionNamespace( + accounts: accounts, + methods: methods, + events: events + ) + try await Sign.instance.approve(proposalId: proposal.id, namespaces: ["eip155": eip155]) + } catch { + logger?.error("WC v2 can't approve proposal, cause: \(error.localizedDescription)") + throw error } - - self.requestIsProcessing = false - self.processNextRequest() } } - func rejectRequest(id: Int) { - guard reachabilityManager.isReachable else { - errorRelay.accept(AppError.noConnection) - return + public func reject(proposal: WalletConnectSign.Session.Proposal) async throws { + logger?.debug("[WALLET] Reject Session: \(proposal.id)") + do { + try await Sign.instance.reject(proposalId: proposal.id, reason: .userRejected) + } catch { + logger?.error("WC v2 can't reject proposal, cause: \(error.localizedDescription)") + throw error } + } - queue.async { - self.pendingRequests.removeValue(forKey: id) + public func disconnect(topic: String, reason: WalletConnectSign.Reason) { + Task { [weak self, logger] in + do { + try await Sign.instance.disconnect(topic: topic) + self?.updateSessions() + } catch { + logger?.error("WC v2 can't disconnect topic, cause: \(error.localizedDescription)") + } + } + } - self.interactor?.rejectRequest(id: id, message: "Rejected by user") + //Works with Requests + public var sessionRequestReceivedObservable: Observable { + sessionRequestReceivedRelay.asObservable() + } - self.requestIsProcessing = false - self.processNextRequest() + public func sign(request: WalletConnectSign.Request, result: Data) { + let result = AnyCodable(result.hs.hexString)// Signer.signEth(request: request) + Task { [weak self] in + do { + try await Sign.instance.respond(topic: request.topic, requestId: request.id, response: .response(result)) + self?.pendingRequestsUpdatedRelay.accept(()) + } } } - func killSession() { - guard let interactor = interactor else { - return + public func reject(request: WalletConnectSign.Request) { + Task { [weak self] in + do { + try await Sign.instance.respond(topic: request.topic, requestId: request.id, response: .error(.init(code: 5000, message: "Reject by User"))) + self?.pendingRequestsUpdatedRelay.accept(()) + } } - - interactor.killSession() } +} +struct WalletConnectClientInfo { + let projectId: String + let relayHost: String + let name: String + let description: String + let url: String + let icons: [String] } -extension WalletConnectService: IWalletConnectInteractorDelegate { +extension WalletConnectSign.Session: Hashable { - func didUpdate(state: WalletConnectInteractor.State) { - connectionStateRelay.accept(state) + public var id: Int { + hashValue } - func didRequestSession(peerId: String, peerMeta: WCPeerMeta, chainId: Int?) { - do { -// guard let chainId = chainId else { -// throw SessionError.unsupportedChainId -// } - - let chainId = chainId ?? 1 // fallback to chainId = 1 (Ethereum MainNet) - - try initSession(peerId: peerId, peerMeta: peerMeta, chainId: chainId) + public static func ==(lhs: WalletConnectSign.Session, rhs: WalletConnectSign.Session) -> Bool { + lhs.topic == rhs.topic + } - state = .waitingForApproveSession - } catch { - interactor?.rejectSession(message: "Session Rejected: \(error)") - state = .invalid(error: error) - } + public func hash(into hasher: inout Hasher) { + hasher.combine(topic) } - func didKillSession() { - if let sessionData = sessionData { - sessionManager.deleteSession(peerId: sessionData.peerId) - } +} - state = .killed - } +extension WalletConnectService: IWalletConnectSignService { - func didRequestSendEthereumTransaction(id: Int, transaction: WCEthereumTransaction) { - let chainId = sessionData?.chainId - let peerName = sessionData?.peerMeta.name - queue.async { - self.handleRequest(id: id) { - try WalletConnectSendEthereumTransactionRequest(id: id, chain: .init(id: chainId ?? 1), dAppName: peerName, transaction: transaction) - } + func approveRequest(id: Int, result: Data) { + guard let request = pendingRequests.first(where: { $0.id.intValue == id }) else { + return } + sign(request: request, result: result) } - func didRequestSignEthereumTransaction(id: Int, transaction: WCEthereumTransaction) { -// print("didRequestSignEthereumTransaction") - } - - func didRequestSign(id: Int, payload: WCEthereumSignPayload) { - let chainId = sessionData?.chainId - let peerName = sessionData?.peerMeta.name - queue.async { - self.handleRequest(id: id) { - WalletConnectSignMessageRequest(id: id, chain: .init(id: chainId ?? 1), dAppName: peerName, payload: payload) - } + func rejectRequest(id: Int) { + guard let request = pendingRequests.first(where: { $0.id.intValue == id }) else { + return } + reject(request: request) } } -extension WalletConnectService { +extension RPCID { - enum State: Equatable { - case idle - case invalid(error: Error) - case waitingForApproveSession - case ready - case killed - - static func ==(lhs: State, rhs: State) -> Bool { - switch (lhs, rhs) { - case (.idle, .idle): return true - case (.invalid(let lhsError), .invalid(let rhsError)): return "\(lhsError)" == "\(rhsError)" - case (.waitingForApproveSession, .waitingForApproveSession): return true - case (.ready, .ready): return true - case (.killed, .killed): return true - default: return false - } - } + var intValue: Int { + (left?.hashValue ?? 0) + Int(right ?? 0) //todo: id potentially can be wrong } - enum SessionError: Error { - case invalidUrl - case unsupportedChainId - case noSuitableAccount + var int64Value: Int64 { + Int64(intValue) } - struct SessionData { - let peerId: String - let chainId: Int - let peerMeta: WCPeerMeta - let account: Account - let evmKitWrapper: EvmKitWrapper - } +} +extension WalletConnectSign.SocketConnectionStatus { + var connectionState: WalletConnectMainModule.ConnectionState { + switch self { + case .connected: return .connected + case .disconnected: return .disconnected + } + } } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectSessionKiller.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectSessionKiller.swift deleted file mode 100644 index 4d622fe4bf..0000000000 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectSessionKiller.swift +++ /dev/null @@ -1,72 +0,0 @@ -import WalletConnectV1 -import RxRelay -import RxSwift - -class WalletConnectSessionKiller { - private let session: WalletConnectSession - private let interactor: WalletConnectInteractor - - private let stateRelay: PublishRelay = PublishRelay() - private(set) var state: State = .notConnected { - didSet { - stateRelay.accept(state) - } - } - - var peerId: String { session.peerId } - - init(session: WalletConnectSession) { - self.session = session - - interactor = WalletConnectInteractor(session: session.session, remotePeerId: session.peerId) - interactor.delegate = self - } - -} - -extension WalletConnectSessionKiller { - - var stateObservable: Observable { - stateRelay.asObservable() - } - - func kill() { - guard interactor.state == .disconnected else { - return - } - - interactor.connect() - } - -} - -extension WalletConnectSessionKiller: IWalletConnectInteractorDelegate { - - func didUpdate(state: WalletConnectInteractor.State) { - switch state { - case .connected: interactor.killSession() - case .connecting: self.state = .processing - case .disconnected: () - } - } - - func didKillSession() { - state = .killed - } - - func didReceive(error: Error) { - state = .failed(error: error) - } - -} - -extension WalletConnectSessionKiller { - - enum State { - case notConnected - case processing - case killed - case failed(error: Error) - } - -} diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectSessionManager.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectSessionManager.swift deleted file mode 100644 index a87013e3ff..0000000000 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectSessionManager.swift +++ /dev/null @@ -1,80 +0,0 @@ -import WalletConnectV1 -import RxSwift -import RxRelay - -class WalletConnectSessionManager { - private let storage: WalletConnectSessionStorage - private let accountManager: AccountManager - private let evmBlockchainManager: EvmBlockchainManager - private let disposeBag = DisposeBag() - - private let sessionsRelay = BehaviorRelay<[WalletConnectSession]>(value: []) - - init(storage: WalletConnectSessionStorage, accountManager: AccountManager, evmBlockchainManager: EvmBlockchainManager) { - self.storage = storage - self.accountManager = accountManager - self.evmBlockchainManager = evmBlockchainManager - - accountManager.accountDeletedObservable - .subscribeOn(ConcurrentDispatchQueueScheduler(qos: .background)) - .subscribe(onNext: { [weak self] account in - self?.handleDeleted(account: account) - }) - .disposed(by: disposeBag) - - accountManager.activeAccountObservable - .subscribeOn(ConcurrentDispatchQueueScheduler(qos: .background)) - .subscribe(onNext: { [weak self] activeAccount in - self?.handle(activeAccount: activeAccount) - }) - .disposed(by: disposeBag) - - syncSessions() - } - - private func handleDeleted(account: Account) { - storage.deleteSessions(accountId: account.id) - syncSessions() - } - - private func handle(activeAccount: Account?) { - syncSessions() - } - - private func syncSessions() { - sessionsRelay.accept(sessions) - } - - private func isChainIdsEnabled(chainId: Int) -> Bool { - evmBlockchainManager.blockchain(chainId: chainId) != nil - } - -} - -extension WalletConnectSessionManager { - - var sessions: [WalletConnectSession] { - guard let activeAccount = accountManager.activeAccount else { - return [] - } - - return storage.sessions(accountId: activeAccount.id).filter { session in - isChainIdsEnabled(chainId: session.chainId) - } - } - - var sessionsObservable: Observable<[WalletConnectSession]> { - sessionsRelay.asObservable() - } - - func save(session: WalletConnectSession) { - storage.save(session: session) - syncSessions() - } - - func deleteSession(peerId: String) { - storage.deleteSession(peerId: peerId) - syncSessions() - } - -} diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectV2SocketConnectionService.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectSocketConnectionService.swift similarity index 95% rename from UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectV2SocketConnectionService.swift rename to UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectSocketConnectionService.swift index 6b068dd359..e8054718d8 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectV2SocketConnectionService.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectSocketConnectionService.swift @@ -9,7 +9,7 @@ import RxCocoa import RxRelay -class WalletConnectV2SocketConnectionService { +class WalletConnectSocketConnectionService { private static let retryInterval = 10 private let reachabilityManager: IReachabilityManager private let logger: Logger? @@ -84,7 +84,7 @@ class WalletConnectV2SocketConnectionService { } -extension WalletConnectV2SocketConnectionService { +extension WalletConnectSocketConnectionService { func retry() { do { @@ -116,7 +116,7 @@ extension WalletConnectV2SocketConnectionService { } -extension WalletConnectV2SocketConnectionService { +extension WalletConnectSocketConnectionService { enum Status { case disconnected diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectUriHandler.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectUriHandler.swift index 2df5c251d6..fcd32c6010 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectUriHandler.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectUriHandler.swift @@ -4,38 +4,16 @@ import WalletConnectUtils class WalletConnectUriHandler { - public static func createServiceV1(uri: String) -> Single { - Single.create { observer in - do { - let service = try WalletConnectV1MainService( - session: nil, - uri: uri, - manager: App.shared.walletConnectManager, - sessionManager: App.shared.walletConnectSessionManager, - reachabilityManager: App.shared.reachabilityManager, - accountManager: App.shared.accountManager, - evmBlockchainManager: App.shared.evmBlockchainManager - ) - observer(.success(service)) - } catch { - observer(.error(error)) - } - - return Disposables.create() - } - } - - public static func validate(uri: String) throws { - _ = try App.shared.walletConnectV2SessionManager.service.validate(uri: uri) + _ = try App.shared.walletConnectSessionManager.service.validate(uri: uri) } - public static func pairV2(uri: String) -> Single<()> { + public static func pair(uri: String) -> Single<()> { Single.create { observer in Task { do { - let uri = try App.shared.walletConnectV2SessionManager.service.validate(uri: uri) - try await App.shared.walletConnectV2SessionManager.service.pair(uri: uri) + let uri = try App.shared.walletConnectSessionManager.service.validate(uri: uri) + try await App.shared.walletConnectSessionManager.service.pair(uri: uri) observer(.success(())) } catch { observer(.error(error)) diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectV2Service.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectV2Service.swift deleted file mode 100644 index 812247af41..0000000000 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/WalletConnectV2Service.swift +++ /dev/null @@ -1,384 +0,0 @@ -import Foundation -import CryptoSwift -import RxSwift -import RxRelay -import Combine -import Starscream -import WalletConnectKMS -import WalletConnectSign -import WalletConnectRelay -import WalletConnectUtils -import WalletConnectNetworking -import WalletConnectPairing -import HsToolKit - -extension Starscream.WebSocket: WebSocketConnecting { } - -struct SocketFactory: WebSocketFactory { - func create(with url: URL) -> WebSocketConnecting { - Starscream.WebSocket(url: url) - } -} - -class WalletConnectV2Service { - private let logger: Logger? - private let connectionService: WalletConnectV2SocketConnectionService - private let sessionRequestFilterManager: SessionRequestFilterManager - - private let receiveProposalSubject = PublishSubject() - private let receiveSessionRelay = PublishRelay() - private let deleteSessionRelay = PublishRelay<(String, WalletConnectSign.Reason)>() - - private let sessionsItemUpdatedRelay = PublishRelay<()>() - private let pendingRequestsUpdatedRelay = PublishRelay<()>() - private let pairingUpdatedRelay = PublishRelay<()>() - private let sessionRequestReceivedRelay = PublishRelay() - - private let socketConnectionStatusRelay = PublishRelay() - private(set) var socketConnectionStatus: WalletConnectMainModule.ConnectionState = .disconnected { - didSet { - socketConnectionStatusRelay.accept(socketConnectionStatus) - } - } - - private var publishers = [AnyCancellable]() - - init(connectionService: WalletConnectV2SocketConnectionService, sessionRequestFilterManager: SessionRequestFilterManager, info: WalletConnectClientInfo, logger: Logger? = nil) { - self.connectionService = connectionService - self.sessionRequestFilterManager = sessionRequestFilterManager - self.logger = logger - let metadata = WalletConnectSign.AppMetadata( - name: info.name, - description: info.description, - url: info.url, - icons: info.icons - ) - - Networking.configure(projectId: info.projectId, socketFactory: SocketFactory(), socketConnectionType: .manual) - Pair.configure(metadata: metadata) - setUpAuthSubscribing() - - connectionService.relayClient = Relay.instance - - updateSessions() - updatePairings() - } - - func setUpAuthSubscribing() { - Sign.instance.socketConnectionStatusPublisher - .receive(on: DispatchQueue.main) - .sink { [weak self] status in - self?.didChangeSocketConnectionStatus(status) - }.store(in: &publishers) - - Sign.instance.sessionProposalPublisher - .receive(on: DispatchQueue.main) - .sink { [weak self] sessionProposal in - self?.didReceive(sessionProposal: sessionProposal.proposal) - }.store(in: &publishers) - - Sign.instance.sessionSettlePublisher - .receive(on: DispatchQueue.main) - .sink { [weak self] session in - self?.didSettle(session: session) - }.store(in: &publishers) - - Sign.instance.sessionUpdatePublisher - .receive(on: DispatchQueue.main) - .sink { [weak self] pair in - self?.didUpdate(sessionTopic: pair.sessionTopic, namespaces: pair.namespaces) - }.store(in: &publishers) - - Sign.instance.sessionRequestPublisher - .receive(on: DispatchQueue.main) - .sink { [weak self] sessionRequest in - self?.didReceive(sessionRequest: sessionRequest.request) - }.store(in: &publishers) - - Sign.instance.sessionDeletePublisher - .receive(on: DispatchQueue.main) - .sink { [weak self] tuple in - self?.didDelete(sessionTopic: tuple.0, reason: tuple.1) - }.store(in: &publishers) - } - - - private func updateSessions() { - sessionsItemUpdatedRelay.accept(()) - } - - private func updatePairings() { - pairingUpdatedRelay.accept(()) - } - -} - -extension WalletConnectV2Service { - - public func didReceive(sessionProposal: Session.Proposal) { - logger?.debug("WC v2 SignClient did receive session proposal: \(sessionProposal.id) : proposer: \(sessionProposal.proposer.name)") - receiveProposalSubject.onNext(sessionProposal) - } - - public func didReceive(sessionRequest: Request) { - logger?.debug("WC v2 SignClient did receive session request: \(sessionRequest.method) : session: \(sessionRequest.topic)") - - if sessionRequestFilterManager.handle(request: sessionRequest) { - return - } - - sessionRequestReceivedRelay.accept(sessionRequest) - pendingRequestsUpdatedRelay.accept(()) - } - - public func didReceive(sessionResponse: Response) { - logger?.debug("WC v2 SignClient did receive session response: \(sessionResponse.topic) : chainId: \(sessionResponse.chainId ?? "")") - } - - public func didReceive(event: Session.Event, sessionTopic: String, chainId: WalletConnectSign.Blockchain?) { - logger?.debug("WC v2 SignClient did receive session event: \(event.name) : session: \(sessionTopic)") - } - - public func didDelete(sessionTopic: String, reason: Reason) { - logger?.debug("WC v2 SignClient did delete session: \(sessionTopic)") - deleteSessionRelay.accept((sessionTopic, reason)) - updateSessions() - } - - public func didUpdate(sessionTopic: String, namespaces: [String: SessionNamespace]) { - logger?.debug("WC v2 SignClient did update session: \(sessionTopic)") - } - - public func didSettle(session: Session) { - logger?.debug("WC v2 SignClient did settle session: \(session.topic)") - receiveSessionRelay.accept(session) - updateSessions() - } - - public func didChangeSocketConnectionStatus(_ status: WalletConnectSign.SocketConnectionStatus) { - logger?.debug("WC v2 SignClient change socketStatus: \(status)") - socketConnectionStatus = status.connectionState - } - -} - -extension WalletConnectV2Service { - - // helpers - public func ping(topic: String, completion: @escaping (Result) -> ()) { - Task(priority: .userInitiated) { @MainActor in - do { - try await Sign.instance.ping(topic: topic) - completion(.success(())) - } catch { - completion(.failure(error)) - } - } - } - - // works with sessions - public var activeSessions: [WalletConnectSign.Session] { - Sign.instance.getSessions() - } - - public var sessionsUpdatedObservable: Observable<()> { - sessionsItemUpdatedRelay.asObservable() - } - - // works with pending requests - public var pendingRequests: [WalletConnectSign.Request] { - Sign.instance.getPendingRequests() - } - - public var pendingRequestsUpdatedObservable: Observable<()> { - pendingRequestsUpdatedRelay.asObservable() - } - - // works with pairings - public var pairings: [WalletConnectPairing.Pairing] { - Pair.instance.getPairings() - } - - public var pairingUpdatedObservable: Observable<()> { - pairingUpdatedRelay.asObservable() - } - - public func disconnectPairing(topic: String) -> Single<()> { - Single.create { observer in - Task { [weak self] in - do { - try await Pair.instance.disconnect(topic: topic) - self?.updatePairings() - observer(.success(())) - } catch { - self?.updatePairings() - observer(.error(error)) - } - } - return Disposables.create() - } - } - - // connect/disconnect session - public var receiveProposalObservable: Observable { - receiveProposalSubject.asObservable() - } - - public var receiveSessionObservable: Observable { - receiveSessionRelay.asObservable() - } - - public var deleteSessionObservable: Observable<(String, WalletConnectSign.Reason)> { - deleteSessionRelay.asObservable() - } - - public var socketConnectionStatusObservable: Observable { - socketConnectionStatusRelay.asObservable() - } - - // works with dApp - public func validate(uri: String) throws -> WalletConnectUtils.WalletConnectURI { - guard let uri = WalletConnectUtils.WalletConnectURI(string: uri) else { - throw WalletConnectUriHandler.ConnectionError.wrongUri - } - return uri - } - - public func pair(uri: WalletConnectUtils.WalletConnectURI) async throws { - Task.init { [weak self] in - do { - try await Pair.instance.pair(uri: uri) - self?.updatePairings() - } catch { - //can't pair with dApp, duplicate pairing or can't parse uri - throw error - } - } - } - - public func approve(proposal: WalletConnectSign.Session.Proposal, accounts: Set, methods: Set, events: Set) async throws { - logger?.debug("[WALLET] Approve Session: \(proposal.id)") - Task { [logger] in - do { - let eip155 = WalletConnectSign.SessionNamespace( - accounts: accounts, - methods: methods, - events: events - ) - try await Sign.instance.approve(proposalId: proposal.id, namespaces: ["eip155": eip155]) - } catch { - logger?.error("WC v2 can't approve proposal, cause: \(error.localizedDescription)") - throw error - } - } - } - - public func reject(proposal: WalletConnectSign.Session.Proposal) async throws { - logger?.debug("[WALLET] Reject Session: \(proposal.id)") - do { - try await Sign.instance.reject(proposalId: proposal.id, reason: .userRejected) - } catch { - logger?.error("WC v2 can't reject proposal, cause: \(error.localizedDescription)") - throw error - } - } - - public func disconnect(topic: String, reason: WalletConnectSign.Reason) { - Task { [weak self, logger] in - do { - try await Sign.instance.disconnect(topic: topic) - self?.updateSessions() - } catch { - logger?.error("WC v2 can't disconnect topic, cause: \(error.localizedDescription)") - } - } - } - - //Works with Requests - public var sessionRequestReceivedObservable: Observable { - sessionRequestReceivedRelay.asObservable() - } - - public func sign(request: WalletConnectSign.Request, result: Data) { - let result = AnyCodable(result.hs.hexString)// Signer.signEth(request: request) - Task { [weak self] in - do { - try await Sign.instance.respond(topic: request.topic, requestId: request.id, response: .response(result)) - self?.pendingRequestsUpdatedRelay.accept(()) - } - } - } - - public func reject(request: WalletConnectSign.Request) { - Task { [weak self] in - do { - try await Sign.instance.respond(topic: request.topic, requestId: request.id, response: .error(.init(code: 5000, message: "Reject by User"))) - self?.pendingRequestsUpdatedRelay.accept(()) - } - } - } -} - -struct WalletConnectClientInfo { - let projectId: String - let relayHost: String - let name: String - let description: String - let url: String - let icons: [String] -} - -extension WalletConnectSign.Session: Hashable { - - public var id: Int { - hashValue - } - - public static func ==(lhs: WalletConnectSign.Session, rhs: WalletConnectSign.Session) -> Bool { - lhs.topic == rhs.topic - } - - public func hash(into hasher: inout Hasher) { - hasher.combine(topic) - } - -} - -extension WalletConnectV2Service: IWalletConnectSignService { - - func approveRequest(id: Int, result: Data) { - guard let request = pendingRequests.first(where: { $0.id.intValue == id }) else { - return - } - sign(request: request, result: result) - } - - func rejectRequest(id: Int) { - guard let request = pendingRequests.first(where: { $0.id.intValue == id }) else { - return - } - reject(request: request) - } - -} - -extension RPCID { - - var intValue: Int { - (left?.hashValue ?? 0) + Int(right ?? 0) //todo: id potentially can be wrong - } - - var int64Value: Int64 { - Int64(intValue) - } - -} - -extension WalletConnectSign.SocketConnectionStatus { - var connectionState: WalletConnectMainModule.ConnectionState { - switch self { - case .connected: return .connected - case .disconnected: return .disconnected - } - } -} diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Workers/WalletConnectV2AppShowWorker/WalletConnectV2AppShowService.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Workers/WalletConnectAppShowWorker/WalletConnectAppShowService.swift similarity index 69% rename from UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Workers/WalletConnectV2AppShowWorker/WalletConnectV2AppShowService.swift rename to UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Workers/WalletConnectAppShowWorker/WalletConnectAppShowService.swift index 5be116a131..4f8ae191e3 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Workers/WalletConnectV2AppShowWorker/WalletConnectV2AppShowService.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Workers/WalletConnectAppShowWorker/WalletConnectAppShowService.swift @@ -3,9 +3,9 @@ import RxCocoa import WalletConnectSign import PinKit -class WalletConnectV2AppShowService { +class WalletConnectAppShowService { private let disposeBag = DisposeBag() - private let walletConnectV2Manager: WalletConnectV2SessionManager + private let walletConnectManager: WalletConnectSessionManager private let cloudAccountBackupManager: CloudAccountBackupManager private let accountManager: AccountManager private let pinKit: PinKit.Kit @@ -13,14 +13,14 @@ class WalletConnectV2AppShowService { private let showSessionProposalRelay = PublishRelay() private let showSessionRequestRelay = PublishRelay() - init(walletConnectV2Manager: WalletConnectV2SessionManager, cloudAccountBackupManager: CloudAccountBackupManager, accountManager: AccountManager, pinKit: PinKit.Kit) { - self.walletConnectV2Manager = walletConnectV2Manager + init(walletConnectManager: WalletConnectSessionManager, cloudAccountBackupManager: CloudAccountBackupManager, accountManager: AccountManager, pinKit: PinKit.Kit) { + self.walletConnectManager = walletConnectManager self.cloudAccountBackupManager = cloudAccountBackupManager self.accountManager = accountManager self.pinKit = pinKit - subscribe(disposeBag, walletConnectV2Manager.service.receiveProposalObservable) { [weak self] in self?.receive(proposal: $0) } - subscribe(disposeBag, walletConnectV2Manager.sessionRequestReceivedObservable) { [weak self] in self?.receive(request: $0) } + subscribe(disposeBag, walletConnectManager.service.receiveProposalObservable) { [weak self] in self?.receive(proposal: $0) } + subscribe(disposeBag, walletConnectManager.sessionRequestReceivedObservable) { [weak self] in self?.receive(request: $0) } } private func receive(proposal: WalletConnectSign.Session.Proposal) { @@ -35,7 +35,7 @@ class WalletConnectV2AppShowService { } -extension WalletConnectV2AppShowService { +extension WalletConnectAppShowService { var activeAccount: Account? { accountManager.activeAccount diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Workers/WalletConnectV2AppShowWorker/WalletConnectV2AppShowView.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Workers/WalletConnectAppShowWorker/WalletConnectAppShowView.swift similarity index 76% rename from UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Workers/WalletConnectV2AppShowWorker/WalletConnectV2AppShowView.swift rename to UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Workers/WalletConnectAppShowWorker/WalletConnectAppShowView.swift index 32db1c02db..ca5e0545f5 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Workers/WalletConnectV2AppShowWorker/WalletConnectV2AppShowView.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Workers/WalletConnectAppShowWorker/WalletConnectAppShowView.swift @@ -5,12 +5,12 @@ import ThemeKit import WalletConnectSign import ComponentKit -class WalletConnectV2AppShowView { +class WalletConnectAppShowView { private let disposeBag = DisposeBag() - private let viewModel: WalletConnectV2AppShowViewModel + private let viewModel: WalletConnectAppShowViewModel private weak var parentViewController: UIViewController? - init(viewModel: WalletConnectV2AppShowViewModel, parentViewController: UIViewController?) { + init(viewModel: WalletConnectAppShowViewModel, parentViewController: UIViewController?) { self.viewModel = viewModel self.parentViewController = parentViewController @@ -18,26 +18,16 @@ class WalletConnectV2AppShowView { subscribe(disposeBag, viewModel.openWalletConnectSignal) { [weak self] in self?.openWalletConnect(mode: $0) } } - private func openWalletConnect(mode: WalletConnectV2AppShowViewModel.WalletConnectOpenMode) { + private func openWalletConnect(mode: WalletConnectAppShowViewModel.WalletConnectOpenMode) { switch mode { case .pair(let uri): switch WalletConnectUriHandler.uriVersion(uri: uri) { - case 1: - WalletConnectUriHandler.createServiceV1(uri: uri) - .subscribeOn(ConcurrentDispatchQueueScheduler(qos: .userInitiated)) - .observeOn(MainScheduler.instance) - .subscribe(onSuccess: { [weak self] service in - self?.processWalletConnectV1(service: service) - }, onError: { [weak self] error in - self?.handle(error: error) - }) - .disposed(by: disposeBag) case 2: - WalletConnectUriHandler.pairV2(uri: uri) + WalletConnectUriHandler.pair(uri: uri) .subscribeOn(ConcurrentDispatchQueueScheduler(qos: .userInitiated)) .observeOn(MainScheduler.instance) - .subscribe(onSuccess: { [weak self] service in - self?.showV2PairedSuccessful() + .subscribe(onSuccess: { [weak self] in + self?.showPairedSuccessful() }, onError: { [weak self] error in self?.handle(error: error) }) @@ -48,7 +38,7 @@ class WalletConnectV2AppShowView { case .proposal(let proposal): processWalletConnectPair(proposal: proposal) case .errorDialog(let error): - WalletConnectV2AppShowView.showWalletConnectError(error: error, sourceViewController: parentViewController) + WalletConnectAppShowView.showWalletConnectError(error: error, sourceViewController: parentViewController) } } @@ -62,19 +52,7 @@ class WalletConnectV2AppShowView { } } - - private func processWalletConnectV1(service: WalletConnectV1MainService) { - guard let viewController = WalletConnectMainModule.viewController( - service: service, - sourceViewController: parentViewController?.visibleController) - else { - return - } - - parentViewController?.visibleController.present(viewController, animated: true) - } - - private func showV2PairedSuccessful() { + private func showPairedSuccessful() { HudHelper.instance.show(banner: .success(string: "Pairing successful. Please wait for a new session!")) } @@ -83,7 +61,7 @@ class WalletConnectV2AppShowView { } private func handle(request: WalletConnectRequest) { - guard let viewController = WalletConnectRequestModule.viewController(signService: App.shared.walletConnectV2SessionManager.service, request: request) else { + guard let viewController = WalletConnectRequestModule.viewController(signService: App.shared.walletConnectSessionManager.service, request: request) else { return } @@ -92,7 +70,7 @@ class WalletConnectV2AppShowView { } -extension WalletConnectV2AppShowView { +extension WalletConnectAppShowView { static func showWalletConnectError(error: WalletConnectOpenError, sourceViewController: UIViewController?) { let viewController: UIViewController @@ -158,7 +136,7 @@ extension WalletConnectV2AppShowView { } -extension WalletConnectV2AppShowView: IDeepLinkHandler { +extension WalletConnectAppShowView: IDeepLinkHandler { func handle(deepLink: DeepLinkManager.DeepLink) { switch deepLink { diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Workers/WalletConnectV2AppShowWorker/WalletConnectV2AppShowViewModel.swift b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Workers/WalletConnectAppShowWorker/WalletConnectAppShowViewModel.swift similarity index 84% rename from UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Workers/WalletConnectV2AppShowWorker/WalletConnectV2AppShowViewModel.swift rename to UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Workers/WalletConnectAppShowWorker/WalletConnectAppShowViewModel.swift index 0925b28c4a..df48a16c0c 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Workers/WalletConnectV2AppShowWorker/WalletConnectV2AppShowViewModel.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/WalletConnect/Workers/WalletConnectAppShowWorker/WalletConnectAppShowViewModel.swift @@ -3,14 +3,14 @@ import RxSwift import RxCocoa import WalletConnectSign -class WalletConnectV2AppShowViewModel { +class WalletConnectAppShowViewModel { private let disposeBag = DisposeBag() - private let service: WalletConnectV2AppShowService + private let service: WalletConnectAppShowService private let showSessionRequestRelay = PublishRelay() private let openWalletConnectRelay = PublishRelay() - init(service: WalletConnectV2AppShowService) { + init(service: WalletConnectAppShowService) { self.service = service subscribe(disposeBag, service.showSessionProposalObservable) { [weak self] in self?.showSession(proposal: $0) } @@ -41,7 +41,7 @@ class WalletConnectV2AppShowViewModel { } -extension WalletConnectV2AppShowViewModel { +extension WalletConnectAppShowViewModel { var openWalletConnectSignal: Signal { openWalletConnectRelay.asSignal() @@ -54,12 +54,12 @@ extension WalletConnectV2AppShowViewModel { } -extension WalletConnectV2AppShowViewModel { +extension WalletConnectAppShowViewModel { enum WalletConnectOpenMode { case pair(url: String) case proposal(WalletConnectSign.Session.Proposal) - case errorDialog(error: WalletConnectV2AppShowView.WalletConnectOpenError) + case errorDialog(error: WalletConnectAppShowView.WalletConnectOpenError) } }