StakePoolProgram.withdrawStake constructor
StakePoolProgram.withdrawStake({
- required SolAddress stakePool,
- required SolAddress validatorList,
- required SolAddress withdrawAuthority,
- required SolAddress validatorStake,
- required SolAddress destinationStake,
- required SolAddress destinationStakeAuthority,
- required SolAddress sourceTransferAuthority,
- required SolAddress sourcePoolAccount,
- required SolAddress managerFeeAccount,
- required SolAddress poolMint,
- required StakePoolWithdrawStakeLayout layout,
Withdraw the token from the pool at the current ratio.
Implementation
factory StakePoolProgram.withdrawStake({
/// Stake pool
required SolAddress stakePool,
/// Validator stake list storage account
required SolAddress validatorList,
/// Stake pool withdraw authority
required SolAddress withdrawAuthority,
/// Validator or reserve stake account to split
required SolAddress validatorStake,
/// Unitialized stake account to receive withdrawal
required SolAddress destinationStake,
/// User account to set as a new withdraw authority
required SolAddress destinationStakeAuthority,
/// User transfer authority, for pool token account
required SolAddress sourceTransferAuthority,
/// User account with pool tokens to burn from
required SolAddress sourcePoolAccount,
/// Account to receive pool fee tokens
required SolAddress managerFeeAccount,
/// Pool token mint account
required SolAddress poolMint,
required StakePoolWithdrawStakeLayout layout,
}) {
return StakePoolProgram(
layout: layout,
keys: [
stakePool.toWritable(),
validatorList.toWritable(),
withdrawAuthority.toReadOnly(),
validatorStake.toWritable(),
destinationStake.toWritable(),
destinationStakeAuthority.toReadOnly(),
sourceTransferAuthority.toSigner(),
sourcePoolAccount.toWritable(),
managerFeeAccount.toWritable(),
poolMint.toWritable(),
SystemProgramConst.sysvarClockPubkey.toReadOnly(),
SPLTokenProgramConst.tokenProgramId.toReadOnly(),
StakeProgramConst.programId.toReadOnly()
],
programId: StakePoolProgramConst.programId);
}