Skip to main content

Function: useBalances()

useBalances(params: {address: string;chain: ChainId | Chain;currencies: Currency | Currency[];query: QueryOptions<Balances>; }): UseQueryResult<Balances, Error>

Get balance for a an address on a give chain

Parameters

ParameterTypeDescription
paramsobject
params.addressstringThe address to fetch the balance for.
params.chainChainId | ChainThe chain to fetch the balance for.
params.currencies?Currency | Currency[]One or many: eur, usd, gbp, isk
params.query?QueryOptions<Balances>See Tanstack Query - useQuery options.

Returns

UseQueryResult<Balances, Error>

Example

const {
data,
isLoading,
isError,
error,
refetch,
...moreUseQueryResults
} = useBalances();

See

API Documentation

Defined in

sdk-react-provider/src/lib/hooks.tsx:404