Skip to content

Commit e5f75c4

Browse files
committed
:godmode:
1 parent 86b3f24 commit e5f75c4

File tree

93 files changed

+249
-251
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+249
-251
lines changed

docs/specifications/activities/class-diagram.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ classDiagram
6363
class Subject {
6464
- type: "address" | "account"
6565
- address?: string
66-
- account?: IAccountState
66+
- account?: IWalletState
6767
}
6868
class Activity Direction {
6969
<<Enum>>

packages/desktop/components/ProposalsDetails.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
4343
async function setParticipationOverview(): Promise<void> {
4444
if (!isOverviewLoaded || getNumberOfVotedProposals() === 0) {
45-
await updateParticipationOverview($selectedWallet.index)
45+
await updateParticipationOverview($selectedWallet.id)
4646
}
4747
}
4848

packages/desktop/components/popups/AddProposalPopup.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
nodeInput?.validate(),
4040
])
4141
await registerParticipationWrapper()
42-
updateActiveAccountPersistedData($selectedWallet.index, {
42+
updateActiveAccountPersistedData($selectedWallet.id, {
4343
removedProposalIds: $selectedWallet.removedProposalIds?.filter((id) => id !== inputtedEventId),
4444
})
4545
isBusy = false

packages/desktop/components/popups/ManageVotingPowerPopup.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
try {
4747
await assetAmountInput?.validate(true)
4848
49-
if (amount === '0' && isWalletVoting($selectedWallet.index)) {
49+
if (amount === '0' && isWalletVoting($selectedWallet.id)) {
5050
openPopup({ id: PopupId.VotingPowerToZero })
5151
return
5252
}

packages/desktop/components/popups/MintNativeTokenConfirmationPopup.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
import { closePopup, openPopup, PopupId } from '@auxiliary/popup'
1414
import { Button, KeyValueBox, Text, FontWeight, TextType } from 'shared/components'
1515
import { onMount } from 'svelte'
16-
import { getClient } from '@core/profile-manager'
1716
import { selectedWallet } from '@core/wallet'
1817
import { handleError } from '@core/error/handlers/handleError'
18+
import { getClient } from '@core/wallet/actions'
1919
2020
export let _onMount: (..._: any[]) => Promise<void> = async () => {}
2121

packages/desktop/components/popups/MintNftConfirmationPopup.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { onMount } from 'svelte'
33
import { Button, Text, FontWeight, NftImageOrIconBox, Tabs, KeyValueBox, NftSize } from 'shared/components'
44
import { localize } from '@core/i18n'
5-
import { getClient } from '@core/profile-manager'
5+
import { getClient } from '@core/wallet/actions'
66
import { selectedWallet } from '@core/wallet'
77
import { buildNftOutputData, formatTokenAmountPrecise, mintNft, mintNftDetails } from '@core/wallet'
88
import { getBaseToken, checkActiveProfileAuth } from '@core/profile'

packages/desktop/components/popups/NodeInfoPopup.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
import { onMount } from 'svelte'
33
import { Button, Checkbox, CopyableBox, Spinner, Text } from 'shared/components'
44
import { formatNumber, localize } from '@core/i18n'
5-
import { INode, INodeInfo } from '@core/network'
5+
import { INode } from '@core/network'
66
import { closePopup } from '@auxiliary/popup'
77
import { showAppNotification } from '@auxiliary/notification'
88
import { resolveObjectPath, setClipboard } from '@core/utils'
9-
import { getNodeInfo } from '@core/profile-manager'
9+
import { INodeInfo } from '@iota/sdk/out/types'
10+
import { getNodeInfo } from '@core/wallet/actions'
1011
1112
enum NodeInfoTab {
1213
General = 'general',

packages/desktop/components/popups/RemoveProposalPopup.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
async function onConfirmClick(): Promise<void> {
2424
try {
2525
await $selectedWallet.deregisterParticipationEvent($selectedProposalId)
26-
updateActiveAccountPersistedData($selectedWallet.index, {
26+
updateActiveAccountPersistedData($selectedWallet.id, {
2727
removedProposalIds: [...($selectedWallet.removedProposalIds ?? []), $selectedProposalId],
2828
})
2929
$governanceRouter.previous()
@@ -40,7 +40,7 @@
4040
}
4141
4242
function clearEvent(): void {
43-
removePersistedProposal($selectedProposalId, $selectedWallet.index)
43+
removePersistedProposal($selectedProposalId, $selectedWallet.id)
4444
$selectedProposalId = null
4545
clearSelectedParticipationEventStatus()
4646
}

packages/desktop/components/popups/VestingRewardsFinderPopup.svelte

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
import { showAppNotification } from '@auxiliary/notification'
44
import { PopupId, closePopup, openPopup } from '@auxiliary/popup'
55
import { selectedWalletVestingOverview } from '@contexts/vesting'
6-
import { SearchAlgorithmType, findBalances } from '@core/account'
6+
import { SearchAlgorithmType, findBalances } from '@core/wallet'
77
import { selectedWallet } from '@core/wallet/stores'
88
import { localize } from '@core/i18n'
99
import { displayNotificationForLedgerProfile, ledgerNanoStatus } from '@core/ledger'
1010
import { loadNftsForActiveProfile } from '@core/nfts'
1111
import {
1212
BALANCE_FINDER_ACCOUNT_RECOVERY_CONFIGURATION,
13+
RecoverAccountsPayload,
1314
activeProfile,
1415
getBaseToken,
1516
isActiveLedgerProfile,
1617
isSoftwareProfile,
17-
loadAccounts,
18+
loadWallets,
1819
} from '@core/profile'
19-
import { RecoverAccountsPayload } from '@core/profile-manager'
2020
import { truncateString } from '@core/utils'
2121
import {
2222
formatTokenAmountBestMatch,
@@ -33,7 +33,7 @@
3333
3434
const { isStrongholdLocked, type } = $activeProfile
3535
const config: RecoverAccountsPayload = {
36-
accountStartIndex: $selectedWallet.index,
36+
accountStartIndex: $selectedWallet.id, // TODO(2.0) Index?
3737
accountGapLimit: 0,
3838
addressGapLimit: BALANCE_FINDER_ACCOUNT_RECOVERY_CONFIGURATION[type].addressGapLimit,
3939
}
@@ -72,7 +72,7 @@
7272
return
7373
}
7474
await findBalances(SearchAlgorithmType.DFS, !hasUsedVestingRewardsFinder, config)
75-
await loadAccounts()
75+
await loadWallets()
7676
hasUsedVestingRewardsFinder = true
7777
} catch (err) {
7878
error = localize(err.error)

packages/desktop/components/popups/send/SendConfirmationPopup.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts">
22
import { PopupId, closePopup, openPopup, updatePopupProps } from '@auxiliary/popup'
3-
import { prepareOutput, selectedWallet } from '@core/account'
3+
import { prepareOutput, selectedWallet } from '@core/wallet'
44
import { handleError } from '@core/error/handlers/handleError'
55
import { localize } from '@core/i18n'
66
import { ledgerPreparedOutput } from '@core/ledger'
@@ -110,7 +110,7 @@
110110
try {
111111
const transactionDetails = get(newTransactionDetails)
112112
const outputParams = await getOutputParameters(transactionDetails)
113-
preparedOutput = await prepareOutput($selectedWallet.index, outputParams, getDefaultTransactionOptions())
113+
preparedOutput = await prepareOutput($selectedWallet.id, outputParams, getDefaultTransactionOptions())
114114
await updateStorageDeposit()
115115
116116
// This potentially triggers a second 'prepareOutput',

packages/desktop/components/popups/send/SendNftForm.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
} from '@core/wallet'
1717
import features from '@features/features'
1818
import { activeProfile } from '@core/profile'
19-
import { prepareOutput } from '@core/account'
19+
import { prepareOutput } from '@core/wallet'
2020
import { handleError } from '@core/error/handlers'
2121
import { MAX_METADATA_BYTES, MAX_TAG_BYTES } from '@core/utils'
2222
import { OptionalInputType } from '@core/wallet/utils/send/sendUtils'
@@ -86,7 +86,7 @@
8686
isPreparingOutput = true
8787
8888
const outputParams = await getOutputParameters(details)
89-
preparedOutput = await prepareOutput($selectedWallet.index, outputParams, getDefaultTransactionOptions())
89+
preparedOutput = await prepareOutput($selectedWallet.id, outputParams, getDefaultTransactionOptions())
9090
} catch (err) {
9191
handleError(err)
9292
} finally {

packages/desktop/components/popups/send/SendTokenForm.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { localize } from '@core/i18n'
44
import { AssetAmountInput, Button, Error, NetworkInput, OptionalInput, RecipientInput } from '@ui'
55
import { closePopup, openPopup, PopupId } from '@auxiliary/popup'
6-
import { prepareOutput, selectedWallet } from '@core/account'
6+
import { prepareOutput, selectedWallet } from '@core/wallet'
77
import { Output } from '@iota/sdk/out/types'
88
import {
99
getDefaultTransactionOptions,
@@ -76,7 +76,7 @@
7676
isPreparingOutput = true
7777
7878
const outputParams = await getOutputParameters(details)
79-
preparedOutput = await prepareOutput($selectedWallet.index, outputParams, getDefaultTransactionOptions())
79+
preparedOutput = await prepareOutput($selectedWallet.id, outputParams, getDefaultTransactionOptions())
8080
} catch (err) {
8181
handleError(err)
8282
} finally {

packages/desktop/views/dashboard/Dashboard.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
resetNftDownloadQueue,
2929
selectedWalletNfts,
3030
} from '@core/nfts'
31-
import { selectedWalletId } from '@core/wallet
31+
import { selectedWalletId } from '@core/wallet'
3232
import { get } from 'svelte/store'
3333
import features from '@features/features'
3434
import { isAwareOfMetricSystemDrop } from '@contexts/dashboard/stores'

packages/desktop/views/dashboard/collectibles/Collectibles.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { selectedWalletId } from '@core/account/stores'
2+
import { selectedWalletId } from '@core/wallet/stores'
33
import { collectiblesRoute, CollectiblesRoute, collectiblesRouter } from '@core/router'
44
import { CollectiblesDetailsView, CollectiblesGalleryView } from './views'
55

packages/desktop/views/dashboard/collectibles/views/CollectiblesDetailsView.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<script lang="ts">
22
import { openPopup, PopupId } from '@auxiliary/popup'
3-
import { selectedWalletId } from '@core/account/stores'
3+
import { selectedWalletId } from '@core/wallet/stores'
44
import { time } from '@core/app'
55
import { openUrlInBrowser } from '@core/app/utils'
66
import { localize } from '@core/i18n'
77
import { ExplorerEndpoint, getOfficialExplorerUrl } from '@core/network'
88
import {
99
INft,
1010
NftDownloadMetadata,
11-
allAccountNfts,
11+
allWalletNfts,
1212
convertAndFormatNftMetadata,
1313
getNftByIdFromAllAccountNfts,
1414
selectedNftId,
@@ -63,7 +63,7 @@
6363
}
6464
6565
$: formattedMetadata = convertAndFormatNftMetadata(metadata)
66-
$: returnIfNftWasSent($allAccountNfts[$selectedWalletId], $time)
66+
$: returnIfNftWasSent($allWalletNfts[$selectedWalletId], $time)
6767
$: timeDiff = getTimeDifference(new Date(nft.timelockTime), $time)
6868
$: alertText = getAlertText(downloadMetadata)
6969
$: detailsList = {

packages/desktop/views/dashboard/governance/Governance.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts">
22
import { GovernanceDashboardView, ProposalDetailsView } from './views'
3-
import { selectedWallet, selectedWalletId } from '@core/account/stores'
3+
import { selectedWallet, selectedWalletId } from '@core/wallet/stores'
44
import { GovernanceRoute, governanceRoute, governanceRouter } from '@core/router'
55
66
$: $selectedWalletId !== undefined && $governanceRouter.reset()

packages/desktop/views/dashboard/settings/views/advanced/HiddenAccounts.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { Checkbox, Text } from 'shared/components'
33
import { localize } from '@core/i18n'
44
import { activeProfile, updateActiveProfile } from '@core/profile'
5-
import { setNextSelectedWallet } from '@core/account'
5+
import { setNextSelectedWallet } from '@core/wallet/actions'
66
77
let showHiddenAccounts = $activeProfile?.showHiddenAccounts
88
$: updateActiveProfile({ showHiddenAccounts: showHiddenAccounts })

packages/desktop/views/dashboard/settings/views/collectibles/MaxMediaSize.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { Dropdown, Text } from '@ui'
33
import { TextType } from '@ui/enums'
44
5-
import { selectedWalletId } from '@core/account/stores'
5+
import { selectedWalletId } from '@core/wallet/stores'
66
import { Platform } from '@core/app'
77
import { localize } from '@core/i18n'
88
import {

packages/desktop/views/dashboard/settings/views/collectibles/RefreshNftMedia.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
updateNftInAllAccountNfts,
1010
} from '@core/nfts'
1111
import { Platform } from '@core/app'
12-
import { selectedWalletId } from '@core/wallet
12+
import { selectedWalletId } from '@core/wallet'
1313
1414
let isLoading = false
1515

packages/desktop/views/dashboard/settings/views/security/ChangePassword.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
} from 'shared/components'
1212
import { localize } from '@core/i18n'
1313
import { MAX_STRONGHOLD_PASSWORD_LENGTH } from '@core/profile'
14-
import { changePasswordAndUnlockStronghold } from '@core/profile-manager'
1514
import zxcvbn from 'zxcvbn'
1615
import { exportStronghold } from '@contexts/settings'
1716
import { PASSWORD_REASON_MAP } from '@core/stronghold'
17+
import { changePasswordAndUnlockStronghold } from '@core/profile/actions'
1818
1919
let exportStrongholdChecked: boolean
2020
let startOfPasswordChange: number

packages/desktop/views/dashboard/settings/views/security/StrongholdPasswordTimeout.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { localize } from '@core/i18n'
44
import { activeProfile, DEFAULT_PERSISTED_PROFILE_OBJECT, updateActiveProfileSettings } from '@core/profile'
55
import { IDropdownItem, SECONDS_PER_MINUTE } from '@core/utils'
6-
import { setStrongholdPasswordClearInterval } from '@core/profile-manager'
6+
import { setStrongholdPasswordClearInterval } from '@core/wallet/actions'
77
88
function onStrongholdPasswordTimeoutChange(option: IDropdownItem<number>): void {
99
const strongholdPasswordTimeoutInMinutes = option.value

packages/desktop/views/login/views/SelectProfileView.svelte

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@
88
needsToAcceptLatestTermsOfService,
99
} from '@core/app'
1010
import { localize } from '@core/i18n'
11-
import { ProfileType, loadPersistedProfileIntoActiveProfile, profiles, removeProfileFolder } from '@core/profile'
12-
import { clearProfileFromMemory } from '@core/profile-manager/actions'
11+
import {
12+
ProfileType,
13+
clearProfileFromMemory,
14+
loadPersistedProfileIntoActiveProfile,
15+
profiles,
16+
removeProfileFolder,
17+
} from '@core/profile'
1318
import { loginRouter, routerManager } from '@core/router'
1419
import features from '@features/features'
1520
import { Icon, Logo, Profile } from '@ui'

packages/desktop/views/onboarding/views/network-setup/views/CustomNetworkView.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
getEnabledNetworkFromFeatureFlags,
1515
getNetworkIdFromNetworkName,
1616
} from '@core/network'
17-
import { getNodeInfo } from '@core/profile-manager'
17+
import { getNodeInfo } from '@core/wallet/actions'
1818
import { Animation, Button, HTMLButtonType, NodeConfigurationForm, Text, TextType } from '@ui'
1919
import { onMount } from 'svelte'
2020
import { networkSetupRouter } from '../network-setup-router'

packages/desktop/views/onboarding/views/restore-from-stronghold/views/ImportStrongholdView.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
import { CLIENT_ERROR_REGEXES } from '@core/error/constants'
66
import { ClientError } from '@core/error/enums'
77
import { localize } from '@core/i18n'
8-
import { restoreBackup } from '@core/profile-manager/api'
98
import { STRONGHOLD_VERSION } from '@core/stronghold/constants'
109
import { StrongholdVersion } from '@core/stronghold/enums'
1110
import { Animation, Button, Dropzone, Text } from '@ui'
1211
import { onMount } from 'svelte'
1312
import { restoreFromStrongholdRouter } from '../../restore-from-stronghold/restore-from-stronghold-router'
13+
import { restoreBackup } from '@core/wallet/actions'
1414
1515
interface FileWithPath extends File {
1616
path?: string

packages/desktop/views/onboarding/views/restore-profile/views/ChooseRestoreProfileFlowView.svelte

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
<script lang="ts">
22
import { OnboardingLayout } from '@components'
3-
import {
4-
RestoreProfileType,
5-
initialiseProfileManagerFromOnboardingProfile,
6-
onboardingProfile,
7-
updateOnboardingProfile,
8-
} from '@contexts/onboarding'
3+
import { RestoreProfileType, onboardingProfile, updateOnboardingProfile } from '@contexts/onboarding'
94
import { localize } from '@core/i18n'
105
import { getNetworkNameFromNetworkId } from '@core/network'
11-
import { ProfileType, removeProfileFolder } from '@core/profile'
6+
import { ProfileType, clearProfileFromMemory, removeProfileFolder } from '@core/profile'
127
import features from '@features/features'
138
import { Animation, OnboardingButton, Text } from '@ui'
149
import { onMount } from 'svelte'
1510
import { restoreProfileRouter } from '../restore-profile-router'
16-
import { clearProfileFromMemory } from '@core/profile-manager/actions'
1711
import { Icon as IconEnum } from '@auxiliary/icon'
1812
import { AnimationEnum } from '@auxiliary/animation'
1913
@@ -31,6 +25,7 @@
3125
isBusy = { ...isBusy, [restoreProfileType]: true }
3226
const type = restoreProfileType === RestoreProfileType.Ledger ? ProfileType.Ledger : ProfileType.Software
3327
updateOnboardingProfile({ type, restoreProfileType })
28+
// TODO(2.0) This is gone
3429
await initialiseProfileManagerFromOnboardingProfile()
3530
$restoreProfileRouter.next()
3631
}

packages/desktop/views/onboarding/views/restore-profile/views/ClaimFinderView.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
ClaimShimmerRewardsError,
66
FindShimmerRewardsError,
77
RestoreProfileType,
8-
ShimmerClaimingAccountState,
8+
ShimmerClaimingWalletState,
99
canUserClaimRewards,
1010
canUserRecoverFromShimmerClaiming,
1111
claimShimmerRewards,
@@ -31,11 +31,11 @@
3131
pollLedgerNanoStatus,
3232
stopPollingLedgerNanoStatus,
3333
} from '@core/ledger'
34-
import { setStrongholdPassword, unsubscribeFromWalletApiEvents } from '@core/profile-manager'
3534
import { Animation, Button, ShimmerClaimingAccountTile, Text } from '@ui'
3635
import { onDestroy, onMount } from 'svelte'
3736
import { restoreProfileRouter } from '../restore-profile-router'
3837
import { AnimationEnum } from '@auxiliary/animation'
38+
import { setStrongholdPassword, unsubscribeFromWalletApiEvents } from '@core/wallet/actions'
3939
4040
$: shimmerClaimingAccounts = $onboardingProfile?.shimmerClaimingAccounts ?? []
4141
@@ -46,7 +46,7 @@
4646
let hasTriedClaimingRewards = false
4747
4848
$: isClaimingRewards = shimmerClaimingAccounts.some(
49-
(shimmerClaimingAccount) => shimmerClaimingAccount.state === ShimmerClaimingAccountState.Claiming
49+
(shimmerClaimingAccount) => shimmerClaimingAccount.state === ShimmerClaimingWalletState.Claiming
5050
)
5151
5252
$: shouldSearchForRewardsButtonBeEnabled =

packages/desktop/views/onboarding/views/shared/EncryptMnemonicView.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import { updateOnboardingProfile, verifyAndStoreMnemonic } from '@contexts/onboarding'
66
import { localize } from '@core/i18n'
77
import { MAX_STRONGHOLD_PASSWORD_LENGTH } from '@core/profile'
8-
import { setStrongholdPassword } from '@core/profile-manager'
98
import { Subrouter } from '@core/router'
109
import { PASSWORD_REASON_MAP } from '@core/stronghold'
10+
import { setStrongholdPassword } from '@core/wallet/actions'
1111
import { Animation, Button, HTMLButtonType, PasswordInput, Text, TextType } from '@ui'
1212
import zxcvbn from 'zxcvbn'
1313

0 commit comments

Comments
 (0)