TokenLendingProgram.repayObligationLiquidity constructor

TokenLendingProgram.repayObligationLiquidity({
  1. required SolAddress sourceLiquidity,
  2. required SolAddress destinationLiquidity,
  3. required SolAddress repayReserve,
  4. required SolAddress obligation,
  5. required SolAddress lendingMarket,
  6. required SolAddress transferAuthority,
  7. required TokenLendingRepayObligationLiquidityLayout layout,
})

Repay borrowed liquidity to a reserve. Requires a refreshed obligation and reserve.

Implementation

factory TokenLendingProgram.repayObligationLiquidity({
  /// Source liquidity token account.
  required SolAddress sourceLiquidity,

  /// Destination repay reserve liquidity supply SPL Token account.
  required SolAddress destinationLiquidity,

  /// Repay reserve account.
  required SolAddress repayReserve,

  /// Obligation account.
  required SolAddress obligation,

  /// Lending market account.
  required SolAddress lendingMarket,

  /// User transfer authority
  required SolAddress transferAuthority,
  required TokenLendingRepayObligationLiquidityLayout layout,
}) {
  return TokenLendingProgram(keys: [
    sourceLiquidity.toWritable(),
    destinationLiquidity.toWritable(),
    repayReserve.toWritable(),
    obligation.toWritable(),
    lendingMarket.toReadOnly(),
    transferAuthority.toSigner(),
    SystemProgramConst.sysvarClockPubkey.toReadOnly(),
    SPLTokenProgramConst.tokenProgramId.toReadOnly(),
  ], programId: TokenLendingProgramConst.lendingProgramId, layout: layout);
}