Skip to main content
To enable wallet funding for your users, you’ll need to configure funding settings in the MoonKey Dashboard.

Dashboard configuration

Visit the MoonKey Dashboard and select your app from the App Dropdown in the sidebar. Then, navigate to the Account Funding page for your selected app.

Enable funding methods

MoonKey currently supports card-based funding methods:
  • Debit/credit cards - Visa, Mastercard, and other major card providers
  • Apple Pay - For Safari and iOS users
  • Google Pay - For Chrome and Android users
All card funding is processed through MoonPay.
Make sure you have MoonKey’s authentication UI components integrated in your app, as they are required for funding flows to work properly.

Set default chain and amount

Once you’ve enabled funding methods, configure the default settings for your users:

Default chain

  • Ethereum
  • Solana
Select Ethereum as your blockchain and choose a default network:
  • Ethereum Mainnet
  • Base
  • Polygon
  • Arbitrum
  • Optimism
  • Other EVM networks
Users will fund their wallets with the native currency of the selected network (e.g., ETH on Ethereum Mainnet).

Default amount

Set a default amount that users should fund their wallets with. Users can adjust this amount before confirming their purchase. Recommended amounts:
  • Ethereum: 0.01 - 0.1 ETH
  • Base/L2s: 0.05 - 0.2 ETH (lower gas fees)
  • Solana: 0.1 - 1 SOL
Choose an amount that makes sense for your application’s typical transaction costs.

Override in code

You can override dashboard defaults programmatically when calling the funding function:
  • Ethereum
  • Solana
import { useWallets, useFundWallet } from '@moon-key/react-auth/ethereum';

function FundWallet() {
  const { wallets } = useWallets();
  const { fundWallet } = useFundWallet();
  
  const handleFund = async () => {
    const selectedWallet = wallets[0];
    
    // Override dashboard defaults
    await fundWallet(selectedWallet.address, {
      chain: 'eip155:1', // Ethereum mainnet
      amount: '0.05' // Custom amount
    });
  };
  
  return <button onClick={handleFund}>Fund Wallet</button>;
}

Sandbox mode for testing

During development, you can enable sandbox mode to test funding flows without processing real transactions. This is useful for testing your integration before going live.
  • Ethereum
  • Solana
import { useWallets, useFundWallet } from '@moon-key/react-auth/ethereum';

function FundWallet() {
  const { wallets } = useWallets();
  const { fundWallet } = useFundWallet();
  
  const handleFund = async () => {
    const selectedWallet = wallets[0];
    
    // Enable sandbox mode for testing
    await fundWallet(selectedWallet.address, {
      chain: 'eip155:1',
      amount: '0.05',
      useSandbox: true // Default is false
    });
  };
  
  return <button onClick={handleFund}>Fund Wallet</button>;
}
Sandbox mode allows you to test the complete funding flow without processing real payments. Always set useSandbox: false or omit it entirely for production environments.

Best practices

  • Consider typical transaction costs in your app
  • Account for gas fees on the network
  • Don’t set amounts too low (users may not have enough for transactions)
  • Don’t set amounts too high (may discourage new users)
  • Use Layer 2s (Base, Arbitrum, Optimism) for lower fees
  • Match the network to where your contracts are deployed
  • Consider user familiarity with different networks
  • Test the funding flow end-to-end on mainnet
  • Verify the default amount makes sense for your use case
  • Ensure the funding modal displays correctly

Next steps