TokenLendingProgram.refreshObligation constructor
TokenLendingProgram.refreshObligation({
- required SolAddress obligation,
- required List<
SolAddress> depositReserves, - required List<
SolAddress> borrowReserves,
Refresh an obligation's accrued interest and collateral and liquidity prices. Requires refreshed reserves, as all obligation collateral deposit reserves in order, followed by all liquidity borrow reserves in order.
Implementation
factory TokenLendingProgram.refreshObligation(
{
/// Obligation account.
required SolAddress obligation,
/// Collateral deposit reserve accounts
required List<SolAddress> depositReserves,
/// Liquidity borrow reserve accounts
required List<SolAddress> borrowReserves}) {
return TokenLendingProgram(
keys: [
obligation.toWritable(),
SystemProgramConst.sysvarClockPubkey.toReadOnly(),
...depositReserves.map((e) => e.toReadOnly()),
...borrowReserves.map((e) => e.toReadOnly())
],
programId: TokenLendingProgramConst.lendingProgramId,
layout: TokenLendingRefreshObligationLayout());
}