Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update account to wallet in locales #7961

Merged
merged 62 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
0e58e1a
refactor(2.0): Dynamic password
marc2332 Dec 21, 2023
2b25b9b
refactor(2.0): Remove Profile Manager (wip)
marc2332 Dec 22, 2023
027b69d
clean up and fix
marc2332 Dec 22, 2023
4bf970b
clean up
marc2332 Dec 22, 2023
d5f50d5
Merge branch 'refactor/dynamic-password' into refactor/remove-profile…
marc2332 Dec 22, 2023
a5a8969
clean up more code
marc2332 Dec 22, 2023
628f376
clean up
marc2332 Jan 8, 2024
60c6836
adapt and remove for profile-manager related code
marc2332 Jan 9, 2024
cc59db7
clean up more code
marc2332 Jan 10, 2024
3080203
fmt
marc2332 Jan 10, 2024
7457f42
Merge branch 'develop-iota2.0' into refactor/dynamic-password
marc2332 Jan 10, 2024
cff2fa6
more cleanup
marc2332 Jan 10, 2024
064d8c5
more cleanup
marc2332 Jan 11, 2024
10105c0
small tweaks
marc2332 Jan 12, 2024
38b7c9b
more cleanup
marc2332 Jan 15, 2024
3a885f6
Merge branch 'develop-iota2.0' into refactor/dynamic-password
marc2332 Jan 15, 2024
071bffc
format
marc2332 Jan 15, 2024
8445a28
Merge branch 'refactor/dynamic-password' into refactor/remove-profile…
marc2332 Jan 15, 2024
df286ea
Merge branch 'develop-iota2.0' into refactor/dynamic-password
begonaalvarezd Jan 16, 2024
67eba8c
update
marc2332 Jan 16, 2024
f8ba63f
clean up
marc2332 Jan 16, 2024
63e6125
Merge branch 'refactor/dynamic-password' into refactor/remove-profile…
marc2332 Jan 16, 2024
5f2a5fd
Merge branch 'develop-iota2.0' into refactor/remove-profile-manager
marc2332 Jan 16, 2024
c5d653d
resolve conflicts and clean up other stuff
marc2332 Jan 17, 2024
f5acc83
https://api.testnet.shimmer.network
marc2332 Jan 17, 2024
84b875f
revert Wallet.svelte
marc2332 Jan 17, 2024
71e06b9
clean up
marc2332 Jan 17, 2024
4cf6327
remove account debris
marc2332 Jan 18, 2024
e4a884e
resolve conflicts
marc2332 Jan 29, 2024
6ecfa1d
feat: Profile-centric file scheme for wallets
marc2332 Jan 29, 2024
ecb5fa1
chore: Clean up 2.0 comments
marc2332 Jan 29, 2024
7637dbb
more
marc2332 Jan 29, 2024
73779d8
more
marc2332 Jan 29, 2024
3673d25
more
marc2332 Jan 29, 2024
1d645e4
Merge branch 'chore/clean-up-2.0-comments' into feat/profile-centric-…
marc2332 Jan 30, 2024
6e8dcd5
works
marc2332 Jan 30, 2024
72383a7
clean up
marc2332 Jan 31, 2024
d4dc55c
clean up
marc2332 Jan 31, 2024
599a98f
clean up
marc2332 Jan 31, 2024
bb26153
Merge branch 'chore/clean-up-2.0-comments' of https://github.com/iota…
marc2332 Jan 31, 2024
c994e77
chore: Simplify path management
marc2332 Jan 31, 2024
52c1e02
fmt
marc2332 Jan 31, 2024
e901a40
chore: Adapt to sdk changes
marc2332 Jan 31, 2024
2cb0e27
Merge branch 'chore/adapt-to-sdk-changes' into chore/simplify-path-ma…
marc2332 Jan 31, 2024
e2e2ae1
Merge branch 'chore/clean-up-2.0-comments' into chore/adapt-to-sdk-ch…
marc2332 Jan 31, 2024
1b19967
Merge branch 'chore/adapt-to-sdk-changes' into chore/simplify-path-ma…
marc2332 Jan 31, 2024
7d8912f
Merge branch 'chore/adapt-to-sdk-changes' into feat/profile-centric-w…
marc2332 Jan 31, 2024
9b8bc3e
Merge branch 'feat/profile-centric-wallet-file-scheme' into chore/sim…
marc2332 Jan 31, 2024
c87689b
Merge branch 'refactor/remove-account-debris' into chore/clean-up-2.0…
marc2332 Jan 31, 2024
f9cf60e
Merge branch 'chore/clean-up-2.0-comments' into chore/adapt-to-sdk-ch…
marc2332 Jan 31, 2024
442cfbd
fmt
marc2332 Jan 31, 2024
dbd8405
Merge branch 'chore/adapt-to-sdk-changes' into feat/profile-centric-w…
marc2332 Jan 31, 2024
6aa8dde
Merge branch 'feat/profile-centric-wallet-file-scheme' into chore/sim…
marc2332 Jan 31, 2024
57c779c
clean up
marc2332 Jan 31, 2024
ce1b12c
feat: Update account to wallet locales and remove unused
marc2332 Feb 1, 2024
6af1c4f
let's do this in another PR
marc2332 Feb 1, 2024
e36facb
resolve conflicts
marc2332 Feb 2, 2024
f26de9b
Merge branch 'develop-iota2.0' into chore/simplify-path-management
marc2332 Feb 5, 2024
9327391
clean up
marc2332 Feb 6, 2024
b283437
Merge branch 'chore/simplify-path-management' into feat/update-accoun…
begonaalvarezd Feb 6, 2024
f5b4f05
resolve conflicts
marc2332 Feb 7, 2024
3299dd3
Merge branch 'develop-iota2.0' into feat/update-account-to-wallet-loc…
begonaalvarezd Feb 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { AccountActionsButton } from '@components'
import { WalletActionsButton } from '@components'
import { Text, TogglableAssetBalanceLabel } from '@ui'
import { TextType } from '@ui/enums'

