Overview
TheuseEmbeddedWallet hook provides access to the user’s Privy embedded wallet. It returns the connected wallet instance with the privy wallet client type, which is used for signing transactions and managing the user’s account.
Import
Signature
Return Value
The Privy embedded wallet instance, or
null if no wallet is connected.Usage Examples
Basic Usage
Check Wallet Connection
Use Wallet in Quote Requests
Display Wallet Address
Conditional Rendering Based on Wallet
Wallet Status Indicator
Types
ConnectedWallet
Notes
- The hook returns the first wallet with
walletClientType === 'privy' - Falls back to the first wallet in the list if no Privy wallet is found
- Returns
nullif no wallets are connected - The wallet is automatically available after Privy authentication
- The embedded wallet is managed by Privy and doesn’t require browser extensions
- Use this hook whenever you need to access the wallet address or sign transactions
Implementation Details
The hook is implemented as a simple wrapper around Privy’suseWallets hook:
/lib/hooks/useEmbeddedWallet.ts
Related Hooks
- useQuotes - Uses embedded wallet for signing quotes
- useBalances - Requires wallet address for balance queries
See Also
- Privy Documentation - Official Privy SDK documentation
- Authentication - Setting up Privy authentication
- Signing Utilities - Functions for signing quotes with the wallet