TokenLendingProgram.initObligation constructor

TokenLendingProgram.initObligation({
  1. required SolAddress obligation,
  2. required SolAddress lendingMarket,
  3. required SolAddress obligationOwner,
})

Initializes a new lending market obligation.

Implementation

factory TokenLendingProgram.initObligation({
  /// Obligation account
  required SolAddress obligation,

  /// Lending market account.
  required SolAddress lendingMarket,

  /// Obligation owner.
  required SolAddress obligationOwner,
}) {
  return TokenLendingProgram(
      keys: [
        obligation.toWritable(),
        lendingMarket.toReadOnly(),
        obligationOwner.toSigner(),
        SystemProgramConst.sysvarClockPubkey.toReadOnly(),
        SystemProgramConst.sysvarRentPubkey.toReadOnly(),
        SPLTokenProgramConst.tokenProgramId.toReadOnly(),
      ],
      programId: TokenLendingProgramConst.lendingProgramId,
      layout: TokenLendingInitObligationLayout());
}