useWalletUiSigner
The useWalletUiSigner hook is a convenience hook that provides a TransactionSendingSigner for the currently connected wallet account.
This signer can be used with libraries like @solana/kit or other transaction-building tools to sign and send transactions on behalf of the user.
Return Value
Section titled “Return Value”The hook returns a TransactionSendingSigner object if a wallet is connected, otherwise it returns undefined.
Example
Section titled “Example”This example demonstrates how to get the signer. Connect a wallet to see the signer’s address appear.
import { useWalletUiSigner } from '@wallet-ui/react';
function SignerInfo() { const signer = useWalletUiSigner();
if (!signer) { return <p>Please connect a wallet to get a signer.</p>; }
return <p>Signer for {signer.address} is available.</p>;}