Skip to main content

Usage

import { transferMoney, Currency } from '@lemoncash/mini-app-sdk';

const result = await transferMoney({
  amount: '5000',
  currency: Currency.ARS,
  name: 'John Doe',
  paymentDestinationInformation: {
    paymentId: '0000003100010000000001',
  },
});

Parameters

type PaymentDestinationInformation = {
  paymentId: string;
  [key: string]: unknown;
};

type TransferMoneyData = {
  amount: string;
  currency: Currency;
  name?: string;
  paymentDestinationInformation: PaymentDestinationInformation;
}
amount
string
required
The amount to transfer.
currency
Currency
required
The fiat currency for the transfer (e.g., Currency.ARS, Currency.PEN).
name
string
Optional recipient name.
paymentDestinationInformation
PaymentDestinationInformation
required
The payment destination information. Contains a required field paymentId (e.g. ‘CBU/CVU’ for Argentina or ‘CCI’ for Peru). Could include additional attributes for other countries banking systems.
The paymentId must be whitelisted by Lemon before it can be used. If you need to change or add a new paymentId, contact the Lemon team first — otherwise the transfer will fail.

Returns

type TransferMoneyResponse = {
  result: TransactionResult.SUCCESS;
  data: {
    transferId: string;
  };
} | {
  result: TransactionResult.FAILED;
  error: MiniAppError;
} | {
  result: TransactionResult.CANCELLED;
} | {
  result: TransactionResult.PENDING;
  data: {
    transferId: string;
  };
}
result
TransactionResult
The result of the transfer attempt.
  • SUCCESS: The transfer was successful.
  • FAILED: The transfer failed.
  • CANCELLED: The transfer was cancelled by the user.
  • PENDING: The transfer is pending confirmation.
data
object
Contains the transfer identifier. Present when the result is SUCCESS or PENDING.
  • transferId: The unique identifier of the transfer.
error
MiniAppError
Contains the error information when the transfer fails. Only present when the result is FAILED.
  • message: The error message.
  • code: The error code.

Demo

Deposit

Deposit funds to your Mini App Wallet.

Withdraw

Withdraw funds from your Mini App Wallet.