diff --git a/packages/desktop/components/NetworkCard.svelte b/packages/desktop/components/NetworkCard.svelte index 130426b38e..3702067c7a 100644 --- a/packages/desktop/components/NetworkCard.svelte +++ b/packages/desktop/components/NetworkCard.svelte @@ -5,7 +5,7 @@ import { openUrlInBrowser } from '@core/app' import { handleError } from '@core/error/handlers' import { localize } from '@core/i18n' - import { generateAndStoreEvmAddressForAccounts, pollL2BalanceForAccount } from '@core/layer-2/actions' + import { generateAndStoreEvmAddressForAccounts, pollEvmBalancesForAccount } from '@core/layer-2/actions' import { LedgerAppName } from '@core/ledger' import { ExplorerEndpoint, Network, NetworkNamespace, getDefaultExplorerUrl, setSelectedChain } from '@core/network' import { ProfileType } from '@core/profile' @@ -67,7 +67,7 @@ network.coinType, $selectedAccount as IAccountState ) - pollL2BalanceForAccount($activeProfile.id, $selectedAccount as IAccountState) + pollEvmBalancesForAccount($activeProfile.id, $selectedAccount as IAccountState) if ($activeProfile.type === ProfileType.Ledger) { $networkConfigRouter.goTo(NetworkConfigRoute.ConfirmLedgerEvmAddress) } diff --git a/packages/desktop/components/menus/TokenActionsMenu.svelte b/packages/desktop/components/menus/TokenActionsMenu.svelte index 2442922c1c..009c14550f 100644 --- a/packages/desktop/components/menus/TokenActionsMenu.svelte +++ b/packages/desktop/components/menus/TokenActionsMenu.svelte @@ -23,7 +23,7 @@ } function onUnverifyClick(): void { - unverifyToken(token.id, NotVerifiedStatus.Skipped) + unverifyToken(token, NotVerifiedStatus.Skipped) updatePopupProps({ token: { ...token, verification: { verified: false, status: NotVerifiedStatus.Skipped } }, }) @@ -31,7 +31,7 @@ } function onVerifyClick(): void { - verifyToken(token.id, VerifiedStatus.SelfVerified) + verifyToken(token, VerifiedStatus.SelfVerified) updatePopupProps({ token: { ...token, verification: { verified: true, status: VerifiedStatus.SelfVerified } }, }) @@ -39,7 +39,7 @@ } function onUnhideClick(): void { - unhideToken(token.id) + unhideToken(token) hideActivitiesForHiddenTokens() updatePopupProps({ token: { ...token, hidden: false }, @@ -48,7 +48,7 @@ } function onHideClick(): void { - hideToken(token.id) + hideToken(token) hideActivitiesForHiddenTokens() updatePopupProps({ token: { ...token, hidden: true }, diff --git a/packages/desktop/components/menus/TokenListMenu.svelte b/packages/desktop/components/menus/TokenListMenu.svelte index 1b10142fac..8193c5b511 100644 --- a/packages/desktop/components/menus/TokenListMenu.svelte +++ b/packages/desktop/components/menus/TokenListMenu.svelte @@ -3,14 +3,14 @@ import { showNotification } from '@auxiliary/notification' import { IconName, Menu } from '@bloomwalletio/ui' import { localize } from '@core/i18n' - import { refreshAccountTokensForActiveProfile } from '@core/token/actions' + import { loadTokensForAllAccountBalances } from '@core/token/actions' import { PopupId, closePopup, openPopup } from '../../lib/auxiliary/popup' - import { fetchL2BalanceForAllAccounts } from '@core/layer-2' + import { fetchEvmBalancesForAllAccounts } from '@core/layer-2' let menu: Menu | undefined = undefined function onSyncTokensClick(): void { - fetchL2BalanceForAllAccounts($activeProfileId as string, true) + fetchEvmBalancesForAllAccounts($activeProfileId as string, true) showNotification({ variant: 'success', text: localize('notifications.syncTokens.success'), @@ -27,7 +27,7 @@ } function refreshTokenMetadata(): void { - refreshAccountTokensForActiveProfile(true) + loadTokensForAllAccountBalances(true) showNotification({ variant: 'success', text: localize('notifications.refreshTokenMetadata.success'), diff --git a/packages/desktop/components/popup/popups/FaucetRequestPopup.svelte b/packages/desktop/components/popup/popups/FaucetRequestPopup.svelte index adce77816c..cdc9b7eb8b 100644 --- a/packages/desktop/components/popup/popups/FaucetRequestPopup.svelte +++ b/packages/desktop/components/popup/popups/FaucetRequestPopup.svelte @@ -6,11 +6,12 @@ import { Error } from '@bloomwalletio/ui' import { handleError } from '@core/error/handlers/handleError' import PopupTemplate from '../PopupTemplate.svelte' - import { getBaseToken } from '@core/profile/actions' let isBusy = false let error: string | undefined + const network = getL1Network() + async function onConfirmClick(): Promise { error = undefined try { @@ -33,7 +34,7 @@ { if (hasUsedWalletFinder) { const profileId = getActiveProfileId() - await refreshAccountTokensForActiveProfile() + await loadTokensForAllAccountBalances() await generateAndStoreActivitiesForAllAccounts(profileId) loadNftsForActiveProfile() } diff --git a/packages/desktop/components/popup/popups/TokenInformationPopup.svelte b/packages/desktop/components/popup/popups/TokenInformationPopup.svelte index dec1772c4e..945270b70f 100644 --- a/packages/desktop/components/popup/popups/TokenInformationPopup.svelte +++ b/packages/desktop/components/popup/popups/TokenInformationPopup.svelte @@ -11,13 +11,13 @@ import { SendFlowRoute, SendFlowRouter, sendFlowRouter } from '@views/dashboard/send-flow' import PopupTemplate from '../PopupTemplate.svelte' - export let token: ITokenWithBalance | undefined + export let token: ITokenWithBalance export let activityId: string | undefined = undefined - $: isNewToken = token?.verification?.status === NotVerifiedStatus.New + $: isNewToken = token.verification?.status === NotVerifiedStatus.New function onSkipClick(): void { - unverifyToken(token?.id, NotVerifiedStatus.Skipped) + unverifyToken(token, NotVerifiedStatus.Skipped) if (activityId) { openPopup({ id: PopupId.ActivityDetails, @@ -31,7 +31,7 @@ } function onVerifyClick(): void { - verifyToken(token?.id, VerifiedStatus.SelfVerified) + verifyToken(token, VerifiedStatus.SelfVerified) if (activityId) { openPopup({ id: PopupId.ActivityDetails, @@ -45,7 +45,7 @@ } function onSendClick(): void { - const sendFlowType = token?.id === BASE_TOKEN_ID ? SendFlowType.BaseCoinTransfer : SendFlowType.TokenTransfer + const sendFlowType = token.id === BASE_TOKEN_ID ? SendFlowType.BaseCoinTransfer : SendFlowType.TokenTransfer setSendFlowParameters({ type: sendFlowType, [sendFlowType]: { @@ -62,7 +62,7 @@
- {#if token?.standard === TokenStandard.Irc30 || token?.standard === TokenStandard.Erc20} + {#if token.standard === TokenStandard.Irc30 || token.standard === TokenStandard.Erc20} {/if}
diff --git a/packages/desktop/features/network.features.ts b/packages/desktop/features/network.features.ts index 7cf79283c1..2d49c92cb9 100644 --- a/packages/desktop/features/network.features.ts +++ b/packages/desktop/features/network.features.ts @@ -12,7 +12,7 @@ const networkFeatures: INetworkFeatures = { }, }, evmNetworks: { - enabled: true, + enabled: false, }, } diff --git a/packages/desktop/views/dashboard/collectibles/components/CollectionDetails.svelte b/packages/desktop/views/dashboard/collectibles/components/CollectionDetails.svelte new file mode 100644 index 0000000000..9fd3dede80 --- /dev/null +++ b/packages/desktop/views/dashboard/collectibles/components/CollectionDetails.svelte @@ -0,0 +1,14 @@ + + + diff --git a/packages/desktop/views/dashboard/collectibles/components/CollectionsGallery.svelte b/packages/desktop/views/dashboard/collectibles/components/CollectionsGallery.svelte new file mode 100644 index 0000000000..cdd80a5671 --- /dev/null +++ b/packages/desktop/views/dashboard/collectibles/components/CollectionsGallery.svelte @@ -0,0 +1,65 @@ + + + +
+ {#each item as collection} + {#if collection} + + {:else} +
+ {/if} + {/each} +
+ diff --git a/packages/desktop/views/dashboard/collectibles/components/CollectionsGalleryItem.svelte b/packages/desktop/views/dashboard/collectibles/components/CollectionsGalleryItem.svelte new file mode 100644 index 0000000000..f3e5fa3cf0 --- /dev/null +++ b/packages/desktop/views/dashboard/collectibles/components/CollectionsGalleryItem.svelte @@ -0,0 +1,81 @@ + + + + + diff --git a/packages/desktop/views/dashboard/collectibles/components/index.ts b/packages/desktop/views/dashboard/collectibles/components/index.ts index cb1cd98401..af0c61c694 100644 --- a/packages/desktop/views/dashboard/collectibles/components/index.ts +++ b/packages/desktop/views/dashboard/collectibles/components/index.ts @@ -1,3 +1,5 @@ export { default as CollectiblesTabs } from './CollectiblesTabs.svelte' +export { default as CollectionDetails } from './CollectionDetails.svelte' +export { default as CollectionsGallery } from './CollectionsGallery.svelte' export { default as Erc721CollectibleDetails } from './Erc721CollectibleDetails.svelte' export { default as Irc27CollectibleDetails } from './Irc27CollectibleDetails.svelte' diff --git a/packages/desktop/views/dashboard/collectibles/views/CollectiblesDetailsView.svelte b/packages/desktop/views/dashboard/collectibles/views/CollectiblesDetailsView.svelte index 45aaa4643b..a229d8dd67 100644 --- a/packages/desktop/views/dashboard/collectibles/views/CollectiblesDetailsView.svelte +++ b/packages/desktop/views/dashboard/collectibles/views/CollectiblesDetailsView.svelte @@ -1,21 +1,25 @@ - - {#if nft?.standard === NftStandard.Irc27} - - {:else if nft?.standard === NftStandard.Erc721} - - {/if} - +{#if collection} + +{:else} + + {#if nft?.standard === NftStandard.Irc27} + + {:else if nft?.standard === NftStandard.Erc721} + + {/if} + +{/if} diff --git a/packages/desktop/views/dashboard/collectibles/views/CollectionsGalleryView.svelte b/packages/desktop/views/dashboard/collectibles/views/CollectionsGalleryView.svelte index e95024b661..068bde93a3 100644 --- a/packages/desktop/views/dashboard/collectibles/views/CollectionsGalleryView.svelte +++ b/packages/desktop/views/dashboard/collectibles/views/CollectionsGalleryView.svelte @@ -1,13 +1,13 @@ @@ -35,23 +33,22 @@
{localize('views.collectibles.collectionsGallery.title')} - {String(queriedCollections.length ?? '')} + {String(Object.keys($selectedAccountCollections).length ?? '')}
- {#if collections.length} - - + {#if hasCollections} + {/if} {#if features.collectibles.erc721.enabled} {/if}
- {#if collections.length} - {#if queriedCollections.length} - + {#if hasCollections} + {#if Object.keys(queriedCollections).length > 0} + {:else}
{#if $dashboardRoute === DashboardRoute.Collectibles && $collectiblesRoute !== CollectiblesRoute.Gallery} - + {/if} {#if $dashboardRoute === DashboardRoute.Governance && $governanceRoute !== GovernanceRoute.Proposals} diff --git a/packages/desktop/views/dashboard/drawers/network-config/views/NetworkInformationDrawer.svelte b/packages/desktop/views/dashboard/drawers/network-config/views/NetworkInformationDrawer.svelte index 3d21699ee9..a0c49aa00f 100644 --- a/packages/desktop/views/dashboard/drawers/network-config/views/NetworkInformationDrawer.svelte +++ b/packages/desktop/views/dashboard/drawers/network-config/views/NetworkInformationDrawer.svelte @@ -1,6 +1,6 @@ import { Table } from '@bloomwalletio/ui' import { getFormattedTimeStamp, localize } from '@core/i18n' - import { NetworkId } from '@core/network' - import { getBaseToken } from '@core/profile/actions' + import { NetworkId, getNetwork } from '@core/network' import { formatTokenAmountBestMatch } from '@core/token' import { NetworkLabel } from '@ui' export let time: Date + export let sourceNetworkId: NetworkId export let destinationNetworkId: NetworkId export let maxGasFee: bigint | undefined = undefined export let transactionFee: bigint | undefined = undefined @@ -17,7 +17,7 @@ $: formattedTransactionFee = formatAmount(transactionFee) function formatAmount(amount: bigint | undefined): string | undefined { - return amount ? formatTokenAmountBestMatch(amount, getBaseToken()) : undefined + return amount ? formatTokenAmountBestMatch(amount, getNetwork(sourceNetworkId)?.baseToken) : undefined } diff --git a/packages/shared/src/components/activities/stardust/StardustActivityInformation.svelte b/packages/shared/src/components/activities/stardust/StardustActivityInformation.svelte index 35a970a3a8..40106c9a31 100644 --- a/packages/shared/src/components/activities/stardust/StardustActivityInformation.svelte +++ b/packages/shared/src/components/activities/stardust/StardustActivityInformation.svelte @@ -52,7 +52,7 @@ case StardustActivityType.Foundry: tabs = getTabItems([PopupTab.Transaction, PopupTab.Foundry, PopupTab.Token]) token = activity.tokenTransfer - ? getPersistedToken(activity.tokenTransfer?.tokenId)?.metadata + ? getPersistedToken(activity.sourceNetworkId, activity.tokenTransfer?.tokenId)?.metadata : undefined break case StardustActivityType.Consolidation: diff --git a/packages/shared/src/components/activities/stardust/info/StardustGenericInformation.svelte b/packages/shared/src/components/activities/stardust/info/StardustGenericInformation.svelte index 95f9894413..7d58394385 100644 --- a/packages/shared/src/components/activities/stardust/info/StardustGenericInformation.svelte +++ b/packages/shared/src/components/activities/stardust/info/StardustGenericInformation.svelte @@ -4,8 +4,7 @@ import { openUrlInBrowser } from '@core/app' import { time } from '@core/app/stores' import { getFormattedTimeStamp, localize } from '@core/i18n' - import { ExplorerEndpoint, getDefaultExplorerUrl } from '@core/network' - import { getBaseToken } from '@core/profile/actions' + import { ExplorerEndpoint, getDefaultExplorerUrl, getNetwork } from '@core/network' import { formatTokenAmountBestMatch } from '@core/token' import { buildUrl } from '@core/utils' import { getTimeDifference } from '@core/utils/time' @@ -32,7 +31,7 @@ } function formatAmount(amount: bigint | undefined): string | undefined { - return amount ? formatTokenAmountBestMatch(amount, getBaseToken()) : undefined + return amount ? formatTokenAmountBestMatch(amount, getNetwork(activity.sourceNetworkId)?.baseToken) : undefined } diff --git a/packages/shared/src/components/activities/stardust/info/StardustTokenInformation.svelte b/packages/shared/src/components/activities/stardust/info/StardustTokenInformation.svelte index e65624d7b2..a22ac80ec9 100644 --- a/packages/shared/src/components/activities/stardust/info/StardustTokenInformation.svelte +++ b/packages/shared/src/components/activities/stardust/info/StardustTokenInformation.svelte @@ -10,7 +10,10 @@ let metadata: IIrc30Metadata | undefined $: metadata = ( - getPersistedToken(activity.tokenTransfer?.tokenId ?? activity.baseTokenTransfer.tokenId)?.metadata + getPersistedToken( + activity.sourceNetworkId, + activity.tokenTransfer?.tokenId ?? activity.baseTokenTransfer.tokenId + )?.metadata ) diff --git a/packages/shared/src/components/avatars/NetworkAvatar.svelte b/packages/shared/src/components/avatars/NetworkAvatar.svelte index b506809076..e96032e491 100644 --- a/packages/shared/src/components/avatars/NetworkAvatar.svelte +++ b/packages/shared/src/components/avatars/NetworkAvatar.svelte @@ -1,8 +1,7 @@ - + {#if showTooltip && networkName} diff --git a/packages/shared/src/components/molecules/NftGalleryItem.svelte b/packages/shared/src/components/molecules/NftGalleryItem.svelte index 391c58b044..1c11331963 100644 --- a/packages/shared/src/components/molecules/NftGalleryItem.svelte +++ b/packages/shared/src/components/molecules/NftGalleryItem.svelte @@ -2,7 +2,7 @@ import { Pill, Text, Tooltip, type TextColor } from '@bloomwalletio/ui' import { localize } from '@core/i18n' import { DownloadErrorType, IDownloadMetadata, Nft } from '@core/nfts' - import { downloadingNftId, selectedNftId } from '@core/nfts/stores' + import { downloadingNftId, selectedNftId, selectedCollectionId } from '@core/nfts/stores' import { CollectiblesRoute, collectiblesRouter } from '@core/router' import { MediaPlaceholder, NetworkAvatar, NftMedia } from '@ui' import AssetPillsForNft from '@ui/nfts/AssetPillsForNft.svelte' @@ -10,7 +10,6 @@ export let nft: Nft - let nftWrapperClientWidth: number let anchor: HTMLElement $: placeHolderColor = nft.downloadMetadata?.error @@ -20,6 +19,7 @@ : ('brand' as TextColor) function onNftClick(): void { + $selectedCollectionId = undefined $selectedNftId = nft.id $collectiblesRouter?.goTo(CollectiblesRoute.Details) $collectiblesRouter?.setBreadcrumb(nft?.name) @@ -38,73 +38,61 @@ } - diff --git a/packages/shared/src/components/pills/NetworkTypePill.svelte b/packages/shared/src/components/pills/NetworkTypePill.svelte index 6711b16958..ab662bcd5b 100644 --- a/packages/shared/src/components/pills/NetworkTypePill.svelte +++ b/packages/shared/src/components/pills/NetworkTypePill.svelte @@ -1,5 +1,5 @@