Use the signMessage method exported from the useSolanaWallets hook to sign a message with an Solana wallet.
signMessage
useSolanaWallets
signMessage: (message: Uint8Array) => Promise<Uint8Array>;
import {useSolanaWallets} from '@privy-io/react-auth/solana'; const {wallets} = useSolanaWallets(); const message = 'Hello world'; const {signature} = await wallets[0].signMessage(new TextEncoder().encode(message));
Message to be signed.
The signature produced by the wallet.
Was this page helpful?