Documentation Index
Fetch the complete documentation index at: https://docs.getpara.com/llms.txt
Use this file to discover all available pages before exploring further.
Para provides a simple React hook to query the native balance of a wallet. This is useful for checking available funds before performing transactions.
useWalletBalance
Basic Usage
import { useWalletBalance } from '@getpara/react-sdk';
const { data: balance, isLoading, error } = useWalletBalance();
// Balance is returned as a string in wei (for EVM)
console.log(balance); // "1000000000000000000" (1 ETH in wei)
Query Specific Wallet
import { useWalletBalance } from '@getpara/react-sdk';
const { data: balance } = useWalletBalance({
walletId: 'wallet_123'
});
console.log(balance); // Balance in wei
External Wallet with RPC
import { useWalletBalance } from '@getpara/react-sdk';
const { data: balance } = useWalletBalance({
walletId: 'external_wallet_id',
rpcUrl: 'https://mainnet.infura.io/v3/YOUR_KEY'
});
console.log(balance); // Balance from external RPC
Important Notes
- EVM only: Currently only supports EVM wallets. Returns
null for COSMOS, SOLANA, and STELLAR wallets
- Native balance only: Does not support token balances
- Wei format: Returns balance as a string in wei (smallest unit)
- No formatting: Returns raw balance value without formatting or symbol information
Next Steps
Work directly with popular blockchain libraries for a more comprehensive approach to wallet interactions.