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.
Name | Type | Default |
---|---|---|
connect | () => Promise<void> Function to initiate wallet connection. |
|
connected | boolean Indicates if a wallet is currently connected. |
|
connecting | boolean Indicates if a wallet connection is in progress. |
|
disconnect | () => Promise<void> Function to disconnect the wallet. |
|
publicKey | PublicKey | null The public key of the connected wallet, or null if not connected. |
|
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