import {useSolanaWallets, useSignMessage} from '@privy-io/react-auth/solana';import bs58 from 'bs58';const {wallets} = useSolanaWallets();const {signMessage} = useSignMessage();const message = 'Hello world';const signatureUint8Array = await signMessage({ message: new TextEncoder().encode(message), options: { address: wallets[0].address, // Optional: Specify the wallet to use for signing. If not provided, the first wallet will be used. uiOptions: { title: 'Sign this message' } }});const signature = bs58.encode(signatureUint8Array);
Address of the wallet to use for signing the message. Recommended when working with external
wallets to ensure reliable functionality. If not provided, the first wallet will be used.