Skip to main content

Usage

const result = await deposit({
  amount: '100',
  tokenName: 'USDC',
});

Parameters

type DepositInput {
  amount: string;
  tokenName: string;
  chainId?: ChainId;
}
amount
string
required
The amount to deposit.
tokenName
string
required
The token name (e.g., ‘USDC’, ‘USDT’, ‘ETH’).
chainId
ChainId
If your Mini App supports multiple chains, you can specify the chain id to use.

Returns

type DepositResponse = {
  result: TransactionResult.SUCCESS;
  data: {
    txHash: string;
  };
} | {
  result: TransactionResult.FAILED;
  error: MiniAppError;
} | {
  result: TransactionResult.CANCELLED;
}

Returns

result
TransactionResult
The result of the deposit attempt.
  • SUCCESS: The deposit was successful.
  • FAILED: The deposit failed.
  • CANCELLED: The deposit was cancelled by the user.
data
object
Contains the transaction hash of the deposit transaction. Only present when the result is SUCCESS.
  • txHash: The transaction hash.
error
MiniAppError
Contains the error information when the deposit fails. Only present when the result is FAILED.
  • message: The error message.
  • code: The error code.

Demo

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 to your Mini App wallet address.