Skip to Content

🚧 These packages are still in development and may change rapidly as they are developed.

ReactuseAccount

useAccount

Hook for getting the current account from the AptosJSProClient. This typically is the account that is connected to the application. If no account is connected, it will return undefined.

Usage

import { useAccount } from "@aptos-labs/react"; export default function App() { const account = useAccount(); return account ? <div>{account.address}</div> : <div>Not connected</div>; }

Return Type

NameTypeDefault
addressAccountAddress
publicKeyPublicKey
Last updated on