Expand All @@ -16,14 +16,14 @@
$: ({ baseCoin } = $selectedWalletAssets[$activeProfile?.network.id])
</script>

<account-summary class="block relative space-y-4">
<wallet-summary class="block relative space-y-4">
<div class="flex flex-row items-center justify-between">
<Text type={TextType.h5} classes="text-left">
{localize('general.balanceWithNetwork', { values: { network: fomattedNetworkName } })}
</Text>
<AccountActionsButton />
<WalletActionsButton />
</div>
<div class="flex flex-col flex-wrap items-start space-y-1">
<TogglableAssetBalanceLabel asset={baseCoin} />
</div>
</account-summary>
</wallet-summary>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
let modal: Modal
</script>

<account-actions-button class="block relative">
<wallet-actions-button class="block relative">
<MeatballMenuButton onClick={modal?.toggle} />
<WalletActionsMenu bind:modal position={{ right: '0' }} classes="mt-1.5" />
</account-actions-button>
</wallet-actions-button>
2 changes: 1 addition & 1 deletion packages/desktop/components/buttons/menu-buttons/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default as AccountActionsButton } from './AccountActionsButton.svelte'
export { default as WalletActionsButton } from './WalletActionsButton.svelte'
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
4 changes: 2 additions & 2 deletions packages/desktop/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions packages/desktop/components/modals/VestingModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
</script>

<Modal bind:this={modal} {...$$restProps}>
<account-actions-menu class="flex flex-col">
<vesting-modal class="flex flex-col">
<MenuItem
icon={Icon.Search}
title={localize('actions.viewVestingRewardsFinder')}
onClick={onVestingFinderClick}
/>
</account-actions-menu>
</vesting-modal>
</Modal>
26 changes: 13 additions & 13 deletions packages/desktop/components/modals/WalletActionsMenu.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { MenuItem, MenuItemVariant, Modal, ToggleHiddenAccountMenuItem } from '@ui'
import { MenuItem, MenuItemVariant, Modal, ToggleHiddenWalletMenuItem } from '@ui'

import { localize } from '@core/i18n'
import { activeProfile, isActiveLedgerProfile } from '@core/profile/stores'
Expand All @@ -16,10 +16,10 @@

export let modal: Modal = undefined

const showDeleteAccount = false // TODO(2.0) It doesn't make sense to allow removing
const showDeleteWallet = false // TODO(2.0) It doesn't make sense to allow removing
// the wallet as there is only one for each profile at the moment

function onCustomiseAccountClick(): void {
function onCustomiseWalletClick(): void {
openPopup({ id: PopupId.ManageWallet })
modal?.close()
}
Expand Down Expand Up @@ -60,11 +60,11 @@
})
}

