This feature is experimental and may change as we iterate.
useAddFunds hook in @privy-io/react-auth that opens a unified funding flow in the Privy modal.
Your app can use this hook to let authenticated users fund a destination wallet with fiat, crypto, or both. When both methods are configured, Privy shows a method picker before starting the selected flow. When only one method is configured, Privy starts that flow directly.
Prerequisites
Enable the funding methods your app supports on the Account Funding page in the Privy Dashboard. See the configuration guide for details.Access the hook
Import and initializeuseAddFunds:
Start a unified funding flow
CalladdFunds with a destination wallet and at least one funding method config.
destination.chain accepts a CAIP-2 identifier (for example, eip155:8453 for Base or
solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp for Solana mainnet). destination.asset is the token
address on that destination chain.Parameters
addFunds accepts an object with the following fields:
| Parameter | Type | Description |
|---|---|---|
destination.address | string | Required. Wallet address to receive funds. |
destination.chain | `${string}:${string}` | Required. Destination chain in CAIP-2 format. |
destination.asset | string | Required. Token address on the destination chain (for example, Base USDC: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913). |
fiat | AddFundsFiatOptions | Required unless crypto is provided. Enables fiat funding with the useFiatOnramp flow. |
fiat.source.assets | SupportedFiatCurrency[] | Optional. The list of fiat source currencies your app allows. Defaults to all supported currencies. When provided, must be non-empty. |
fiat.source.defaultAsset | SupportedFiatCurrency | Optional. The source currency selected when the flow opens. Falls back to the locale currency, then to the first item in fiat.source.assets. |
fiat.environment | 'sandbox' | 'production' | Optional. Onramp environment for provider APIs. |
fiat.defaultAmount | string | Optional. Initial fiat amount displayed in the amount step. |
crypto | AddFundsCryptoOptions | Required unless fiat is provided. Enables crypto funding with the useDepositAddress flow. |
crypto.refundAddress | string | Optional. Refund address used if a crypto deposit cannot be completed. |
crypto.slippageBps | number | Optional. Maximum slippage for the crypto deposit route, in basis points. |
fiat or crypto must be provided. Provide both to show the method picker.
Return value
addFunds returns a Promise with one of the following results:
| Result | Meaning |
|---|---|
{method: 'fiat', status: 'submitted'} | The user completed the provider flow, then exited before final confirmation finished in Privy. |
{method: 'fiat', status: 'confirmed'} | The fiat flow reached provider confirmation, and the user completed the success step. |
{method: 'crypto', status: 'completed'} | The crypto deposit flow completed successfully. |
Error handling
addFunds rejects on invalid configuration or incomplete flows. Common error cases include:
destination.address,destination.chain, ordestination.assetis missing- neither
fiatnorcryptois provided fiat.source.assetsis empty- the user is not authenticated
- another add funds flow is already in progress
- the user cancels the flow
- provider session, quote, or deposit address requests fail
try/catch and show clear UI feedback.
Complete example
Related
Fiat-to-crypto onramps
Fund wallets with fiat via card, Apple Pay, or Google Pay.
Crypto deposit addresses
Fund wallets by letting users transfer crypto from another wallet.

