useBalance
Use this hook to read the balance of any address.
const { balance } = useBalance({
address: "0xabca6bf26964af9f7eed9e03e53415d37aa90123",
});
Configuration
| Parameter | Type | Required | Description |
|---|---|---|---|
| address | string | Yes | Address to read from. |
| watch | boolean | No | If set to true, the balance will be refetched on each block mine (default: false). |
Return Values
- The balance is stored in the
balanceproperty. - The loading state is stored in the
isLoadingproperty. - The refetching state is stored in the
isRefetchingproperty. - You can refetch the balance by calling the
refetchfunction. - The
errorproperty stores any errors during reads.