TokenLendingProgram.depositObligationCollateral constructor

TokenLendingProgram.depositObligationCollateral({
  1. required SolAddress sourceCollateral,
  2. required SolAddress destinationCollateral,
  3. required SolAddress depositReserve,
  4. required SolAddress obligation,
  5. required SolAddress lendingMarket,
  6. required SolAddress obligationOwner,
  7. required SolAddress transferAuthority,
  8. required TokenLendingDepositObligationCollateralLayout layout,
})

Deposit collateral to an obligation. Requires a refreshed reserve.

Implementation

factory TokenLendingProgram.depositObligationCollateral({
  /// Source collateral token account
  required SolAddress sourceCollateral,

  /// Destination deposit reserve collateral supply SPL Token account.
  required SolAddress destinationCollateral,

  /// Deposit reserve account
  required SolAddress depositReserve,

  /// Obligation account.
  required SolAddress obligation,

  /// Lending market account.
  required SolAddress lendingMarket,

  /// Obligation owner.
  required SolAddress obligationOwner,

  /// User transfer authority
  required SolAddress transferAuthority,
  required TokenLendingDepositObligationCollateralLayout layout,
}) {
  return TokenLendingProgram(keys: [
    sourceCollateral.toWritable(),
    destinationCollateral.toWritable(),
    depositReserve.toReadOnly(),
    obligation.toWritable(),
    lendingMarket.toReadOnly(),
    obligationOwner.toSigner(),
    transferAuthority.toSigner(),
    SystemProgramConst.sysvarClockPubkey.toReadOnly(),
    SPLTokenProgramConst.tokenProgramId.toReadOnly(),
  ], programId: TokenLendingProgramConst.lendingProgramId, layout: layout);
}