diff --git a/novawallet/Modules/Swaps/Base/Model/SwapDetailsViewModelFactory.swift b/novawallet/Modules/Swaps/Base/Model/SwapDetailsViewModelFactory.swift index 9c00e3e41..d62a5086d 100644 --- a/novawallet/Modules/Swaps/Base/Model/SwapDetailsViewModelFactory.swift +++ b/novawallet/Modules/Swaps/Base/Model/SwapDetailsViewModelFactory.swift @@ -12,7 +12,7 @@ protocol SwapDetailsViewModelFactoryProtocol: SwapBaseViewModelFactoryProtocol { func slippageViewModel(slippage: BigRational, locale: Locale) -> String - func walletViewModel(walletAddress: WalletDisplayAddress) -> WalletAccountViewModel? + func walletViewModel(metaAccountResponse: MetaChainAccountResponse) -> WalletAccountViewModel? } final class SwapDetailsViewModelFactory: SwapBaseViewModelFactory { @@ -72,7 +72,7 @@ extension SwapDetailsViewModelFactory: SwapDetailsViewModelFactoryProtocol { slippage.decimalValue.map { percentForamatter.value(for: locale).stringFromDecimal($0) ?? "" } ?? "" } - func walletViewModel(walletAddress: WalletDisplayAddress) -> WalletAccountViewModel? { - try? walletViewModelFactory.createViewModel(from: walletAddress) + func walletViewModel(metaAccountResponse: MetaChainAccountResponse) -> WalletAccountViewModel? { + try? walletViewModelFactory.createViewModel(from: metaAccountResponse) } } diff --git a/novawallet/Modules/Swaps/Confirm/SwapConfirmPresenter.swift b/novawallet/Modules/Swaps/Confirm/SwapConfirmPresenter.swift index 0549331b1..2e8d0738b 100644 --- a/novawallet/Modules/Swaps/Confirm/SwapConfirmPresenter.swift +++ b/novawallet/Modules/Swaps/Confirm/SwapConfirmPresenter.swift @@ -290,11 +290,7 @@ extension SwapConfirmPresenter { return } - guard let walletAddress = WalletDisplayAddress(response: chainAccountResponse) else { - view?.didReceiveWallet(viewModel: nil) - return - } - let viewModel = viewModelFactory.walletViewModel(walletAddress: walletAddress) + let viewModel = viewModelFactory.walletViewModel(metaAccountResponse: chainAccountResponse) view?.didReceiveWallet(viewModel: viewModel) }