Parameters
Returns
UseBalancesResult
Complete balance data with loading and error states
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
function useBalances(options): UseBalancesResult;
| Parameter | Type | Description |
|---|---|---|
options | UseBalancesOptions | Configuration options for balance fetching |
UseBalancesResult
Complete balance data with loading and error states
import { useBalances } from '@sqds/grid-react';
function WalletBalances() {
const { balances, isLoading, error } = useBalances();
if (isLoading) return <div>Loading...</div>;
if (error) return <div>Error: {error.message}</div>;
return (
<div>
<div>SOL: {balances.sol.amountDecimal}</div>
{balances.tokens.map(t => <div key={t.tokenAddress}>{t.symbol}: {t.amountDecimal}</div>)}
</div>
);
}
Was this page helpful?