diff --git a/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj b/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj index c3a07f836b..87d5c1e03c 100644 --- a/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj +++ b/UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj @@ -2602,6 +2602,10 @@ D087627729815DAE00E6FFD4 /* ChooseWatchViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D087626F29815DAD00E6FFD4 /* ChooseWatchViewModel.swift */; }; D08C93AF2B91E39E00A7D1D5 /* Hodler in Frameworks */ = {isa = PBXBuildFile; productRef = D08C93AE2B91E39E00A7D1D5 /* Hodler */; }; D08C93B12B91E3B400A7D1D5 /* Hodler in Frameworks */ = {isa = PBXBuildFile; productRef = D08C93B02B91E3B400A7D1D5 /* Hodler */; }; + D08D16812C2164880086E5A5 /* TonPresendHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = D08D16802C2164880086E5A5 /* TonPresendHandler.swift */; }; + D08D16822C2164880086E5A5 /* TonPresendHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = D08D16802C2164880086E5A5 /* TonPresendHandler.swift */; }; + D08D16842C2165490086E5A5 /* TonSendHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = D08D16832C2165490086E5A5 /* TonSendHandler.swift */; }; + D08D16852C2165490086E5A5 /* TonSendHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = D08D16832C2165490086E5A5 /* TonSendHandler.swift */; }; D090AF61297D725D00699916 /* TransparentIconButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D090AF60297D725D00699916 /* TransparentIconButtonView.swift */; }; D090AF62297D725D00699916 /* TransparentIconButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D090AF60297D725D00699916 /* TransparentIconButtonView.swift */; }; D09200B3293F21520091981A /* RestoreMnemonicNonStandardService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D09200AF293F21510091981A /* RestoreMnemonicNonStandardService.swift */; }; @@ -2630,16 +2634,16 @@ D09D76942A2E07BD004311E6 /* SendTronConfirmationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D09D76932A2E07BD004311E6 /* SendTronConfirmationService.swift */; }; D09D76952A2E07BD004311E6 /* SendTronConfirmationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D09D76932A2E07BD004311E6 /* SendTronConfirmationService.swift */; }; D09D76992A2F3682004311E6 /* SendTronConfirmationModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = D09D768B2A2E066E004311E6 /* SendTronConfirmationModule.swift */; }; + D0A690252BFCB51800E59296 /* TronPresendHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0A690242BFCB51800E59296 /* TronPresendHandler.swift */; }; + D0A690262BFCB51800E59296 /* TronPresendHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0A690242BFCB51800E59296 /* TronPresendHandler.swift */; }; + D0A690282BFF50D900E59296 /* TronSendData.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0A690272BFF50D900E59296 /* TronSendData.swift */; }; + D0A690292BFF50D900E59296 /* TronSendData.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0A690272BFF50D900E59296 /* TronSendData.swift */; }; D0A6902B2C00ACF600E59296 /* CautionDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0A6902A2C00ACF600E59296 /* CautionDataSource.swift */; }; D0A6902C2C00ACF600E59296 /* CautionDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0A6902A2C00ACF600E59296 /* CautionDataSource.swift */; }; D0A6902E2C04969300E59296 /* CautionDataSourceViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0A6902D2C04969300E59296 /* CautionDataSourceViewModel.swift */; }; D0A6902F2C04969300E59296 /* CautionDataSourceViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0A6902D2C04969300E59296 /* CautionDataSourceViewModel.swift */; }; D0A690342C05D01C00E59296 /* UIImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0A690332C05D01C00E59296 /* UIImageView.swift */; }; D0A690352C05D01C00E59296 /* UIImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0A690332C05D01C00E59296 /* UIImageView.swift */; }; - D0A690252BFCB51800E59296 /* TronPresendHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0A690242BFCB51800E59296 /* TronPresendHandler.swift */; }; - D0A690262BFCB51800E59296 /* TronPresendHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0A690242BFCB51800E59296 /* TronPresendHandler.swift */; }; - D0A690282BFF50D900E59296 /* TronSendData.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0A690272BFF50D900E59296 /* TronSendData.swift */; }; - D0A690292BFF50D900E59296 /* TronSendData.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0A690272BFF50D900E59296 /* TronSendData.swift */; }; D0A980A92B5E3C0900127AF4 /* StepChangeButtonsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0A980A82B5E3C0900127AF4 /* StepChangeButtonsView.swift */; }; D0A980AA2B5E3C0900127AF4 /* StepChangeButtonsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0A980A82B5E3C0900127AF4 /* StepChangeButtonsView.swift */; }; D0A980AF2B60E73F00127AF4 /* LegacyFeeSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0A980AE2B60E73F00127AF4 /* LegacyFeeSettingsView.swift */; }; @@ -4487,6 +4491,8 @@ D086A9152BF4D08400462024 /* SendParameters.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendParameters.swift; sourceTree = ""; }; D087626E29815DAD00E6FFD4 /* ChooseWatchViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChooseWatchViewController.swift; sourceTree = ""; }; D087626F29815DAD00E6FFD4 /* ChooseWatchViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChooseWatchViewModel.swift; sourceTree = ""; }; + D08D16802C2164880086E5A5 /* TonPresendHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TonPresendHandler.swift; sourceTree = ""; }; + D08D16832C2165490086E5A5 /* TonSendHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TonSendHandler.swift; sourceTree = ""; }; D090AF60297D725D00699916 /* TransparentIconButtonView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransparentIconButtonView.swift; sourceTree = ""; }; D09200AF293F21510091981A /* RestoreMnemonicNonStandardService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RestoreMnemonicNonStandardService.swift; sourceTree = ""; }; D09200B2293F21520091981A /* RestoreMnemonicNonStandardViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RestoreMnemonicNonStandardViewModel.swift; sourceTree = ""; }; @@ -4499,11 +4505,11 @@ D09D768D2A2E06D6004311E6 /* SendTronConfirmationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendTronConfirmationViewController.swift; sourceTree = ""; }; D09D76902A2E0753004311E6 /* SendTronConfirmationViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendTronConfirmationViewModel.swift; sourceTree = ""; }; D09D76932A2E07BD004311E6 /* SendTronConfirmationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendTronConfirmationService.swift; sourceTree = ""; }; + D0A690242BFCB51800E59296 /* TronPresendHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TronPresendHandler.swift; sourceTree = ""; }; + D0A690272BFF50D900E59296 /* TronSendData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TronSendData.swift; sourceTree = ""; }; D0A6902A2C00ACF600E59296 /* CautionDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CautionDataSource.swift; sourceTree = ""; }; D0A6902D2C04969300E59296 /* CautionDataSourceViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CautionDataSourceViewModel.swift; sourceTree = ""; }; D0A690332C05D01C00E59296 /* UIImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIImageView.swift; sourceTree = ""; }; - D0A690242BFCB51800E59296 /* TronPresendHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TronPresendHandler.swift; sourceTree = ""; }; - D0A690272BFF50D900E59296 /* TronSendData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TronSendData.swift; sourceTree = ""; }; D0A980A82B5E3C0900127AF4 /* StepChangeButtonsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StepChangeButtonsView.swift; sourceTree = ""; }; D0A980AE2B60E73F00127AF4 /* LegacyFeeSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegacyFeeSettingsView.swift; sourceTree = ""; }; D0C2260F2A66A3BC007101F7 /* PersonalSupportModule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersonalSupportModule.swift; sourceTree = ""; }; @@ -8560,6 +8566,8 @@ D084F6BD2BEB94F700407FA4 /* OutputSelectView2.swift */, D084F6C02BEB951C00407FA4 /* OutputSelectorViewModel2.swift */, D03F74812BF76D0A004FBCFA /* GasPriceData.swift */, + D08D16802C2164880086E5A5 /* TonPresendHandler.swift */, + D08D16832C2165490086E5A5 /* TonSendHandler.swift */, ); path = SendNew; sourceTree = ""; @@ -9484,6 +9492,7 @@ 58AAAA71882CB345D56BBA00 /* CoinChartFactory.swift in Sources */, 11B351856787DD75A41861B6 /* CoinInvestorsViewModel.swift in Sources */, 11B3507F17791BC895872490 /* BrandFooterView.swift in Sources */, + D08D16852C2165490086E5A5 /* TonSendHandler.swift in Sources */, 6BCD53152A161F4800993F20 /* BackupViewModel.swift in Sources */, 11B35D10A6A15EFA47FCE6D0 /* TextCell.swift in Sources */, 6BCD53012A161F4100993F20 /* BackupCloudModule.swift in Sources */, @@ -10332,6 +10341,7 @@ 11B35D4CF0FBE2496CED70E4 /* EditPasscodeViewModel.swift in Sources */, 11B35481F59793CD9C95B324 /* CreatePasscodeViewModel.swift in Sources */, 11B3531D97E44DA1D8280C35 /* EditDuressPasscodeViewModel.swift in Sources */, + D08D16822C2164880086E5A5 /* TonPresendHandler.swift in Sources */, 11B35E04C504E2C268F53B66 /* CreateDuressPasscodeViewModel.swift in Sources */, 11B35FFC8C3E4CF638397650 /* UnlockView.swift in Sources */, 11B3564236FEF4E5ACC8C838 /* UnlockModule.swift in Sources */, @@ -10936,6 +10946,7 @@ D3833AFF2BF335D100ACECFB /* MarketNewsViewModel.swift in Sources */, D36DE0D8272FD887000BC916 /* OneInchDataSource.swift in Sources */, 58AAA2EBAFC1C443C48BA857 /* CoinChartFactory.swift in Sources */, + D08D16842C2165490086E5A5 /* TonSendHandler.swift in Sources */, 11B35085F61E874613B2B882 /* CoinInvestorsViewModel.swift in Sources */, 6BCD53142A161F4800993F20 /* BackupViewModel.swift in Sources */, 11B35D7420EF4FB9C4DDF0B9 /* BrandFooterView.swift in Sources */, @@ -11784,6 +11795,7 @@ 11B3587D9E89A97F63CD0C5A /* EditPasscodeModule.swift in Sources */, 11B35E051C3D3534E88BEB3D /* CreatePasscodeModule.swift in Sources */, 11B351E088F87C02C870DDB8 /* SetPasscodeViewModel.swift in Sources */, + D08D16812C2164880086E5A5 /* TonPresendHandler.swift in Sources */, 11B358006AEB85BBE0BF47A7 /* EditPasscodeViewModel.swift in Sources */, 11B35C9570D3C283E9C943D5 /* CreatePasscodeViewModel.swift in Sources */, 11B356A5B50D4E6EF2282398 /* EditDuressPasscodeViewModel.swift in Sources */, diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/SendNew/SendData.swift b/UnstoppableWallet/UnstoppableWallet/Modules/SendNew/SendData.swift index c4847bd0b1..73f44cc084 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/SendNew/SendData.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/SendNew/SendData.swift @@ -11,6 +11,7 @@ enum SendData { case binance(token: Token, amount: Decimal, address: String, memo: String?) case zcash(amount: Decimal, recipient: Recipient, memo: String?) case tron(token: Token, contract: Contract) + case ton(amount: Decimal, address: String, memo: String?) case swap(tokenIn: Token, tokenOut: Token, amountIn: Decimal, provider: IMultiSwapProvider) case walletConnect(request: WalletConnectRequest) } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/SendNew/SendHandlerFactory.swift b/UnstoppableWallet/UnstoppableWallet/Modules/SendNew/SendHandlerFactory.swift index 882263ea25..a65650e9d7 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/SendNew/SendHandlerFactory.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/SendNew/SendHandlerFactory.swift @@ -13,6 +13,8 @@ enum SendHandlerFactory { return ZcashSendHandler.instance(amount: amount, recipient: recipient, memo: memo) case let .tron(token, contract): return TronSendHandler.instance(token: token, contract: contract) + case let .ton(amount, address, memo): + return TonSendHandler.instance(amount: amount, address: address, memo: memo) case let .swap(tokenIn, tokenOut, amountIn, provider): return MultiSwapSendHandler.instance(tokenIn: tokenIn, tokenOut: tokenOut, amountIn: amountIn, provider: provider) case let .walletConnect(request): @@ -43,6 +45,10 @@ enum SendHandlerFactory { return TronPreSendHandler(token: wallet.token, adapter: adapter) } + if let adapter = adapter as? ISendTonAdapter & IBalanceAdapter { + return TonPreSendHandler(adapter: adapter) + } + return nil } } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/SendNew/TonPresendHandler.swift b/UnstoppableWallet/UnstoppableWallet/Modules/SendNew/TonPresendHandler.swift new file mode 100644 index 0000000000..6b3b4c15c4 --- /dev/null +++ b/UnstoppableWallet/UnstoppableWallet/Modules/SendNew/TonPresendHandler.swift @@ -0,0 +1,65 @@ +import BigInt +import Combine +import Foundation +import MarketKit +import RxSwift +import TonKit + +class TonPreSendHandler { + private let adapter: ISendTonAdapter & IBalanceAdapter + + private let stateSubject = PassthroughSubject() + private let balanceSubject = PassthroughSubject() + + private let disposeBag = DisposeBag() + + init(adapter: ISendTonAdapter & IBalanceAdapter) { + self.adapter = adapter + + adapter.balanceStateUpdatedObservable + .observeOn(ConcurrentDispatchQueueScheduler(qos: .userInitiated)) + .subscribe { [weak self] state in + self?.stateSubject.send(state) + } + .disposed(by: disposeBag) + + adapter.balanceDataUpdatedObservable + .observeOn(ConcurrentDispatchQueueScheduler(qos: .userInitiated)) + .subscribe { [weak self] balanceData in + self?.balanceSubject.send(balanceData.available) + } + .disposed(by: disposeBag) + } +} + +extension TonPreSendHandler: IPreSendHandler { + var state: AdapterState { + adapter.balanceState + } + + var statePublisher: AnyPublisher { + stateSubject.eraseToAnyPublisher() + } + + var balance: Decimal { + adapter.balanceData.available + } + + var balancePublisher: AnyPublisher { + balanceSubject.eraseToAnyPublisher() + } + + func hasMemo(address _: String?) -> Bool { + true + } + + func sendData(amount: Decimal, address: String, memo: String?) -> SendDataResult { + do { + try TonKit.Kit.validate(address: address) + } catch { + return .invalid(cautions: [CautionNew(text: error.smartDescription, type: .error)]) + } + + return .valid(sendData: .ton(amount: amount, address: address, memo: memo)) + } +} diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/SendNew/TonSendHandler.swift b/UnstoppableWallet/UnstoppableWallet/Modules/SendNew/TonSendHandler.swift new file mode 100644 index 0000000000..9f05e2aa9f --- /dev/null +++ b/UnstoppableWallet/UnstoppableWallet/Modules/SendNew/TonSendHandler.swift @@ -0,0 +1,235 @@ +import BigInt +import Foundation +import MarketKit +import TonKit + +class TonSendHandler { + private let token: Token + private let adapter: ISendTonAdapter + private var amount: Decimal + private let address: String + private let memo: String? + + init(token: Token, adapter: ISendTonAdapter, amount: Decimal, address: String, memo: String?) { + self.token = token + self.adapter = adapter + self.amount = amount + self.address = address + self.memo = memo + } +} + +extension TonSendHandler { + class SendData: ISendData { + private let token: Token + private let amount: Decimal + private let address: String + private let memo: String? + let fee: Decimal? + private let transactionError: Error? + var feeData: FeeData? = nil + + init(token: Token, amount: Decimal, address: String, memo: String?, fee: Decimal?, transactionError: Error?) { + self.token = token + self.amount = amount + self.address = address + self.memo = memo + self.fee = fee + self.transactionError = transactionError + } + + var canSend: Bool { + fee != nil && transactionError == nil + } + + var customSendButtonTitle: String? { + nil + } + + var rateCoins: [Coin] { + [token.coin] + } + + func caution(transactionError: Error, feeToken: Token) -> CautionNew { + let title: String + let text: String + + if let tonError = transactionError as? TonSendHandler.TransactionError { + switch tonError { + case let .insufficientBalance(balance): + let coinValue = CoinValue(kind: .token(token: feeToken), value: balance) + let balanceString = ValueFormatter.instance.formatShort(coinValue: coinValue) + + title = "fee_settings.errors.insufficient_balance".localized + text = "fee_settings.errors.insufficient_balance.info".localized(balanceString ?? "") + + case .zeroAmount: + title = "alert.error".localized + text = "fee_settings.errors.zero_amount.info".localized + } + } else { + title = "Error" + text = transactionError.convertedError.smartDescription + } + + return CautionNew(title: title, text: text, type: .error) + } + + func cautions(baseToken: Token) -> [CautionNew] { + var cautions = [CautionNew]() + + if let transactionError { + cautions.append(caution(transactionError: transactionError, feeToken: baseToken)) + } + + return cautions + } + + func sections(baseToken _: Token, currency: Currency, rates: [String: Decimal]) -> [[SendField]] { + var fields: [SendField] = [ + .amount( + title: "send.confirmation.you_send".localized, + token: token, + coinValueType: .regular(coinValue: CoinValue(kind: .token(token: token), value: amount)), + currencyValue: rates[token.coin.uid].map { CurrencyValue(currency: currency, value: $0 * amount) }, + type: .neutral + ), + .address( + title: "send.confirmation.to".localized, + value: address, + blockchainType: .ton + ), + ] + + if let memo { + fields.append(.levelValue(title: "send.confirmation.memo".localized, value: memo, level: .regular)) + } + + return [ + fields, + feeFields(currency: currency, feeTokenRate: rates[token.coin.uid]), + ] + } + + private func feeFields(currency: Currency, feeTokenRate: Decimal?) -> [SendField] { + var viewItems = [SendField]() + + if let fee { + let coinValue = CoinValue(kind: .token(token: token), value: fee) + let currencyValue = feeTokenRate.map { CurrencyValue(currency: currency, value: fee * $0) } + + viewItems.append( + .value( + title: "fee_settings.network_fee".localized, + description: .init(title: "fee_settings.network_fee".localized, description: "fee_settings.network_fee.info".localized), + coinValue: coinValue, + currencyValue: currencyValue, + formatFull: true + ) + ) + } + + return viewItems + } + } +} + +extension TonSendHandler: ISendHandler { + var baseToken: Token { + token + } + + var expirationDuration: Int? { + 10 + } + + func sendData(transactionSettings _: TransactionSettings?) async throws -> ISendData { + var fee: Decimal? + var transactionError: Error? + let tonBalance = adapter.availableBalance + + do { + let _fee = try await adapter.estimateFee(recipient: address, amount: amount, memo: memo) + var totalAmount = Decimal.zero + + var sentAmount = amount + if tonBalance == amount { + // If the maximum amount is being sent, then we subtract fees from sent amount + sentAmount = sentAmount - _fee + + guard sentAmount > 0 else { + throw TransactionError.zeroAmount + } + + amount = sentAmount + } + + totalAmount += sentAmount + totalAmount += _fee + fee = _fee + + if tonBalance < totalAmount { + throw TransactionError.insufficientBalance(balance: tonBalance) + } + } catch { + transactionError = error + } + + return SendData( + token: token, + amount: amount, + address: address, + memo: memo, + fee: fee, + transactionError: transactionError + ) + } + + func send(data: ISendData) async throws { + guard let data = data as? SendData else { + throw SendError.invalidData + } + + guard data.fee != nil else { + throw SendError.noFees + } + + _ = try await adapter.send( + recipient: address, + amount: amount, + memo: memo + ) + } +} + +extension TonSendHandler { + enum SendError: Error { + case invalidData + case noFees + } + + enum TransactionError: Error { + case insufficientBalance(balance: Decimal) + case zeroAmount + } +} + +extension TonSendHandler { + static func instance(amount: Decimal, address: String, memo: String?) -> TonSendHandler? { + guard let baseToken = try? App.shared.coinManager.token(query: .init(blockchainType: .ton, tokenType: .native)) else { + return nil + } + + guard let adapter = App.shared.adapterManager.adapter(for: baseToken) as? ISendTonAdapter else { + return nil + } + + return TonSendHandler( + token: baseToken, + adapter: adapter, + amount: amount, + address: address, + memo: memo + ) + } +} diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/SendNew/ZcashSendHandler.swift b/UnstoppableWallet/UnstoppableWallet/Modules/SendNew/ZcashSendHandler.swift index c17819ee2b..87d0b0c4e9 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/SendNew/ZcashSendHandler.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/SendNew/ZcashSendHandler.swift @@ -86,7 +86,7 @@ extension ZcashSendHandler { .address( title: "send.confirmation.to".localized, value: recipient.stringEncoded, - blockchainType: .binanceChain + blockchainType: .zcash ), ]