# Overview

MoonPay Wallets lets users add funds to an embedded wallet or sell crypto for fiat from the wallet.
The React SDK opens Commerce when it is enabled, or the MoonPay Wallets funding window otherwise.

## Funding integrations

| Integration | User actions | Configuration |
| --- | --- | --- |
| MoonPay Ramps | Buy crypto by card and other supported payment methods. Sell crypto through cash out. | Your app's **MoonPay** integration, with Ramps API keys. |
| MoonPay Commerce | Fund through card payments, wallet connection, exchange connection, or crypto transfer. | Your app's **MoonPay Commerce** integration, with Commerce API keys and receiving options. |
| Direct transfer | Show the embedded wallet address for an incoming transfer. | No Commerce receiving option or Ramps purchase session. |

Ramps and Commerce have separate configuration and enablement.
You can offer either integration or both.
Commerce card payments also require Ramps keys configured in the matching Commerce dashboard.

<CardGroup cols={2}>
  <Card title="Ramps configuration" icon="gear" href="/wallets/funding/configure">
    Save Ramps keys and enable Buy and Sell for your app.
  </Card>

  <Card title="Commerce setup" icon="gear" href="/wallets/funding/configure-commerce">
    Save Commerce keys, select receiving networks and tokens, and enable funding.
  </Card>
</CardGroup>

## Open a funding flow

The web SDK exposes these methods through `useMoonX()`:

| Method | Opens |
| --- | --- |
| `fundWallet({ address, walletType, options })` | Commerce when enabled for the selected environment; otherwise the MoonPay Wallets funding window. |
| `openCommerceFunding({ address, ... })` | Commerce's native payment-method list, or an explicit Commerce starting screen. |
| `openRampsFunding({ address, walletType, options })` | MoonPay Buy directly. |
| `showWalletAddress({ address, walletType })` | The wallet's own receiving address and QR code. No provider session is created. |

The chain-specific `useCashOutWallet()` hooks continue to open MoonPay Sell directly.
See [Commerce](/wallets/funding/methods/commerce), [Ramps card funding](/wallets/funding/methods/card), and [cash out](/wallets/funding/methods/cash-out).

### Automatic routing with fundWallet

The chain-specific `useFundWallet().fundWallet(address, options)` methods remain available.
`useMoonX().fundWallet({ address, walletType, options })` provides the same routing without a chain-specific hook.

| Configuration for the selected environment | Behavior |
| --- | --- |
| Commerce enabled, with or without standalone Ramps | Open Commerce's native list immediately. |
| Commerce absent or disabled | Open the MoonPay Wallets funding window. |

The MoonPay Wallets window offers **Pay with card** when Ramps Buy is available, **Receive funds** for the wallet address and QR code, and **Cash out** when Sell is available.
It prepares a Ramps checkout only after the user selects that method. With no Ramps configured, the window still offers **Receive funds**.

An explicit `commerceDepositId` selects Commerce. Combining it with `provider: 'ramps'` rejects the request.
An unavailable or malformed configuration rejects automatic routing. The SDK does not guess a provider after a failed request.
Commerce takes priority without asking the user to choose a provider. Its receiving network and deposit are validated during preparation; a preparation failure does not fall back to Ramps.
The fallback window requires environment-specific Ramps availability. If that data is missing, it hides Ramps actions and still offers **Receive funds**. Older aggregate flags cannot establish which environment has keys.
Set `options.provider` to `'commerce'` or `'ramps'` only when your application needs an explicit direct-provider override. The direct methods do not perform automatic discovery.

The provider option is specific to the React web SDK. It does not change the core or React Native headless funding API.
Opening promises report readiness or presentation, not payment settlement.

### Show the wallet address

```tsx
import { useMoonX } from '@moon-x/react-sdk';

export function useReceiveCrypto() {
	const { showWalletAddress } = useMoonX();
	return (address: string) => showWalletAddress({ address, walletType: 'ethereum' });
}
```

This shows and copies the supplied wallet address. It does not display Commerce deposit addresses or create a customer session.

<Note>
  Provider-specific web funding requires React SDK 0.22.0 or later and core 0.24.0 or later, with the corresponding backend configuration response.
  The Commerce guide covers the React web widget.
  See [React Native funding](/get-started/frontend-sdks/react-native/funding) for the native SDK's funding API.
</Note>

## Receiving network and token

Ramps uses the network, asset, and purchase parameters passed to the funding call.
Available assets also depend on your MoonPay account, the user's region, and the payment method.
Supported assets include native ETH on EVM networks, SOL on Solana, BTC on Bitcoin mainnet, and supported stablecoins and ERC-20 tokens.

Bitcoin Ramps funding supports native BTC for Taproot (`bc1p`), Native SegWit (`bc1q`), and Legacy (`1...`) wallets.
See [Bitcoin funding](/wallets/funding/fund-types/bitcoin) for usage and wallet-type guidance.

Commerce uses a registered receiving option for the selected environment.
Each option defines a receiving network and token, such as USDC on Base.
The user chooses how to pay; your app chooses what the wallet receives.

Each network has at most one default receiving option.
Pass `commerceDepositId` to select a different registered option for a call.
An explicit network or asset must match that option.
See [Defaults and overrides](/wallets/funding/methods/commerce#defaults-and-overrides).

## Method guides

<CardGroup cols={2}>
  <Card title="Card payments (Ramps)" icon="credit-card" href="/wallets/funding/methods/card">
    Open the MoonPay Buy flow and configure purchase parameters.
  </Card>

  <Card title="MoonPay Commerce" icon="wallet" href="/wallets/funding/methods/commerce">
    Use the embedded Commerce methods, receiving defaults, and deposit overrides.
  </Card>

  <Card title="Cash out" icon="banknote" href="/wallets/funding/methods/cash-out">
    Sell crypto from an embedded wallet and receive fiat.
  </Card>
</CardGroup>

Payment availability, fees, and processing time depend on the provider and the selected method.
Confirm the payment status and received funds before treating a wallet as funded.
