diff --git a/apps/extension/src/App/Accounts/ViewAccount.tsx b/apps/extension/src/App/Accounts/ViewAccount.tsx index 751329db2..4b1a2d085 100644 --- a/apps/extension/src/App/Accounts/ViewAccount.tsx +++ b/apps/extension/src/App/Accounts/ViewAccount.tsx @@ -16,6 +16,7 @@ export const ViewAccount = (): JSX.Element => { const [parentAccount, setParentAccount] = useState(); const [transparentAddress, setTransparentAddress] = useState(""); const [shieldedAddress, setShieldedAddress] = useState(""); + const [viewingKey, setViewingKey] = useState(""); const navigate = useNavigate(); const searchParentAccount = ( @@ -41,9 +42,12 @@ export const ViewAccount = (): JSX.Element => { setTransparentAddress(parentAccount?.address); } - const shieldedKey = searchShieldedKey(accountId); - if (shieldedKey) { - setShieldedAddress(shieldedKey.address); + const shieldedAccount = searchShieldedKey(accountId); + if (shieldedAccount) { + setShieldedAddress(shieldedAccount.address); + if (shieldedAccount.owner) { + setViewingKey(shieldedAccount.owner); + } } }, [accountId]); @@ -61,6 +65,7 @@ export const ViewAccount = (): JSX.Element => { publicKeyAddress={parentAccount.publicKey ?? ""} transparentAccountAddress={transparentAddress} shieldedAccountAddress={shieldedAddress} + viewingKeys={viewingKey} trimCharacters={21} /> diff --git a/apps/extension/src/Setup/Ledger/LedgerConnect.tsx b/apps/extension/src/Setup/Ledger/LedgerConnect.tsx index f22beddc0..a054d0a06 100644 --- a/apps/extension/src/Setup/Ledger/LedgerConnect.tsx +++ b/apps/extension/src/Setup/Ledger/LedgerConnect.tsx @@ -1,4 +1,4 @@ -import { Ledger as LedgerApp, makeBip44Path } from "@heliax/namada-sdk/web"; +import { Ledger as LedgerApp, makeBip44Path } from "@heliaxdev/namada-sdk/web"; import { chains } from "@namada/chains"; import { ActionButton, Alert, Image, Stack } from "@namada/components"; import { Bip44Path } from "@namada/types"; diff --git a/packages/components/src/ViewKeys.tsx b/packages/components/src/ViewKeys.tsx index 8ab47a915..a533545c1 100644 --- a/packages/components/src/ViewKeys.tsx +++ b/packages/components/src/ViewKeys.tsx @@ -2,6 +2,7 @@ import { ActionButton, GapPatterns, Input, Stack } from "@namada/components"; import { shortenAddress } from "@namada/utils"; import clsx from "clsx"; +import { useState } from "react"; type ViewKeysProps = { publicKeyAddress?: string; @@ -20,6 +21,7 @@ export const ViewKeys = ({ footer, trimCharacters = 16, }: ViewKeysProps): JSX.Element => { + const [seeViewingKey, setSeeViewingKey] = useState(false); return ( )} - {viewingKeys && ( -
- Viewing keys of shielded account - - Download - -
- )} + {viewingKeys && + (seeViewingKey ? + + :
+ setSeeViewingKey(true)} + > + See Viewing Key + +
)}
{(viewingKeys || footer) && (