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

# Deposit

> Let users deposit tokens to a wallet address from any supported chain

## What it does

A hosted deposit page where users can send tokens to a specific wallet address. They connect their wallet, pick a token, and AnySpend handles the cross-chain routing. You generate a URL, they click it.

## How it works

1. **Your app generates a deposit URL** with the recipient address, chain, and token.
2. **User connects their wallet** (MetaMask, Coinbase, Rainbow, Rabby, Trust Wallet).
3. **User picks a token** from their available balances.
4. **AnySpend routes the payment** cross-chain if needed, converting to the destination token.
5. **Done** -- optionally redirect the user back to your app.

## URL parameters

The deposit page accepts these URL parameters:

| Parameter          | Required | Description                                                                     |
| ------------------ | -------- | ------------------------------------------------------------------------------- |
| `recipientAddress` | Yes      | The wallet address to receive the deposit (valid EVM address)                   |
| `toChainId`        | Yes\*    | The destination chain ID (e.g., 8453 for Base)                                  |
| `toCurrency`       | Yes\*    | The token contract address on the destination chain                             |
| `amount`           | No       | Fixed amount in wei/smallest unit. When provided, user cannot change the amount |
| `redirect_url`     | No       | HTTPS URL to redirect after completion                                          |
| `redirect_label`   | No       | Custom label for the redirect button                                            |
| `partner`          | No       | Partner ID for custom configuration                                             |

\* Not required for Hyperliquid chain where USDC is the default token.

## Example URLs

**Basic deposit to Base USDC:**

```
https://anyspend.b3.fun/deposit?recipientAddress=0x1234...&toChainId=8453&toCurrency=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
```

**Fixed amount deposit:**

```
https://anyspend.b3.fun/deposit?recipientAddress=0x1234...&toChainId=8453&toCurrency=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&amount=1000000
```

**With redirect:**

```
https://anyspend.b3.fun/deposit?recipientAddress=0x1234...&toChainId=8453&toCurrency=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&redirect_url=https://yourapp.com/success&redirect_label=Return+to+App
```

## Supported wallets

Supported out of the box:

* MetaMask
* Coinbase Wallet
* Rainbow
* Rabby
* Trust Wallet

Auto-connect is enabled for returning users who have previously connected their wallet.

## Special chain support

### Hyperliquid

Hyperliquid gets special handling:

* USDC uses a special 34-character address format (`0x00000000000000000000000000000000`)
* When `toChainId` is set to Hyperliquid, `toCurrency` defaults to USDC if not specified
* Zero addresses are automatically corrected to the Hyperliquid USDC format

## Partner integration

Partners can be configured with custom settings:

```typescript theme={null}
interface PartnerConfig {
  returnToHomeUrl?: string;      // Default redirect URL
  customRecipientLabel?: string; // Custom label for the recipient
  returnHomeLabel?: string;      // Custom label for return button
}
```

To register as a partner, contact the AnySpend team to add your configuration.

## Security

* Only HTTPS redirect URLs are allowed (prevents open redirect attacks)
* Amounts must be valid positive integers (wei)
* Addresses are validated before processing

## Common use cases

* **Telegram bots** -- fund bot wallets via a shareable link
* **Gaming** -- deposit tokens to game accounts
* **Marketplaces** -- fund escrow addresses
* **Tipping** -- let users tip creators with a deposit link

## Integration example

Generate a deposit link in your app:

```typescript theme={null}
function generateDepositLink({
  recipientAddress,
  chainId,
  tokenAddress,
  amount,
  redirectUrl,
}: {
  recipientAddress: string;
  chainId: number;
  tokenAddress: string;
  amount?: string;
  redirectUrl?: string;
}) {
  const params = new URLSearchParams({
    recipientAddress,
    toChainId: chainId.toString(),
    toCurrency: tokenAddress,
  });

  if (amount) params.set("amount", amount);
  if (redirectUrl) params.set("redirect_url", redirectUrl);

  return `https://anyspend.b3.fun/deposit?${params.toString()}`;
}
```
