Privy makes it easy to allow your users to fund their embedded wallets with convenient payment methods like Apple Pay and Google Pay via @privy-io/expo and on the web through @privy-io/react-auth.This guide will walk you through setting up Privy’s funding flows, allowing your users to fund their wallets quickly and easily in under two minutes.
Card and fiat on-ramp purchases are supported on mainnets only. On testnets (e.g. Polygon Amoy, Sepolia), on-ramps cannot purchase testnet tokens, so this flow will not be shown or will fail.
In the Privy
Dashboard, enable Pay with card on the User management > Account funding page.With this option enabled, if Apple Pay or Google Pay is available on your user’s device, Privy will provide users the option to purchase with those methods.Choose your desired network across EVM and Solana and set a recommended amount for users to fund. Users can update the amount manually if they choose.
Optional. A viem/chains object for the network on which users should fund their accounts. Defaults to the network you configured in the Privy Dashboard.
asset
'native-currency' | 'USDC' | {erc20: string}
Optional. The asset you’d like the user to fund their accounts with. Set 'native-currency' to fund with the chain’s native currency (e.g. ETH), 'USDC' to fund with USDC, or a token address in the erc20 field to fund with an arbitrary ERC20. Defaults to 'native-currency'.
amount
string
Required if asset is set, optional otherwise. The amount of the asset to fund as a decimal string. Defaults to the amount you configured in the Privy Dashboard.
Report incorrect code
Copy
Ask AI
import {useFundWallet} from '@privy-io/react-auth';// Replace this with your desired networkimport {base} from 'viem/chains'...// `fundWallet` from the useFundWallet() hookfundWallet('your-wallet-address-here', { chain: base, amount: '0.01' // Since no `asset` is set, defaults to 'native-currency' (ETH)})
Optional. A viem/chains object for the network on which users should fund their accounts. Defaults to the network you configured in the Privy Dashboard.
asset
'native-currency' | 'USDC' | {erc20: string}
Optional. The asset you’d like the user to fund their accounts with. Set 'native-currency' to fund with the chain’s native currency (e.g. ETH), 'USDC' to fund with USDC, or a token address in the erc20 field to fund with an arbitrary ERC20. Defaults to 'native-currency'.
amount
string
Required if asset is set, optional otherwise. The amount of the asset to fund as a decimal string. Defaults to the amount you configured in the Privy Dashboard.
Report incorrect code
Copy
Ask AI
import {useFundWallet} from '@privy-io/expo/ui';// Replace this with your desired networkimport {base} from 'viem/chains'...// `fundWallet` from the useFundWallet() hookfundWallet({ address: '0x2F3eb40872143b77D54a6f6e7Cc120464C764c09', asset: "USDC", chain: base, amount: '1'})