TokenLendingProgram.withdrawObligationCollateral constructor
TokenLendingProgram.withdrawObligationCollateral({
- required SolAddress sourceCollateral,
- required SolAddress destinationCollateral,
- required SolAddress withdrawReserve,
- required SolAddress obligation,
- required SolAddress lendingMarket,
- required SolAddress lendingMarketAuthority,
- required SolAddress obligationOwner,
- required TokenLendingWithdrawObligationCollateralLayout layout,
Withdraw collateral from an obligation. Requires a refreshed obligation and reserve.
Implementation
factory TokenLendingProgram.withdrawObligationCollateral({
/// Source withdraw reserve collateral supply SPL Token account.
required SolAddress sourceCollateral,
/// Destination collateral token account. Minted by
/// withdraw reserve collateral mint.
required SolAddress destinationCollateral,
/// Withdraw reserve account.
required SolAddress withdrawReserve,
/// Obligation account
required SolAddress obligation,
/// Lending market account
required SolAddress lendingMarket,
/// Derived lending market authority
required SolAddress lendingMarketAuthority,
/// Obligation owner.
required SolAddress obligationOwner,
required TokenLendingWithdrawObligationCollateralLayout layout,
}) {
return TokenLendingProgram(keys: [
sourceCollateral.toWritable(),
destinationCollateral.toWritable(),
withdrawReserve.toReadOnly(),
obligation.toWritable(),
lendingMarket.toReadOnly(),
lendingMarketAuthority.toReadOnly(),
obligationOwner.toSigner(),
SystemProgramConst.sysvarClockPubkey.toReadOnly(),
SPLTokenProgramConst.tokenProgramId.toReadOnly(),
], programId: TokenLendingProgramConst.lendingProgramId, layout: layout);
}