You’re viewing the 2.0 (LTS) docs. View the current 3.0 version of this page.
useWalletBalance hook fetches the current balance of the selected wallet, supporting both Para-managed wallets and external wallets.
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 balance of the selected wallet
useWalletBalance hook fetches the current balance of the selected wallet, supporting both Para-managed wallets and external wallets.
import { useWalletBalance } from "@getpara/react-sdk";
function WalletBalance() {
const { data: balance, isLoading, error } = useWalletBalance();
if (isLoading) return <div>Loading balance...</div>;
if (error) return <div>Error loading balance</div>;
if (!balance) {
return <div>No balance available</div>;
}
return (
<div>
<p>Balance: {balance} ETH</p>
</div>
);
}