diff --git a/packages/desktop/components/popup/popups/ActivityDetailsPopup.svelte b/packages/desktop/components/popup/popups/ActivityDetailsPopup.svelte index b79ed5ba1f..9012019726 100644 --- a/packages/desktop/components/popup/popups/ActivityDetailsPopup.svelte +++ b/packages/desktop/components/popup/popups/ActivityDetailsPopup.svelte @@ -41,7 +41,7 @@ ? getNftByIdFromAllAccountNfts($selectedAccountIndex, activity?.nftId) : undefined $: nftIsOwned = nft ? $ownedNfts.some((_onMountnft) => _onMountnft.id === nft?.id) : false - $: explorerUrl = setExplorerUrl(activity) + $: explorerUrl = getExplorerUrl(activity) let title: string = localize('popups.activityDetails.title.fallback') $: void setTitle(activity) @@ -60,7 +60,7 @@ $collectiblesRouter.setBreadcrumb(nft?.name) } - function setExplorerUrl(_activity: Activity): string | undefined { + function getExplorerUrl(_activity: Activity): string | undefined { if (activity?.direction === ActivityDirection.Genesis) { const explorerUrl = getDefaultExplorerUrl(activity?.sourceNetworkId, ExplorerEndpoint.Output) return explorerUrl ? `${explorerUrl}/${_activity?.outputId}` : undefined diff --git a/packages/shared/package.json b/packages/shared/package.json index d23d2d135b..629b315904 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -5,7 +5,7 @@ "author": "Bloom Labs Ltd ", "license": "Apache-2.0", "dependencies": { - "@bloomwalletio/ui": "0.20.8", + "@bloomwalletio/ui": "0.20.9", "@ethereumjs/rlp": "4.0.1", "@ethereumjs/tx": "5.2.1", "@ethereumjs/util": "9.0.2", diff --git a/packages/shared/src/components/molecules/ActivityInformation.svelte b/packages/shared/src/components/molecules/ActivityInformation.svelte index 811d5cd011..c491ccb6ff 100644 --- a/packages/shared/src/components/molecules/ActivityInformation.svelte +++ b/packages/shared/src/components/molecules/ActivityInformation.svelte @@ -78,9 +78,9 @@ {:else if selectedTab.key === PopupTab.Nft && activity.type === ActivityType.Nft} - {:else if selectedTab.key === PopupTab.Foundry} + {:else if selectedTab.key === PopupTab.Foundry && activity.type === ActivityType.Foundry} - {:else if selectedTab.key === PopupTab.Token} + {:else if selectedTab.key === PopupTab.Token && activity.type === ActivityType.Foundry} {:else if selectedTab.key === PopupTab.NftMetadata && activity.type === ActivityType.Nft} diff --git a/packages/shared/src/components/molecules/activity-info/AliasActivityInformation.svelte b/packages/shared/src/components/molecules/activity-info/AliasActivityInformation.svelte index afa7dd2cb6..422276266d 100644 --- a/packages/shared/src/components/molecules/activity-info/AliasActivityInformation.svelte +++ b/packages/shared/src/components/molecules/activity-info/AliasActivityInformation.svelte @@ -2,8 +2,16 @@ import { Table } from '@bloomwalletio/ui' import { localize } from '@core/i18n' import { AliasActivity } from '@core/activity' + import { getDefaultExplorerUrl } from '@core/network/utils' + import { ExplorerEndpoint } from '@core/network/enums' + import { openUrlInBrowser } from '@core/app/utils' export let activity: AliasActivity + + function onAddressClick(address: string) { + const explorerUrl = getDefaultExplorerUrl(activity?.sourceNetworkId, ExplorerEndpoint.Address) + openUrlInBrowser(`${explorerUrl}/${address}`) + } onAddressClick(activity.aliasId), }, { key: localize('general.governorAddress'), value: activity.governorAddress, - copyable: true, - truncate: true, + onClick: () => onAddressClick(activity.governorAddress), }, { key: localize('general.stateControllerAddress'), value: activity.stateControllerAddress, - copyable: true, - truncate: true, + onClick: () => onAddressClick(activity.stateControllerAddress), }, ]} /> diff --git a/packages/shared/src/components/molecules/activity-info/FoundryActivityInformation.svelte b/packages/shared/src/components/molecules/activity-info/FoundryActivityInformation.svelte index f68936443f..38b25738ea 100644 --- a/packages/shared/src/components/molecules/activity-info/FoundryActivityInformation.svelte +++ b/packages/shared/src/components/molecules/activity-info/FoundryActivityInformation.svelte @@ -1,9 +1,22 @@
onAliasClick(activity.aliasAddress), }, { key: localize('popups.nativeToken.property.tokenId'), value: activity.tokenTransfer?.tokenId, truncate: { firstCharCount: 10, endCharCount: 10 }, - copyable: true, + onClick: () => onTokenClick(activity.tokenTransfer?.tokenId ?? ''), }, { key: localize('popups.nativeToken.property.maximumSupply'), - value: activity.maximumSupply, + value: String(activity.maximumSupply), }, { key: localize('popups.nativeToken.property.mintedTokens'), - value: activity.mintedTokens, + value: String(activity.mintedTokens), }, { key: localize('popups.nativeToken.property.meltedTokens'), - value: activity.meltedTokens, + value: String(activity.meltedTokens), }, ]} /> diff --git a/packages/shared/src/components/molecules/activity-info/NftActivityInformation.svelte b/packages/shared/src/components/molecules/activity-info/NftActivityInformation.svelte index b6e7748f7c..62732f7023 100644 --- a/packages/shared/src/components/molecules/activity-info/NftActivityInformation.svelte +++ b/packages/shared/src/components/molecules/activity-info/NftActivityInformation.svelte @@ -2,14 +2,29 @@ import { Table } from '@bloomwalletio/ui' import { selectedAccountIndex } from '@core/account/stores' import { NftActivity } from '@core/activity' + import { openUrlInBrowser } from '@core/app/utils' import { localize } from '@core/i18n' + import { ExplorerEndpoint } from '@core/network/enums' + import { getDefaultExplorerUrl } from '@core/network/utils' + import { NftStandard } from '@core/nfts' import { getNftByIdFromAllAccountNfts } from '@core/nfts/actions' import { getBech32AddressFromAddressTypes, getHexAddressFromAddressTypes } from '@core/wallet' - import { AddressType } from '@iota/sdk/out/types' + import { type Address, AddressType } from '@iota/sdk/out/types' export let activity: NftActivity $: nft = getNftByIdFromAllAccountNfts($selectedAccountIndex, activity?.nftId) + $: issuer = nft?.standard === NftStandard.Irc27 ? nft?.issuer : undefined + + function onNftIdClick(nftId: string) { + const explorerUrl = getDefaultExplorerUrl(activity?.sourceNetworkId, ExplorerEndpoint.Nft) + openUrlInBrowser(`${explorerUrl}/${nftId}`) + } + + function onIssuerClick(issuer: Address) { + const explorerUrl = getDefaultExplorerUrl(activity?.sourceNetworkId, ExplorerEndpoint.Address) + openUrlInBrowser(`${explorerUrl}/${getBech32AddressFromAddressTypes(issuer)}`) + }
onNftIdClick(activity?.nftId), }, { key: localize('general.issuerAddress'), - value: - nft?.issuer?.type === AddressType.Ed25519 ? getBech32AddressFromAddressTypes(nft?.issuer) : undefined, - truncate: { firstCharCount: 10, endCharCount: 10 }, - copyable: true, + value: issuer?.type === AddressType.Ed25519 ? getBech32AddressFromAddressTypes(issuer) : undefined, + onClick: () => issuer && onIssuerClick(issuer), }, { key: localize('general.collectionId'), - value: [AddressType.Nft, AddressType.Alias].includes(nft?.issuer?.type) - ? getHexAddressFromAddressTypes(nft?.issuer) - : undefined, - truncate: { firstCharCount: 10, endCharCount: 10 }, - copyable: true, + value: + issuer && [AddressType.Nft, AddressType.Alias].includes(issuer?.type) + ? getHexAddressFromAddressTypes(issuer) + : undefined, + onClick: () => issuer && onIssuerClick(issuer), }, ]} /> diff --git a/packages/shared/src/components/molecules/activity-info/NftMetadataInformation.svelte b/packages/shared/src/components/molecules/activity-info/NftMetadataInformation.svelte index 5f2581bf64..36c2e6ce0c 100644 --- a/packages/shared/src/components/molecules/activity-info/NftMetadataInformation.svelte +++ b/packages/shared/src/components/molecules/activity-info/NftMetadataInformation.svelte @@ -2,6 +2,7 @@ import { Table } from '@bloomwalletio/ui' import { selectedAccountIndex } from '@core/account/stores' import { NftActivity } from '@core/activity' + import { openUrlInBrowser } from '@core/app/utils' import { localize } from '@core/i18n' import { getNftByIdFromAllAccountNfts } from '@core/nfts/actions' import { NftStandard } from '@core/nfts/enums' @@ -31,7 +32,7 @@ { key: localize('general.uri'), value: metadata.uri, - copyable: true, + onClick: () => openUrlInBrowser(metadata?.uri ?? ''), }, { key: localize('general.description'), @@ -68,7 +69,7 @@ { key: localize('general.image'), value: metadata.image, - copyable: true, + onClick: () => openUrlInBrowser(metadata?.image ?? ''), }, { key: localize('general.description'), diff --git a/packages/shared/src/components/molecules/activity-info/TokenActivityInformation.svelte b/packages/shared/src/components/molecules/activity-info/TokenActivityInformation.svelte index 0c3487ca83..15f57110b1 100644 --- a/packages/shared/src/components/molecules/activity-info/TokenActivityInformation.svelte +++ b/packages/shared/src/components/molecules/activity-info/TokenActivityInformation.svelte @@ -1,6 +1,7 @@