diff --git a/client/src/app/components/nova/OutputView.tsx b/client/src/app/components/nova/OutputView.tsx index 515b9d02f..e8ca6c461 100644 --- a/client/src/app/components/nova/OutputView.tsx +++ b/client/src/app/components/nova/OutputView.tsx @@ -42,7 +42,7 @@ const OutputView: React.FC = ({ outputId, output, showCopyAmoun const [isFormattedBalance, setIsFormattedBalance] = useState(true); const { bech32Hrp, name: network } = useNetworkInfoNova((s) => s.networkInfo); - const aliasOrNftBech32 = buildAddressForAliasOrNft(outputId, output, bech32Hrp); + const aliasOrNftBech32 = buildAddressForAccountOrNft(outputId, output, bech32Hrp); const outputIdTransactionPart = `${outputId.slice(0, 8)}....${outputId.slice(-8, -4)}`; const outputIdIndexPart = outputId.slice(-4); const manaEntries = getManaKeyValueEntries(manaDetails); @@ -217,7 +217,7 @@ const OutputView: React.FC = ({ outputId, output, showCopyAmoun ); }; -function buildAddressForAliasOrNft(outputId: string, output: Output, bech32Hrp: string): string { +function buildAddressForAccountOrNft(outputId: string, output: Output, bech32Hrp: string): string { let bech32: string = ""; if (output.type === OutputType.Account) { diff --git a/client/src/app/components/nova/address/section/nft/Nft.tsx b/client/src/app/components/nova/address/section/nft/Nft.tsx index fe84536ab..6dd0694b1 100644 --- a/client/src/app/components/nova/address/section/nft/Nft.tsx +++ b/client/src/app/components/nova/address/section/nft/Nft.tsx @@ -16,7 +16,7 @@ import { tryParseMetadata } from "~helpers/stardust/metadataUtils"; import { INftImmutableMetadata } from "~models/api/stardust/nft/INftImmutableMetadata"; import "./Nft.scss"; import { useNetworkInfoNova } from "~/helpers/nova/networkInfo"; -import { MetadataFeature, NftOutput, Utils } from "@iota/sdk-wasm-nova/web"; +import { MetadataFeature, NftAddress, NftOutput, Utils } from "@iota/sdk-wasm-nova/web"; import TruncatedId from "~/app/components/stardust/TruncatedId"; import { TransactionsHelper } from "~/helpers/nova/transactionsHelper"; @@ -32,7 +32,8 @@ const Nft: React.FC = ({ nftOutput }) => { const [metadata, setMetadata] = useState(null); const [issuerId, setIssuerId] = useState(null); const [standardMetadata, setStandardMetadata] = useState(); - const nftAddress = Utils.hexToBech32(nftOutput.nftId, bech32Hrp); + const nftAddress = new NftAddress(nftOutput.nftId); + const nftBech32Address = Utils.addressToBech32(nftAddress, bech32Hrp); const [isWhitelisted] = useTokenRegistryNftCheck(issuerId, nftOutput.nftId); const [name, setName] = useState(); const [uri, isNftUriLoading] = useNftMetadataUri(standardMetadata?.uri); @@ -75,9 +76,9 @@ const Nft: React.FC = ({ nftOutput }) => { return (
- {nftImageContent} + {nftImageContent} - +
{name && isWhitelisted && {name}}