Balance
Read a Stellar account's balances — the connected wallet's, or any address by public key.
Drop-in button that opens a prebuilt modal showing the connected wallet's balances, fully rendered.
openWalletBalanceModal() takes no arguments — it reads the connected wallet and renders the table for you.
Hook & values used
All of these come from the usePollar() hook — the react layer built on top of getClient().
usePollar()hookparams: No arguments. Call it at the top level of a component — it reads React context, so it must run during render.
returns: PollarContextValue — the whole SDK surface: reactive state values, modal openers, and getClient() to drop down to core.
openWalletBalanceModal()syncparams: No arguments — it reads the connected wallet and renders the balances table inside the modal.
returns: void — opens the prebuilt modal; there is nothing to await.
walletBalancereactive valueparams: Not a function — a value of type WalletBalanceState read from usePollar().
returns: Re-renders your component whenever it changes. Mirrors getClient().getWalletBalanceState(): step plus data when loaded.
import { usePollar } from '@pollar/react'; export function BalanceButton() { const { openWalletBalanceModal, isAuthenticated } = usePollar(); // openWalletBalanceModal renders the connected wallet's // balances inside a modal — built on top of client.refreshBalance(). return ( <button onClick={openWalletBalanceModal} disabled={!isAuthenticated} > Balance </button> ); }
Submit a request to load balances.