Privy has integrated onramp providers that let users fund embedded wallets with payment methods like Apple Pay and Google Pay via @privy-io/expo and on the web through @privy-io/react-auth.This guide walks through setting up Privy’s funding flows, enabling users to fund wallets quickly 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 a user’s device, Privy will provide 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)})
Parameter
Type
Description
cluster
SolanaCluster
Optional. An object for the cluster on which users should fund their accounts. Defaults to mainnet-beta.
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.
As an example, you can configure the cluster and amount to fund like so:
Report incorrect code
Copy
Ask AI
import {useFundWallet} from '@privy-io/react-auth/solana';...// `fundWallet` from the useFundWallet() hookconst {fundWallet} = useFundWallet();fundWallet('your-wallet-address-here', { cluster: {name: 'devnet'}, amount: '0.01', // SOL});
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'})
Parameter
Type
Description
cluster
SolanaCluster
Optional. An object for the cluster on which users should fund their accounts. Defaults to mainnet-beta.
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.
As an example, you can configure the cluster and amount to fund like so:
Report incorrect code
Copy
Ask AI
import {useFundSolanaWallet} from '@privy-io/expo/ui';...// `fundWallet` from the useFundSolanaWallet() hookconst {fundWallet} = useFundSolanaWallet();fundWallet({ address: 'address' amount: '0.01', // SOL});