function onDeleteAccountClick(): void {
function onDeleteWalletClick(): void {
openPopup({
id: PopupId.DeleteAccount,
id: PopupId.DeleteWallet,
props: {
account: selectedWallet,
wallet: selectedWallet,
deleteWallet,
},
})
Expand All @@ -73,7 +73,7 @@
</script>

<Modal bind:this={modal} {...$$restProps}>
<account-actions-menu class="flex flex-col">
<wallet-actions-menu class="flex flex-col">
<MenuItem icon={Icon.Doc} title={localize('actions.viewBalanceBreakdown')} onClick={onViewBalanceClick} />
{#if $activeProfile?.network?.id === NetworkId.Iota || $activeProfile?.network?.id === NetworkId.IotaAlphanet}
<MenuItem
Expand All @@ -82,23 +82,23 @@
onClick={onViewAddressHistoryClick}
/>
{/if}
<MenuItem icon={Icon.Customize} title={localize('actions.customizeAcount')} onClick={onCustomiseAccountClick} />
<MenuItem icon={Icon.Customize} title={localize('actions.customizeAcount')} onClick={onCustomiseWalletClick} />
{#if $isActiveLedgerProfile}
<MenuItem
icon={Icon.Ledger}
title={localize('actions.verifyDepositAddress')}
onClick={onVerifyAddressClick}
/>
{/if}
<ToggleHiddenAccountMenuItem onClick={modal?.close} />
<ToggleHiddenWalletMenuItem onClick={modal?.close} />
<hr />
{#if showDeleteAccount}
{#if showDeleteWallet}
<MenuItem
icon={Icon.Delete}
title={localize('actions.deleteAccount')}
onClick={onDeleteAccountClick}
title={localize('actions.showDeleteWallet')}
onClick={onDeleteWalletClick}
variant={MenuItemVariant.Error}
/>
{/if}
</account-actions-menu>
</wallet-actions-menu>
</Modal>
12 changes: 6 additions & 6 deletions packages/desktop/components/modals/WalletSwitcherModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

async function scrollToSelectedWallet(): Promise<void> {
await tick()
const element = document.getElementById(`account-${$selectedWallet.id}`)
const element = document.getElementById(`wallet-${$selectedWallet.id}`)
element?.scrollIntoView({ behavior: 'auto' })
}

Expand All @@ -34,13 +34,13 @@
size="large"
position={{ top: '30px', left: '50%' }}
>
<account-list-container class="block p-4">
<account-list class="flex flex-col space-y-1 max-h-96 scrollable-y">
<wallet-list-container class="block p-4">
<wallet-list class="flex flex-col space-y-1 max-h-96 scrollable-y">
{#each $visibleActiveWallets as wallet}
<WalletSwitcherMenuItem id="account-{wallet.id}" {wallet} onClick={modal?.close} />
<WalletSwitcherMenuItem id="wallet-{wallet.id}" {wallet} onClick={modal?.close} />
{/each}
</account-list>
</account-list-container>
</wallet-list>
</wallet-list-container>
<hr />
<button
type="button"
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/components/popups/AddProposalPopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
label={localize('views.governance.details.proposalInformation.eventId')}
/>
{#if !isEditMode}
<Checkbox label={localize('popups.addProposal.addToAllAccounts')} bind:checked={isAddingForAllWallets} />
<Checkbox label={localize('popups.addProposal.addToAllWallets')} bind:checked={isAddingForAllWallets} />
{/if}
</div>
<div class="flex w-full space-x-4 mt-6">
Expand Down
14 changes: 7 additions & 7 deletions packages/desktop/components/popups/BalanceBreakdownPopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
Timelock = 'timelock',
}

$: accountBalance = $selectedWallet?.balances
$: accountBalance, void setBreakdown()
$: walletBalance = $selectedWallet?.balances
$: walletBalance, void setBreakdown()

let breakdown: { [key: string]: BalanceBreakdown } = {}

Expand All @@ -44,14 +44,14 @@
}

function getAvailableBreakdown(): BalanceBreakdown {
return { amount: Number(accountBalance?.baseCoin?.available ?? 0) }
return { amount: Number(walletBalance?.baseCoin?.available ?? 0) }
}

async function getPendingBreakdown(): Promise<BalanceBreakdown> {
let pendingOutputsStorageDeposit = 0

const subBreakdown = {}
for (const [outputId, unlocked] of Object.entries(accountBalance?.potentiallyLockedOutputs ?? {})) {
for (const [outputId, unlocked] of Object.entries(walletBalance?.potentiallyLockedOutputs ?? {})) {
if (!unlocked) {
const output = (await $selectedWallet.getOutput(outputId)).output

Expand Down Expand Up @@ -100,9 +100,9 @@
}

function getStorageDepositBreakdown(): BalanceBreakdown {
const storageDeposits = accountBalance?.requiredStorageDeposit
const storageDeposits = walletBalance?.requiredStorageDeposit
const totalStorageDeposit = storageDeposits
? Object.values(accountBalance.requiredStorageDeposit).reduce(
? Object.values(walletBalance.requiredStorageDeposit).reduce(
(total: number, value: string): number => total + Number(value ?? 0),
0
)
Expand Down Expand Up @@ -161,7 +161,7 @@
subBreakdown={breakdown[breakdownKey].subBreakdown}
/>
{/each}
<BalanceSummarySection titleKey="totalBalance" amount={Number(accountBalance?.baseCoin?.total ?? 0)} bold />
<BalanceSummarySection titleKey="totalBalance" amount={Number(walletBalance?.baseCoin?.total ?? 0)} bold />
</div>
<Button onClick={onConsolidationClick}>
{localize('popups.balanceBreakdown.minimizeStorageDepositButton')}
Expand Down
24 changes: 12 additions & 12 deletions packages/desktop/components/popups/BalanceFinderPopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
} from '@core/profile'
import {
formatTokenAmountBestMatch,
generateAndStoreActivitiesForAllAccounts,
refreshAccountAssetsForActiveProfile,
generateAndStoreActivitiesForAllWallets,
refreshWalletAssetsForActiveProfile,
} from '@core/wallet'
import {
Button,
Expand All @@ -41,7 +41,7 @@
export let searchForBalancesOnLoad = false
export let hasUsedBalanceFinder = false
export let showConsolidation = false
export let consolidateAccountsOnLoad = false
export let consolidateWalletsOnLoad = false
export let title: string
export let body: string
export let searchInCurrentWallet: boolean = false
Expand All @@ -59,7 +59,7 @@
? $visibleActiveWallets?.filter((_wallet) => _wallet.id === $selectedWalletId)
: $visibleActiveWallets
$: searchForBalancesOnLoad && !$isStrongholdLocked && onFindBalancesClick()
$: consolidateAccountsOnLoad && !$isStrongholdLocked && onConsolidateAccountsClick()
$: consolidateWalletsOnLoad && !$isStrongholdLocked && onConsolidateWalletsClick()
$: totalBalance = sumBalanceForWallets($visibleActiveWallets)
$: searchInCurrentWallet, (shouldInitSearch = true)
$: searchAlgorithm = searchInCurrentWallet
Expand All @@ -79,11 +79,11 @@
}
}

async function onConsolidateAccountsClick(): Promise<void> {
async function onConsolidateWalletsClick(): Promise<void> {
if ($isSoftwareProfile && $isStrongholdLocked) {
openUnlockStrongholdPopup(false, true)
} else {
await handleAction(consolidateProfileAccounts)
await handleAction(consolidateProfileWallets)
}
}

Expand All @@ -99,7 +99,7 @@
shouldInitSearch = false
}

async function consolidateProfileAccounts(): Promise<void> {
async function consolidateProfileWallets(): Promise<void> {
const consolidationPromises: Promise<void>[] = []

for (const wallet of get(visibleActiveWallets)) {
Expand Down Expand Up @@ -134,7 +134,7 @@
}
}

function openUnlockStrongholdPopup(searchForBalancesOnLoad: boolean, consolidateAccountsOnLoad: boolean) {
function openUnlockStrongholdPopup(searchForBalancesOnLoad: boolean, consolidateWalletsOnLoad: boolean) {
openPopup({
id: PopupId.UnlockStronghold,
props: {
Expand All @@ -143,7 +143,7 @@
id: PopupId.BalanceFinder,
props: {
searchForBalancesOnLoad,
consolidateAccountsOnLoad,
consolidateWalletsOnLoad,
showConsolidation,
hasUsedBalanceFinder,
title,
Expand Down Expand Up @@ -172,8 +172,8 @@

onDestroy(async () => {
if (hasUsedBalanceFinder) {
await refreshAccountAssetsForActiveProfile()
await generateAndStoreActivitiesForAllAccounts()
await refreshWalletAssetsForActiveProfile()
await generateAndStoreActivitiesForAllWallets()
loadNftsForActiveProfile()
}
})
Expand Down Expand Up @@ -252,7 +252,7 @@
/>
<Button
classes="w-full"
onClick={onConsolidateAccountsClick}
onClick={onConsolidateWalletsClick}
disabled={isBusy || isTransferring}
isBusy={isTransferring}
busyMessage={localize('popups.minimizeStorageDeposit.title')}
Expand Down
Loading
Loading