Skip to Content
useWallet

useWallet

The useWallet hook gives you access to the current wallet’s state and methods, such as connecting, disconnecting, and sending transactions. It is the primary way to interact with the user’s wallet programmatically.

NameTypeDefault
connect
() => Promise<void>
Function to initiate wallet connection.
connected
boolean
Indicates if a wallet is currently connected.
false
connecting
boolean
Indicates if a wallet connection is in progress.
false
disconnect
() => Promise<void>
Function to disconnect the wallet.
publicKey
PublicKey | null
The public key of the connected wallet, or null if not connected.
null
signIn
(input) => Promise<SignInOutput>
Signs in using the wallet, if supported.
signMessage
(message: Uint8Array) => Promise<Uint8Array>
Signs an arbitrary message with the connected wallet.
Last updated on