TokenLendingProgram.redeemReserveCollateral constructor
TokenLendingProgram.redeemReserveCollateral({
- required SolAddress sourceCollateral,
- required SolAddress destinationLiquidity,
- required SolAddress reserve,
- required SolAddress reserveCollateralMint,
- required SolAddress reserveLiquiditySupply,
- required SolAddress lendingMarket,
- required SolAddress lendingMarketAuthority,
- required SolAddress transferAuthority,
- required TokenLendingRedeemReserveCollateralLayout layout,
Redeem collateral from a reserve in exchange for liquidity.
Implementation
factory TokenLendingProgram.redeemReserveCollateral(
{
/// Source collateral token account.
required SolAddress sourceCollateral,
/// Destination liquidity token account.
required SolAddress destinationLiquidity,
/// Reserve account.
required SolAddress reserve,
/// Reserve collateral SPL Token mint.
required SolAddress reserveCollateralMint,
/// Reserve liquidity supply SPL Token account.
required SolAddress reserveLiquiditySupply,
/// Lending market account.
required SolAddress lendingMarket,
/// Derived lending market authority.
required SolAddress lendingMarketAuthority,
/// User transfer authority
required SolAddress transferAuthority,
required TokenLendingRedeemReserveCollateralLayout layout}) {
return TokenLendingProgram(keys: [
sourceCollateral.toWritable(),
destinationLiquidity.toWritable(),
reserve.toWritable(),
reserveCollateralMint.toWritable(),
reserveLiquiditySupply.toWritable(),
lendingMarket.toReadOnly(),
lendingMarketAuthority.toReadOnly(),
transferAuthority.toSigner(),
SystemProgramConst.sysvarClockPubkey.toReadOnly(),
SPLTokenProgramConst.tokenProgramId.toReadOnly(),
], programId: TokenLendingProgramConst.lendingProgramId, layout: layout);
}