To request a typed data signature from a wallet, first find your desired wallet from the wallets array and get its EIP-1193 provider via its getEthereumProvider method:

const {wallets} = useWallets();
const wallet = wallets[0]; // Replace this with your desired wallet
const provider = await wallet.getEthereumProvider();

Then, using the provider’s request method, send an eth_signTypedData_v4 JSON-RPC to the wallet. In the params array, include the wallet’s address as the first entry, and the typed data as the second entry.

const address = wallet.address;
// https://viem.sh/docs/actions/wallet/signTypedData#signtypeddata
const typedData = typedDataRequestParams, // Your typed data request params

const signature = await provider.request({
  method: 'eth_signTypedData_v4',
  params: [address, typedData]
});

If you’ve integrated Privy with another web3 library, you can also use that library’s syntax for requesting a typed data signature from the wallet:

LibraryMethod
ViemUse the wallet client’s signTypedData method.
EthersUse the signer’s signTypedData method.
WagmiUse the useSignTypedData hook.

When requesting a signature from an embedded wallet, you can customize the signature prompt by using Privy’s native signTypedData method.