diff --git a/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Icons/mail_24.imageset/Contents.json b/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Icons/mail_24.imageset/Contents.json new file mode 100644 index 0000000000..a3a0532fd0 --- /dev/null +++ b/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Icons/mail_24.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "mail@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "mail@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Icons/mail_24.imageset/mail@2x.png b/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Icons/mail_24.imageset/mail@2x.png new file mode 100644 index 0000000000..7625afc6f7 Binary files /dev/null and b/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Icons/mail_24.imageset/mail@2x.png differ diff --git a/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Icons/mail_24.imageset/mail@3x.png b/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Icons/mail_24.imageset/mail@3x.png new file mode 100644 index 0000000000..285e2e6fda Binary files /dev/null and b/UnstoppableWallet/UnstoppableWallet/Assets.xcassets/Icons/mail_24.imageset/mail@3x.png differ diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/ManageWallets/ManageWalletsService.swift b/UnstoppableWallet/UnstoppableWallet/Modules/ManageWallets/ManageWalletsService.swift index 4f6c62b075..9ac4632721 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/ManageWallets/ManageWalletsService.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/ManageWallets/ManageWalletsService.swift @@ -68,17 +68,12 @@ class ManageWalletsService { private func fetchTokens() -> [Token] { do { if filter.trimmingCharacters(in: .whitespaces).isEmpty { - let queries = [ - TokenQuery(blockchainType: .bitcoin, tokenType: .derived(derivation: .bip84)), - TokenQuery(blockchainType: .ethereum, tokenType: .native), - TokenQuery(blockchainType: .binanceSmartChain, tokenType: .native), - ] - - let tokens = try marketKit.tokens(queries: queries) + let list = BlockchainType.supported.map { $0.defaultTokenQuery } + let tokens = try marketKit.tokens(queries: list) let featuredTokens = tokens.filter { account.type.supports(token: $0) } let enabledTokens = wallets.map { $0.token } - return Array(Set(featuredTokens + enabledTokens)) + return (enabledTokens + featuredTokens).removeDuplicates() } else if let ethAddress = try? EvmKit.Address(hex: filter) { let address = ethAddress.hex let tokens = try marketKit.tokens(reference: address) @@ -136,22 +131,10 @@ class ManageWalletsService { return lhsStartsWithName } } - - let lhsMarketCapRank = lhsToken.coin.marketCapRank ?? Int.max - let rhsMarketCapRank = rhsToken.coin.marketCapRank ?? Int.max - - if lhsMarketCapRank != rhsMarketCapRank { - return lhsMarketCapRank < rhsMarketCapRank + if lhsToken.blockchainType.order != rhsToken.blockchainType.order { + return lhsToken.blockchainType.order < rhsToken.blockchainType.order } - - let lhsName = lhsToken.coin.name.lowercased() - let rhsName = rhsToken.coin.name.lowercased() - - if lhsName != rhsName { - return lhsName < rhsName - } - - return lhsToken.blockchainType.order < rhsToken.blockchainType.order + return lhsToken.badge ?? "" < rhsToken.badge ?? "" } } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/Settings/About/AboutViewController.swift b/UnstoppableWallet/UnstoppableWallet/Modules/Settings/About/AboutViewController.swift index 8aaa701431..3477512c8c 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/Settings/About/AboutViewController.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/Settings/About/AboutViewController.swift @@ -285,7 +285,7 @@ extension AboutViewController: SectionsDataSource { rows: [ row( id: "email", - image: "at_24", + image: "mail_24", title: "settings.about_app.contact".localized, isFirst: true, isLast: true, diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/Wallet/Receive/ReceiveService.swift b/UnstoppableWallet/UnstoppableWallet/Modules/Wallet/Receive/ReceiveService.swift index 69cbba67a2..87f19341b1 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/Wallet/Receive/ReceiveService.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/Wallet/Receive/ReceiveService.swift @@ -155,6 +155,10 @@ extension ReceiveService { } extension ReceiveService { + func isEnabled(coin: Coin) -> Bool { + walletManager.activeWallets.contains { $0.coin == coin } + } + var predefinedCoins: [FullCoin] { // get all restored coins let activeWallets = walletManager.activeWallets @@ -173,9 +177,18 @@ extension ReceiveService { // filter not supported by current account let predefined = fullCoins?.filter { fullCoin in fullCoin.tokens.contains { account.type.supports(token: $0) } - } ?? [] + }.sorted { lhsCoin, rhsCoin in + let lhsEnabled = isEnabled(coin: lhsCoin.coin) + let rhsEnabled = isEnabled(coin: rhsCoin.coin) + + if lhsEnabled != rhsEnabled { + return lhsEnabled + } + + return lhsCoin.coin.marketCapRank ?? Int.max < rhsCoin.coin.marketCapRank ?? Int.max + } - return predefined + return predefined ?? [] } } diff --git a/UnstoppableWallet/UnstoppableWallet/Modules/Wallet/Receive/SelectCoin/ReceiveSelectCoinService.swift b/UnstoppableWallet/UnstoppableWallet/Modules/Wallet/Receive/SelectCoin/ReceiveSelectCoinService.swift index 8b61027e45..d4f0520c2e 100644 --- a/UnstoppableWallet/UnstoppableWallet/Modules/Wallet/Receive/SelectCoin/ReceiveSelectCoinService.swift +++ b/UnstoppableWallet/UnstoppableWallet/Modules/Wallet/Receive/SelectCoin/ReceiveSelectCoinService.swift @@ -16,8 +16,9 @@ class ReceiveSelectCoinService { private func sync() { let filter = provider.filter - coins = provider.fetch().sorted { lhsFullCoin, rhsFullCoin in - if !filter.isEmpty { + let coins = provider.fetch() + if !filter.isEmpty { + self.coins = coins.sorted { lhsFullCoin, rhsFullCoin in let filter = filter.lowercased() let lhsExactCode = lhsFullCoin.coin.code.lowercased() == filter @@ -26,16 +27,7 @@ class ReceiveSelectCoinService { if lhsExactCode != rhsExactCode { return lhsExactCode } - } - - let lhsMarketCapRank = lhsFullCoin.coin.marketCapRank ?? Int.max - let rhsMarketCapRank = rhsFullCoin.coin.marketCapRank ?? Int.max - if lhsMarketCapRank != rhsMarketCapRank { - return lhsMarketCapRank < rhsMarketCapRank - } - - if !filter.isEmpty { let lhsStartsWithCode = lhsFullCoin.coin.code.lowercased().starts(with: filter) let rhsStartsWithCode = rhsFullCoin.coin.code.lowercased().starts(with: filter) @@ -49,16 +41,16 @@ class ReceiveSelectCoinService { if lhsStartsWithName != rhsStartsWithName { return lhsStartsWithName } - } - return lhsFullCoin.coin.name.lowercased() < rhsFullCoin.coin.name.lowercased() + return lhsFullCoin.coin.name.lowercased() < rhsFullCoin.coin.name.lowercased() + } + } else { + self.coins = coins } } - } extension ReceiveSelectCoinService { - func set(filter: String) { provider.filter = filter @@ -70,5 +62,4 @@ extension ReceiveSelectCoinService { coin.coin.uid == uid } } - } diff --git a/UnstoppableWallet/UnstoppableWallet/en.lproj/Localizable.strings b/UnstoppableWallet/UnstoppableWallet/en.lproj/Localizable.strings index ea97db4d7c..60350ff05e 100644 --- a/UnstoppableWallet/UnstoppableWallet/en.lproj/Localizable.strings +++ b/UnstoppableWallet/UnstoppableWallet/en.lproj/Localizable.strings @@ -369,7 +369,7 @@ Go to Settings - > %@ and allow access to the camera."; "receive_network_select.description" = "Choose a network and get an address to receive."; "receive_address_format_select.title" = "Address Format"; -"receive_address_format_select.description" = "Choose a network and get an address to receive."; +"receive_address_format_select.description" = "Select an address format to receive your address."; "receive_address_format_select.bitcoin.bottom_description" = "The Native SegWit format is preferred in Bitcoin for improved throughput and security. All address formats (Taproot, SegWit, Legacy) can be used interchangeably to receive BTC regardless of the sender's address format, enabling seamless transactions across different coin types."; "receive_address_format_select.bitcoin_cash.bottom_description" = "The Cash Address format is preferred for receiving Bitcoin Cash (BCH) due to its improved user experience and compatibility. However, both address formats can be used interchangeably to receive BCH, regardless of the sender's address format.";