Deposit Methods

Deposit methods of Papaya SDK for depositing tokens into the protocol

deposit()

Deposits tokens into the Papaya protocol.

async deposit(amount: bigint | number, isPermit2: boolean = false): Promise<ethers.TransactionResponse>

Parameters:

  • amount: The amount of tokens to deposit, should be formatted using formatInput()

  • isPermit2: (Optional) Whether to use Permit2 for the deposit (default: false)

Returns: An ethers.js TransactionResponse object.

Example:

// Format the amount correctly (10 USDT with 6 decimals)
const amount = formatInput('10', 6);

// Deposit
const tx = await papaya.deposit(amount);
await tx.wait();
console.log('Deposit successful');

depositBySig()

Creates a deposit transaction that can be signed off-chain and executed by anyone.

Parameters:

  • amount: The amount of tokens to deposit, should be formatted using formatInput()

  • deadline: Timestamp after which the transaction can't be executed

Returns: An ethers.js TransactionResponse object.

Example:

depositFor()

Deposits tokens into another account.

Parameters:

  • amount: The amount of tokens to deposit, should be formatted using formatInput()

  • to: The recipient address

  • isPermit2: (Optional) Whether to use Permit2 for the deposit (default: false)

Returns: An ethers.js TransactionResponse object.

Example:

Last updated