Skip to main content

Overview

The useEmbeddedWallet 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

ConnectedWallet | null
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 null if 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’s useWallets hook:
/lib/hooks/useEmbeddedWallet.ts
  • useQuotes - Uses embedded wallet for signing quotes
  • useBalances - Requires wallet address for balance queries

See Also