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

# Deposit

> Initiate crypto deposits from Lemon Cash wallet to Mini App wallet.

## Usage

```typescript theme={null}
const result = await deposit({
  amount: '100',
  tokenName: 'USDC',
  chainId: ChainId.POLYGON,
});
```

## Parameters

```typescript theme={null}
type DepositInput {
  amount: string;
  tokenName: string;
  chainId: ChainId;
}
```

<ParamField body="amount" type="string" required>
  The amount to deposit.
</ParamField>

<ParamField body="tokenName" type="string" required>
  The token name (e.g., 'USDC', 'USDT', 'ETH').
</ParamField>

<ParamField body="chainId" type="ChainId" required>
  The chain id to use for the deposit.
</ParamField>

## Returns

<CodeGroup>
  ```typescript DepositResponse theme={null}
  type DepositResponse = {
    result: TransactionResult.SUCCESS | TransactionResult.PENDING;
    data: {
      txHash: string;
    };
  } | {
    result: TransactionResult.FAILED;
    error: MiniAppError;
  } | {
    result: TransactionResult.CANCELLED;
  }
  ```

  ```typescript SUCCESS icon="check" theme={null}
  {
    result: 'SUCCESS',
    data: {
      txHash: '0x1234567890123456789012345678901234567890'
    }
  }
  ```

  ```typescript FAILED icon="ban" theme={null}
  {
    result: 'FAILED',
    error: {
      message: 'Insufficient balance',
      code: 'INSUFFICIENT_BALANCE'
    }
  }
  ```

  ```typescript CANCELLED icon="user-minus" theme={null}
  {
    result: 'CANCELLED',
  }
  ```

  ```typescript PENDING icon="clock" theme={null}
  {
    result: 'PENDING',
    data: {
      txHash: '0x1234567890123456789012345678901234567890'
    }
  }
  ```
</CodeGroup>

## Returns

<ResponseField name="result" type="TransactionResult">
  The result of the deposit attempt.

  * `SUCCESS`: The deposit was successful.
  * `FAILED`: The deposit failed.
  * `CANCELLED`: The deposit was cancelled by the user.
  * `PENDING`: The deposit is pending confirmation.
</ResponseField>

<ResponseField name="data" type="object">
  Contains the transaction hash of the deposit transaction. Only present when the result is `SUCCESS` or `PENDING`.

  * `txHash`: The transaction hash.
</ResponseField>

<ResponseField name="error" type="MiniAppError">
  Contains the error information when the deposit fails. Only present when the result is `FAILED`.

  * `message`: The error message.
  * `code`: The error code.
</ResponseField>

## Demo

<div className="w-screen px-0 relative left-1/2 right-1/2 -mx-[50vw]">
  <video autoPlay muted loop playsInline className="w-full aspect-video rounded-xl" src="https://mintcdn.com/lemoncash/V3w-aDpCopaji2Ja/assets/videos/demo-deposit.mp4?fit=max&auto=format&n=V3w-aDpCopaji2Ja&q=85&s=cfe54e1c64676e2b7ecf28ba0e818bba" data-path="assets/videos/demo-deposit.mp4" />
</div>

<Warning>
  **Important**: Deposits are blocked if your Mini App is connected to a testnet.
  Otherwise, deposits would discount real money from the Lemon App and credit test tokens in your Mini App wallet.

  Instead, send testnet tokens from a [Faucet](/testing/faucets.mdx) to your Mini App wallet address.
</Warning>

## Related Functions

<CardGroup cols={2}>
  <Card title="Call Smart Contract" icon="code" href="/functions/call-smart-contract">
    Interact with smart contracts on the blockchain.
  </Card>

  <Card title="Withdraw" icon="arrow-up-right" href="/functions/withdraw">
    Withdraw funds from your Mini App Wallet.
  </Card>
</CardGroup>
