From 312a8a8f3580975e1719428009c5f1f6896304c1 Mon Sep 17 00:00:00 2001 From: Marc Espin Date: Thu, 1 Feb 2024 18:34:11 +0100 Subject: [PATCH] refactor: Remove Account debris (#7909) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor(2.0): Dynamic password * refactor(2.0): Remove Profile Manager (wip) * clean up and fix * clean up * clean up more code * clean up * adapt and remove for profile-manager related code * clean up more code * fmt * more cleanup * more cleanup * small tweaks * more cleanup * format * update * clean up * https://api.testnet.shimmer.network * revert Wallet.svelte * clean up * remove account debris * clean up * fix --------- Co-authored-by: Begoña Álvarez de la Cruz --- ...tActivity.svelte => WalletActivity.svelte} | 0 ...untSummary.svelte => WalletSummary.svelte} | 8 ++--- ...tton.svelte => WalletActionsButton.svelte} | 4 +-- .../components/buttons/menu-buttons/index.js | 2 +- .../RefreshTokenMetadataButton.svelte | 4 +-- packages/desktop/components/index.js | 4 +-- .../components/modals/VestingModal.svelte | 4 +-- .../modals/WalletActionsMenu.svelte | 26 +++++++------- .../modals/WalletSwitcherModal.svelte | 12 +++---- .../components/popups/AddProposalPopup.svelte | 2 +- .../popups/BalanceBreakdownPopup.svelte | 14 ++++---- .../popups/BalanceFinderPopup.svelte | 24 ++++++------- .../popups/CreateWalletPopup.svelte | 34 +++++++++---------- ...tPopup.svelte => DeleteWalletPopup.svelte} | 14 ++++---- .../popups/ManageWalletPopup.svelte | 14 ++++---- .../desktop/components/popups/Popup.svelte | 4 +-- .../popups/VestingRewardsFinderPopup.svelte | 8 ++--- .../popups/WalletSwitcherPopup.svelte | 4 +-- .../popups/send/SendConfirmationPopup.svelte | 4 +-- .../desktop/features/settings.features.ts | 2 +- packages/desktop/features/wallet.features.ts | 2 +- .../views/advanced/HiddenAccounts.svelte | 17 ---------- .../views/advanced/HiddenWallets.svelte | 17 ++++++++++ .../advanced/advanced-settings.constant.js | 4 +-- .../settings/views/advanced/index.js | 2 +- .../dashboard/wallet/views/WalletView.svelte | 8 ++--- .../views/CustomNetworkView.svelte | 2 +- .../components/inputs/RecipientInput.svelte | 13 +++---- ...elte => ToggleHiddenWalletMenuItem.svelte} | 12 +++---- .../shared/components/menu-items/index.js | 2 +- .../NftActivityTileContent.svelte | 2 +- .../icon/constants/settings-icon-svg.ts | 2 +- .../auxiliary/popup/enums/popup-id.enum.ts | 2 +- .../actions/registerProposalsFromNodes.ts | 13 +++---- .../utils/getParticipationsForProposal.ts | 6 ++-- .../governance/utils/isVotingForProposal.ts | 6 ++-- .../utils/isVotingForSelectedProposal.ts | 6 ++-- packages/shared/lib/core/nfts/utils/index.ts | 2 +- .../core/nfts/utils/isNftOwnedByAnyAccount.ts | 12 ------- .../core/nfts/utils/isNftOwnedByAnyWallet.ts | 12 +++++++ .../checkAndRemoveProfilePicture.ts | 4 +-- .../findActiveWalletWithAddress.ts | 0 .../getWalletColorById.ts | 0 .../index.ts | 0 .../updateActiveWalletPersistedData.ts | 0 .../shared/lib/core/profile/actions/index.ts | 3 +- .../initial-active-profile.constant.ts | 2 +- .../profile/interfaces/profile.interface.ts | 2 +- .../profile/stores/active-wallets.store.ts | 2 +- .../settings/advanced-settings-route.enum.ts | 2 +- .../core/wallet/actions/consolidateOutputs.ts | 6 ++-- .../generateSingleConsolidationActivity.ts | 8 ++--- .../generateSingleGovernanceActivity.ts | 6 ++-- .../generateVestingActivity.ts | 8 ++--- .../getDirectionFromOutgoingTransaction.ts | 2 +- .../transactions/getSenderFromTransaction.ts | 4 +-- .../interfaces/settings-features.interface.ts | 2 +- .../interfaces/wallet-features.interface.ts | 2 +- ...balance.mock.ts => wallet-balance.mock.ts} | 8 +++-- .../shared/lib/tests/__mocks__/wallet.mock.ts | 4 +-- packages/shared/locales/en.json | 26 ++++++-------- 61 files changed, 204 insertions(+), 217 deletions(-) rename packages/desktop/components/{AccountActivity.svelte => WalletActivity.svelte} (100%) rename packages/desktop/components/{AccountSummary.svelte => WalletSummary.svelte} (85%) rename packages/desktop/components/buttons/menu-buttons/{AccountActionsButton.svelte => WalletActionsButton.svelte} (79%) rename packages/desktop/components/popups/{DeleteAccountPopup.svelte => DeleteWalletPopup.svelte} (85%) delete mode 100644 packages/desktop/views/dashboard/settings/views/advanced/HiddenAccounts.svelte create mode 100644 packages/desktop/views/dashboard/settings/views/advanced/HiddenWallets.svelte rename packages/shared/components/menu-items/{ToggleHiddenAccountMenuItem.svelte => ToggleHiddenWalletMenuItem.svelte} (71%) delete mode 100644 packages/shared/lib/core/nfts/utils/isNftOwnedByAnyAccount.ts create mode 100644 packages/shared/lib/core/nfts/utils/isNftOwnedByAnyWallet.ts rename packages/shared/lib/core/profile/actions/{active-accounts => active-wallet}/findActiveWalletWithAddress.ts (100%) rename packages/shared/lib/core/profile/actions/{active-accounts => active-wallet}/getWalletColorById.ts (100%) rename packages/shared/lib/core/profile/actions/{active-accounts => active-wallet}/index.ts (100%) rename packages/shared/lib/core/profile/actions/{active-accounts => active-wallet}/updateActiveWalletPersistedData.ts (100%) rename packages/shared/lib/tests/__mocks__/{account-balance.mock.ts => wallet-balance.mock.ts} (71%) diff --git a/packages/desktop/components/AccountActivity.svelte b/packages/desktop/components/WalletActivity.svelte similarity index 100% rename from packages/desktop/components/AccountActivity.svelte rename to packages/desktop/components/WalletActivity.svelte diff --git a/packages/desktop/components/AccountSummary.svelte b/packages/desktop/components/WalletSummary.svelte similarity index 85% rename from packages/desktop/components/AccountSummary.svelte rename to packages/desktop/components/WalletSummary.svelte index 8ff8e230589..db247d9197e 100644 --- a/packages/desktop/components/AccountSummary.svelte +++ b/packages/desktop/components/WalletSummary.svelte @@ -1,5 +1,5 @@ - +
{localize('general.balanceWithNetwork', { values: { network: fomattedNetworkName } })} - +
-
+ diff --git a/packages/desktop/components/buttons/menu-buttons/AccountActionsButton.svelte b/packages/desktop/components/buttons/menu-buttons/WalletActionsButton.svelte similarity index 79% rename from packages/desktop/components/buttons/menu-buttons/AccountActionsButton.svelte rename to packages/desktop/components/buttons/menu-buttons/WalletActionsButton.svelte index 03eb4801298..1c7b763b8f2 100644 --- a/packages/desktop/components/buttons/menu-buttons/AccountActionsButton.svelte +++ b/packages/desktop/components/buttons/menu-buttons/WalletActionsButton.svelte @@ -5,7 +5,7 @@ let modal: Modal - + - + diff --git a/packages/desktop/components/buttons/menu-buttons/index.js b/packages/desktop/components/buttons/menu-buttons/index.js index 8542bc19bd0..be9e7f30ece 100644 --- a/packages/desktop/components/buttons/menu-buttons/index.js +++ b/packages/desktop/components/buttons/menu-buttons/index.js @@ -1 +1 @@ -export { default as AccountActionsButton } from './AccountActionsButton.svelte' +export { default as WalletActionsButton } from './WalletActionsButton.svelte' diff --git a/packages/desktop/components/buttons/popup-buttons/RefreshTokenMetadataButton.svelte b/packages/desktop/components/buttons/popup-buttons/RefreshTokenMetadataButton.svelte index 794c4fbb42c..b52e926957e 100644 --- a/packages/desktop/components/buttons/popup-buttons/RefreshTokenMetadataButton.svelte +++ b/packages/desktop/components/buttons/popup-buttons/RefreshTokenMetadataButton.svelte @@ -2,14 +2,14 @@ import { OnboardingButton } from '@ui' import { localize } from '@core/i18n' - import { refreshAccountAssetsForActiveProfile } from '@core/wallet' + import { refreshWalletAssetsForActiveProfile } from '@core/wallet' import { showAppNotification } from '@auxiliary/notification' import { closePopup, openPopup, PopupId } from '@auxiliary/popup' import { TextHintVariant } from 'shared/components/enums' function refreshTokenMetadata(): void { - refreshAccountAssetsForActiveProfile(true) + refreshWalletAssetsForActiveProfile(true) showAppNotification({ type: 'success', message: localize('notifications.refreshTokenMetadata.success'), diff --git a/packages/desktop/components/index.js b/packages/desktop/components/index.js index 0143a5740b5..99d664c7e45 100644 --- a/packages/desktop/components/index.js +++ b/packages/desktop/components/index.js @@ -5,8 +5,8 @@ export * from './modals' export * from './panes' export * from './popups' -export { default as AccountActivity } from './AccountActivity.svelte' -export { default as AccountSummary } from './AccountSummary.svelte' +export { default as WalletActivity } from './WalletActivity.svelte' +export { default as WalletSummary } from './WalletSummary.svelte' export { default as WalletSwitcher } from './WalletSwitcher.svelte' export { default as OnboardingLayout } from './OnboardingLayout.svelte' export { default as Proposals } from './Proposals.svelte' diff --git a/packages/desktop/components/modals/VestingModal.svelte b/packages/desktop/components/modals/VestingModal.svelte index 98f9548065a..1f8a80b4838 100644 --- a/packages/desktop/components/modals/VestingModal.svelte +++ b/packages/desktop/components/modals/VestingModal.svelte @@ -14,11 +14,11 @@ - + - + diff --git a/packages/desktop/components/modals/WalletActionsMenu.svelte b/packages/desktop/components/modals/WalletActionsMenu.svelte index e62f8f38c60..d2da96ea36a 100644 --- a/packages/desktop/components/modals/WalletActionsMenu.svelte +++ b/packages/desktop/components/modals/WalletActionsMenu.svelte @@ -1,5 +1,5 @@ - + {#if $activeProfile?.network?.id === NetworkId.Iota || $activeProfile?.network?.id === NetworkId.IotaAlphanet} {/if} - + {#if $isActiveLedgerProfile} {/if} - +
- {#if showDeleteAccount} + {#if showDeleteWallet} {/if} -
+
diff --git a/packages/desktop/components/modals/WalletSwitcherModal.svelte b/packages/desktop/components/modals/WalletSwitcherModal.svelte index fa5e892fed3..35594e214e4 100644 --- a/packages/desktop/components/modals/WalletSwitcherModal.svelte +++ b/packages/desktop/components/modals/WalletSwitcherModal.svelte @@ -17,7 +17,7 @@ async function scrollToSelectedWallet(): Promise { await tick() - const element = document.getElementById(`account-${$selectedWallet.id}`) + const element = document.getElementById(`wallet-${$selectedWallet.id}`) element?.scrollIntoView({ behavior: 'auto' }) } @@ -34,13 +34,13 @@ size="large" position={{ top: '30px', left: '50%' }} > - - + + {#each $visibleActiveWallets as wallet} - + {/each} - - + +
- - + + diff --git a/packages/desktop/components/popups/DeleteAccountPopup.svelte b/packages/desktop/components/popups/DeleteWalletPopup.svelte similarity index 85% rename from packages/desktop/components/popups/DeleteAccountPopup.svelte rename to packages/desktop/components/popups/DeleteWalletPopup.svelte index 336dd7acc74..185d81b7e5f 100644 --- a/packages/desktop/components/popups/DeleteAccountPopup.svelte +++ b/packages/desktop/components/popups/DeleteWalletPopup.svelte @@ -17,11 +17,11 @@ async function onDeleteClick(): Promise { error = null isBusy = true - await deleteStrongholdAccount(password) + await deleteStrongholdWallet(password) isBusy = false } - async function deleteStrongholdAccount(password: string): Promise { + async function deleteStrongholdWallet(password: string): Promise { try { if ($isSoftwareProfile) { await setStrongholdPassword(password) @@ -41,17 +41,17 @@
- {localize('popups.deleteAccount.title', { + {localize('popups.deleteWallet.title', { values: { name: $selectedWallet?.name }, })}
- {localize('popups.deleteAccount.body')} - + {localize('popups.deleteWallet.body')} +
{#if $isSoftwareProfile} - {localize('popups.deleteAccount.typePassword')} + {localize('popups.deleteWallet.typePassword')} - {localize('actions.deleteAccount')} + {localize('actions.deleteWallet')}
diff --git a/packages/desktop/components/popups/ManageWalletPopup.svelte b/packages/desktop/components/popups/ManageWalletPopup.svelte index 1a5587b5c8a..7c444dbb7af 100644 --- a/packages/desktop/components/popups/ManageWalletPopup.svelte +++ b/packages/desktop/components/popups/ManageWalletPopup.svelte @@ -48,12 +48,12 @@ } - +
{localize('general.manageWallet')} - + - - + +
- + @@ -78,5 +78,5 @@ > {localize('actions.save')} - -
+ + diff --git a/packages/desktop/components/popups/Popup.svelte b/packages/desktop/components/popups/Popup.svelte index c4a13c92b98..8231c96932b 100644 --- a/packages/desktop/components/popups/Popup.svelte +++ b/packages/desktop/components/popups/Popup.svelte @@ -21,7 +21,7 @@ import ConnectLedgerPopup from './ConnectLedgerPopup.svelte' import createWalletPopup from './CreateWalletPopup.svelte' import DeepLinkErrorPopup from './DeepLinkErrorPopup.svelte' - import DeleteAccountPopup from './DeleteAccountPopup.svelte' + import DeleteWalletPopup from './DeleteWalletPopup.svelte' import DeleteProfilePopup from './DeleteProfilePopup.svelte' import DiagnosticsPopup from './DiagnosticsPopup.svelte' import EnableLedgerBlindSigningPopup from './EnableLedgerBlindSigningPopup.svelte' @@ -107,7 +107,7 @@ [PopupId.ConnectLedger]: ConnectLedgerPopup, [PopupId.createWallet]: createWalletPopup, [PopupId.DeepLinkError]: DeepLinkErrorPopup, - [PopupId.DeleteAccount]: DeleteAccountPopup, + [PopupId.DeleteWallet]: DeleteWalletPopup, [PopupId.DeleteProfile]: DeleteProfilePopup, [PopupId.Diagnostics]: DiagnosticsPopup, [PopupId.EnableLedgerBlindSigning]: EnableLedgerBlindSigningPopup, diff --git a/packages/desktop/components/popups/VestingRewardsFinderPopup.svelte b/packages/desktop/components/popups/VestingRewardsFinderPopup.svelte index 08c09d9a464..d0385c99e8d 100644 --- a/packages/desktop/components/popups/VestingRewardsFinderPopup.svelte +++ b/packages/desktop/components/popups/VestingRewardsFinderPopup.svelte @@ -20,8 +20,8 @@ import { truncateString } from '@core/utils' import { formatTokenAmountBestMatch, - generateAndStoreActivitiesForAllAccounts, - refreshAccountAssetsForActiveProfile, + generateAndStoreActivitiesForAllWallets, + refreshWalletAssetsForActiveProfile, } from '@core/wallet' import VirtualList from '@sveltejs/svelte-virtual-list' import { Button, FontWeight, KeyValueBox, Text, TextHint, TextType } from 'shared/components' @@ -97,8 +97,8 @@ onDestroy(async () => { if (hasUsedVestingRewardsFinder) { - await refreshAccountAssetsForActiveProfile() - await generateAndStoreActivitiesForAllAccounts() + await refreshWalletAssetsForActiveProfile() + await generateAndStoreActivitiesForAllWallets() loadNftsForActiveProfile() } }) diff --git a/packages/desktop/components/popups/WalletSwitcherPopup.svelte b/packages/desktop/components/popups/WalletSwitcherPopup.svelte index ffd39cf5291..365c96acae2 100644 --- a/packages/desktop/components/popups/WalletSwitcherPopup.svelte +++ b/packages/desktop/components/popups/WalletSwitcherPopup.svelte @@ -22,10 +22,10 @@ - {localize('popups.deeplinkAccountSwitch.title')} + {localize('popups.deeplinkWalletSwitch.title')}
- {localize('popups.deeplinkAccountSwitch.body')} + {localize('popups.deeplinkWalletSwitch.body')}
diff --git a/packages/desktop/components/popups/send/SendConfirmationPopup.svelte b/packages/desktop/components/popups/send/SendConfirmationPopup.svelte index c6e671a0652..e66a834d4e9 100644 --- a/packages/desktop/components/popups/send/SendConfirmationPopup.svelte +++ b/packages/desktop/components/popups/send/SendConfirmationPopup.svelte @@ -7,7 +7,7 @@ import { checkActiveProfileAuth, isActiveLedgerProfile } from '@core/profile' import { TimePeriod } from '@core/utils' import { sendOutput } from '@core/wallet/actions' - import { TokenStandard } from '@core/wallet/enums' + import { SubjectType, TokenStandard } from '@core/wallet/enums' import { NewTransactionType, newTransactionDetails, updateNewTransactionDetails } from '@core/wallet/stores' import { NewTokenTransactionDetails, NftActivity, TransactionActivity, VestingActivity } from '@core/wallet/types' import { @@ -66,7 +66,7 @@ $: isBaseTokenTransfer = transactionDetails.type === NewTransactionType.TokenTransfer && transactionDetails.asset?.metadata?.standard === TokenStandard.BaseToken - $: isInternal = recipient.type === 'account' + $: isInternal = recipient.type === SubjectType.Wallet $: isLayer2Transaction = !!layer2Parameters $: isTransferring = $selectedWallet.isTransferring $: hideGiftToggle = isBaseTokenTransfer || isLayer2Transaction || (disableToggleGift && !giftStorageDeposit) diff --git a/packages/desktop/features/settings.features.ts b/packages/desktop/features/settings.features.ts index dc83ed8cb4d..5d42fb74ccb 100644 --- a/packages/desktop/features/settings.features.ts +++ b/packages/desktop/features/settings.features.ts @@ -79,7 +79,7 @@ const settingsFeatures: ISettingsFeatures = { balanceFinder: { enabled: true, }, - hiddenAccounts: { + hiddenWallets: { enabled: true, }, developerToggle: { diff --git a/packages/desktop/features/wallet.features.ts b/packages/desktop/features/wallet.features.ts index 46a9b567440..4eb393048ee 100644 --- a/packages/desktop/features/wallet.features.ts +++ b/packages/desktop/features/wallet.features.ts @@ -2,7 +2,7 @@ import { IWalletFeatures } from '@lib/features/interfaces' const walletFeatures: IWalletFeatures = { enabled: true, - accountSummary: { + walletSummary: { enabled: true, }, sendAndReceive: { diff --git a/packages/desktop/views/dashboard/settings/views/advanced/HiddenAccounts.svelte b/packages/desktop/views/dashboard/settings/views/advanced/HiddenAccounts.svelte deleted file mode 100644 index ce386e4fb99..00000000000 --- a/packages/desktop/views/dashboard/settings/views/advanced/HiddenAccounts.svelte +++ /dev/null @@ -1,17 +0,0 @@ - - -{localize('views.settings.hiddenAccounts.title')} -{localize('views.settings.hiddenAccounts.description')} - diff --git a/packages/desktop/views/dashboard/settings/views/advanced/HiddenWallets.svelte b/packages/desktop/views/dashboard/settings/views/advanced/HiddenWallets.svelte new file mode 100644 index 00000000000..4128181daa4 --- /dev/null +++ b/packages/desktop/views/dashboard/settings/views/advanced/HiddenWallets.svelte @@ -0,0 +1,17 @@ + + +{localize('views.settings.hiddenWallets.title')} +{localize('views.settings.hiddenWallets.description')} + diff --git a/packages/desktop/views/dashboard/settings/views/advanced/advanced-settings.constant.js b/packages/desktop/views/dashboard/settings/views/advanced/advanced-settings.constant.js index d1008ec4037..6aa72684b90 100644 --- a/packages/desktop/views/dashboard/settings/views/advanced/advanced-settings.constant.js +++ b/packages/desktop/views/dashboard/settings/views/advanced/advanced-settings.constant.js @@ -1,8 +1,8 @@ -import { BalanceFinder, HiddenAccounts, DeveloperToggle } from '.' +import { BalanceFinder, HiddenWallets, DeveloperToggle } from '.' import { AdvancedSettingsRoute } from '@core/router' export const ADVANCED_SETTINGS = [ { component: BalanceFinder, childRoute: AdvancedSettingsRoute.BalanceFinder, requiresLogin: true }, - { component: HiddenAccounts, childRoute: AdvancedSettingsRoute.HiddenAccounts, requiresLogin: true }, + { component: HiddenWallets, childRoute: AdvancedSettingsRoute.HiddenAccounts, requiresLogin: true }, { component: DeveloperToggle, childRoute: AdvancedSettingsRoute.DeveloperToggle, requiresLogin: true }, ] diff --git a/packages/desktop/views/dashboard/settings/views/advanced/index.js b/packages/desktop/views/dashboard/settings/views/advanced/index.js index 59fd5f7b0fd..801ec3427b8 100644 --- a/packages/desktop/views/dashboard/settings/views/advanced/index.js +++ b/packages/desktop/views/dashboard/settings/views/advanced/index.js @@ -1,5 +1,5 @@ export { default as DeveloperToggle } from './DeveloperToggle.svelte' -export { default as HiddenAccounts } from './HiddenAccounts.svelte' +export { default as HiddenWallets } from './HiddenWallets.svelte' export { default as BalanceFinder } from './BalanceFinder.svelte' export * from './advanced-settings.constant' diff --git a/packages/desktop/views/dashboard/wallet/views/WalletView.svelte b/packages/desktop/views/dashboard/wallet/views/WalletView.svelte index 632cf8adb08..6fa00af8aa0 100644 --- a/packages/desktop/views/dashboard/wallet/views/WalletView.svelte +++ b/packages/desktop/views/dashboard/wallet/views/WalletView.svelte @@ -1,6 +1,6 @@ @@ -11,8 +11,8 @@
- {#if features?.wallet?.accountSummary?.enabled} - + {#if features?.wallet?.walletSummary?.enabled} + {/if} @@ -31,7 +31,7 @@ {#if features?.wallet?.activityHistory?.enabled} - + {/if}
diff --git a/packages/desktop/views/onboarding/views/network-setup/views/CustomNetworkView.svelte b/packages/desktop/views/onboarding/views/network-setup/views/CustomNetworkView.svelte index ca735cb4d2d..90455196fe2 100644 --- a/packages/desktop/views/onboarding/views/network-setup/views/CustomNetworkView.svelte +++ b/packages/desktop/views/onboarding/views/network-setup/views/CustomNetworkView.svelte @@ -43,7 +43,7 @@ updateOnboardingProfile({ clientOptions: { nodes: [node], primaryNode: node } }) await initialiseOnboardingProfile(true) - // The API request to check if a node is reachable requires an existing account manager. + // The API request to check if a node is reachable requires an existing wallet manager. const nodeInfoResponse = await getNodeInfo(node.url) // Check network of node matches selected id if ( diff --git a/packages/shared/components/inputs/RecipientInput.svelte b/packages/shared/components/inputs/RecipientInput.svelte index 80498e5143c..dba8f10260b 100644 --- a/packages/shared/components/inputs/RecipientInput.svelte +++ b/packages/shared/components/inputs/RecipientInput.svelte @@ -7,6 +7,7 @@ import { Layer1RecipientError } from '@core/layer-2/errors' import { getNetworkHrp, getWalletColorById, visibleActiveWallets } from '@core/profile' import { selectedWalletId } from '@core/wallet/stores' + import { SubjectType } from 'shared/lib/core/wallet' export let recipient: Subject export let disabled = false @@ -17,11 +18,11 @@ let error: string let selected: IOption = - recipient?.type === 'account' - ? { key: recipient.account.name, value: recipient.account.depositAddress } + recipient?.type === SubjectType.Wallet + ? { key: recipient.wallet.name, value: recipient.wallet.depositAddress } : { value: recipient?.address } - $: accountOptions = isLayer2 ? [] : getLayer1AccountOptions() + $: walletOptions = isLayer2 ? [] : getLayer1WalletOptions() $: recipient = getSubjectFromAddress(selected?.value) $: isLayer2, (error = '') @@ -37,7 +38,7 @@ } else { validateBech32Address(getNetworkHrp(), recipient?.address) } - } else if (recipient?.type === 'account') { + } else if (recipient?.type === SubjectType.Wallet) { if (isLayer2) { throw new Layer1RecipientError() } @@ -52,7 +53,7 @@ } } - function getLayer1AccountOptions(): IOption[] { + function getLayer1WalletOptions(): IOption[] { return $visibleActiveWallets .filter((wallet) => wallet.id !== $selectedWalletId) .map((wallet) => ({ @@ -70,7 +71,7 @@ bind:modal bind:error {disabled} - options={accountOptions} + options={walletOptions} pickerHeight="max-h-48" {...$$restProps} let:option diff --git a/packages/shared/components/menu-items/ToggleHiddenAccountMenuItem.svelte b/packages/shared/components/menu-items/ToggleHiddenWalletMenuItem.svelte similarity index 71% rename from packages/shared/components/menu-items/ToggleHiddenAccountMenuItem.svelte rename to packages/shared/components/menu-items/ToggleHiddenWalletMenuItem.svelte index d80cffac866..a2a3b5c69e7 100644 --- a/packages/shared/components/menu-items/ToggleHiddenAccountMenuItem.svelte +++ b/packages/shared/components/menu-items/ToggleHiddenWalletMenuItem.svelte @@ -7,24 +7,24 @@ export let onClick: () => unknown - function onShowAccountClick(): void { + function onShowWalletClick(): void { if ($selectedWallet) { updateActiveWalletPersistedData($selectedWallet.id, { hidden: false }) onClick && onClick() } } - function onHideAccountClick(): void { + function onHideWalletClick(): void { if ($nonHiddenActiveWallets.length > 1) { if ($selectedWallet) { updateActiveWalletPersistedData($selectedWallet.id, { hidden: true }) - if (!$activeProfile.showHiddenAccounts) { + if (!$activeProfile.showHiddenWallets) { setNextSelectedWallet() } onClick && onClick() } } else { - console.error('Not enough accounts visible: ', $nonHiddenActiveWallets.length) + console.error('Not enough wallets visible: ', $nonHiddenActiveWallets.length) } } @@ -32,8 +32,8 @@ {#if $selectedWallet} ($selectedWallet.hidden ? onShowAccountClick() : onHideAccountClick())} + title={localize($selectedWallet.hidden ? 'actions.showWallet' : 'actions.hideWallet')} + onClick={() => ($selectedWallet.hidden ? onShowWalletClick() : onHideWalletClick())} disabled={!$selectedWallet.hidden && $nonHiddenActiveWallets.length <= 1} {...$$restProps} /> diff --git a/packages/shared/components/menu-items/index.js b/packages/shared/components/menu-items/index.js index 664fd37c341..370c15a68f3 100644 --- a/packages/shared/components/menu-items/index.js +++ b/packages/shared/components/menu-items/index.js @@ -1,2 +1,2 @@ export { default as WalletSwitcherMenuItem } from './WalletSwitcherMenuItem.svelte' -export { default as ToggleHiddenAccountMenuItem } from './ToggleHiddenAccountMenuItem.svelte' +export { default as ToggleHiddenWalletMenuItem } from './ToggleHiddenWalletMenuItem.svelte' diff --git a/packages/shared/components/tiles/tileContents/NftActivityTileContent.svelte b/packages/shared/components/tiles/tileContents/NftActivityTileContent.svelte index 91582a53fb8..78b998b982c 100644 --- a/packages/shared/components/tiles/tileContents/NftActivityTileContent.svelte +++ b/packages/shared/components/tiles/tileContents/NftActivityTileContent.svelte @@ -13,7 +13,7 @@ activity.direction === ActivityDirection.Incoming || activity.direction === ActivityDirection.SelfTransaction $: action = localize(getActivityTileTitle(activity)) $: subject = localize(isIncoming ? 'general.fromAddress' : 'general.toAddress', { - values: { account: subjectLocale }, + values: { address: subjectLocale }, }) $: formattedAsset = { text: nft?.name ?? '', diff --git a/packages/shared/lib/auxiliary/icon/constants/settings-icon-svg.ts b/packages/shared/lib/auxiliary/icon/constants/settings-icon-svg.ts index 5a5a73d0669..2b7d9f3ceb2 100644 --- a/packages/shared/lib/auxiliary/icon/constants/settings-icon-svg.ts +++ b/packages/shared/lib/auxiliary/icon/constants/settings-icon-svg.ts @@ -31,7 +31,7 @@ export const SETTINGS_ICON_SVG = { [SecuritySettingsRoute.ChangePassword]: Icon.Lock2, [SecuritySettingsRoute.ChangePincode]: Icon.Lock, [AdvancedSettingsRoute.BalanceFinder]: Icon.Reset, - [AdvancedSettingsRoute.HiddenAccounts]: Icon.View, + [AdvancedSettingsRoute.HiddenWallets]: Icon.View, [AdvancedSettingsRoute.DeveloperToggle]: Icon.Dev, [HelpAndInfoRoute.Diagnostics]: Icon.Tools, [HelpAndInfoRoute.ErrorLog]: Icon.Warning, 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 11da53d0e17..15ba39fd236 100644 --- a/packages/shared/lib/auxiliary/popup/enums/popup-id.enum.ts +++ b/packages/shared/lib/auxiliary/popup/enums/popup-id.enum.ts @@ -13,7 +13,7 @@ export enum PopupId { ConnectLedger = 'connectLedger', createWallet = 'createWallet', DeepLinkError = 'deepLinkError', - DeleteAccount = 'deleteAccount', + DeleteWallet = 'deleteWallet', DeleteProfile = 'deleteProfile', Diagnostics = 'diagnostics', EnableLedgerBlindSigning = 'enableLedgerBlindSigning', diff --git a/packages/shared/lib/contexts/governance/actions/registerProposalsFromNodes.ts b/packages/shared/lib/contexts/governance/actions/registerProposalsFromNodes.ts index ef0d50b85ec..759af4c8d7c 100644 --- a/packages/shared/lib/contexts/governance/actions/registerProposalsFromNodes.ts +++ b/packages/shared/lib/contexts/governance/actions/registerProposalsFromNodes.ts @@ -1,13 +1,8 @@ -import { get } from 'svelte/store' - import { IWalletState } from '@core/wallet/interfaces' -import { INode } from '@core/network/interfaces' -import { activeProfile } from '@core/profile/stores' - +import { getActiveProfile } from '@core/profile/stores' import { registerProposalsForWallets } from './registerProposalsForWallets' -// TODO(2.0) FIx this -export async function registerProposalsFromNodes(accounts: IWalletState[], nodes?: INode[]): Promise { - const _nodes = nodes ? nodes : get(activeProfile)?.clientOptions?.nodes - await Promise.all(_nodes.map((node) => registerProposalsForWallets({ node }, accounts))) +export async function registerProposalsFromNodes(wallets: IWalletState[]): Promise { + const nodes = getActiveProfile().clientOptions?.nodes || [] + await Promise.all(nodes.map((node) => registerProposalsForWallets({ node }, wallets))) } diff --git a/packages/shared/lib/contexts/governance/utils/getParticipationsForProposal.ts b/packages/shared/lib/contexts/governance/utils/getParticipationsForProposal.ts index 31b366d607c..d4fae484eac 100644 --- a/packages/shared/lib/contexts/governance/utils/getParticipationsForProposal.ts +++ b/packages/shared/lib/contexts/governance/utils/getParticipationsForProposal.ts @@ -3,10 +3,8 @@ import type { ParticipationOverview, TrackedParticipationOverview } from '@iota/ import { allParticipationOverviews } from '@contexts/governance/stores' import { selectedWalletId } from 'shared/lib/core/wallet' -export function getParticipationsForProposal( - proposalId: string, - walletId = get(selectedWalletId) -): { [outputId: string]: TrackedParticipationOverview } { +export function getParticipationsForProposal(proposalId: string): { [outputId: string]: TrackedParticipationOverview } { + const walletId = get(selectedWalletId) const overview: ParticipationOverview = get(allParticipationOverviews)[walletId] return overview?.participations?.[proposalId] } diff --git a/packages/shared/lib/contexts/governance/utils/isVotingForProposal.ts b/packages/shared/lib/contexts/governance/utils/isVotingForProposal.ts index 8c95e100a8f..90a0dd3639f 100644 --- a/packages/shared/lib/contexts/governance/utils/isVotingForProposal.ts +++ b/packages/shared/lib/contexts/governance/utils/isVotingForProposal.ts @@ -1,10 +1,8 @@ -import { get } from 'svelte/store' import type { TrackedParticipationOverview } from '@iota/sdk/out/types' import { getParticipationsForProposal } from './getParticipationsForProposal' -import { selectedWalletId } from '@core/wallet' -export function isVotingForProposal(proposalId: string, walletId = get(selectedWalletId)): boolean { - const participations = getParticipationsForProposal(proposalId, walletId) ?? {} +export function isVotingForProposal(proposalId: string): boolean { + const participations = getParticipationsForProposal(proposalId) ?? {} const participationOutputs: TrackedParticipationOverview[] = Object.values(participations) return participationOutputs.some((output) => output?.endMilestoneIndex === 0) } diff --git a/packages/shared/lib/contexts/governance/utils/isVotingForSelectedProposal.ts b/packages/shared/lib/contexts/governance/utils/isVotingForSelectedProposal.ts index 461c7e0324c..f7058cbd79e 100644 --- a/packages/shared/lib/contexts/governance/utils/isVotingForSelectedProposal.ts +++ b/packages/shared/lib/contexts/governance/utils/isVotingForSelectedProposal.ts @@ -1,10 +1,8 @@ import { get } from 'svelte/store' - import { selectedProposalId } from '../stores' import { isVotingForProposal } from './isVotingForProposal' -import { selectedWalletId } from '@core/wallet' -export function isVotingForSelectedProposal(walletId = get(selectedWalletId)): boolean { +export function isVotingForSelectedProposal(): boolean { const proposalId = get(selectedProposalId) - return isVotingForProposal(proposalId, walletId) + return isVotingForProposal(proposalId) } diff --git a/packages/shared/lib/core/nfts/utils/index.ts b/packages/shared/lib/core/nfts/utils/index.ts index ea8bd888dc2..d3a959ef871 100644 --- a/packages/shared/lib/core/nfts/utils/index.ts +++ b/packages/shared/lib/core/nfts/utils/index.ts @@ -4,7 +4,7 @@ export * from './composeUrlFromNftUri' export * from './convertAndFormatNftMetadata' export * from './getSpendableStatusFromUnspentNftOutput' export * from './fetchWithTimeout' -export * from './isNftOwnedByAnyAccount' +export * from './isNftOwnedByAnyWallet' export * from './parseNftMetadata' export * from './rewriteIpfsUri' export * from './getParentMimeType' diff --git a/packages/shared/lib/core/nfts/utils/isNftOwnedByAnyAccount.ts b/packages/shared/lib/core/nfts/utils/isNftOwnedByAnyAccount.ts deleted file mode 100644 index 2b30770fdb5..00000000000 --- a/packages/shared/lib/core/nfts/utils/isNftOwnedByAnyAccount.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { get } from 'svelte/store' -import { allWalletNfts } from '../stores' - -export function isNftOwnedByAnyAccount(nftId: string): boolean { - for (const accountNfts of get(allWalletNfts) ?? []) { - const nft = accountNfts.find((nft) => nft.id === nftId) - if (nft?.isSpendable) { - return true - } - } - return false -} diff --git a/packages/shared/lib/core/nfts/utils/isNftOwnedByAnyWallet.ts b/packages/shared/lib/core/nfts/utils/isNftOwnedByAnyWallet.ts new file mode 100644 index 00000000000..9cb16b6468e --- /dev/null +++ b/packages/shared/lib/core/nfts/utils/isNftOwnedByAnyWallet.ts @@ -0,0 +1,12 @@ +import { get } from 'svelte/store' +import { allWalletNfts } from '../stores' + +export function isNftOwnedByAnyWallet(nftId: string): boolean { + for (const walletNfts of Object.values(get(allWalletNfts) ?? {})) { + const nft = walletNfts.find((nft) => nft.id === nftId) + if (nft?.isSpendable) { + return true + } + } + return false +} diff --git a/packages/shared/lib/core/profile/actions/active-profile/checkAndRemoveProfilePicture.ts b/packages/shared/lib/core/profile/actions/active-profile/checkAndRemoveProfilePicture.ts index 8c528c1c6e2..b02b7a4f8ef 100644 --- a/packages/shared/lib/core/profile/actions/active-profile/checkAndRemoveProfilePicture.ts +++ b/packages/shared/lib/core/profile/actions/active-profile/checkAndRemoveProfilePicture.ts @@ -1,11 +1,11 @@ -import { isNftOwnedByAnyAccount } from '@core/nfts/utils' +import { isNftOwnedByAnyWallet } from '@core/nfts/utils' import { activeProfile, updateActiveProfile } from '@core/profile/stores' import { get } from 'svelte/store' export function checkAndRemoveProfilePicture(): void { const _activeProfile = get(activeProfile) if (_activeProfile.pfp) { - const isProfilePictureStillOwned = isNftOwnedByAnyAccount(_activeProfile.pfp.id) + const isProfilePictureStillOwned = isNftOwnedByAnyWallet(_activeProfile.pfp.id) if (!isProfilePictureStillOwned) { updateActiveProfile({ pfp: undefined }) } diff --git a/packages/shared/lib/core/profile/actions/active-accounts/findActiveWalletWithAddress.ts b/packages/shared/lib/core/profile/actions/active-wallet/findActiveWalletWithAddress.ts similarity index 100% rename from packages/shared/lib/core/profile/actions/active-accounts/findActiveWalletWithAddress.ts rename to packages/shared/lib/core/profile/actions/active-wallet/findActiveWalletWithAddress.ts diff --git a/packages/shared/lib/core/profile/actions/active-accounts/getWalletColorById.ts b/packages/shared/lib/core/profile/actions/active-wallet/getWalletColorById.ts similarity index 100% rename from packages/shared/lib/core/profile/actions/active-accounts/getWalletColorById.ts rename to packages/shared/lib/core/profile/actions/active-wallet/getWalletColorById.ts diff --git a/packages/shared/lib/core/profile/actions/active-accounts/index.ts b/packages/shared/lib/core/profile/actions/active-wallet/index.ts similarity index 100% rename from packages/shared/lib/core/profile/actions/active-accounts/index.ts rename to packages/shared/lib/core/profile/actions/active-wallet/index.ts diff --git a/packages/shared/lib/core/profile/actions/active-accounts/updateActiveWalletPersistedData.ts b/packages/shared/lib/core/profile/actions/active-wallet/updateActiveWalletPersistedData.ts similarity index 100% rename from packages/shared/lib/core/profile/actions/active-accounts/updateActiveWalletPersistedData.ts rename to packages/shared/lib/core/profile/actions/active-wallet/updateActiveWalletPersistedData.ts diff --git a/packages/shared/lib/core/profile/actions/index.ts b/packages/shared/lib/core/profile/actions/index.ts index 8c0a1f8d30e..fbfb5c66e78 100644 --- a/packages/shared/lib/core/profile/actions/index.ts +++ b/packages/shared/lib/core/profile/actions/index.ts @@ -5,7 +5,6 @@ export * from './recoverWallets' export * from './clearProfileFromMemory' export * from './deleteWallet' export * from './changePasswordAndUnlockStronghold' - -export * from './active-accounts' +export * from './active-wallet' export * from './active-profile' export * from './profiles' diff --git a/packages/shared/lib/core/profile/constants/initial-active-profile.constant.ts b/packages/shared/lib/core/profile/constants/initial-active-profile.constant.ts index 29fcb2d3064..a30d90f5349 100644 --- a/packages/shared/lib/core/profile/constants/initial-active-profile.constant.ts +++ b/packages/shared/lib/core/profile/constants/initial-active-profile.constant.ts @@ -13,5 +13,5 @@ export const INITIAL_ACTIVE_PROFILE: Partial = { to: string } }>({}), - showHiddenAccounts: false, + showHiddenWallets: false, } diff --git a/packages/shared/lib/core/profile/interfaces/profile.interface.ts b/packages/shared/lib/core/profile/interfaces/profile.interface.ts index d2842936271..66bc58aab04 100644 --- a/packages/shared/lib/core/profile/interfaces/profile.interface.ts +++ b/packages/shared/lib/core/profile/interfaces/profile.interface.ts @@ -13,5 +13,5 @@ export interface IProfile extends IPersistedProfile { }> loggedIn: Writable lastActiveAt: Writable - showHiddenAccounts: boolean + showHiddenWallets: boolean } diff --git a/packages/shared/lib/core/profile/stores/active-wallets.store.ts b/packages/shared/lib/core/profile/stores/active-wallets.store.ts index 19d6379e070..4b1b566860d 100644 --- a/packages/shared/lib/core/profile/stores/active-wallets.store.ts +++ b/packages/shared/lib/core/profile/stores/active-wallets.store.ts @@ -33,7 +33,7 @@ export const visibleActiveWallets: Readable = derived( return [] } const unsortedVisiblewallets = - $activeProfile?.showHiddenAccounts ?? false + $activeProfile?.showHiddenWallets ?? false ? $activeWallets : $activeWallets?.filter((wallet) => !wallet?.hidden) return unsortedVisiblewallets // TODO(2.0): Sort them: .sort((a, b) => a.index - b.index) diff --git a/packages/shared/lib/core/router/enums/settings/advanced-settings-route.enum.ts b/packages/shared/lib/core/router/enums/settings/advanced-settings-route.enum.ts index eb30fbdfd60..d716495bdf5 100644 --- a/packages/shared/lib/core/router/enums/settings/advanced-settings-route.enum.ts +++ b/packages/shared/lib/core/router/enums/settings/advanced-settings-route.enum.ts @@ -1,5 +1,5 @@ export enum AdvancedSettingsRoute { BalanceFinder = 'balanceFinder', - HiddenAccounts = 'hiddenAccounts', + HiddenWallets = 'hiddenWallets', DeveloperToggle = 'developerToggle', } diff --git a/packages/shared/lib/core/wallet/actions/consolidateOutputs.ts b/packages/shared/lib/core/wallet/actions/consolidateOutputs.ts index f1a4eb7db28..8595d870ffd 100644 --- a/packages/shared/lib/core/wallet/actions/consolidateOutputs.ts +++ b/packages/shared/lib/core/wallet/actions/consolidateOutputs.ts @@ -5,9 +5,9 @@ import { processAndAddToActivities } from '../utils' import { plainToInstance } from 'class-transformer' import { updateActiveWallet } from '@core/profile' -export async function consolidateOutputs(accountToConsolidate?: IWalletState): Promise { - const wallet = accountToConsolidate || getSelectedWallet() - if (!wallet) return Promise.reject('No account selected') +export async function consolidateOutputs(walletToConsolidate?: IWalletState): Promise { + const wallet = walletToConsolidate || getSelectedWallet() + if (!wallet) return Promise.reject('No wallet selected') try { updateActiveWallet(wallet.id, { hasConsolidatingOutputsTransactionInProgress: true, isTransferring: true }) diff --git a/packages/shared/lib/core/wallet/utils/generateActivity/generateSingleConsolidationActivity.ts b/packages/shared/lib/core/wallet/utils/generateActivity/generateSingleConsolidationActivity.ts index c0959a4009e..886347d457d 100644 --- a/packages/shared/lib/core/wallet/utils/generateActivity/generateSingleConsolidationActivity.ts +++ b/packages/shared/lib/core/wallet/utils/generateActivity/generateSingleConsolidationActivity.ts @@ -20,7 +20,7 @@ export async function generateSingleConsolidationActivity( const isHidden = false const isAssetHidden = false - const containsValue = await activityOutputContainsValue(account, wrappedOutput) + const containsValue = await activityOutputContainsValue(wallet, wrappedOutput) const outputId = wrappedOutput.outputId const id = outputId || transactionId @@ -32,10 +32,10 @@ export async function generateSingleConsolidationActivity( const tag = getTagFromOutput(output) const metadata = getMetadataFromOutput(output) - const sendingInfo = getSendingInformation(processedTransaction, output, account) - const asyncData = await getAsyncDataFromOutput(output, outputId, claimingData, account) + const sendingInfo = getSendingInformation(processedTransaction, output, wallet) + const asyncData = await getAsyncDataFromOutput(output, outputId, claimingData, wallet) - const { storageDeposit, giftedStorageDeposit } = await getStorageDepositFromOutput(account, output) + const { storageDeposit, giftedStorageDeposit } = await getStorageDepositFromOutput(wallet, output) return { type: ActivityType.Consolidation, isHidden, diff --git a/packages/shared/lib/core/wallet/utils/generateActivity/generateSingleGovernanceActivity.ts b/packages/shared/lib/core/wallet/utils/generateActivity/generateSingleGovernanceActivity.ts index 973e6adc094..8b9b55db578 100644 --- a/packages/shared/lib/core/wallet/utils/generateActivity/generateSingleGovernanceActivity.ts +++ b/packages/shared/lib/core/wallet/utils/generateActivity/generateSingleGovernanceActivity.ts @@ -21,7 +21,7 @@ export async function generateSingleGovernanceActivity( const isHidden = false const isAssetHidden = false - const containsValue = await activityOutputContainsValue(account, wrappedOutput) + const containsValue = await activityOutputContainsValue(wallet, wrappedOutput) const outputId = wrappedOutput.outputId const id = outputId || transactionId @@ -31,9 +31,9 @@ export async function generateSingleGovernanceActivity( const tag = getTagFromOutput(output) const metadata = getMetadataFromOutput(output) - const sendingInfo = getSendingInformation(processedTransaction, output, account) + const sendingInfo = getSendingInformation(processedTransaction, output, wallet) - const { storageDeposit } = await getStorageDepositFromOutput(account, output) + const { storageDeposit } = await getStorageDepositFromOutput(wallet, output) const votingPower = getAmountFromOutput(output) const governanceInfo = getGovernanceInfo(output, wrappedInputs, metadata) diff --git a/packages/shared/lib/core/wallet/utils/generateActivity/generateVestingActivity.ts b/packages/shared/lib/core/wallet/utils/generateActivity/generateVestingActivity.ts index 21c142d6fd6..4f548995571 100644 --- a/packages/shared/lib/core/wallet/utils/generateActivity/generateVestingActivity.ts +++ b/packages/shared/lib/core/wallet/utils/generateActivity/generateVestingActivity.ts @@ -23,7 +23,7 @@ export async function generateVestingActivity( const isHidden = false const isAssetHidden = false - const containsValue = await activityOutputContainsValue(account, wrappedOutput) + const containsValue = await activityOutputContainsValue(wallet, wrappedOutput) const outputId = wrappedOutput.outputId const id = outputId || transactionId @@ -33,12 +33,12 @@ export async function generateVestingActivity( const tag = getTagFromOutput(output) const metadata = getMetadataFromOutput(output) - const sendingInfo = getSendingInformation(processedTransaction, output, account) - const asyncData = await getAsyncDataFromOutput(output, outputId, claimingData, account) + const sendingInfo = getSendingInformation(processedTransaction, output, wallet) + const asyncData = await getAsyncDataFromOutput(output, outputId, claimingData, wallet) const { parsedLayer2Metadata, destinationNetwork } = getLayer2ActivityInformation(metadata, sendingInfo) - const { storageDeposit, giftedStorageDeposit } = await getStorageDepositFromOutput(account, output) + const { storageDeposit, giftedStorageDeposit } = await getStorageDepositFromOutput(wallet, output) const rawAmount = getAmountFromOutput(output) - storageDeposit const assetId = getCoinType() diff --git a/packages/shared/lib/core/wallet/utils/transactions/getDirectionFromOutgoingTransaction.ts b/packages/shared/lib/core/wallet/utils/transactions/getDirectionFromOutgoingTransaction.ts index 74a71a83cc1..6182044ba1a 100644 --- a/packages/shared/lib/core/wallet/utils/transactions/getDirectionFromOutgoingTransaction.ts +++ b/packages/shared/lib/core/wallet/utils/transactions/getDirectionFromOutgoingTransaction.ts @@ -13,6 +13,6 @@ export function getDirectionFromOutgoingTransaction( return walletDepositAddress !== outputRecipient }) - // If there is any output not destined for the account, it's an outgoing transaction. + // If there is any output not destined for the wallet, it's an outgoing transaction. return containsNonWalletRecipient ? ActivityDirection.Outgoing : ActivityDirection.SelfTransaction } diff --git a/packages/shared/lib/core/wallet/utils/transactions/getSenderFromTransaction.ts b/packages/shared/lib/core/wallet/utils/transactions/getSenderFromTransaction.ts index 4de7c6b7924..2ac2f52b562 100644 --- a/packages/shared/lib/core/wallet/utils/transactions/getSenderFromTransaction.ts +++ b/packages/shared/lib/core/wallet/utils/transactions/getSenderFromTransaction.ts @@ -5,12 +5,12 @@ import { SubjectType } from '@core/wallet/enums' export function getSenderFromTransaction( isIncoming: boolean, - accountAddress: string, + walletAddress: string, output: CommonOutput ): Subject | undefined { if (isIncoming) { return getSenderFromOutput(output) } else { - return { type: SubjectType.Address, address: accountAddress } + return { type: SubjectType.Address, address: walletAddress } } } diff --git a/packages/shared/lib/features/interfaces/settings-features.interface.ts b/packages/shared/lib/features/interfaces/settings-features.interface.ts index 0caa6800a69..c1f6c0da6af 100644 --- a/packages/shared/lib/features/interfaces/settings-features.interface.ts +++ b/packages/shared/lib/features/interfaces/settings-features.interface.ts @@ -36,7 +36,7 @@ interface INetworkSettingsFeatures extends IFeatureFlag { interface IAdvancedSettingsFeatures extends IFeatureFlag { balanceFinder: IFeatureFlag - hiddenAccounts: IFeatureFlag + hiddenWallets: IFeatureFlag developerToggle: IFeatureFlag } diff --git a/packages/shared/lib/features/interfaces/wallet-features.interface.ts b/packages/shared/lib/features/interfaces/wallet-features.interface.ts index 3a321800586..d00242a47d0 100644 --- a/packages/shared/lib/features/interfaces/wallet-features.interface.ts +++ b/packages/shared/lib/features/interfaces/wallet-features.interface.ts @@ -1,7 +1,7 @@ import { IFeatureFlag } from './feature-flag.interface' export interface IWalletFeatures extends IFeatureFlag { - accountSummary: IFeatureFlag + walletSummary: IFeatureFlag sendAndReceive: IFeatureFlag & { nft: IFeatureFlag } diff --git a/packages/shared/lib/tests/__mocks__/account-balance.mock.ts b/packages/shared/lib/tests/__mocks__/wallet-balance.mock.ts similarity index 71% rename from packages/shared/lib/tests/__mocks__/account-balance.mock.ts rename to packages/shared/lib/tests/__mocks__/wallet-balance.mock.ts index 236adf76b2d..cfc5c6a00a8 100644 --- a/packages/shared/lib/tests/__mocks__/account-balance.mock.ts +++ b/packages/shared/lib/tests/__mocks__/wallet-balance.mock.ts @@ -1,20 +1,22 @@ import { Balance } from '@iota/sdk/out/types' -export const MOCK_ACCOUNT_BALANCE: Balance = { +export const MOCK_WALLET_BALANCE: Balance = { baseCoin: { total: BigInt('10000'), available: BigInt('9000'), votingPower: '0', }, - aliases: [], foundries: [], nativeTokens: [], nfts: [], potentiallyLockedOutputs: {}, + accounts: [], + delegations: [], requiredStorageDeposit: { - alias: BigInt('0'), basic: BigInt('0'), foundry: BigInt('0'), nft: BigInt('0'), + account: BigInt('0'), + delegation: BigInt('0'), }, } diff --git a/packages/shared/lib/tests/__mocks__/wallet.mock.ts b/packages/shared/lib/tests/__mocks__/wallet.mock.ts index 14cd5dcbce7..8f7fea18e16 100644 --- a/packages/shared/lib/tests/__mocks__/wallet.mock.ts +++ b/packages/shared/lib/tests/__mocks__/wallet.mock.ts @@ -27,7 +27,7 @@ import { } from '@iota/sdk/out/types' import { IWallet } from '../../core/profile/interfaces' -import { MOCK_ACCOUNT_BALANCE } from './account-balance.mock' +import { MOCK_WALLET_BALANCE } from './wallet-balance.mock' export class WalletMock implements Partial { public id: string @@ -93,7 +93,7 @@ export class WalletMock implements Partial { } getBalance(): Promise { - return Promise.resolve(MOCK_ACCOUNT_BALANCE) + return Promise.resolve(MOCK_WALLET_BALANCE) } getIncomingTransaction(transactionId: string): Promise { diff --git a/packages/shared/locales/en.json b/packages/shared/locales/en.json index fb3422ef4f8..c559957271c 100644 --- a/packages/shared/locales/en.json +++ b/packages/shared/locales/en.json @@ -348,7 +348,7 @@ "title": "Balance finder", "description": "Perform an extended search of your balance" }, - "hiddenAccounts": { + "hiddenWallets": { "title": "Hidden wallets", "description": "Selecting this options will show wallets that were previously hidden" }, @@ -818,7 +818,7 @@ "title": "Backup your stronghold file", "body": "It is important to back up your wallet regularly to ensure you have a copy of your wallets and transaction history. If you lose your backup and recovery phrase you will lose access to your funds." }, - "deeplinkAccountSwitch": { + "deeplinkWalletSwitch": { "title": "Select a wallet", "body": "You just followed a deep link. Please select the wallet with which you want to continue." }, @@ -826,7 +826,7 @@ "title": "Failed link", "body": "This link failed or is invalid. Please try again or double check the source of the link." }, - "deleteAccount": { + "showDeleteWallet": { "title": "Delete {name}?", "body": "Are you sure you want to delete this wallet?", "hint": "Note: once deleted, you can restore this wallet by using the \"Wallet Finder\" in the settings.", @@ -1191,7 +1191,7 @@ "addProposal": { "title": "Add proposal", "body": "Please provide the information listed below to add a proposal.", - "addToAllAccounts": "Add the proposal to all accounts" + "addToAllWallets": "Add the proposal to all wallets" }, "editProposal": { "title": "Edit proposal", @@ -1341,9 +1341,9 @@ "refresh": "Refresh", "saveBackup": "Save Stronghold backup", "customizeAcount": "Customise wallet", - "hideAccount": "Hide wallet", - "showAccount": "Unhide wallet", - "deleteAccount": "Delete wallet", + "hideWallet": "Hide wallet", + "showWallet": "Unhide wallet", + "showDeleteWallet": "Delete wallet", "max": "Max", "addNode": "Add node", "addingNode": "Adding node", @@ -1383,7 +1383,7 @@ "viewAddressHistory": "View address history", "viewBalanceBreakdown": "View balance breakdown", "verifyDepositAddress": "Verify deposit address", - "showHiddenAccounts": "Show hidden wallets", + "showHiddenWallets": "Show hidden wallets", "confirm": "Confirm", "hideNetworkStatistics": "Hide network statistics", "findWallets": "Find wallets", @@ -1610,12 +1610,8 @@ "creatingProfile": "Creating profile, please wait...", "fundMigration": "Fund migration", "accountRemoved": "This wallet is hidden. Unhide it to perform transfers.", - "fromAddress": "from {account}", - "toAddress": "to {account}", - "stakedFor": "Staked for {account}", - "unstakedFor": "Unstaked for {account}", - "votedFor": "Voted for {account}", - "unvotedFor": "Unvoted for {account}", + "fromAddress": "from {address}", + "toAddress": "to {address}", "stakingTransaction": "Staking Transaction", "unstakingTransaction": "Unstaking Transaction", "legacyNetwork": "Legacy Network", @@ -1632,7 +1628,7 @@ "notStaked": "Not staked", "stakedFunds": "Staked funds", "unstakedFunds": "Unstaked funds", - "accountColor": "Wallet color", + "walletColor": "Wallet color", "transactionTime": "Transaction time", "surplus": "Surplus", "storageDeposit": "Storage deposit",