TokenLendingProgram.initLendingMarket constructor

TokenLendingProgram.initLendingMarket({
  1. required SolAddress lendingMarket,
  2. required TokenLendingInitLendingMarketLayout layout,
})

Initializes a new lending market.

Implementation

factory TokenLendingProgram.initLendingMarket(
    {
    /// Lending market account
    required SolAddress lendingMarket,
    required TokenLendingInitLendingMarketLayout layout}) {
  return TokenLendingProgram(keys: [
    lendingMarket.toWritable(),
    SystemProgramConst.sysvarRentPubkey.toReadOnly(),
    SPLTokenProgramConst.tokenProgramId.toReadOnly(),
    TokenLendingProgramConst.oracleProgramId.toReadOnly(),
  ], programId: TokenLendingProgramConst.lendingProgramId, layout: layout);
}