diff --git a/packages/desktop/components/modals/AccountActionsMenu.svelte b/packages/desktop/components/modals/AccountActionsMenu.svelte index b3199b6ab3b..691e11a08bf 100644 --- a/packages/desktop/components/modals/AccountActionsMenu.svelte +++ b/packages/desktop/components/modals/AccountActionsMenu.svelte @@ -3,7 +3,7 @@ import { selectedAccount } from '@core/account/stores' import { localize } from '@core/i18n' - import { activeAccounts, isActiveLedgerProfile, visibleActiveAccounts } from '@core/profile/stores' + import { activeAccounts, activeProfile, isActiveLedgerProfile, visibleActiveAccounts } from '@core/profile/stores' import { deleteAccount } from '@core/profile-manager/actions' import { Icon } from '@auxiliary/icon/enums' @@ -12,6 +12,7 @@ import { checkOrConnectLedger } from '@core/ledger' import { showAppNotification } from '@auxiliary/notification' import { handleError } from '@core/error/handlers' + import { NetworkId } from '@core/network/enums' export let modal: Modal = undefined @@ -28,6 +29,11 @@ modal?.close() } + function onViewAddressHistoryClick(): void { + openPopup({ id: PopupId.AddressHistory }) + modal?.close() + } + function onVerifyAddressClick(): void { const ADDRESS_INDEX = 0 checkOrConnectLedger(() => { @@ -66,6 +72,13 @@ + {#if $activeProfile?.network?.id === NetworkId.Iota} + + {/if} {#if $isActiveLedgerProfile} + import { getSelectedAccount } from '@core/account' + import { localize } from '@core/i18n' + import { truncateString } from '@core/utils' + import { AccountAddress } from '@iota/sdk/out/types' + import VirtualList from '@sveltejs/svelte-virtual-list' + import { FontWeight, KeyValueBox, Spinner, Text, TextType } from 'shared/components' + import { onMount } from 'svelte' + + let addressList: AccountAddress[] | undefined = undefined + + onMount(() => { + getSelectedAccount() + ?.addresses() + .then((_addressList) => { + addressList = _addressList?.sort((a, b) => a.keyIndex - b.keyIndex) ?? [] + }) + .catch((err) => { + console.error(err) + addressList = [] + }) + }) + + +
+ + {localize('popups.addressHistory.title')} + + {localize('popups.addressHistory.disclaimer')} + {#if addressList} + {#if addressList.length > 0} +
+ +
+ +
+
+
+ {:else} + - + {/if} + {:else} +
+ +
+ {/if} +
+ + diff --git a/packages/desktop/components/popups/Popup.svelte b/packages/desktop/components/popups/Popup.svelte index 2cfc798ad9c..c2873aec23a 100644 --- a/packages/desktop/components/popups/Popup.svelte +++ b/packages/desktop/components/popups/Popup.svelte @@ -12,6 +12,7 @@ import ActivityDetailsPopup from './ActivityDetailsPopup.svelte' import AddNodePopup from './AddNodePopup.svelte' import AddProposalPopup from './AddProposalPopup.svelte' + import AddressHistoryPopup from './AddressHistoryPopup.svelte' import AliasConfirmationPopup from './AliasConfirmationPopup.svelte' import BackupStrongholdPopup from './BackupStrongholdPopup.svelte' import BurnNativeTokensPopup from './BurnNativeTokensPopup.svelte' @@ -97,6 +98,7 @@ [PopupId.ActivityDetails]: ActivityDetailsPopup, [PopupId.AddNode]: AddNodePopup, [PopupId.AddProposal]: AddProposalPopup, + [PopupId.AddressHistory]: AddressHistoryPopup, [PopupId.AliasConfirmation]: AliasConfirmationPopup, [PopupId.BackupStronghold]: BackupStrongholdPopup, [PopupId.BurnNativeTokens]: BurnNativeTokensPopup, diff --git a/packages/shared/lib/auxiliary/popup/enums/popup-id.enum.ts b/packages/shared/lib/auxiliary/popup/enums/popup-id.enum.ts index 20ac4107538..c0378ef4623 100644 --- a/packages/shared/lib/auxiliary/popup/enums/popup-id.enum.ts +++ b/packages/shared/lib/auxiliary/popup/enums/popup-id.enum.ts @@ -3,6 +3,7 @@ export enum PopupId { ActivityDetails = 'activityDetails', AddNode = 'addNode', AddProposal = 'addProposal', + AddressHistory = 'addressHistory', AliasConfirmation = 'aliasConfirmation', BackupStronghold = 'backupStronghold', BurnNativeTokens = 'burnNativeTokens', diff --git a/packages/shared/locales/en.json b/packages/shared/locales/en.json index 6f7085bf3f8..772f587a656 100644 --- a/packages/shared/locales/en.json +++ b/packages/shared/locales/en.json @@ -812,12 +812,6 @@ "errorBody2": "You currently have {balance} remaining on this wallet. Please move these funds to a different wallet and try again.", "errorBody3": "You cannot hide this wallet, you must have at least one." }, - "addressHistory": { - "title": "{name} address history", - "currentBalance": "Balance: {balance}", - "internal": "Internal Address", - "external": "Deposit Address" - }, "excludeNode": { "title": "Exclude node", "body": "Are you sure you want to exclude {url} from the available node pool?" @@ -1188,6 +1182,12 @@ "nodeAuthRequired": { "title": "Authentication required", "body": "This node requires additional authentication. Please fill in the appropriate information." + }, + "addressHistory": { + "title": "Address history", + "disclaimer": "List of addresses with funds or known by this profile", + "indexAndType": "{internal, select, true {Internal address} other {Deposit address}} {index}", + "internal": "Internal" } }, "charts": { @@ -1338,6 +1338,7 @@ "visitFaq": "Visit FAQ", "viewDownloads" : "View downloads", "viewStatus": "View status", + "viewAddressHistory": "View address history", "viewBalanceBreakdown": "View balance breakdown", "verifyDepositAddress": "Verify deposit address", "showHiddenAccounts": "Show hidden wallets",