useAccount
function useAccount(): { account: | undefined | IAccount; adapter: | undefined | WalletAdapter; address: string; chain: Chain; network: Network; state: ConnectionState;};
Defined in: packages/iso-filecoin-react/src/wallet-provider.js:334
Hook to access the current account and its state
Returns
{ account: | undefined | IAccount; adapter: | undefined | WalletAdapter; address: string; chain: Chain; network: Network; state: ConnectionState;}
Account state
account
account: | undefined | IAccount;
Currently connected account
adapter
adapter: | undefined | WalletAdapter;
Currently selected wallet adapter
address
address: string;
Current address
chain
chain: Chain;
Current chain
network
network: Network;
Current network (mainnet or testnet)
state
state: ConnectionState;
Current connection state
Example
import { useAccount } from 'iso-filecoin-react'
function App() { const { account, adapter, network, chain, state } = useAccount()
return <div>Current address: {account?.address.toString()}</div>}