> ## Documentation Index
> Fetch the complete documentation index at: https://docs.streambird.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

To enable wallet funding for your users, you'll need to configure funding settings in the MoonKey Dashboard.

## Dashboard configuration

Visit the [MoonKey Dashboard](https://dashboard.moonkey.fun) 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.

<Info>
  Make sure you have MoonKey's authentication UI components integrated in your app, as they are required for funding flows to work properly.
</Info>

## Set default chain and amount

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

### Default chain

<Tabs>
  <Tab title="Ethereum">
    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).
  </Tab>

  <Tab title="Solana">
    Select **Solana** as your blockchain.

    Users will fund their wallets with SOL (Solana's native currency).
  </Tab>
</Tabs>

### 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:

<Tabs>
  <Tab title="Ethereum">
    ```tsx theme={null}
    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>;
    }
    ```
  </Tab>

  <Tab title="Solana">
    ```tsx theme={null}
    import { useWallets, useFundWallet } from '@moon-key/react-auth/solana';

    function FundWallet() {
      const { wallets } = useWallets();
      const { fundWallet } = useFundWallet();
      
      const handleFund = async () => {
        const selectedWallet = wallets[0];
        
        // Override dashboard defaults
        await fundWallet(selectedWallet.address, {
          cluster: 'solana:mainnet',
          amount: '0.5' // Custom amount
        });
      };
      
      return <button onClick={handleFund}>Fund Wallet</button>;
    }
    ```
  </Tab>
</Tabs>

## 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.

<Tabs>
  <Tab title="Ethereum">
    ```tsx theme={null}
    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>;
    }
    ```
  </Tab>

  <Tab title="Solana">
    ```tsx theme={null}
    import { useWallets, useFundWallet } from '@moon-key/react-auth/solana';

    function FundWallet() {
      const { wallets } = useWallets();
      const { fundWallet } = useFundWallet();
      
      const handleFund = async () => {
        const selectedWallet = wallets[0];
        
        // Enable sandbox mode for testing
        await fundWallet(selectedWallet.address, {
          cluster: 'solana:mainnet',
          amount: '0.5',
          useSandbox: true // Default is false
        });
      };
      
      return <button onClick={handleFund}>Fund Wallet</button>;
    }
    ```
  </Tab>
</Tabs>

<Info>
  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.
</Info>

## Best practices

<AccordionGroup>
  <Accordion title="Choose appropriate default amounts">
    * 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)
  </Accordion>

  <Accordion title="Select the right network">
    * Use Layer 2s (Base, Arbitrum, Optimism) for lower fees
    * Match the network to where your contracts are deployed
    * Consider user familiarity with different networks
  </Accordion>

  <Accordion title="Test your configuration">
    * 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
  </Accordion>
</AccordionGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Card Payments" icon="credit-card" href="/wallet-as-a-service/funding/methods/card">
    Learn how to integrate card-based funding
  </Card>

  <Card title="Funding Overview" icon="wallet" href="/wallet-as-a-service/funding/overview">
    Overview of MoonKey's funding features
  </Card>
</CardGroup>
