Skip to content

Commit 66163e4

Browse files
committed
merge account into wallet
1 parent e05e7bb commit 66163e4

File tree

112 files changed

+507
-734
lines changed

Some content is hidden

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

112 files changed

+507
-734
lines changed

Diff for: packages/desktop/components/popups/CreateAccountPopup.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import { onMount } from 'svelte'
33
import { Button, ColorPicker, Input, Text, TextType } from '@ui'
4-
import { getRandomAccountColor, tryCreateAdditionalAccount, validateAccountName } from '@core/account'
4+
import { getRandomWalletColor, tryCreateAdditionalAccount, validateAccountName } from '@core/account'
55
import { handleError } from '@core/error/handlers/handleError'
66
import { localize } from '@core/i18n'
77
import { checkActiveProfileAuth } from '@core/profile'
@@ -10,7 +10,7 @@
1010
1111
export let accountAlias = ''
1212
export let error: string
13-
export let color = getRandomAccountColor()
13+
export let color = getRandomWalletColor()
1414
export let isBusy = false
1515
export let _onMount: (..._: any[]) => Promise<void> = async () => {}
1616

Diff for: packages/shared/components/AssetIcon.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import { AnimationRenderer } from '@auxiliary/animation'
33
import { Icon as IconEnum, NETWORK_ICON_SVG } from '@auxiliary/icon'
4-
import { getIconColorFromString } from '@core/account'
4+
import { getIconColorFromString } from '@core/wallet/utils'
55
import { COIN_TYPE, NetworkId } from '@core/network'
66
import { isBright } from '@core/utils'
77
import { ANIMATED_TOKEN_IDS, getAssetInitials, IPersistedAsset, TokenStandard } from '@core/wallet'

Diff for: packages/shared/components/ProfilePicture.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { getIconColorFromString } from '@core/account/utils'
2+
import { getIconColorFromString } from '@core/wallet/utils'
33
import { IPersistedProfile } from '@core/profile'
44
import { getInitials } from '@core/utils'
55
import { NftMedia, Text, FontWeight, Size } from '@ui'

Diff for: packages/shared/components/inputs/RecipientInput.svelte

+10-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
<script lang="ts">
22
import { Modal, SelectorInput, IOption, ColoredCircle } from 'shared/components'
3-
import { selectedAccountIndex } from '@core/account/stores'
4-
import { getAccountColorById } from '@core/account/utils'
53
import { localize } from '@core/i18n'
6-
import { visibleActiveAccounts } from '@core/profile/stores'
74
import { validateBech32Address, validateEthereumAddress } from '@core/utils/crypto'
85
import { Subject } from '@core/wallet/types'
96
import { getSubjectFromAddress } from '@core/wallet/utils'
107
import { Layer1RecipientError } from '@core/layer-2/errors'
11-
import { getNetworkHrp } from '@core/profile'
8+
import { getNetworkHrp, getWalletColorById, visibleActiveWallets } from '@core/profile'
9+
import { selectedWalletId } from '@core/wallet/stores'
1210
1311
export let recipient: Subject
1412
export let disabled = false
@@ -47,20 +45,20 @@
4745
throw new Error(localize('error.send.recipientRequired'))
4846
}
4947
50-
Promise.resolve()
48+
return Promise.resolve()
5149
} catch (err) {
5250
error = err?.message ?? err
5351
return Promise.reject(error)
5452
}
5553
}
5654
5755
function getLayer1AccountOptions(): IOption[] {
58-
return $visibleActiveAccounts
59-
.filter((account) => account.index !== $selectedAccountIndex)
60-
.map((account) => ({
61-
id: account.index,
62-
key: account.name,
63-
value: account.depositAddress,
56+
return $visibleActiveWallets
57+
.filter((wallet) => wallet.id !== $selectedWalletId)
58+
.map((wallet) => ({
59+
id: wallet.id,
60+
key: wallet.name,
61+
value: wallet.depositAddress,
6462
}))
6563
}
6664
</script>
@@ -78,6 +76,6 @@
7876
let:option
7977
>
8078
{#if option?.id}
81-
<ColoredCircle color={getAccountColorById(option?.id)} />
79+
<ColoredCircle color={getWalletColorById(option?.id)} />
8280
{/if}
8381
</SelectorInput>
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export interface IOption {
2-
id?: number
2+
id?: string
33
key?: string
44
value?: string
55
}

Diff for: packages/shared/lib/core/account/actions/buildAccountStateAndPersistedData.ts

-20
This file was deleted.

Diff for: packages/shared/lib/core/account/actions/createNewAccount.ts

-30
This file was deleted.

Diff for: packages/shared/lib/core/account/actions/index.ts

-12
This file was deleted.

Diff for: packages/shared/lib/core/account/actions/loadAccount.ts

-22
This file was deleted.

Diff for: packages/shared/lib/core/account/actions/resetSelectedAccountIndex.ts

-5
This file was deleted.

Diff for: packages/shared/lib/core/account/actions/setNextSelectedAccount.ts

-17
This file was deleted.

Diff for: packages/shared/lib/core/account/actions/setSelectedAccount.ts

-21
This file was deleted.

Diff for: packages/shared/lib/core/account/actions/syncBalance.ts

-14
This file was deleted.

Diff for: packages/shared/lib/core/account/actions/syncVotingPower.ts

-14
This file was deleted.

Diff for: packages/shared/lib/core/account/api/createAliasIfNecessary.ts

-9
This file was deleted.

Diff for: packages/shared/lib/core/account/api/getBalance.ts

-6
This file was deleted.

Diff for: packages/shared/lib/core/account/api/getParticipationOverview.ts

-7
This file was deleted.

Diff for: packages/shared/lib/core/account/api/getVotingPower.ts

-6
This file was deleted.

Diff for: packages/shared/lib/core/account/api/index.ts

-5
This file was deleted.

Diff for: packages/shared/lib/core/account/constants/index.ts

-2
This file was deleted.

Diff for: packages/shared/lib/core/account/constants/max-account-name-length.constant.ts

-1
This file was deleted.

Diff for: packages/shared/lib/core/account/enums/index.ts

-2
This file was deleted.

Diff for: packages/shared/lib/core/account/errors/index.ts

-1
This file was deleted.

Diff for: packages/shared/lib/core/account/index.ts

-8
This file was deleted.

Diff for: packages/shared/lib/core/account/interfaces/account-balances.interface.ts

-12
This file was deleted.

0 commit comments

Comments
 (0)