Getting the embeddeded wallet address
To get your user's embedded wallet address, first find their embedded wallet in the useWallets
array, by finding the element with a walletClientType
of 'privy'
:
import {useWallets} from '@privy-io/react-auth';
const {wallets} = useWallets();
const embeddedWallet = wallets.find((wallet) => wallet.walletClientType === 'privy');
Then, you can easily get the user's embedded wallet address from the wallet's address
field:
const embeddedWalletAddress = embeddedWallet.address;