diff --git a/Shared/Wallets/WalletsManager.swift b/Shared/Wallets/WalletsManager.swift index bf96715f..5dbc9da6 100644 --- a/Shared/Wallets/WalletsManager.swift +++ b/Shared/Wallets/WalletsManager.swift @@ -84,6 +84,15 @@ final class WalletsManager { } } + func suggestedAccount(coin: CoinType) -> SpecificWalletAccount? { + for wallet in wallets { + if let account = wallet.accounts.first(where: { $0.coin == coin }) { + return SpecificWalletAccount(walletId: wallet.id, account: account) + } + } + return nil + } + private func createWallet(name: String, password: String) throws -> TokenaryWallet { let key = StoredKey(name: name, password: Data(password.utf8)) let id = makeNewWalletId()