Skip to main content
This feature is experimental and may change as we iterate.
Funding overview

Overview

Privy provides a useDepositAddress hook in @privy-io/react-auth that opens a deposit address flow in the Privy modal. Your app can use this hook to let authenticated users fund a wallet by sending crypto from any supported source chain. Privy generates a unique deposit address, and when the user sends tokens to it, the funds are automatically bridged or swapped and delivered to the destination wallet. This is useful when users already hold crypto on a different chain than the one your app uses, or in a different wallet, app, or exchange.

Prerequisites

Before using the deposit address hooks, enable the deposit address feature for your app in the Privy Dashboard. See here for full guidance.

Access the hook

Import and initialize useDepositAddress:
import {useDepositAddress} from '@privy-io/react-auth';

const {createDepositAddress} = useDepositAddress();

Start a deposit address flow

Call createDepositAddress with a destination chain, currency, and wallet address:
await createDepositAddress({
  destinationChain: 'eip155:8453',
  destinationCurrency: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
  destinationAddress: '0x1234...abcd'
});
The method opens the Privy modal where the user selects a source token and network. Privy displays a unique deposit address for the user to send funds to. Once the deposit is detected, the tokens will be bridged and swapped as needed and delivered to the destination address. createDepositAddress returns a Promise<void> that resolves when the deposit completes successfully, and rejects if an error occurs or the user exits the flow.
destinationChain accepts a CAIP-2 identifier (for example, eip155:8453 for Base or solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp for Solana mainnet).

Parameters

createDepositAddress accepts an object with the following fields:
destinationChain
string
required
CAIP-2 chain identifier for the destination (e.g. eip155:8453 for Base, solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp for Solana mainnet).
destinationCurrency
string
required
Token contract address on the destination chain. Use the zero address for native tokens.
destinationAddress
string
required
Wallet address to receive the deposited funds.

Returns

createDepositAddress returns a Promise<void> that resolves when the deposit completes successfully. The promise rejects if an error occurs or the user exits the flow.

Supported chains

Destination chains

Your app specifies the destination chain when calling createDepositAddress. The following destination chains are supported:
ChainCAIP-2 identifier
Abstracteip155:2741
Arbitrumeip155:42161
Baseeip155:8453
BNB Chaineip155:56
Ethereumeip155:1
HyperEVMeip155:999
Hypercoreeip155:1337
Monadeip155:143
Optimismeip155:10
Polygoneip155:137
Solanasolana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
Trontron:20191129

Source chains

Users can deposit from a wide range of chains and assets, including Bitcoin, Solana, and other tokens. The Privy modal automatically presents available source options based on the destination configuration.

Example

import {useDepositAddress} from '@privy-io/react-auth';

function FundWallet() {
  const {createDepositAddress} = useDepositAddress();

  const handleDeposit = async () => {
    try {
      await createDepositAddress({
        destinationAddress: '<your-wallet-address>',
        // Base
        destinationChain: 'eip155:8453',
        // USDC
        destinationCurrency: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
      });
      console.log('Deposit completed');
    } catch (error) {
      console.error('Deposit failed:', error);
    }
  };

  return <button onClick={handleDeposit}>Fund with crypto</button>;
}
If the user does not have an existing embedded wallet on the source chain, Privy automatically creates an embedded wallet to serve as the refund address in case the deposit fails. For apps using on-device execution, this wallet is created using TEE infrastructure.

Funding overview

All available methods for funding wallets.

Fiat onramp

Fund wallets with fiat via card, Apple Pay, or Google Pay.