You’re viewing the 2.0 (LTS) docs. View the current 3.0 version of this page.
useWallet hook provides access to the currently selected wallet’s information.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Hook for retrieving the currently selected wallet
useWallet hook provides access to the currently selected wallet’s information.
import { useWallet } from "@getpara/react-sdk";
function WalletInfo() {
const { data: wallet, isLoading, error } = useWallet();
const para = useClient();
if (isLoading) return <div>Loading wallet...</div>;
if (error) return <div>Error loading wallet</div>;
if (!wallet) {
return <div>No wallet selected</div>;
}
return (
<div>
<p>Wallet ID: {wallet.id}</p>
<p>Type: {wallet.type}</p>
<p>Address: {para.getDisplayAddress(wallet.id, {
truncate: true,
addressType: wallet.type
})}</p>
<p>Is External: {wallet.isExternal ? "Yes" : "No"}</p>
</div>
);
}