diff --git a/src/app/modules/main/module.nim b/src/app/modules/main/module.nim index 5ea65db45c..ae85d3d0f3 100644 --- a/src/app/modules/main/module.nim +++ b/src/app/modules/main/module.nim @@ -447,10 +447,6 @@ proc connectForNotificationsOnly[T](self: Module[T]) = let args = NetworkEndpointUpdatedArgs(e) self.view.showNetworkEndpointUpdated(args.networkName, args.isTest, args.revertedToDefault) - self.events.on(SIGNAL_INCLUDE_WATCH_ONLY_ACCOUNTS_UPDATED) do(e: Args): - let args = SettingsBoolValueArgs(e) - self.view.showIncludeWatchOnlyAccountUpdated(args.value) - self.events.on(SIGNAL_KEYPAIR_DELETED) do(e: Args): let args = KeypairArgs(e) self.view.showToastKeypairRemoved(args.keyPairName) diff --git a/src/app/modules/main/profile_section/wallet/accounts/controller.nim b/src/app/modules/main/profile_section/wallet/accounts/controller.nim index 6cdfb3d051..58c0e98d0c 100644 --- a/src/app/modules/main/profile_section/wallet/accounts/controller.nim +++ b/src/app/modules/main/profile_section/wallet/accounts/controller.nim @@ -52,12 +52,6 @@ proc getWalletAccount*(self: Controller, address: string): WalletAccountDto = proc getKeypairs*(self: Controller): seq[KeypairDto] = return self.walletAccountService.getKeypairs() -proc toggleIncludeWatchOnlyAccount*(self: Controller) = - self.walletAccountService.toggleIncludeWatchOnlyAccount() - -proc isIncludeWatchOnlyAccount*(self: Controller): bool = - return self.walletAccountService.isIncludeWatchOnlyAccount() - proc getEnabledChainIds*(self: Controller): seq[int] = return self.walletAccountService.getEnabledChainIds() @@ -78,3 +72,6 @@ proc areTestNetworksEnabled*(self: Controller): bool = proc getCurrencyBalance*(self: Controller, address: string, chainIds: seq[int], currency: string): float64 = return self.walletAccountService.getCurrencyBalance(address, chainIds, currency) + +proc updateWatchAccountHiddenFromTotalBalance*(self: Controller, address: string, hideFromTotalBalance: bool) = + discard self.walletAccountService.updateWatchAccountHiddenFromTotalBalance(address, hideFromTotalBalance) diff --git a/src/app/modules/main/profile_section/wallet/accounts/io_interface.nim b/src/app/modules/main/profile_section/wallet/accounts/io_interface.nim index 41109663d4..9d68ca541a 100644 --- a/src/app/modules/main/profile_section/wallet/accounts/io_interface.nim +++ b/src/app/modules/main/profile_section/wallet/accounts/io_interface.nim @@ -46,11 +46,11 @@ method getModuleAsVariant*(self: AccessInterface): QVariant {.base.} = method getCollectiblesModel*(self: AccessInterface): QVariant {.base.} = raise newException(ValueError, "No implementation available") -method toggleIncludeWatchOnlyAccount*(self: AccessInterface) {.base.} = - raise newException(ValueError, "No implementation available") - method updateWalletAccountProdPreferredChains*(self: AccessInterface, address, preferredChainIds: string) {.base.} = raise newException(ValueError, "No implementation available") method updateWalletAccountTestPreferredChains*(self: AccessInterface, address, preferredChainIds: string) {.base.} = raise newException(ValueError, "No implementation available") + +method updateWatchAccountHiddenFromTotalBalance*(self: AccessInterface, address: string, hideFromTotalBalance: bool) {.base.} = + raise newException(ValueError, "No implementation available") diff --git a/src/app/modules/main/profile_section/wallet/accounts/module.nim b/src/app/modules/main/profile_section/wallet/accounts/module.nim index 68ea77eda3..2da9862242 100644 --- a/src/app/modules/main/profile_section/wallet/accounts/module.nim +++ b/src/app/modules/main/profile_section/wallet/accounts/module.nim @@ -79,7 +79,8 @@ method convertWalletAccountDtoToKeyPairAccountItem(self: Module, account: Wallet isDefaultAccount = account.isWallet, self.controller.areTestNetworksEnabled(), prodPreferredChainIds = account.prodPreferredChainIds, - testPreferredChainIds = account.testPreferredChainIds) + testPreferredChainIds = account.testPreferredChainIds, + hideFromTotalBalance = account.hideFromTotalBalance) method setBalance(self: Module, accountsTokens: OrderedTable[string, seq[WalletTokenDto]]) = let enabledChainIds = self.controller.getEnabledChainIds() @@ -179,17 +180,16 @@ method load*(self: Module) = self.events.on(SIGNAL_WALLET_ACCOUNT_POSITION_UPDATED) do(e:Args): self.refreshWalletAccounts() - self.events.on(SIGNAL_INCLUDE_WATCH_ONLY_ACCOUNTS_UPDATED) do(e: Args): - let args = SettingsBoolValueArgs(e) - self.view.setIncludeWatchOnlyAccount(args.value) - self.events.on(SIGNAL_WALLET_ACCOUNT_PREFERRED_SHARING_CHAINS_UPDATED) do(e: Args): let args = AccountArgs(e) self.view.onPreferredSharingChainsUpdated(args.account.keyUid, args.account.address, args.account.prodPreferredChainIds, args.account.testPreferredChainIds) + self.events.on(SIGNAL_WALLET_ACCOUNT_HIDDEN_UPDATED) do(e: Args): + let args = AccountArgs(e) + self.view.onHideFromTotalBalanceUpdated(args.account.keyUid, args.account.address, args.account.hideFromTotalBalance) + self.controller.init() self.view.load() - self.view.setIncludeWatchOnlyAccount(self.controller.isIncludeWatchOnlyAccount()) method isLoaded*(self: Module): bool = return self.moduleLoaded @@ -211,9 +211,6 @@ method deleteAccount*(self: Module, address: string) = method deleteKeypair*(self: Module, keyUid: string) = self.controller.deleteKeypair(keyUid) -method toggleIncludeWatchOnlyAccount*(self: Module) = - self.controller.toggleIncludeWatchOnlyAccount() - method renameKeypair*(self: Module, keyUid: string, name: string) = self.controller.renameKeypair(keyUid, name) @@ -225,3 +222,6 @@ method updateWalletAccountProdPreferredChains*(self: Module, address, preferredC method updateWalletAccountTestPreferredChains*(self: Module, address, preferredChainIds: string) = self.controller.updateWalletAccountTestPreferredChains(address, preferredChainIds) + +method updateWatchAccountHiddenFromTotalBalance*(self: Module, address: string, hideFromTotalBalance: bool) = + self.controller.updateWatchAccountHiddenFromTotalBalance(address, hideFromTotalBalance) diff --git a/src/app/modules/main/profile_section/wallet/accounts/view.nim b/src/app/modules/main/profile_section/wallet/accounts/view.nim index 3c406fd848..8eb3c381ef 100644 --- a/src/app/modules/main/profile_section/wallet/accounts/view.nim +++ b/src/app/modules/main/profile_section/wallet/accounts/view.nim @@ -13,7 +13,6 @@ QtObject: accounts: Model accountsVariant: QVariant keyPairModel: KeyPairModel - includeWatchOnlyAccount: bool proc delete*(self: View) = self.accounts.delete @@ -57,6 +56,9 @@ QtObject: proc onPreferredSharingChainsUpdated*(self: View, keyUid, address, prodPreferredChainIds, testPreferredChainIds: string) = self.keyPairModel.onPreferredSharingChainsUpdated(keyUid, address, prodPreferredChainIds, testPreferredChainIds) + proc onHideFromTotalBalanceUpdated*(self: View, keyUid, address: string, hideFromTotalBalance: bool) = + self.keyPairModel.onHideFromTotalBalanceUpdated(keyUid, address, hideFromTotalBalance) + proc deleteAccount*(self: View, address: string) {.slot.} = self.delegate.deleteAccount(address) @@ -77,20 +79,6 @@ QtObject: self.keyPairModel.setItems(items) self.keyPairModelChanged() - proc includeWatchOnlyAccountChanged*(self: View) {.signal.} - proc getIncludeWatchOnlyAccount(self: View): bool {.slot.} = - return self.includeWatchOnlyAccount - QtProperty[bool] includeWatchOnlyAccount: - read = getIncludeWatchOnlyAccount - notify = includeWatchOnlyAccountChanged - - proc toggleIncludeWatchOnlyAccount*(self: View) {.slot.} = - self.delegate.toggleIncludeWatchOnlyAccount() - - proc setIncludeWatchOnlyAccount*(self: View, includeWatchOnlyAccount: bool) = - self.includeWatchOnlyAccount = includeWatchOnlyAccount - self.includeWatchOnlyAccountChanged() - proc keypairNameExists*(self: View, name: string): bool {.slot.} = return self.keyPairModel.keypairNameExists(name) @@ -111,3 +99,6 @@ QtObject: proc setBalanceForKeyPairs*(self: View, address: string, balance: CurrencyAmount) = self.keyPairModel.setBalanceForAddress(address, balance) + + proc updateWatchAccountHiddenFromTotalBalance*(self: View, address: string, hideFromTotalBalance: bool) {.slot.} = + self.delegate.updateWatchAccountHiddenFromTotalBalance(address, hideFromTotalBalance) diff --git a/src/app/modules/main/view.nim b/src/app/modules/main/view.nim index 278f463957..c2193f185e 100644 --- a/src/app/modules/main/view.nim +++ b/src/app/modules/main/view.nim @@ -293,7 +293,6 @@ QtObject: proc showToastAccountAdded*(self: View, name: string) {.signal.} proc showToastKeypairRenamed*(self: View, oldName: string, newName: string) {.signal.} proc showNetworkEndpointUpdated*(self: View, name: string, isTest: bool, revertedToDefault: bool) {.signal.} - proc showIncludeWatchOnlyAccountUpdated*(self: View, includeWatchOnly: bool) {.signal.} proc showToastKeypairRemoved*(self: View, keypairName: string) {.signal.} proc showToastKeypairsImported*(self: View, keypairName: string, keypairsCount: int, error: string) {.signal.} proc showToastTransactionSent*(self: View, chainId: int, txHash: string, uuid: string, error: string) {.signal.} diff --git a/src/app/modules/main/wallet_section/accounts/controller.nim b/src/app/modules/main/wallet_section/accounts/controller.nim index 30a495c5d7..375cb7f44f 100644 --- a/src/app/modules/main/wallet_section/accounts/controller.nim +++ b/src/app/modules/main/wallet_section/accounts/controller.nim @@ -70,3 +70,6 @@ proc areTestNetworksEnabled*(self: Controller): bool = proc getCurrencyBalance*(self: Controller, address: string, chainIds: seq[int], currency: string): float64 = return self.walletAccountService.getCurrencyBalance(address, chainIds, currency) + +proc updateWatchAccountHiddenFromTotalBalance*(self: Controller, address: string, hideFromTotalBalance: bool) = + discard self.walletAccountService.updateWatchAccountHiddenFromTotalBalance(address, hideFromTotalBalance) diff --git a/src/app/modules/main/wallet_section/accounts/io_interface.nim b/src/app/modules/main/wallet_section/accounts/io_interface.nim index cce2343e31..b3431e8fa7 100644 --- a/src/app/modules/main/wallet_section/accounts/io_interface.nim +++ b/src/app/modules/main/wallet_section/accounts/io_interface.nim @@ -36,3 +36,6 @@ method updateWalletAccountProdPreferredChains*(self: AccessInterface, address, p method updateWalletAccountTestPreferredChains*(self: AccessInterface, address, preferredChainIds: string) {.base.} = raise newException(ValueError, "No implementation available") + +method updateWatchAccountHiddenFromTotalBalance*(self: AccessInterface, address: string, hideFromTotalBalance: bool) {.base.} = + raise newException(ValueError, "No implementation available") diff --git a/src/app/modules/main/wallet_section/accounts/item.nim b/src/app/modules/main/wallet_section/accounts/item.nim index 9b72aae512..b85f719e3a 100644 --- a/src/app/modules/main/wallet_section/accounts/item.nim +++ b/src/app/modules/main/wallet_section/accounts/item.nim @@ -27,7 +27,8 @@ proc initItem*( isWallet: bool = false, areTestNetworksEnabled: bool = false, prodPreferredChainIds: string = "", - testPreferredChainIds: string = "" + testPreferredChainIds: string = "", + hideFromTotalBalance: bool = false ): Item = result = Item() result.WalletAccountItem.setup(name, @@ -42,7 +43,8 @@ proc initItem*( operability = wa_dto.AccountFullyOperable, areTestNetworksEnabled, prodPreferredChainIds, - testPreferredChainIds) + testPreferredChainIds, + hideFromTotalBalance) result.createdAt = createdAt result.assetsLoading = assetsLoading result.currencyBalance = currencyBalance diff --git a/src/app/modules/main/wallet_section/accounts/model.nim b/src/app/modules/main/wallet_section/accounts/model.nim index 11edd92ac8..2bf774e75c 100644 --- a/src/app/modules/main/wallet_section/accounts/model.nim +++ b/src/app/modules/main/wallet_section/accounts/model.nim @@ -19,7 +19,8 @@ type KeycardAccount, AssetsLoading, IsWallet, - PreferredSharingChainIds + PreferredSharingChainIds, + HideFromTotalBalance QtObject: type @@ -69,7 +70,8 @@ QtObject: ModelRole.KeycardAccount.int: "keycardAccount", ModelRole.AssetsLoading.int: "assetsLoading", ModelRole.IsWallet.int: "isWallet", - ModelRole.PreferredSharingChainIds.int: "preferredSharingChainIds" + ModelRole.PreferredSharingChainIds.int: "preferredSharingChainIds", + ModelRole.HideFromTotalBalance.int: "hideFromTotalBalance" }.toTable @@ -121,6 +123,8 @@ QtObject: result = newQVariant(item.isWallet()) of ModelRole.PreferredSharingChainIds: result = newQVariant(item.preferredSharingChainIds()) + of ModelRole.HideFromTotalBalance: + result = newQVariant(item.hideFromTotalBalance()) proc getNameByAddress*(self: Model, address: string): string = for item in self.items: @@ -144,4 +148,4 @@ QtObject: for item in self.items: if cmpIgnoreCase(item.address(), address) == 0 and item.walletType != "watch": return true - return false \ No newline at end of file + return false diff --git a/src/app/modules/main/wallet_section/accounts/module.nim b/src/app/modules/main/wallet_section/accounts/module.nim index 450ddb2f72..99ef24133c 100644 --- a/src/app/modules/main/wallet_section/accounts/module.nim +++ b/src/app/modules/main/wallet_section/accounts/module.nim @@ -83,3 +83,6 @@ method updateWalletAccountProdPreferredChains*(self: Module, address, preferredC method updateWalletAccountTestPreferredChains*(self: Module, address, preferredChainIds: string) = self.controller.updateWalletAccountTestPreferredChains(address, preferredChainIds) + +method updateWatchAccountHiddenFromTotalBalance*(self: Module, address: string, hideFromTotalBalance: bool) = + self.controller.updateWatchAccountHiddenFromTotalBalance(address, hideFromTotalBalance) diff --git a/src/app/modules/main/wallet_section/accounts/view.nim b/src/app/modules/main/wallet_section/accounts/view.nim index 94bbf674d2..835efe9cf7 100644 --- a/src/app/modules/main/wallet_section/accounts/view.nim +++ b/src/app/modules/main/wallet_section/accounts/view.nim @@ -63,3 +63,6 @@ QtObject: proc updateWalletAccountTestPreferredChains*(self: View, address: string, preferredChainIds: string) {.slot.} = self.delegate.updateWalletAccountTestPreferredChains(address, preferredChainIds) + + proc updateWatchAccountHiddenFromTotalBalance*(self: View, address: string, hideFromTotalBalance: bool) {.slot.} = + self.delegate.updateWatchAccountHiddenFromTotalBalance(address, hideFromTotalBalance) diff --git a/src/app/modules/main/wallet_section/controller.nim b/src/app/modules/main/wallet_section/controller.nim index 686270dc9c..15a6746f9f 100644 --- a/src/app/modules/main/wallet_section/controller.nim +++ b/src/app/modules/main/wallet_section/controller.nim @@ -63,14 +63,8 @@ proc getWalletAccounts*(self: Controller): seq[wallet_account_service.WalletAcco proc getEnabledChainIds*(self: Controller): seq[int] = return self.networkService.getNetworks().filter(n => n.enabled).map(n => n.chainId) -proc toggleIncludeWatchOnlyAccount*(self: Controller) = - self.walletAccountService.toggleIncludeWatchOnlyAccount() - -proc isIncludeWatchOnlyAccount*(self: Controller): bool = - return self.walletAccountService.isIncludeWatchOnlyAccount() - proc getKeypairByAccountAddress*(self: Controller, address: string): KeypairDto = return self.walletAccountService.getKeypairByAccountAddress(address) proc hasPairedDevices*(self: Controller): bool = - return self.walletAccountService.hasPairedDevices() \ No newline at end of file + return self.walletAccountService.hasPairedDevices() diff --git a/src/app/modules/main/wallet_section/filter.nim b/src/app/modules/main/wallet_section/filter.nim index bfa422fc4e..df9a930f00 100644 --- a/src/app/modules/main/wallet_section/filter.nim +++ b/src/app/modules/main/wallet_section/filter.nim @@ -27,17 +27,11 @@ proc `$`*(self: Filter): string = proc setFillterAllAddresses*(self: Filter) = self.allAddresses = true - self.addresses = self.controller.getWalletAccounts().map(a => a.address) - -proc toggleWatchOnlyAccounts*(self: Filter) = - self.controller.toggleIncludeWatchOnlyAccount() - -proc includeWatchOnlyToggled*(self: Filter) = - let includeWatchOnly = self.controller.isIncludeWatchOnlyAccount() - if includeWatchOnly: - self.setFillterAllAddresses() - else: - self.addresses = self.controller.getWalletAccounts().filter(a => a.walletType != "watch").map(a => a.address) + var allAccounts = self.controller.getWalletAccounts() + var accountsExclWatchAccs = allAccounts.filter(a => not a.hideFromTotalBalance) + if allAccounts.len != accountsExclWatchAccs.len: + self.allAddresses = false + self.addresses = self.controller.getWalletAccounts().filter(a => not a.hideFromTotalBalance).map(a => a.address) proc setAddress*(self: Filter, address: string) = self.allAddresses = false @@ -58,5 +52,5 @@ proc updateNetworks*(self: Filter) = self.allChainsEnabled = (self.chainIds.len == self.controller.getNetworks().len) proc load*(self: Filter) = - self.includeWatchOnlyToggled() - self.updateNetworks() \ No newline at end of file + self.setFillterAllAddresses() + self.updateNetworks() diff --git a/src/app/modules/main/wallet_section/io_interface.nim b/src/app/modules/main/wallet_section/io_interface.nim index 4f943052d9..88a938901d 100644 --- a/src/app/modules/main/wallet_section/io_interface.nim +++ b/src/app/modules/main/wallet_section/io_interface.nim @@ -21,9 +21,6 @@ method setFilterAddress*(self: AccessInterface, address: string) {.base.} = method setFillterAllAddresses*(self: AccessInterface) {.base.} = raise newException(ValueError, "No implementation available") -method toggleWatchOnlyAccounts*(self: AccessInterface) {.base.} = - raise newException(ValueError, "No implementation available") - method updateCurrency*(self: AccessInterface, currency: string) {.base.} = raise newException(ValueError, "No implementation available") @@ -116,4 +113,4 @@ method destroyKeypairImportPopup*(self: AccessInterface) {.base.} = raise newException(ValueError, "No implementation available") method hasPairedDevices*(self: AccessInterface): bool {.base.} = - raise newException(ValueError, "No implementation available") \ No newline at end of file + raise newException(ValueError, "No implementation available") diff --git a/src/app/modules/main/wallet_section/module.nim b/src/app/modules/main/wallet_section/module.nim index 5ca4da07c1..b08ba6cf5d 100644 --- a/src/app/modules/main/wallet_section/module.nim +++ b/src/app/modules/main/wallet_section/module.nim @@ -163,32 +163,23 @@ method getCurrentCurrency*(self: Module): string = self.controller.getCurrency() method setTotalCurrencyBalance*(self: Module) = - var addresses: seq[string] = @[] let walletAccounts = self.controller.getWalletAccounts() - if self.controller.isIncludeWatchOnlyAccount(): - addresses = walletAccounts.map(a => a.address) - else: - addresses = walletAccounts.filter(a => a.walletType != "watch").map(a => a.address) - + var addresses = walletAccounts.filter(a => not a.hideFromTotalBalance).map(a => a.address) self.view.setTotalCurrencyBalance(self.controller.getCurrencyBalance(addresses)) method notifyFilterChanged(self: Module) = - let includeWatchOnly = self.controller.isIncludeWatchOnlyAccount() - self.overviewModule.filterChanged(self.filter.addresses, self.filter.chainIds, includeWatchOnly, self.filter.allAddresses) + self.overviewModule.filterChanged(self.filter.addresses, self.filter.chainIds, self.filter.allAddresses) self.assetsModule.filterChanged(self.filter.addresses, self.filter.chainIds) self.accountsModule.filterChanged(self.filter.addresses, self.filter.chainIds) self.sendModule.filterChanged(self.filter.addresses, self.filter.chainIds) self.activityController.globalFilterChanged(self.filter.addresses, self.filter.allAddresses, self.filter.chainIds, self.filter.allChainsEnabled) self.collectiblesController.globalFilterChanged(self.filter.addresses, self.filter.chainIds) if self.filter.addresses.len > 0: - self.view.filterChanged(self.filter.addresses[0], includeWatchOnly, self.filter.allAddresses) + self.view.filterChanged(self.filter.addresses[0], self.filter.allAddresses) method getCurrencyAmount*(self: Module, amount: float64, symbol: string): CurrencyAmount = return self.controller.getCurrencyAmount(amount, symbol) -method toggleWatchOnlyAccounts*(self: Module) = - self.filter.toggleWatchOnlyAccounts() - method setFilterAddress*(self: Module, address: string) = let keypair = self.controller.getKeypairByAccountAddress(address) if keypair.isNil: @@ -247,10 +238,6 @@ method load*(self: Module) = self.notifyFilterChanged() self.events.on(SIGNAL_WALLET_ACCOUNT_POSITION_UPDATED) do(e:Args): self.notifyFilterChanged() - self.events.on(SIGNAL_INCLUDE_WATCH_ONLY_ACCOUNTS_UPDATED) do(e: Args): - self.filter.includeWatchOnlyToggled() - self.notifyFilterChanged() - self.setTotalCurrencyBalance() self.events.on(SIGNAL_HISTORY_NON_ARCHIVAL_NODE) do (e:Args): self.view.setIsNonArchivalNode(true) self.events.on(SIGNAL_TRANSACTION_DECODED) do(e: Args): @@ -263,7 +250,11 @@ method load*(self: Module) = self.onUpdatedKeypairsOperability(args.keypairs) self.events.on(SIGNAL_LOCAL_PAIRING_STATUS_UPDATE) do(e:Args): let data = LocalPairingStatus(e) - self.onLocalPairingStatusUpdate(data) + self.onLocalPairingStatusUpdate(data) + self.events.on(SIGNAL_WALLET_ACCOUNT_HIDDEN_UPDATED) do(e: Args): + self.filter.setFillterAllAddresses() + self.notifyFilterChanged() + self.setTotalCurrencyBalance() self.controller.init() self.view.load() @@ -428,4 +419,4 @@ method hasPairedDevices*(self: Module): bool = proc onLocalPairingStatusUpdate*(self: Module, data: LocalPairingStatus) = if data.state == LocalPairingState.Finished: - self.view.emitHasPairedDevicesChangedSignal() \ No newline at end of file + self.view.emitHasPairedDevicesChangedSignal() diff --git a/src/app/modules/main/wallet_section/overview/io_interface.nim b/src/app/modules/main/wallet_section/overview/io_interface.nim index 627715c07b..87b483721b 100644 --- a/src/app/modules/main/wallet_section/overview/io_interface.nim +++ b/src/app/modules/main/wallet_section/overview/io_interface.nim @@ -17,5 +17,5 @@ method isLoaded*(self: AccessInterface): bool {.base.} = method viewDidLoad*(self: AccessInterface) {.base.} = raise newException(ValueError, "No implementation available") -method filterChanged*(self: AccessInterface, addresses: seq[string], chainIds: seq[int], includeWatchOnly: bool, allAddresses: bool) {.base.} = +method filterChanged*(self: AccessInterface, addresses: seq[string], chainIds: seq[int], allAddresses: bool) {.base.} = raise newException(ValueError, "No implementation available") diff --git a/src/app/modules/main/wallet_section/overview/item.nim b/src/app/modules/main/wallet_section/overview/item.nim index ce7bc14507..4851f078c4 100644 --- a/src/app/modules/main/wallet_section/overview/item.nim +++ b/src/app/modules/main/wallet_section/overview/item.nim @@ -10,7 +10,6 @@ type emoji: string isWatchOnlyAccount: bool isAllAccounts: bool - includeWatchOnly: bool colorIds: seq[string] proc initItem*( @@ -22,7 +21,6 @@ proc initItem*( emoji: string, isWatchOnlyAccount: bool=false, isAllAccounts: bool = false, - includeWatchOnly: bool = true, colorIds: seq[string] = @[] ): Item = result.name = name @@ -32,7 +30,6 @@ proc initItem*( result.colorId = colorId result.emoji = emoji result.isAllAccounts = isAllAccounts - result.includeWatchOnly = includeWatchOnly result.colorIds = colorIds result.isWatchOnlyAccount = isWatchOnlyAccount @@ -46,7 +43,6 @@ proc `$`*(self: Item): string = emoji: {self.emoji}, isWatchOnlyAccount: {self.isWatchOnlyAccount}, isAllAccounts: {self.isAllAccounts}, - includeWatchOnly: {self.includeWatchOnly}, colorIds: {self.colorIds} ]""" @@ -71,9 +67,6 @@ proc getEmoji*(self: Item): string = proc getIsAllAccounts*(self: Item): bool = return self.isAllAccounts -proc getIncludeWatchOnly*(self: Item): bool = - return self.includeWatchOnly - proc getColorIds*(self: Item): string = return self.colorIds.join(";") diff --git a/src/app/modules/main/wallet_section/overview/module.nim b/src/app/modules/main/wallet_section/overview/module.nim index 41214346d5..dfb3953ea0 100644 --- a/src/app/modules/main/wallet_section/overview/module.nim +++ b/src/app/modules/main/wallet_section/overview/module.nim @@ -65,7 +65,7 @@ proc getWalletAccoutColors(self: Module, walletAccounts: seq[WalletAccountDto]) colors.add(account.colorId) return colors -method filterChanged*(self: Module, addresses: seq[string], chainIds: seq[int], includeWatchOnly: bool, allAddresses: bool) = +method filterChanged*(self: Module, addresses: seq[string], chainIds: seq[int], allAddresses: bool) = let walletAccounts = self.controller.getWalletAccountsByAddresses(addresses) if allAddresses: let item = initItem( @@ -77,7 +77,6 @@ method filterChanged*(self: Module, addresses: seq[string], chainIds: seq[int], "", isWatchOnlyAccount=false, isAllAccounts=true, - includeWatchOnly=includeWatchOnly, self.getWalletAccoutColors(walletAccounts) ) self.view.setData(item) diff --git a/src/app/modules/main/wallet_section/overview/view.nim b/src/app/modules/main/wallet_section/overview/view.nim index 57368ca0f9..f7fd76d085 100644 --- a/src/app/modules/main/wallet_section/overview/view.nim +++ b/src/app/modules/main/wallet_section/overview/view.nim @@ -17,7 +17,6 @@ QtObject: colorId: string emoji: string isAllAccounts: bool - includeWatchOnly: bool colorIds: string isWatchOnlyAccount: bool @@ -99,13 +98,6 @@ QtObject: read = getIsAllAccounts notify = isAllAccountsChanged - proc getIncludeWatchOnly(self: View): QVariant {.slot.} = - return newQVariant(self.includeWatchOnly) - proc includeWatchOnlyChanged(self: View) {.signal.} - QtProperty[QVariant] includeWatchOnly: - read = getIncludeWatchOnly - notify = includeWatchOnlyChanged - proc getColorIds(self: View): QVariant {.slot.} = return newQVariant(self.colorIds) proc colorIdsChanged(self: View) {.signal.} @@ -147,6 +139,3 @@ QtObject: if(self.isAllAccounts != item.getIsAllAccounts()): self.isAllAccounts = item.getIsAllAccounts() self.isAllAccountsChanged() - if(self.includeWatchOnly != item.getIncludeWatchOnly()): - self.includeWatchOnly = item.getIncludeWatchOnly() - self.includeWatchOnlyChanged() diff --git a/src/app/modules/main/wallet_section/send/module.nim b/src/app/modules/main/wallet_section/send/module.nim index c00190b84a..41d52f8eee 100644 --- a/src/app/modules/main/wallet_section/send/module.nim +++ b/src/app/modules/main/wallet_section/send/module.nim @@ -227,6 +227,9 @@ method load*(self: Module) = self.events.on(SIGNAL_WALLET_ACCOUNT_PREFERRED_SHARING_CHAINS_UPDATED) do(e:Args): self.refreshWalletAccounts() + self.events.on(SIGNAL_WALLET_ACCOUNT_HIDDEN_UPDATED) do(e: Args): + self.refreshWalletAccounts() + self.controller.init() self.view.load() diff --git a/src/app/modules/main/wallet_section/view.nim b/src/app/modules/main/wallet_section/view.nim index 244c580684..427a96f011 100644 --- a/src/app/modules/main/wallet_section/view.nim +++ b/src/app/modules/main/wallet_section/view.nim @@ -47,7 +47,7 @@ QtObject: QtProperty[string] currentCurrency: read = getCurrentCurrency - proc filterChanged*(self: View, addresses: string, includeWatchOnly: bool, allAddresses: bool) {.signal.} + proc filterChanged*(self: View, addresses: string, allAddresses: bool) {.signal.} proc totalCurrencyBalanceChanged*(self: View) {.signal.} @@ -76,9 +76,6 @@ QtObject: proc setFillterAllAddresses(self: View) {.slot.} = self.delegate.setFillterAllAddresses() - proc toggleWatchOnlyAccounts(self: View) {.slot.} = - self.delegate.toggleWatchOnlyAccounts() - proc setTotalCurrencyBalance*(self: View, totalCurrencyBalance: CurrencyAmount) = self.totalCurrencyBalance = totalCurrencyBalance self.totalCurrencyBalanceChanged() @@ -205,4 +202,4 @@ QtObject: proc destroyKeypairImportPopup*(self: View) {.signal.} proc emitDestroyKeypairImportPopup*(self: View) = - self.destroyKeypairImportPopup() \ No newline at end of file + self.destroyKeypairImportPopup() diff --git a/src/app/modules/shared/keypairs.nim b/src/app/modules/shared/keypairs.nim index fac43495ec..eab3eaab8a 100644 --- a/src/app/modules/shared/keypairs.nim +++ b/src/app/modules/shared/keypairs.nim @@ -48,7 +48,7 @@ proc buildKeypairItem*(keypair: KeypairDto, areTestNetworksEnabled: bool): KeyPa icon = "wallet" item.addAccount(newKeyPairAccountItem(acc.name, acc.path, acc.address, acc.publicKey, acc.emoji, acc.colorId, icon, newCurrencyAmount(), balanceFetched = true, operability = acc.operable, acc.isWallet, areTestNetworksEnabled, - acc.prodPreferredChainIds, acc.testPreferredChainIds)) + acc.prodPreferredChainIds, acc.testPreferredChainIds, acc.hideFromTotalBalance)) return item proc buildKeyPairsList*(keypairs: seq[KeypairDto], excludeAlreadyMigratedPairs: bool, @@ -68,4 +68,4 @@ proc buildKeyPairsList*(keypairs: seq[KeypairDto], excludeAlreadyMigratedPairs: items.add(item) if items.len == 0: debug "sm_there is no any key pair for the logged in user that is not already migrated to a keycard" - return items \ No newline at end of file + return items diff --git a/src/app/modules/shared/wallet_utils.nim b/src/app/modules/shared/wallet_utils.nim index 6770e22f83..3db777d979 100644 --- a/src/app/modules/shared/wallet_utils.nim +++ b/src/app/modules/shared/wallet_utils.nim @@ -42,7 +42,8 @@ proc walletAccountToWalletAccountItem*(w: WalletAccountDto, keycardAccount: bool w.operable, areTestNetworksEnabled, w.prodPreferredChainIds, - w.testPreferredChainIds + w.testPreferredChainIds, + w.hideFromTotalBalance ) proc walletAccountToWalletAccountsItem*(w: WalletAccountDto, keycardAccount: bool, @@ -63,7 +64,8 @@ proc walletAccountToWalletAccountsItem*(w: WalletAccountDto, keycardAccount: boo w.isWallet, areTestNetworksEnabled, w.prodPreferredChainIds, - w.testPreferredChainIds + w.testPreferredChainIds, + w.hideFromTotalBalance ) proc walletAccountToWalletAssetsItem*(w: WalletAccountDto): wallet_assets_item.Item = diff --git a/src/app/modules/shared_models/keypair_account_item.nim b/src/app/modules/shared_models/keypair_account_item.nim index cfd24fd14a..d4b8d80345 100644 --- a/src/app/modules/shared_models/keypair_account_item.nim +++ b/src/app/modules/shared_models/keypair_account_item.nim @@ -20,13 +20,14 @@ QtObject: areTestNetworksEnabled: bool prodPreferredChainIds: string testPreferredChainIds: string + hideFromTotalBalance: bool proc delete*(self: KeyPairAccountItem) = self.QObject.delete proc newKeyPairAccountItem*(name = "", path = "", address = "", pubKey = "", emoji = "", colorId = "", icon = "", balance = newCurrencyAmount(), balanceFetched = true, operability = wa_dto.AccountFullyOperable, - isDefaultAccount = false, areTestNetworksEnabled =false, prodPreferredChainIds = "", testPreferredChainIds = ""): KeyPairAccountItem = + isDefaultAccount = false, areTestNetworksEnabled =false, prodPreferredChainIds = "", testPreferredChainIds = "", hideFromTotalBalance = false): KeyPairAccountItem = new(result, delete) result.QObject.setup result.name = name @@ -43,6 +44,7 @@ QtObject: result.areTestNetworksEnabled = areTestNetworksEnabled result.prodPreferredChainIds = prodPreferredChainIds result.testPreferredChainIds = testPreferredChainIds + result.hideFromTotalBalance = hideFromTotalBalance proc `$`*(self: KeyPairAccountItem): string = result = fmt"""KeyPairAccountItem[ @@ -59,7 +61,8 @@ QtObject: isDefaultAccount: {self.isDefaultAccount}, areTestNetworksEnabled: {self.areTestNetworksEnabled}, prodPreferredChainIds: {self.prodPreferredChainIds}, - testPreferredChainIds: {self.testPreferredChainIds} + testPreferredChainIds: {self.testPreferredChainIds}, + hideFromTotalBalance: {self.hideFromTotalBalance} ]""" proc nameChanged*(self: KeyPairAccountItem) {.signal.} @@ -191,3 +194,13 @@ QtObject: QtProperty[string] preferredSharingChainIds: read = preferredSharingChainIds notify = preferredSharingChainIdsChanged + + proc hideFromTotalBalanceChanged*(self: KeyPairAccountItem) {.signal.} + proc hideFromTotalBalance*(self: KeyPairAccountItem): bool {.slot.} = + return self.hideFromTotalBalance + proc setHideFromTotalBalance*(self: KeyPairAccountItem, value: bool) = + self.hideFromTotalBalance = value + self.hideFromTotalBalanceChanged() + QtProperty[bool] hideFromTotalBalance: + read = hideFromTotalBalance + notify = hideFromTotalBalanceChanged diff --git a/src/app/modules/shared_models/keypair_account_model.nim b/src/app/modules/shared_models/keypair_account_model.nim index 1e62c5e6bd..016bc9e084 100644 --- a/src/app/modules/shared_models/keypair_account_model.nim +++ b/src/app/modules/shared_models/keypair_account_model.nim @@ -141,3 +141,8 @@ QtObject: self.items[i].setProdPreferredChainIds(prodPreferredChainIds) if testPreferredChainIds.len > 0: self.items[i].setTestPreferredChainIds(testPreferredChainIds) + + proc updateAccountHiddenInTotalBalance*(self: KeyPairAccountModel, address: string, hideFromTotalBalance: bool) = + for i in 0 ..< self.items.len: + if cmpIgnoreCase(self.items[i].getAddress(), address) == 0: + self.items[i].setHideFromTotalBalance(hideFromTotalBalance) diff --git a/src/app/modules/shared_models/keypair_item.nim b/src/app/modules/shared_models/keypair_item.nim index 8d1cee424a..4f8ef8ad04 100644 --- a/src/app/modules/shared_models/keypair_item.nim +++ b/src/app/modules/shared_models/keypair_item.nim @@ -268,6 +268,8 @@ QtObject: self.accounts.updateDetailsForAddressIfTheyAreSet(address, name, colorId, emoji) proc updatePreferredSharingChainsForAddress*(self: KeyPairItem, address, prodPreferredChainIds, testPreferredChainIds: string) = self.accounts.updatePreferredSharingChainsForAddress(address, prodPreferredChainIds, testPreferredChainIds) + proc updateAccountHiddenInTotalBalance*(self: KeyPairItem, address: string, hideFromTotalBalance: bool) = + self.accounts.updateAccountHiddenInTotalBalance(address, hideFromTotalBalance) proc setBalanceForAddress*(self: KeyPairItem, address: string, balance: CurrencyAmount) = self.accounts.setBalanceForAddress(address, balance) proc updateOperabilityForAllAddresses*(self: KeyPairItem, operability: string) = diff --git a/src/app/modules/shared_models/keypair_model.nim b/src/app/modules/shared_models/keypair_model.nim index 285f7ad562..9961fec35a 100644 --- a/src/app/modules/shared_models/keypair_model.nim +++ b/src/app/modules/shared_models/keypair_model.nim @@ -88,12 +88,18 @@ QtObject: item.updateOperabilityForAllAddresses(operability) break - proc onPreferredSharingChainsUpdated*(self: KeyPairModel,keyUid, address, prodPreferredChainIds, testPreferredChainIds: string) = + proc onPreferredSharingChainsUpdated*(self: KeyPairModel, keyUid, address, prodPreferredChainIds, testPreferredChainIds: string) = for item in self.items: if keyUid == item.getKeyUid(): item.getAccountsModel().updatePreferredSharingChainsForAddress(address, prodPreferredChainIds, testPreferredChainIds) break + proc onHideFromTotalBalanceUpdated*(self: KeyPairModel, keyUid, address: string, hideFromTotalBalance: bool) = + for item in self.items: + if keyUid == item.getKeyUid(): + item.getAccountsModel().updateAccountHiddenInTotalBalance(address, hideFromTotalBalance) + break + proc keypairNameExists*(self: KeyPairModel, name: string): bool = return self.items.any(x => x.getName() == name) diff --git a/src/app/modules/shared_models/wallet_account_item.nim b/src/app/modules/shared_models/wallet_account_item.nim index d2027e1cf4..2fca7287c4 100644 --- a/src/app/modules/shared_models/wallet_account_item.nim +++ b/src/app/modules/shared_models/wallet_account_item.nim @@ -18,6 +18,7 @@ QtObject: areTestNetworksEnabled: bool prodPreferredChainIds: string testPreferredChainIds: string + hideFromTotalBalance: bool proc setup*(self: WalletAccountItem, name: string = "", @@ -32,7 +33,8 @@ QtObject: operability: string = wa_dto.AccountFullyOperable, areTestNetworksEnabled: bool = false, prodPreferredChainIds: string = "", - testPreferredChainIds: string = "" + testPreferredChainIds: string = "", + hideFromTotalBalance: bool = true ) = self.QObject.setup self.name = name @@ -48,6 +50,7 @@ QtObject: self.areTestNetworksEnabled = areTestNetworksEnabled self.prodPreferredChainIds = prodPreferredChainIds self.testPreferredChainIds = testPreferredChainIds + self.hideFromTotalBalance = hideFromTotalBalance proc delete*(self: WalletAccountItem) = self.QObject.delete @@ -65,7 +68,8 @@ QtObject: operability: string = wa_dto.AccountFullyOperable, areTestNetworksEnabled: bool = false, prodPreferredChainIds: string = "", - testPreferredChainIds: string = ""): WalletAccountItem = + testPreferredChainIds: string = "", + hideFromTotalBalance: bool = true): WalletAccountItem = new(result, delete) result.QObject.setup result.name = name @@ -81,6 +85,7 @@ QtObject: result.areTestNetworksEnabled = areTestNetworksEnabled result.prodPreferredChainIds = prodPreferredChainIds result.testPreferredChainIds = testPreferredChainIds + result.hideFromTotalBalance = hideFromTotalBalance proc `$`*(self: WalletAccountItem): string = result = fmt"""WalletAccountItem( @@ -97,6 +102,7 @@ QtObject: areTestNetworksEnabled: {self.areTestNetworksEnabled}, prodPreferredChainIds: {self.prodPreferredChainIds}, testPreferredChainIds: {self.testPreferredChainIds}, + hideFromTotalBalance: {self.hideFromTotalBalance} ]""" proc nameChanged*(self: WalletAccountItem) {.signal.} @@ -198,3 +204,10 @@ QtObject: QtProperty[string] preferredSharingChainIds: read = preferredSharingChainIds notify = preferredSharingChainIdsChanged + + proc hideFromTotalBalanceChanged*(self: WalletAccountItem) {.signal.} + proc hideFromTotalBalance*(self: WalletAccountItem): bool {.slot.} = + return self.hideFromTotalBalance + QtProperty[bool] hideFromTotalBalance: + read = hideFromTotalBalance + notify = hideFromTotalBalanceChanged diff --git a/src/app/modules/shared_modules/add_account/controller.nim b/src/app/modules/shared_modules/add_account/controller.nim index f01a85f359..ab86966d90 100644 --- a/src/app/modules/shared_modules/add_account/controller.nim +++ b/src/app/modules/shared_modules/add_account/controller.nim @@ -145,7 +145,7 @@ proc fetchDetailsForAddresses*(self: Controller, addresses: seq[string]) = self.walletAccountService.fetchDetailsForAddresses(self.uniqueFetchingDetailsId, addresses) proc addWalletAccount*(self: Controller, createKeystoreFile, doPasswordHashing: bool, name, address, path, publicKey, - keyUid, accountType, colorId, emoji: string): bool = + keyUid, accountType, colorId, emoji: string, hideFromTotalBalance: bool): bool = var password: string if createKeystoreFile: password = self.getPassword() @@ -153,7 +153,7 @@ proc addWalletAccount*(self: Controller, createKeystoreFile, doPasswordHashing: info "cannot create keystore file if provided password is empty", name=name, address=address return false let err = self.walletAccountService.addWalletAccount(password, doPasswordHashing, name, address, path, publicKey, - keyUid, accountType, colorId, emoji) + keyUid, accountType, colorId, emoji, hideFromTotalBalance) if err.len > 0: info "adding wallet account failed", name=name, address=address return false diff --git a/src/app/modules/shared_modules/add_account/module.nim b/src/app/modules/shared_modules/add_account/module.nim index 174eaf6d85..90ab68bee1 100644 --- a/src/app/modules/shared_modules/add_account/module.nim +++ b/src/app/modules/shared_modules/add_account/module.nim @@ -599,6 +599,7 @@ proc doAddAccount[T](self: Module[T]) = keyUid = selectedOrigin.getKeyUid() createKeystoreFile = not selectedOrigin.getMigratedToKeycard() doPasswordHashing = not singletonInstance.userProfile.getIsKeycardUser() + hideFromTotalBalance = false if selectedOrigin.getPairType() == KeyPairType.Profile.int: accountType = account_constants.GENERATED @@ -616,6 +617,7 @@ proc doAddAccount[T](self: Module[T]) = addingNewKeyPair = not self.isKeyPairAlreadyAdded(keyUid) else: accountType = account_constants.WATCH + hideFromTotalBalance = true createKeystoreFile = false doPasswordHashing = false keypairName = "" @@ -678,7 +680,8 @@ proc doAddAccount[T](self: Module[T]) = keyUid = keyUid, accountType = accountType, colorId = self.view.getSelectedColorId(), - emoji = self.view.getSelectedEmoji()) + emoji = self.view.getSelectedEmoji(), + hideFromTotalBalance = hideFromTotalBalance) if not success: error "failed to store account", address=selectedAddrItem.getAddress() diff --git a/src/app/modules/shared_modules/keycard_popup/controller.nim b/src/app/modules/shared_modules/keycard_popup/controller.nim index bad7b831e6..80ac8d8410 100644 --- a/src/app/modules/shared_modules/keycard_popup/controller.nim +++ b/src/app/modules/shared_modules/keycard_popup/controller.nim @@ -744,16 +744,6 @@ proc updateKeycardUid*(self: Controller, keyUid: string, keycardUid: string) = self.tmpKeycardUid = keycardUid info "update keycard uid failed", oldKeycardUid=self.tmpKeycardUid, newKeycardUid=keycardUid -proc addWalletAccount*(self: Controller, name, address, path, publicKey, keyUid, accountType, colorId, emoji: string): bool = - if not serviceApplicable(self.walletAccountService): - return false - let err = self.walletAccountService.addWalletAccount(password = "", doPasswordHashing = false, name, address, path, - publicKey, keyUid, accountType, colorId, emoji) - if err.len > 0: - info "adding wallet account failed", name=name, path=path - return false - return true - proc addNewSeedPhraseKeypair*(self: Controller, seedPhrase, keyUid, keypairName, rootWalletMasterKey: string, accounts: seq[WalletAccountDto]): bool = let err = self.walletAccountService.addNewSeedPhraseKeypair(seedPhrase, password = "", doPasswordHashing = false, keyUid, diff --git a/src/app_service/service/settings/dto/settings.nim b/src/app_service/service/settings/dto/settings.nim index 30792fa678..8f086184eb 100644 --- a/src/app_service/service/settings/dto/settings.nim +++ b/src/app_service/service/settings/dto/settings.nim @@ -45,7 +45,6 @@ const KEY_DISPLAY_NAME* = "display-name" const KEY_BIO* = "bio" const KEY_TEST_NETWORKS_ENABLED* = "test-networks-enabled?" const KEY_IS_SEPOLIA_ENABLED* = "is-sepolia-enabled?" -const INCLUDE_WATCH_ONLY_ACCOUNT* = "include-watch-only-account?" const PROFILE_MIGRATION_NEEDED* = "profile-migration-needed" # Notifications Settings Values @@ -138,7 +137,6 @@ type notificationsSoundsEnabled*: bool notificationsVolume*: int notificationsMessagePreview*: int - includeWatchOnlyAccount*: bool profileMigrationNeeded*: bool isSepoliaEnabled*: bool @@ -195,7 +193,6 @@ proc toSettingsDto*(jsonObj: JsonNode): SettingsDto = discard jsonObj.getProp(KEY_GIF_FAVORITES, result.gifFavorites) discard jsonObj.getProp(KEY_TEST_NETWORKS_ENABLED, result.testNetworksEnabled) discard jsonObj.getProp(KEY_IS_SEPOLIA_ENABLED, result.isSepoliaEnabled) - discard jsonObj.getProp(INCLUDE_WATCH_ONLY_ACCOUNT, result.includeWatchOnlyAccount) discard jsonObj.getProp(PROFILE_MIGRATION_NEEDED, result.profileMigrationNeeded) var pinnedMailserverObj: JsonNode diff --git a/src/app_service/service/settings/service.nim b/src/app_service/service/settings/service.nim index 002914a46d..b0e53875d1 100644 --- a/src/app_service/service/settings/service.nim +++ b/src/app_service/service/settings/service.nim @@ -27,7 +27,6 @@ const SIGNAL_BIO_UPDATED* = "bioUpdated" const SIGNAL_MNEMONIC_REMOVED* = "mnemonicRemoved" const SIGNAL_SOCIAL_LINKS_UPDATED* = "socialLinksUpdated" const SIGNAL_CURRENT_USER_STATUS_UPDATED* = "currentUserStatusUpdated" -const SIGNAL_INCLUDE_WATCH_ONLY_ACCOUNTS_UPDATED* = "includeWatchOnlyAccounts" const SIGNAL_PROFILE_MIGRATION_NEEDED_UPDATED* = "profileMigrationNeededUpdated" logScope: @@ -114,9 +113,6 @@ QtObject: if settingsField.name == KEY_MNEMONIC: self.settings.mnemonic = "" self.events.emit(SIGNAL_MNEMONIC_REMOVED, Args()) - if settingsField.name == INCLUDE_WATCH_ONLY_ACCOUNT: - self.settings.includeWatchOnlyAccount = settingsField.value.getBool - self.events.emit(SIGNAL_INCLUDE_WATCH_ONLY_ACCOUNTS_UPDATED, SettingsBoolValueArgs(value: self.settings.includeWatchOnlyAccount)) if settingsField.name == PROFILE_MIGRATION_NEEDED: self.settings.profileMigrationNeeded = settingsField.value.getBool self.events.emit(SIGNAL_PROFILE_MIGRATION_NEEDED_UPDATED, SettingsBoolValueArgs(value: self.settings.profileMigrationNeeded)) @@ -984,14 +980,5 @@ QtObject: error "error saving social links", errDescription=data.error self.storeSocialLinksAndNotify(data) - proc isIncludeWatchOnlyAccount*(self: Service): bool = - return self.settings.includeWatchOnlyAccount - - proc toggleIncludeWatchOnlyAccount*(self: Service) = - let newValue = not self.settings.includeWatchOnlyAccount - if(self.saveSetting(INCLUDE_WATCH_ONLY_ACCOUNT, newValue)): - self.settings.includeWatchOnlyAccount = newValue - self.events.emit(SIGNAL_INCLUDE_WATCH_ONLY_ACCOUNTS_UPDATED, SettingsBoolValueArgs(value: newValue)) - proc getProfileMigrationNeeded*(self: Service): bool = - self.settings.profileMigrationNeeded \ No newline at end of file + self.settings.profileMigrationNeeded diff --git a/src/app_service/service/wallet_account/dto/account_dto.nim b/src/app_service/service/wallet_account/dto/account_dto.nim index 731cfe987d..73f86b3915 100644 --- a/src/app_service/service/wallet_account/dto/account_dto.nim +++ b/src/app_service/service/wallet_account/dto/account_dto.nim @@ -38,6 +38,7 @@ type position*: int prodPreferredChainIDs*: string testPreferredChainIDs*: string + hideFromTotalBalance*: bool proc toWalletAccountDto*(jsonObj: JsonNode): WalletAccountDto = result = WalletAccountDto() @@ -59,6 +60,7 @@ proc toWalletAccountDto*(jsonObj: JsonNode): WalletAccountDto = discard jsonObj.getProp("position", result.position) discard jsonObj.getProp("prodPreferredChainIds", result.prodPreferredChainIds) discard jsonObj.getProp("testPreferredChainIds", result.testPreferredChainIds) + discard jsonObj.getProp("hidden", result.hideFromTotalBalance) result.assetsLoading = true result.hasBalanceCache = false result.hasMarketValuesCache = false @@ -81,5 +83,6 @@ proc `$`*(self: WalletAccountDto): string = removed: {self.removed}, operable: {self.operable}, prodPreferredChainIds: {self.prodPreferredChainIds}, - testPreferredChainIds: {self.testPreferredChainIds} - ]""" \ No newline at end of file + testPreferredChainIds: {self.testPreferredChainIds}, + hideFromTotalBalance: {self.hideFromTotalBalance} + ]""" diff --git a/src/app_service/service/wallet_account/service_account.nim b/src/app_service/service/wallet_account/service_account.nim index 52b5615ae2..8326475ac2 100644 --- a/src/app_service/service/wallet_account/service_account.nim +++ b/src/app_service/service/wallet_account/service_account.nim @@ -319,18 +319,18 @@ proc updatePreferredSharingChainsAndNotify(self: Service, address, prodPreferred ## if password is not provided local keystore file won't be created proc addWalletAccount*(self: Service, password: string, doPasswordHashing: bool, name, address, path, publicKey, - keyUid, accountType, colorId, emoji: string): string = + keyUid, accountType, colorId, emoji: string, hideFromTotalBalance: bool): string = try: var response: RpcResponse[JsonNode] if password.len == 0: response = status_go_accounts.addAccountWithoutKeystoreFileCreation(name, address, path, publicKey, keyUid, - accountType, colorId, emoji) + accountType, colorId, emoji, hideFromTotalBalance) else: var finalPassword = password if doPasswordHashing: finalPassword = utils.hashPassword(password) response = status_go_accounts.addAccount(finalPassword, name, address, path, publicKey, keyUid, accountType, - colorId, emoji) + colorId, emoji, hideFromTotalBalance) if not response.error.isNil: error "status-go error", procName="addWalletAccount", errCode=response.error.code, errDesription=response.error.message return response.error.message @@ -546,7 +546,7 @@ proc updateWalletAccount*(self: Service, address: string, accountName: string, c error "account's address is not among known addresses: ", address=address, procName="updateWalletAccount" return false let response = status_go_accounts.updateAccount(accountName, account.address, account.path, account.publicKey, - account.keyUid, account.walletType, colorId, emoji, account.isWallet, account.isChat, account.prodPreferredChainIds, account.testPreferredChainIds) + account.keyUid, account.walletType, colorId, emoji, account.isWallet, account.isChat, account.prodPreferredChainIds, account.testPreferredChainIds, account.hideFromTotalBalance) if not response.error.isNil: error "status-go error", procName="updateWalletAccount", errCode=response.error.code, errDesription=response.error.message return false @@ -563,7 +563,7 @@ proc updateWalletAccountProdPreferredChains*(self: Service, address, preferredCh error "account's address is not among known addresses: ", address=address, procName="updateWalletAccountProdPreferredChains" return false let response = status_go_accounts.updateAccount(account.name, account.address, account.path, account.publicKey, - account.keyUid, account.walletType, account.colorId, account.emoji, account.isWallet, account.isChat, preferredChainIds, account.testPreferredChainIds) + account.keyUid, account.walletType, account.colorId, account.emoji, account.isWallet, account.isChat, preferredChainIds, account.testPreferredChainIds, account.hideFromTotalBalance) if not response.error.isNil: error "status-go error", procName="updateWalletAccountProdPreferredChains", errCode=response.error.code, errDesription=response.error.message return false @@ -580,7 +580,7 @@ proc updateWalletAccountTestPreferredChains*(self: Service, address, preferredCh error "account's address is not among known addresses: ", address=address, procName="updateWalletAccountTestPreferredChains" return false let response = status_go_accounts.updateAccount(account.name, account.address, account.path, account.publicKey, - account.keyUid, account.walletType, account.colorId, account.emoji, account.isWallet, account.isChat, account.prodPreferredChainIds, preferredChainIds) + account.keyUid, account.walletType, account.colorId, account.emoji, account.isWallet, account.isChat, account.prodPreferredChainIds, preferredChainIds, account.hideFromTotalBalance) if not response.error.isNil: error "status-go error", procName="updateWalletAccountTestPreferredChains", errCode=response.error.code, errDesription=response.error.message return false @@ -590,6 +590,25 @@ proc updateWalletAccountTestPreferredChains*(self: Service, address, preferredCh error "error: ", procName="updateWalletAccountTestPreferredChains", errName=e.name, errDesription=e.msg return false +proc updateWatchAccountHiddenFromTotalBalance*(self: Service, address: string, hideFromTotalBalance: bool): bool = + try: + var account = self.getAccountByAddress(address) + if account.isNil: + error "account's address is not among known addresses: ", address=address, procName="updateWatchAccountHiddenFromTotalBalance" + return false + let response = status_go_accounts.updateAccount(account.name, account.address, account.path, account.publicKey, + account.keyUid, account.walletType, account.colorId, account.emoji, account.isWallet, account.isChat, account.prodPreferredChainIds, account.testPreferredChainIds, hideFromTotalBalance) + if not response.error.isNil: + error "status-go error", procName="updateWatchAccountHiddenFromTotalBalance", errCode=response.error.code, errDesription=response.error.message + return false + if hideFromTotalBalance != account.hideFromTotalBalance: + account.hideFromTotalBalance = hideFromTotalBalance + self.events.emit(SIGNAL_WALLET_ACCOUNT_HIDDEN_UPDATED, AccountArgs(account: account)) + return true + except Exception as e: + error "error: ", procName="updateWatchAccountHiddenFromTotalBalance", errName=e.name, errDesription=e.msg + return false + proc moveAccountFinally*(self: Service, fromPosition: int, toPosition: int) = var updated = false try: @@ -724,12 +743,6 @@ proc handleKeypair(self: Service, keypair: KeypairDto) = # notify all interested parts about the keypair change self.events.emit(SIGNAL_KEYPAIR_SYNCED, KeypairArgs(keypair: keypair)) -proc isIncludeWatchOnlyAccount*(self: Service): bool = - return self.settingsService.isIncludeWatchOnlyAccount() - -proc toggleIncludeWatchOnlyAccount*(self: Service) = - self.settingsService.toggleIncludeWatchOnlyAccount() - proc onFetchChainIdForUrl*(self: Service, jsonString: string) {.slot.} = let response = parseJson(jsonString) self.events.emit(SIGNAL_WALLET_ACCOUNT_CHAIN_ID_FOR_URL_FETCHED, ChainIdForUrlArgs( diff --git a/src/app_service/service/wallet_account/signals_and_payloads.nim b/src/app_service/service/wallet_account/signals_and_payloads.nim index cc714e7d5c..991b83b41b 100644 --- a/src/app_service/service/wallet_account/signals_and_payloads.nim +++ b/src/app_service/service/wallet_account/signals_and_payloads.nim @@ -21,6 +21,7 @@ const SIGNAL_WALLET_ACCOUNT_POSITION_UPDATED* = "walletAccount/positionUpdated" const SIGNAL_WALLET_ACCOUNT_OPERABILITY_UPDATED* = "walletAccount/operabilityUpdated" const SIGNAL_WALLET_ACCOUNT_CHAIN_ID_FOR_URL_FETCHED* = "walletAccount/chainIdForUrlFetched" const SIGNAL_WALLET_ACCOUNT_PREFERRED_SHARING_CHAINS_UPDATED* = "walletAccount/preferredSharingChainsUpdated" +const SIGNAL_WALLET_ACCOUNT_HIDDEN_UPDATED* = "walletAccount/accountHiddenChanged" const SIGNAL_KEYPAIR_SYNCED* = "keypairSynced" const SIGNAL_KEYPAIR_NAME_CHANGED* = "keypairNameChanged" diff --git a/src/backend/accounts.nim b/src/backend/accounts.nim index 6594a86465..3d30c24626 100644 --- a/src/backend/accounts.nim +++ b/src/backend/accounts.nim @@ -41,7 +41,7 @@ proc deleteKeypair*(keyUid: string): RpcResponse[JsonNode] {.raises: [Exception] return core.callPrivateRPC("accounts_deleteKeypair", payload) ## Adds a new account and creates a Keystore file if password is provided, otherwise it only creates a new account. Notifies paired devices. -proc addAccount*(password, name, address, path, publicKey, keyUid, accountType, colorId, emoji: string): +proc addAccount*(password, name, address, path, publicKey, keyUid, accountType, colorId, emoji: string, hideFromTotalBalance: bool): RpcResponse[JsonNode] {.raises: [Exception].} = let payload = %* [ password, @@ -56,7 +56,7 @@ proc addAccount*(password, name, address, path, publicKey, keyUid, accountType, "name": name, "emoji": emoji, "colorId": colorId, - #"hidden" present on the status-go side, but we don't use it + "hidden": hideFromTotalBalance #"clock" we leave this empty, set on the status-go side #"removed" present on the status-go side, used for synchronization, no need to set it here } @@ -90,7 +90,7 @@ proc addKeypair*(password, keyUid, keypairName, keypairType, rootWalletMasterKey "name": acc.name, "emoji": acc.emoji, "colorId": acc.colorId, - #"hidden" present on the status-go side, but we don't use it + "hidden": acc.hideFromTotalBalance #"clock" we leave this empty, set on the status-go side #"removed" present on the status-go side, used for synchronization, no need to set it here } @@ -100,13 +100,13 @@ proc addKeypair*(password, keyUid, keypairName, keypairType, rootWalletMasterKey return core.callPrivateRPC("accounts_addKeypair", payload) ## Adds a new account without creating a Keystore file and notifies paired devices -proc addAccountWithoutKeystoreFileCreation*(name, address, path, publicKey, keyUid, accountType, colorId, emoji: string): +proc addAccountWithoutKeystoreFileCreation*(name, address, path, publicKey, keyUid, accountType, colorId, emoji: string, hideFromTotalBalance: bool): RpcResponse[JsonNode] {.raises: [Exception].} = - return addAccount(password = "", name, address, path, publicKey, keyUid, accountType, colorId, emoji) + return addAccount(password = "", name, address, path, publicKey, keyUid, accountType, colorId, emoji, hideFromTotalBalance) ## Updates either regular or keycard account, without interaction to a Keystore file and notifies paired devices proc updateAccount*(name, address, path: string, publicKey, keyUid, accountType, colorId, emoji: string, - walletDefaultAccount: bool, chatDefaultAccount: bool, prodPreferredChainIds, testPreferredChainIds: string): + walletDefaultAccount: bool, chatDefaultAccount: bool, prodPreferredChainIds, testPreferredChainIds: string, hideFromTotalBalance: bool): RpcResponse[JsonNode] {.raises: [Exception].} = let payload = %* [ { @@ -121,8 +121,8 @@ proc updateAccount*(name, address, path: string, publicKey, keyUid, accountType, "emoji": emoji, "colorId": colorId, "prodPreferredChainIds": prodPreferredChainIds, - "testPreferredChainIds": testPreferredChainIds - #"hidden" present on the status-go side, but we don't use it + "testPreferredChainIds": testPreferredChainIds, + "hidden": hideFromTotalBalance #"clock" we leave this empty, set on the status-go side #"removed" present on the status-go side, used for synchronization, no need to set it here } diff --git a/storybook/pages/AccountViewPage.qml b/storybook/pages/AccountViewPage.qml index d2d49403d8..024f5a5f5d 100644 --- a/storybook/pages/AccountViewPage.qml +++ b/storybook/pages/AccountViewPage.qml @@ -39,7 +39,6 @@ SplitView { displayDecimals: 4, stripTrailingZeroes: false}), isAllAccounts: false, - includeWatchOnly: false, path: "m/44’/60’/0’/0’/34", preferredSharingChainIds: walletStore.areTestNetworksEnabled ? "5:420:421613": "1:10:42161" }) @@ -87,6 +86,9 @@ SplitView { account: d.dummyOverview walletStore: d.walletStore keyPair: d.keyPairModel.data[0].keyPair + onUpdateWatchAccountHiddenFromTotalBalance: { + console.warn("updateWatchAccountHiddenFromTotalBalance :: address ::", address, "hideFromTotalBalance :: ", hideFromTotalBalance) + } } } diff --git a/storybook/pages/ActivityFilterMenuPage.qml b/storybook/pages/ActivityFilterMenuPage.qml index ad290ccb69..ca5b89f138 100644 --- a/storybook/pages/ActivityFilterMenuPage.qml +++ b/storybook/pages/ActivityFilterMenuPage.qml @@ -48,7 +48,6 @@ SplitView { displayDecimals: 4, stripTrailingZeroes: false}), isAllAccounts: false, - includeWatchOnly: false }) function getNameForAddress(address) { diff --git a/storybook/pages/WalletHeaderPage.qml b/storybook/pages/WalletHeaderPage.qml index b479034a5b..f3abba1790 100644 --- a/storybook/pages/WalletHeaderPage.qml +++ b/storybook/pages/WalletHeaderPage.qml @@ -56,7 +56,6 @@ SplitView { displayDecimals: 4, stripTrailingZeroes: false}), isAllAccounts: false, - includeWatchOnly: false }) } @@ -73,7 +72,6 @@ SplitView { displayDecimals: 4, stripTrailingZeroes: false}), isAllAccounts: true, - includeWatchOnly: true, colorIds: "purple;pink;magenta" }) diff --git a/ui/app/AppLayouts/Profile/controls/WalletKeyPairDelegate.qml b/ui/app/AppLayouts/Profile/controls/WalletKeyPairDelegate.qml index a584aa7e60..8c5ee3dcfb 100644 --- a/ui/app/AppLayouts/Profile/controls/WalletKeyPairDelegate.qml +++ b/ui/app/AppLayouts/Profile/controls/WalletKeyPairDelegate.qml @@ -18,10 +18,8 @@ Rectangle { property bool hasPairedDevices property var getNetworkShortNames: function(chainIds){} property string userProfilePublicKey - property bool includeWatchOnlyAccount signal goToAccountView(var account) - signal toggleIncludeWatchOnlyAccount() signal runExportQrFlow() signal runImportViaQrFlow() signal runImportViaSeedPhraseFlow() @@ -98,16 +96,6 @@ Rectangle { onRunStopUsingKeycardFlow: root.runStopUsingKeycardFlow() } } - }, - StatusBaseText { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Include in total balance") - visible: d.isWatchOnly - }, - StatusSwitch { - visible: d.isWatchOnly - checked: root.includeWatchOnlyAccount - onClicked: root.toggleIncludeWatchOnlyAccount() } ] } @@ -120,6 +108,7 @@ Rectangle { model: d.relatedAccounts delegate: WalletAccountDelegate { width: ListView.view.width + label: keyPair.pairType !== Constants.keypair.type.watchOnly ? "" : model.account.hideFromTotalBalance ? qsTr("Excl. from total balance"): qsTr("Incl. in total balance") account: model.account totalCount: ListView.view.count getNetworkShortNames: root.getNetworkShortNames diff --git a/ui/app/AppLayouts/Profile/stores/WalletStore.qml b/ui/app/AppLayouts/Profile/stores/WalletStore.qml index 0fd2367027..5449396683 100644 --- a/ui/app/AppLayouts/Profile/stores/WalletStore.qml +++ b/ui/app/AppLayouts/Profile/stores/WalletStore.qml @@ -28,11 +28,6 @@ QtObject { property var assets: walletSectionAssets.assets property var accounts: Global.appIsReady? accountsModule.accounts : null property var originModel: accountsModule.keyPairModel - property bool includeWatchOnlyAccount: accountsModule.includeWatchOnlyAccount - - function toggleIncludeWatchOnlyAccount() { - accountsModule.toggleIncludeWatchOnlyAccount() - } property string userProfilePublicKey: userProfile.pubKey @@ -150,4 +145,8 @@ QtObject { layer: combinedNetwork.layer } } + + function updateWatchAccountHiddenFromTotalBalance(address, hideFromTotalBalance) { + accountsModule.updateWatchAccountHiddenFromTotalBalance(address, hideFromTotalBalance) + } } diff --git a/ui/app/AppLayouts/Profile/views/WalletView.qml b/ui/app/AppLayouts/Profile/views/WalletView.qml index 222854e4da..a00489f028 100644 --- a/ui/app/AppLayouts/Profile/views/WalletView.qml +++ b/ui/app/AppLayouts/Profile/views/WalletView.qml @@ -199,6 +199,9 @@ SettingsContentBase { onRunStopUsingKeycardFlow: { root.rootStore.keycardStore.runStopUsingKeycardPopup(keyPair.keyUid) } + onUpdateWatchAccountHiddenFromTotalBalance: { + root.walletStore.updateWatchAccountHiddenFromTotalBalance(address, hideFromTotalBalance) + } } DappPermissionsView { diff --git a/ui/app/AppLayouts/Profile/views/wallet/AccountView.qml b/ui/app/AppLayouts/Profile/views/wallet/AccountView.qml index 37344a3b98..47dddc0745 100644 --- a/ui/app/AppLayouts/Profile/views/wallet/AccountView.qml +++ b/ui/app/AppLayouts/Profile/views/wallet/AccountView.qml @@ -29,6 +29,7 @@ ColumnLayout { signal runImportMissingKeypairFlow() signal runMoveKeypairToKeycardFlow() signal runStopUsingKeycardFlow() + signal updateWatchAccountHiddenFromTotalBalance(string address, bool hideFromTotalBalance) property var account property var keyPair @@ -218,6 +219,27 @@ ColumnLayout { StatusListItem { Layout.fillWidth: true + title: qsTr("Include in total balance") + visible: d.watchOnlyAccount + color: Theme.palette.transparent + components: [ + StatusSwitch { + checked: !!root.account && !account.hideFromTotalBalance + onToggled: root.updateWatchAccountHiddenFromTotalBalance(account.address, !checked) + } + ] + } + + Separator { + visible: d.watchOnlyAccount + Layout.fillWidth: true + Layout.preferredHeight: 1 + color: Theme.palette.baseColor2 + } + + StatusListItem { + Layout.fillWidth: true + Layout.topMargin: Style.current.halfPadding title: qsTr("Preferred networks when sharing this address") color: Theme.palette.transparent components: [ diff --git a/ui/app/AppLayouts/Profile/views/wallet/MainView.qml b/ui/app/AppLayouts/Profile/views/wallet/MainView.qml index 7e89eb3c01..037c5d7231 100644 --- a/ui/app/AppLayouts/Profile/views/wallet/MainView.qml +++ b/ui/app/AppLayouts/Profile/views/wallet/MainView.qml @@ -223,9 +223,7 @@ Column { hasPairedDevices: root.walletStore.walletModule.hasPairedDevices getNetworkShortNames: walletStore.getNetworkShortNames userProfilePublicKey: walletStore.userProfilePublicKey - includeWatchOnlyAccount: walletStore.includeWatchOnlyAccount onGoToAccountView: root.goToAccountView(account, keyPair) - onToggleIncludeWatchOnlyAccount: walletStore.toggleIncludeWatchOnlyAccount() onRunRenameKeypairFlow: root.runRenameKeypairFlow(model) onRunRemoveKeypairFlow: root.runRemoveKeypairFlow(model) onRunImportViaSeedPhraseFlow: { diff --git a/ui/app/AppLayouts/Wallet/WalletLayout.qml b/ui/app/AppLayouts/Wallet/WalletLayout.qml index 5e7be70a7b..5ef000f9a7 100644 --- a/ui/app/AppLayouts/Wallet/WalletLayout.qml +++ b/ui/app/AppLayouts/Wallet/WalletLayout.qml @@ -30,7 +30,7 @@ Item { Connections { target: walletSection - function onFilterChanged(address, includeWatchOnly, allAddresses) { + function onFilterChanged(address, allAddresses) { root.showAllAccounts = allAddresses } diff --git a/ui/app/AppLayouts/Wallet/panels/WalletHeader.qml b/ui/app/AppLayouts/Wallet/panels/WalletHeader.qml index 8100a92b68..c0b9ca94ff 100644 --- a/ui/app/AppLayouts/Wallet/panels/WalletHeader.qml +++ b/ui/app/AppLayouts/Wallet/panels/WalletHeader.qml @@ -82,31 +82,6 @@ Item { visible: !overview.isAllAccounts } - - StatusButton { - objectName: "hideShowWatchOnlyButton" - Layout.preferredHeight: 38 - Layout.alignment: Qt.AlignTop - - spacing: 8 - size: StatusBaseButton.Size.Small - borderColor: Theme.palette.directColor7 - normalColor: Theme.palette.transparent - hoverColor: Theme.palette.baseColor2 - - font.weight: Font.Normal - textColor: Theme.palette.baseColor1 - text: overview.includeWatchOnly ? qsTr("Hide watched addresses"): qsTr("Show watched addresses") - - icon.name: overview.includeWatchOnly ? "hide" : "show" - icon.height: 16 - icon.width: 16 - icon.color: Theme.palette.baseColor1 - - onClicked: switchHideWatchOnlyAccounts() - visible: overview.isAllAccounts - } - // network filter NetworkFilter { id: networkFilter diff --git a/ui/app/AppLayouts/Wallet/stores/RootStore.qml b/ui/app/AppLayouts/Wallet/stores/RootStore.qml index 75f7cba4d4..03072e2fee 100644 --- a/ui/app/AppLayouts/Wallet/stores/RootStore.qml +++ b/ui/app/AppLayouts/Wallet/stores/RootStore.qml @@ -378,4 +378,8 @@ QtObject { } return prefChains } + + function updateWatchAccountHiddenFromTotalBalance(address, hideFromTotalBalance) { + walletSectionAccounts.updateWatchAccountHiddenFromTotalBalance(address, hideFromTotalBalance) + } } diff --git a/ui/app/AppLayouts/Wallet/views/AccountContextMenu.qml b/ui/app/AppLayouts/Wallet/views/AccountContextMenu.qml index ba57a1fd5e..7a315bc2ee 100644 --- a/ui/app/AppLayouts/Wallet/views/AccountContextMenu.qml +++ b/ui/app/AppLayouts/Wallet/views/AccountContextMenu.qml @@ -5,6 +5,8 @@ import StatusQ.Popups 0.1 import "../stores" +import utils 1.0 + StatusMenu { id: root @@ -14,6 +16,7 @@ StatusMenu { signal deleteAccountClicked() signal addNewAccountClicked() signal addWatchOnlyAccountClicked() + signal hideFromTotalBalanceClicked(string address, bool hideFromTotalBalance) width: 204 @@ -40,6 +43,14 @@ StatusMenu { onTriggered: { root.editAccountClicked() } + } + + StatusAction { + objectName: "AccountMenu-HideFromTotalBalance-%1".arg(root.uniqueIdentifier) + enabled: !!root.account && root.account.walletType === Constants.watchWalletType + text: !!root.account ? root.account.hideFromTotalBalance ? qsTr("Include in total balance"): qsTr("Exclude from total balance"): "" + icon.name: !!root.account ? root.account.hideFromTotalBalance ? "show" : "hide": "" + onTriggered: root.hideFromTotalBalanceClicked(root.account.address, !root.account.hideFromTotalBalance) } StatusAction { diff --git a/ui/app/AppLayouts/Wallet/views/LeftTabView.qml b/ui/app/AppLayouts/Wallet/views/LeftTabView.qml index 90a14d3bf3..5fdd51cf38 100644 --- a/ui/app/AppLayouts/Wallet/views/LeftTabView.qml +++ b/ui/app/AppLayouts/Wallet/views/LeftTabView.qml @@ -115,6 +115,8 @@ Rectangle { removeAccountConfirmation.accountDerivationPath = account.path removeAccountConfirmation.active = true } + + onHideFromTotalBalanceClicked: RootStore.updateWatchAccountHiddenFromTotalBalance(address, hideFromTotalBalance) } } @@ -158,7 +160,7 @@ Rectangle { function onDestroyAddAccountPopup() { addAccount.active = false } - function onFilterChanged(address, includeWatchOnly, allAddresses) { + function onFilterChanged(address, allAddresses) { root.currentAddress = allAddresses ? "" : address root.showAllAccounts = allAddresses } @@ -269,7 +271,7 @@ Rectangle { } anchors.horizontalCenter: !!parent ? parent.horizontalCenter : undefined title: model.name - subTitle: LocaleUtils.currencyAmountToLocaleString(model.currencyBalance) + subTitle: !model.hideFromTotalBalance ? LocaleUtils.currencyAmountToLocaleString(model.currencyBalance): "" asset.emoji: !!model.emoji ? model.emoji: "" asset.color: Utils.getColorForId(model.colorId) asset.name: !model.emoji ? "filled-account": "" diff --git a/ui/app/mainui/AppMain.qml b/ui/app/mainui/AppMain.qml index daa851097a..148f352bbc 100644 --- a/ui/app/mainui/AppMain.qml +++ b/ui/app/mainui/AppMain.qml @@ -142,16 +142,6 @@ Item { ) } - function onShowIncludeWatchOnlyAccountUpdated(includeWatchOnly: bool) { - Global.displayToastMessage( - includeWatchOnly ? qsTr("Your wallet’s total balance will now include balances of watched addresses") : qsTr("Your wallet’s total balance will not include balances of watched addresses") , - "", - "checkmark-circle", - false, - Constants.ephemeralNotificationType.success, - "") - } - function onShowToastKeypairRemoved(keypairName: string) { Global.displayToastMessage( qsTr("“%1” keypair and its derived accounts were successfully removed from all devices").arg(keypairName), diff --git a/vendor/status-go b/vendor/status-go index 11b5aed27a..ac813ef5d8 160000 --- a/vendor/status-go +++ b/vendor/status-go @@ -1 +1 @@ -Subproject commit 11b5aed27a3ed167c6e39e185737e07c246de029 +Subproject commit ac813ef5d8f012ba4a0b532483ceeebc553aa3b1