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
Name | Type | Default |
---|---|---|
address | AccountAddress | |
publicKey | PublicKey |
Last updated on