Skip to content

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.

The hook returns a TransactionSendingSigner object if a wallet is connected, otherwise it returns undefined.

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>;
}